diff --git a/javascript/README.md b/javascript/README.md index 74b5a29..026a492 100644 --- a/javascript/README.md +++ b/javascript/README.md @@ -1,11 +1,20 @@ # gRPC Protobufs +[![NPM Version](https://img.shields.io/npm/v/%40pretendonetwork%2Fgrpc)](https://www.npmjs.com/package/@pretendonetwork/grpc) + gRPC protobuf definitions for Pretendo micro-services ## Structure Each folder contains the protobuf definitions for the _server_ intended on receiving the requests. Meaning, for example, `account` contains protobuf files intended for requests to the account server +## Install Language Bindings + +To install + +- Go: `github.com/PretendoNetwork/grpc/go` - `go get github.com/PretendoNetwork/grpc/go` +- JavaScript: [`@pretendnetwork/grpc`](https://www.npmjs.com/package/@pretendonetwork/grpc) - `npm i @pretendonetwork/grpc` + ## Build - Install the protobuf compiler (protoc) from [here](https://grpc.io/docs/protoc-installation/#install-pre-compiled-binaries-any-os) (Use the pre-compiled binaries, the `protoc` package in the package manager is outdated) diff --git a/javascript/account/account_service.client.d.ts b/javascript/account/account_service.client.d.ts deleted file mode 100644 index 017bf54..0000000 --- a/javascript/account/account_service.client.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/account_service.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { ExchangeTokenForUserDataRequest } from "./exchange_token_for_user_data"; -import type { Empty } from "../google/protobuf/empty"; -import type { UpdatePNIDPermissionsRequest } from "./update_pnid_permissions"; -import type { GetNEXDataResponse } from "./get_nex_data_rpc"; -import type { GetNEXDataRequest } from "./get_nex_data_rpc"; -import type { GetNEXPasswordResponse } from "./get_nex_password_rpc"; -import type { GetNEXPasswordRequest } from "./get_nex_password_rpc"; -import type { GetUserDataResponse } from "./get_user_data_rpc"; -import type { GetUserDataRequest } from "./get_user_data_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service account.Account - */ -export interface IAccountClient { - /** - * @generated from protobuf rpc: GetUserData(account.GetUserDataRequest) returns (account.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXPassword(account.GetNEXPasswordRequest) returns (account.GetNEXPasswordResponse); - */ - getNEXPassword(input: GetNEXPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXData(account.GetNEXDataRequest) returns (account.GetNEXDataResponse); - */ - getNEXData(input: GetNEXDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.UpdatePNIDPermissionsRequest) returns (google.protobuf.Empty); - */ - updatePNIDPermissions(input: UpdatePNIDPermissionsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.ExchangeTokenForUserDataRequest) returns (account.GetUserDataResponse); - */ - exchangeTokenForUserData(input: ExchangeTokenForUserDataRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service account.Account - */ -export declare class AccountClient implements IAccountClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: GetUserData(account.GetUserDataRequest) returns (account.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXPassword(account.GetNEXPasswordRequest) returns (account.GetNEXPasswordResponse); - */ - getNEXPassword(input: GetNEXPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXData(account.GetNEXDataRequest) returns (account.GetNEXDataResponse); - */ - getNEXData(input: GetNEXDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.UpdatePNIDPermissionsRequest) returns (google.protobuf.Empty); - */ - updatePNIDPermissions(input: UpdatePNIDPermissionsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.ExchangeTokenForUserDataRequest) returns (account.GetUserDataResponse); - */ - exchangeTokenForUserData(input: ExchangeTokenForUserDataRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/account/account_service.client.js b/javascript/account/account_service.client.js deleted file mode 100644 index 92353f9..0000000 --- a/javascript/account/account_service.client.js +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/account_service.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AccountClient = void 0; -const account_service_1 = require("./account_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service account.Account - */ -class AccountClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = account_service_1.Account.typeName; - this.methods = account_service_1.Account.methods; - this.options = account_service_1.Account.options; - } - /** - * @generated from protobuf rpc: GetUserData(account.GetUserDataRequest) returns (account.GetUserDataResponse); - */ - getUserData(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetNEXPassword(account.GetNEXPasswordRequest) returns (account.GetNEXPasswordResponse); - */ - getNEXPassword(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetNEXData(account.GetNEXDataRequest) returns (account.GetNEXDataResponse); - */ - getNEXData(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.UpdatePNIDPermissionsRequest) returns (google.protobuf.Empty); - */ - updatePNIDPermissions(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.ExchangeTokenForUserDataRequest) returns (account.GetUserDataResponse); - */ - exchangeTokenForUserData(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.AccountClient = AccountClient; diff --git a/javascript/account/account_service.d.ts b/javascript/account/account_service.d.ts index d8d9fa9..b49d43a 100644 --- a/javascript/account/account_service.d.ts +++ b/javascript/account/account_service.d.ts @@ -1,9 +1,74 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/account_service.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service account.Account - */ -export declare const Account: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { ExchangeTokenForUserDataRequest } from "./exchange_token_for_user_data"; +import { GetNEXDataRequest, GetNEXDataResponse } from "./get_nex_data_rpc"; +import { GetNEXPasswordRequest, GetNEXPasswordResponse } from "./get_nex_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { UpdatePNIDPermissionsRequest } from "./update_pnid_permissions"; +export declare const protobufPackage = "account"; +export type AccountDefinition = typeof AccountDefinition; +export declare const AccountDefinition: { + readonly name: "Account"; + readonly fullName: "account.Account"; + readonly methods: { + readonly getUserData: { + readonly name: "GetUserData"; + readonly requestType: import("./get_user_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getNEXPassword: { + readonly name: "GetNEXPassword"; + readonly requestType: import("./get_nex_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_nex_password_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getNEXData: { + readonly name: "GetNEXData"; + readonly requestType: import("./get_nex_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_nex_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updatePNIDPermissions: { + readonly name: "UpdatePNIDPermissions"; + readonly requestType: import("./update_pnid_permissions").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly exchangeTokenForUserData: { + readonly name: "ExchangeTokenForUserData"; + readonly requestType: import("./exchange_token_for_user_data").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface AccountServiceImplementation { + getUserData(request: GetUserDataRequest, context: CallContext & CallContextExt): Promise>; + getNEXPassword(request: GetNEXPasswordRequest, context: CallContext & CallContextExt): Promise>; + getNEXData(request: GetNEXDataRequest, context: CallContext & CallContextExt): Promise>; + updatePNIDPermissions(request: UpdatePNIDPermissionsRequest, context: CallContext & CallContextExt): Promise>; + exchangeTokenForUserData(request: ExchangeTokenForUserDataRequest, context: CallContext & CallContextExt): Promise>; +} +export interface AccountClient { + getUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getNEXPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getNEXData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updatePNIDPermissions(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + exchangeTokenForUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/account/account_service.js b/javascript/account/account_service.js index ebbcc55..3065614 100644 --- a/javascript/account/account_service.js +++ b/javascript/account/account_service.js @@ -1,33 +1,61 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/account_service.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/account_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Account = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/account_service.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -const exchange_token_for_user_data_1 = require("./exchange_token_for_user_data"); +exports.AccountDefinition = exports.protobufPackage = void 0; const empty_1 = require("../google/protobuf/empty"); -const update_pnid_permissions_1 = require("./update_pnid_permissions"); +const exchange_token_for_user_data_1 = require("./exchange_token_for_user_data"); const get_nex_data_rpc_1 = require("./get_nex_data_rpc"); -const get_nex_data_rpc_2 = require("./get_nex_data_rpc"); const get_nex_password_rpc_1 = require("./get_nex_password_rpc"); -const get_nex_password_rpc_2 = require("./get_nex_password_rpc"); const get_user_data_rpc_1 = require("./get_user_data_rpc"); -const get_user_data_rpc_2 = require("./get_user_data_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service account.Account - */ -exports.Account = new runtime_rpc_1.ServiceType("account.Account", [ - { name: "GetUserData", options: {}, I: get_user_data_rpc_2.GetUserDataRequest, O: get_user_data_rpc_1.GetUserDataResponse }, - { name: "GetNEXPassword", options: {}, I: get_nex_password_rpc_2.GetNEXPasswordRequest, O: get_nex_password_rpc_1.GetNEXPasswordResponse }, - { name: "GetNEXData", options: {}, I: get_nex_data_rpc_2.GetNEXDataRequest, O: get_nex_data_rpc_1.GetNEXDataResponse }, - { name: "UpdatePNIDPermissions", options: {}, I: update_pnid_permissions_1.UpdatePNIDPermissionsRequest, O: empty_1.Empty }, - { name: "ExchangeTokenForUserData", options: {}, I: exchange_token_for_user_data_1.ExchangeTokenForUserDataRequest, O: get_user_data_rpc_1.GetUserDataResponse } -]); +const update_pnid_permissions_1 = require("./update_pnid_permissions"); +exports.protobufPackage = "account"; +exports.AccountDefinition = { + name: "Account", + fullName: "account.Account", + methods: { + getUserData: { + name: "GetUserData", + requestType: get_user_data_rpc_1.GetUserDataRequest, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + getNEXPassword: { + name: "GetNEXPassword", + requestType: get_nex_password_rpc_1.GetNEXPasswordRequest, + requestStream: false, + responseType: get_nex_password_rpc_1.GetNEXPasswordResponse, + responseStream: false, + options: {}, + }, + getNEXData: { + name: "GetNEXData", + requestType: get_nex_data_rpc_1.GetNEXDataRequest, + requestStream: false, + responseType: get_nex_data_rpc_1.GetNEXDataResponse, + responseStream: false, + options: {}, + }, + updatePNIDPermissions: { + name: "UpdatePNIDPermissions", + requestType: update_pnid_permissions_1.UpdatePNIDPermissionsRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + exchangeTokenForUserData: { + name: "ExchangeTokenForUserData", + requestType: exchange_token_for_user_data_1.ExchangeTokenForUserDataRequest, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/account/account_service.ts b/javascript/account/account_service.ts new file mode 100644 index 0000000..6c367c6 --- /dev/null +++ b/javascript/account/account_service.ts @@ -0,0 +1,118 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/account_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { ExchangeTokenForUserDataRequest } from "./exchange_token_for_user_data"; +import { GetNEXDataRequest, GetNEXDataResponse } from "./get_nex_data_rpc"; +import { GetNEXPasswordRequest, GetNEXPasswordResponse } from "./get_nex_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { UpdatePNIDPermissionsRequest } from "./update_pnid_permissions"; + +export const protobufPackage = "account"; + +export type AccountDefinition = typeof AccountDefinition; +export const AccountDefinition = { + name: "Account", + fullName: "account.Account", + methods: { + getUserData: { + name: "GetUserData", + requestType: GetUserDataRequest, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + getNEXPassword: { + name: "GetNEXPassword", + requestType: GetNEXPasswordRequest, + requestStream: false, + responseType: GetNEXPasswordResponse, + responseStream: false, + options: {}, + }, + getNEXData: { + name: "GetNEXData", + requestType: GetNEXDataRequest, + requestStream: false, + responseType: GetNEXDataResponse, + responseStream: false, + options: {}, + }, + updatePNIDPermissions: { + name: "UpdatePNIDPermissions", + requestType: UpdatePNIDPermissionsRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + exchangeTokenForUserData: { + name: "ExchangeTokenForUserData", + requestType: ExchangeTokenForUserDataRequest, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface AccountServiceImplementation { + getUserData( + request: GetUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + getNEXPassword( + request: GetNEXPasswordRequest, + context: CallContext & CallContextExt, + ): Promise>; + getNEXData( + request: GetNEXDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + updatePNIDPermissions( + request: UpdatePNIDPermissionsRequest, + context: CallContext & CallContextExt, + ): Promise>; + exchangeTokenForUserData( + request: ExchangeTokenForUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface AccountClient { + getUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getNEXPassword( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getNEXData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updatePNIDPermissions( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + exchangeTokenForUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/account/exchange_token_for_user_data.d.ts b/javascript/account/exchange_token_for_user_data.d.ts index 0cf8122..d8670c5 100644 --- a/javascript/account/exchange_token_for_user_data.d.ts +++ b/javascript/account/exchange_token_for_user_data.d.ts @@ -1,31 +1,19 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/exchange_token_for_user_data.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.ExchangeTokenForUserDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account"; export interface ExchangeTokenForUserDataRequest { - /** - * @generated from protobuf field: string token = 1; - */ token: string; } -declare class ExchangeTokenForUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ExchangeTokenForUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExchangeTokenForUserDataRequest): ExchangeTokenForUserDataRequest; - internalBinaryWrite(message: ExchangeTokenForUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ExchangeTokenForUserDataRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.ExchangeTokenForUserDataRequest - */ -export declare const ExchangeTokenForUserDataRequest: ExchangeTokenForUserDataRequest$Type; export {}; diff --git a/javascript/account/exchange_token_for_user_data.js b/javascript/account/exchange_token_for_user_data.js index 83b19aa..3a9f684 100644 --- a/javascript/account/exchange_token_for_user_data.js +++ b/javascript/account/exchange_token_for_user_data.js @@ -1,59 +1,65 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/exchange_token_for_user_data.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/exchange_token_for_user_data.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExchangeTokenForUserDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class ExchangeTokenForUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.ExchangeTokenForUserDataRequest", [ - { no: 1, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.token = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ExchangeTokenForUserDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account"; +function createBaseExchangeTokenForUserDataRequest() { + return { token: "" }; +} +exports.ExchangeTokenForUserDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string token */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.token = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string token = 1; */ - if (message.token !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.token); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { token: isSet(object.token) ? globalThis.String(object.token) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + create(base) { + return exports.ExchangeTokenForUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseExchangeTokenForUserDataRequest(); + message.token = object.token ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.ExchangeTokenForUserDataRequest - */ -exports.ExchangeTokenForUserDataRequest = new ExchangeTokenForUserDataRequest$Type(); diff --git a/javascript/account/exchange_token_for_user_data.ts b/javascript/account/exchange_token_for_user_data.ts new file mode 100644 index 0000000..a1db014 --- /dev/null +++ b/javascript/account/exchange_token_for_user_data.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/exchange_token_for_user_data.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account"; + +export interface ExchangeTokenForUserDataRequest { + token: string; +} + +function createBaseExchangeTokenForUserDataRequest(): ExchangeTokenForUserDataRequest { + return { token: "" }; +} + +export const ExchangeTokenForUserDataRequest: MessageFns = { + encode(message: ExchangeTokenForUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExchangeTokenForUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExchangeTokenForUserDataRequest { + return { token: isSet(object.token) ? globalThis.String(object.token) : "" }; + }, + + toJSON(message: ExchangeTokenForUserDataRequest): unknown { + const obj: any = {}; + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + + create(base?: DeepPartial): ExchangeTokenForUserDataRequest { + return ExchangeTokenForUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExchangeTokenForUserDataRequest { + const message = createBaseExchangeTokenForUserDataRequest(); + message.token = object.token ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/get_nex_data_rpc.d.ts b/javascript/account/get_nex_data_rpc.d.ts index 7f1e1a0..aff3b8f 100644 --- a/javascript/account/get_nex_data_rpc.d.ts +++ b/javascript/account/get_nex_data_rpc.d.ts @@ -1,87 +1,36 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_nex_data_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.GetNEXDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account"; +export declare enum DeviceType { + CTR = 0, + WUP = 1, + UNRECOGNIZED = -1 +} +export declare function deviceTypeFromJSON(object: any): DeviceType; +export declare function deviceTypeToJSON(object: DeviceType): string; export interface GetNEXDataRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.GetNEXDataResponse - */ export interface GetNEXDataResponse { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: string password = 2; - */ password: string; - /** - * @generated from protobuf field: uint32 owning_pid = 3; - */ owningPid: number; - /** - * @generated from protobuf field: int32 access_level = 4; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 5; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: string friend_code = 6; - */ friendCode: string; - /** - * @generated from protobuf field: account.DeviceType device_type = 7; - */ deviceType: DeviceType; } -/** - * @generated from protobuf enum account.DeviceType - */ -export declare enum DeviceType { - /** - * @generated from protobuf enum value: CTR = 0; - */ - CTR = 0, - /** - * @generated from protobuf enum value: WUP = 1; - */ - WUP = 1 -} -declare class GetNEXDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXDataRequest): GetNEXDataRequest; - internalBinaryWrite(message: GetNEXDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message account.GetNEXDataRequest - */ -export declare const GetNEXDataRequest: GetNEXDataRequest$Type; -declare class GetNEXDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXDataResponse): GetNEXDataResponse; - internalBinaryWrite(message: GetNEXDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetNEXDataRequest: MessageFns; +export declare const GetNEXDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.GetNEXDataResponse - */ -export declare const GetNEXDataResponse: GetNEXDataResponse$Type; export {}; diff --git a/javascript/account/get_nex_data_rpc.js b/javascript/account/get_nex_data_rpc.js index e0a3e62..be76c1b 100644 --- a/javascript/account/get_nex_data_rpc.js +++ b/javascript/account/get_nex_data_rpc.js @@ -1,168 +1,241 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_nex_data_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_nex_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetNEXDataResponse = exports.GetNEXDataRequest = exports.DeviceType = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -/** - * @generated from protobuf enum account.DeviceType - */ +exports.GetNEXDataResponse = exports.GetNEXDataRequest = exports.DeviceType = exports.protobufPackage = void 0; +exports.deviceTypeFromJSON = deviceTypeFromJSON; +exports.deviceTypeToJSON = deviceTypeToJSON; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account"; var DeviceType; (function (DeviceType) { - /** - * @generated from protobuf enum value: CTR = 0; - */ DeviceType[DeviceType["CTR"] = 0] = "CTR"; - /** - * @generated from protobuf enum value: WUP = 1; - */ DeviceType[DeviceType["WUP"] = 1] = "WUP"; -})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.GetNEXDataRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); + DeviceType[DeviceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(DeviceType || (exports.DeviceType = DeviceType = {})); +function deviceTypeFromJSON(object) { + switch (object) { + case 0: + case "CTR": + return DeviceType.CTR; + case 1: + case "WUP": + return DeviceType.WUP; + case -1: + case "UNRECOGNIZED": + default: + return DeviceType.UNRECOGNIZED; } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; +} +function deviceTypeToJSON(object) { + switch (object) { + case DeviceType.CTR: + return "CTR"; + case DeviceType.WUP: + return "WUP"; + case DeviceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +} +function createBaseGetNEXDataRequest() { + return { pid: 0 }; +} +exports.GetNEXDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.GetNEXDataRequest - */ -exports.GetNEXDataRequest = new GetNEXDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.GetNEXDataResponse", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "owning_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "friend_code", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "device_type", kind: "enum", T: () => ["account.DeviceType", DeviceType] } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - message.password = ""; - message.owningPid = 0; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.friendCode = ""; - message.deviceType = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetNEXDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXDataRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetNEXDataResponse() { + return { pid: 0, password: "", owningPid: 0, accessLevel: 0, serverAccessLevel: "", friendCode: "", deviceType: 0 }; +} +exports.GetNEXDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.password !== "") { + writer.uint32(18).string(message.password); + } + if (message.owningPid !== 0) { + writer.uint32(24).uint32(message.owningPid); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.friendCode !== "") { + writer.uint32(50).string(message.friendCode); + } + if (message.deviceType !== 0) { + writer.uint32(56).int32(message.deviceType); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* string password */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.password = reader.string(); - break; - case /* uint32 owning_pid */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.owningPid = reader.uint32(); - break; - case /* int32 access_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* string friend_code */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.friendCode = reader.string(); - break; - case /* account.DeviceType device_type */ 7: + continue; + } + case 7: { + if (tag !== 56) { + break; + } message.deviceType = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* string password = 2; */ - if (message.password !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.password); - /* uint32 owning_pid = 3; */ - if (message.owningPid !== 0) - writer.tag(3, runtime_1.WireType.Varint).uint32(message.owningPid); - /* int32 access_level = 4; */ - if (message.accessLevel !== 0) - writer.tag(4, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 5; */ - if (message.serverAccessLevel !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* string friend_code = 6; */ - if (message.friendCode !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.friendCode); - /* account.DeviceType device_type = 7; */ - if (message.deviceType !== 0) - writer.tag(7, runtime_1.WireType.Varint).int32(message.deviceType); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + password: isSet(object.password) ? globalThis.String(object.password) : "", + owningPid: isSet(object.owningPid) ? globalThis.Number(object.owningPid) : 0, + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + friendCode: isSet(object.friendCode) ? globalThis.String(object.friendCode) : "", + deviceType: isSet(object.deviceType) ? deviceTypeFromJSON(object.deviceType) : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.owningPid !== 0) { + obj.owningPid = Math.round(message.owningPid); + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.friendCode !== "") { + obj.friendCode = message.friendCode; + } + if (message.deviceType !== 0) { + obj.deviceType = deviceTypeToJSON(message.deviceType); + } + return obj; + }, + create(base) { + return exports.GetNEXDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXDataResponse(); + message.pid = object.pid ?? 0; + message.password = object.password ?? ""; + message.owningPid = object.owningPid ?? 0; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.friendCode = object.friendCode ?? ""; + message.deviceType = object.deviceType ?? 0; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.GetNEXDataResponse - */ -exports.GetNEXDataResponse = new GetNEXDataResponse$Type(); diff --git a/javascript/account/get_nex_data_rpc.ts b/javascript/account/get_nex_data_rpc.ts new file mode 100644 index 0000000..c4c3791 --- /dev/null +++ b/javascript/account/get_nex_data_rpc.ts @@ -0,0 +1,292 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_nex_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account"; + +export enum DeviceType { + CTR = 0, + WUP = 1, + UNRECOGNIZED = -1, +} + +export function deviceTypeFromJSON(object: any): DeviceType { + switch (object) { + case 0: + case "CTR": + return DeviceType.CTR; + case 1: + case "WUP": + return DeviceType.WUP; + case -1: + case "UNRECOGNIZED": + default: + return DeviceType.UNRECOGNIZED; + } +} + +export function deviceTypeToJSON(object: DeviceType): string { + switch (object) { + case DeviceType.CTR: + return "CTR"; + case DeviceType.WUP: + return "WUP"; + case DeviceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface GetNEXDataRequest { + pid: number; +} + +export interface GetNEXDataResponse { + pid: number; + password: string; + owningPid: number; + accessLevel: number; + serverAccessLevel: string; + friendCode: string; + deviceType: DeviceType; +} + +function createBaseGetNEXDataRequest(): GetNEXDataRequest { + return { pid: 0 }; +} + +export const GetNEXDataRequest: MessageFns = { + encode(message: GetNEXDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXDataRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetNEXDataRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXDataRequest { + return GetNEXDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXDataRequest { + const message = createBaseGetNEXDataRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetNEXDataResponse(): GetNEXDataResponse { + return { pid: 0, password: "", owningPid: 0, accessLevel: 0, serverAccessLevel: "", friendCode: "", deviceType: 0 }; +} + +export const GetNEXDataResponse: MessageFns = { + encode(message: GetNEXDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.password !== "") { + writer.uint32(18).string(message.password); + } + if (message.owningPid !== 0) { + writer.uint32(24).uint32(message.owningPid); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.friendCode !== "") { + writer.uint32(50).string(message.friendCode); + } + if (message.deviceType !== 0) { + writer.uint32(56).int32(message.deviceType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.password = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.owningPid = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.friendCode = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.deviceType = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXDataResponse { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + password: isSet(object.password) ? globalThis.String(object.password) : "", + owningPid: isSet(object.owningPid) ? globalThis.Number(object.owningPid) : 0, + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + friendCode: isSet(object.friendCode) ? globalThis.String(object.friendCode) : "", + deviceType: isSet(object.deviceType) ? deviceTypeFromJSON(object.deviceType) : 0, + }; + }, + + toJSON(message: GetNEXDataResponse): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.owningPid !== 0) { + obj.owningPid = Math.round(message.owningPid); + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.friendCode !== "") { + obj.friendCode = message.friendCode; + } + if (message.deviceType !== 0) { + obj.deviceType = deviceTypeToJSON(message.deviceType); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXDataResponse { + return GetNEXDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXDataResponse { + const message = createBaseGetNEXDataResponse(); + message.pid = object.pid ?? 0; + message.password = object.password ?? ""; + message.owningPid = object.owningPid ?? 0; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.friendCode = object.friendCode ?? ""; + message.deviceType = object.deviceType ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/get_nex_password_rpc.d.ts b/javascript/account/get_nex_password_rpc.d.ts index 55dde60..2223cea 100644 --- a/javascript/account/get_nex_password_rpc.d.ts +++ b/javascript/account/get_nex_password_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_nex_password_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.GetNEXPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account"; export interface GetNEXPasswordRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.GetNEXPasswordResponse - */ export interface GetNEXPasswordResponse { - /** - * @generated from protobuf field: string password = 1; - */ password: string; } -declare class GetNEXPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXPasswordRequest): GetNEXPasswordRequest; - internalBinaryWrite(message: GetNEXPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetNEXPasswordRequest: MessageFns; +export declare const GetNEXPasswordResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.GetNEXPasswordRequest - */ -export declare const GetNEXPasswordRequest: GetNEXPasswordRequest$Type; -declare class GetNEXPasswordResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXPasswordResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXPasswordResponse): GetNEXPasswordResponse; - internalBinaryWrite(message: GetNEXPasswordResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message account.GetNEXPasswordResponse - */ -export declare const GetNEXPasswordResponse: GetNEXPasswordResponse$Type; export {}; diff --git a/javascript/account/get_nex_password_rpc.js b/javascript/account/get_nex_password_rpc.js index e050060..77f5667 100644 --- a/javascript/account/get_nex_password_rpc.js +++ b/javascript/account/get_nex_password_rpc.js @@ -1,106 +1,116 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_nex_password_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_nex_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetNEXPasswordResponse = exports.GetNEXPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.GetNEXPasswordRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.GetNEXPasswordResponse = exports.GetNEXPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account"; +function createBaseGetNEXPasswordRequest() { + return { pid: 0 }; +} +exports.GetNEXPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.GetNEXPasswordRequest - */ -exports.GetNEXPasswordRequest = new GetNEXPasswordRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXPasswordResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.GetNEXPasswordResponse", [ - { no: 1, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.password = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetNEXPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXPasswordRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetNEXPasswordResponse() { + return { password: "" }; +} +exports.GetNEXPasswordResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string password */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.password = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string password = 1; */ - if (message.password !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.password); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { password: isSet(object.password) ? globalThis.String(object.password) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.password !== "") { + obj.password = message.password; + } + return obj; + }, + create(base) { + return exports.GetNEXPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXPasswordResponse(); + message.password = object.password ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.GetNEXPasswordResponse - */ -exports.GetNEXPasswordResponse = new GetNEXPasswordResponse$Type(); diff --git a/javascript/account/get_nex_password_rpc.ts b/javascript/account/get_nex_password_rpc.ts new file mode 100644 index 0000000..0edb55a --- /dev/null +++ b/javascript/account/get_nex_password_rpc.ts @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_nex_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account"; + +export interface GetNEXPasswordRequest { + pid: number; +} + +export interface GetNEXPasswordResponse { + password: string; +} + +function createBaseGetNEXPasswordRequest(): GetNEXPasswordRequest { + return { pid: 0 }; +} + +export const GetNEXPasswordRequest: MessageFns = { + encode(message: GetNEXPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXPasswordRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetNEXPasswordRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXPasswordRequest { + return GetNEXPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXPasswordRequest { + const message = createBaseGetNEXPasswordRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetNEXPasswordResponse(): GetNEXPasswordResponse { + return { password: "" }; +} + +export const GetNEXPasswordResponse: MessageFns = { + encode(message: GetNEXPasswordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXPasswordResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.password = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXPasswordResponse { + return { password: isSet(object.password) ? globalThis.String(object.password) : "" }; + }, + + toJSON(message: GetNEXPasswordResponse): unknown { + const obj: any = {}; + if (message.password !== "") { + obj.password = message.password; + } + return obj; + }, + + create(base?: DeepPartial): GetNEXPasswordResponse { + return GetNEXPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXPasswordResponse { + const message = createBaseGetNEXPasswordResponse(); + message.password = object.password ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/get_user_data_rpc.d.ts b/javascript/account/get_user_data_rpc.d.ts index 9b38031..e09c584 100644 --- a/javascript/account/get_user_data_rpc.d.ts +++ b/javascript/account/get_user_data_rpc.d.ts @@ -1,104 +1,38 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_user_data_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { PNIDPermissionFlags } from "./pnid_permission_flags"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * @generated from protobuf message account.GetUserDataRequest - */ +import { PNIDPermissionFlags } from "./pnid_permission_flags"; +export declare const protobufPackage = "account"; export interface GetUserDataRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.GetUserDataResponse - */ export interface GetUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: uint32 pid = 2; - */ pid: number; - /** - * @generated from protobuf field: string username = 3; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 4; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 5; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: account.Mii mii = 6; - */ - mii?: Mii; - /** - * @generated from protobuf field: string creation_date = 7; - */ + mii: Mii | undefined; creationDate: string; - /** - * @generated from protobuf field: string birthdate = 8; - */ birthdate: string; - /** - * @generated from protobuf field: string gender = 9; - */ gender: string; - /** - * @generated from protobuf field: string country = 10; - */ country: string; - /** - * @generated from protobuf field: string language = 11; - */ language: string; - /** - * @generated from protobuf field: string email_address = 12; - */ emailAddress: string; - /** - * @generated from protobuf field: string tier_name = 13; - */ tierName: string; - /** - * @generated from protobuf field: account.PNIDPermissionFlags permissions = 14; - */ - permissions?: PNIDPermissionFlags; -} -declare class GetUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataRequest): GetUserDataRequest; - internalBinaryWrite(message: GetUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; + permissions: PNIDPermissionFlags | undefined; } -/** - * @generated MessageType for protobuf message account.GetUserDataRequest - */ -export declare const GetUserDataRequest: GetUserDataRequest$Type; -declare class GetUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataResponse): GetUserDataResponse; - internalBinaryWrite(message: GetUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserDataRequest: MessageFns; +export declare const GetUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.GetUserDataResponse - */ -export declare const GetUserDataResponse: GetUserDataResponse$Type; export {}; diff --git a/javascript/account/get_user_data_rpc.js b/javascript/account/get_user_data_rpc.js index c30a8ba..2747e36 100644 --- a/javascript/account/get_user_data_rpc.js +++ b/javascript/account/get_user_data_rpc.js @@ -1,210 +1,332 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/get_user_data_rpc.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserDataResponse = exports.GetUserDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.GetUserDataResponse = exports.GetUserDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.GetUserDataRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.protobufPackage = "account"; +function createBaseGetUserDataRequest() { + return { pid: 0 }; +} +exports.GetUserDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.GetUserDataRequest - */ -exports.GetUserDataRequest = new GetUserDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.GetUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 7, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "birthdate", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "tier_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "permissions", kind: "message", T: () => pnid_permission_flags_1.PNIDPermissionFlags } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.creationDate = ""; - message.birthdate = ""; - message.gender = ""; - message.country = ""; - message.language = ""; - message.emailAddress = ""; - message.tierName = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserDataResponse() { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} +exports.GetUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + pnid_permission_flags_1.PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* uint32 pid */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* account.Mii mii */ 6: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string creation_date */ 7: + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.creationDate = reader.string(); - break; - case /* string birthdate */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.birthdate = reader.string(); - break; - case /* string gender */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.country = reader.string(); - break; - case /* string language */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.emailAddress = reader.string(); - break; - case /* string tier_name */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.tierName = reader.string(); - break; - case /* account.PNIDPermissionFlags permissions */ 14: - message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryRead(reader, reader.uint32(), options, message.permissions); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* uint32 pid = 2; */ - if (message.pid !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 3; */ - if (message.username !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 4; */ - if (message.accessLevel !== 0) - writer.tag(4, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 5; */ - if (message.serverAccessLevel !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* account.Mii mii = 6; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string creation_date = 7; */ - if (message.creationDate !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string birthdate = 8; */ - if (message.birthdate !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.birthdate); - /* string gender = 9; */ - if (message.gender !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 10; */ - if (message.country !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.country); - /* string language = 11; */ - if (message.language !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 12; */ - if (message.emailAddress !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* string tier_name = 13; */ - if (message.tierName !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* account.PNIDPermissionFlags permissions = 14; */ - if (message.permissions) - pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryWrite(message.permissions, writer.tag(14, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? pnid_permission_flags_1.PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = pnid_permission_flags_1.PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + create(base) { + return exports.GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? pnid_permission_flags_1.PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.GetUserDataResponse - */ -exports.GetUserDataResponse = new GetUserDataResponse$Type(); diff --git a/javascript/account/get_user_data_rpc.ts b/javascript/account/get_user_data_rpc.ts new file mode 100644 index 0000000..67ec818 --- /dev/null +++ b/javascript/account/get_user_data_rpc.ts @@ -0,0 +1,397 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/get_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { PNIDPermissionFlags } from "./pnid_permission_flags"; + +export const protobufPackage = "account"; + +export interface GetUserDataRequest { + pid: number; +} + +export interface GetUserDataResponse { + deleted: boolean; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + creationDate: string; + birthdate: string; + gender: string; + country: string; + language: string; + emailAddress: string; + tierName: string; + permissions: PNIDPermissionFlags | undefined; +} + +function createBaseGetUserDataRequest(): GetUserDataRequest { + return { pid: 0 }; +} + +export const GetUserDataRequest: MessageFns = { + encode(message: GetUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserDataRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataRequest { + return GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataRequest { + const message = createBaseGetUserDataRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserDataResponse(): GetUserDataResponse { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} + +export const GetUserDataResponse: MessageFns = { + encode(message: GetUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.username = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.birthdate = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.gender = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.country = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.language = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.permissions = PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + + toJSON(message: GetUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataResponse { + return GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataResponse { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/mii.d.ts b/javascript/account/mii.d.ts index 6a518e5..50c33d1 100644 --- a/javascript/account/mii.d.ts +++ b/javascript/account/mii.d.ts @@ -1,39 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/mii.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.Mii - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account"; export interface Mii { - /** - * @generated from protobuf field: string name = 1; - */ name: string; - /** - * @generated from protobuf field: string data = 2; - */ data: string; - /** - * @generated from protobuf field: string url = 3; - */ url: string; } -declare class Mii$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Mii; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mii): Mii; - internalBinaryWrite(message: Mii, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Mii: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.Mii - */ -export declare const Mii: Mii$Type; export {}; diff --git a/javascript/account/mii.js b/javascript/account/mii.js index 6ac766a..5104a8c 100644 --- a/javascript/account/mii.js +++ b/javascript/account/mii.js @@ -1,75 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/mii.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/mii.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mii = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Mii$Type extends runtime_4.MessageType { - constructor() { - super("account.Mii", [ - { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "data", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.name = ""; - message.data = ""; - message.url = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Mii = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account"; +function createBaseMii() { + return { name: "", data: "", url: "" }; +} +exports.Mii = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.name = reader.string(); - break; - case /* string data */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.data = reader.string(); - break; - case /* string url */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.url = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string name = 1; */ - if (message.name !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.name); - /* string data = 2; */ - if (message.data !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.data); - /* string url = 3; */ - if (message.url !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.url); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + create(base) { + return exports.Mii.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.Mii - */ -exports.Mii = new Mii$Type(); diff --git a/javascript/account/mii.ts b/javascript/account/mii.ts new file mode 100644 index 0000000..77fab5f --- /dev/null +++ b/javascript/account/mii.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/mii.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account"; + +export interface Mii { + name: string; + data: string; + url: string; +} + +function createBaseMii(): Mii { + return { name: "", data: "", url: "" }; +} + +export const Mii: MessageFns = { + encode(message: Mii, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Mii { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Mii { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: Mii): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): Mii { + return Mii.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Mii { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/pnid_permission_flags.d.ts b/javascript/account/pnid_permission_flags.d.ts index 6f2bf09..84827b6 100644 --- a/javascript/account/pnid_permission_flags.d.ts +++ b/javascript/account/pnid_permission_flags.d.ts @@ -1,115 +1,40 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/pnid_permission_flags.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.PNIDPermissionFlags - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account"; export interface PNIDPermissionFlags { - /** - * @generated from protobuf field: bool banned_all_permanently = 1; - */ bannedAllPermanently: boolean; - /** - * @generated from protobuf field: bool banned_all_temporarily = 2; - */ bannedAllTemporarily: boolean; - /** - * @generated from protobuf field: bool beta_access = 3; - */ betaAccess: boolean; - /** - * @generated from protobuf field: bool access_admin_panel = 4; - */ accessAdminPanel: boolean; - /** - * @generated from protobuf field: bool create_server_configs = 5; - */ createServerConfigs: boolean; - /** - * @generated from protobuf field: bool modify_server_configs = 6; - */ modifyServerConfigs: boolean; - /** - * @generated from protobuf field: bool deploy_server = 7; - */ deployServer: boolean; - /** - * @generated from protobuf field: bool modify_pnids = 8; - */ modifyPnids: boolean; - /** - * @generated from protobuf field: bool modify_nex_accounts = 9; - */ modifyNexAccounts: boolean; - /** - * @generated from protobuf field: bool modify_consoles = 10; - */ modifyConsoles: boolean; - /** - * @generated from protobuf field: bool ban_pnids = 11; - */ banPnids: boolean; - /** - * @generated from protobuf field: bool ban_nex_accounts = 12; - */ banNexAccounts: boolean; - /** - * @generated from protobuf field: bool ban_consoles = 13; - */ banConsoles: boolean; - /** - * @generated from protobuf field: bool moderate_miiverse = 14; - */ moderateMiiverse: boolean; - /** - * @generated from protobuf field: bool create_api_keys = 15; - */ createApiKeys: boolean; - /** - * @generated from protobuf field: bool create_boss_tasks = 16; - */ createBossTasks: boolean; - /** - * @generated from protobuf field: bool update_boss_tasks = 17; - */ updateBossTasks: boolean; - /** - * @generated from protobuf field: bool delete_boss_tasks = 18; - */ deleteBossTasks: boolean; - /** - * @generated from protobuf field: bool upload_boss_files = 19; - */ uploadBossFiles: boolean; - /** - * @generated from protobuf field: bool update_boss_files = 20; - */ updateBossFiles: boolean; - /** - * @generated from protobuf field: bool delete_boss_files = 21; - */ deleteBossFiles: boolean; - /** - * @generated from protobuf field: bool update_pnid_permissions = 22; - */ updatePnidPermissions: boolean; } -declare class PNIDPermissionFlags$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PNIDPermissionFlags; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PNIDPermissionFlags): PNIDPermissionFlags; - internalBinaryWrite(message: PNIDPermissionFlags, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const PNIDPermissionFlags: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.PNIDPermissionFlags - */ -export declare const PNIDPermissionFlags: PNIDPermissionFlags$Type; export {}; diff --git a/javascript/account/pnid_permission_flags.js b/javascript/account/pnid_permission_flags.js index 4abee0c..f90e241 100644 --- a/javascript/account/pnid_permission_flags.js +++ b/javascript/account/pnid_permission_flags.js @@ -1,227 +1,411 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/pnid_permission_flags.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/pnid_permission_flags.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.PNIDPermissionFlags = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class PNIDPermissionFlags$Type extends runtime_4.MessageType { - constructor() { - super("account.PNIDPermissionFlags", [ - { no: 1, name: "banned_all_permanently", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "banned_all_temporarily", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "beta_access", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "access_admin_panel", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "create_server_configs", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "modify_server_configs", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "deploy_server", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 8, name: "modify_pnids", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "modify_nex_accounts", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "modify_consoles", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 11, name: "ban_pnids", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 12, name: "ban_nex_accounts", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 13, name: "ban_consoles", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 14, name: "moderate_miiverse", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 15, name: "create_api_keys", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "create_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 17, name: "update_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "delete_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 19, name: "upload_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 20, name: "update_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 21, name: "delete_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 22, name: "update_pnid_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.bannedAllPermanently = false; - message.bannedAllTemporarily = false; - message.betaAccess = false; - message.accessAdminPanel = false; - message.createServerConfigs = false; - message.modifyServerConfigs = false; - message.deployServer = false; - message.modifyPnids = false; - message.modifyNexAccounts = false; - message.modifyConsoles = false; - message.banPnids = false; - message.banNexAccounts = false; - message.banConsoles = false; - message.moderateMiiverse = false; - message.createApiKeys = false; - message.createBossTasks = false; - message.updateBossTasks = false; - message.deleteBossTasks = false; - message.uploadBossFiles = false; - message.updateBossFiles = false; - message.deleteBossFiles = false; - message.updatePnidPermissions = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.PNIDPermissionFlags = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account"; +function createBasePNIDPermissionFlags() { + return { + bannedAllPermanently: false, + bannedAllTemporarily: false, + betaAccess: false, + accessAdminPanel: false, + createServerConfigs: false, + modifyServerConfigs: false, + deployServer: false, + modifyPnids: false, + modifyNexAccounts: false, + modifyConsoles: false, + banPnids: false, + banNexAccounts: false, + banConsoles: false, + moderateMiiverse: false, + createApiKeys: false, + createBossTasks: false, + updateBossTasks: false, + deleteBossTasks: false, + uploadBossFiles: false, + updateBossFiles: false, + deleteBossFiles: false, + updatePnidPermissions: false, + }; +} +exports.PNIDPermissionFlags = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.bannedAllPermanently !== false) { + writer.uint32(8).bool(message.bannedAllPermanently); + } + if (message.bannedAllTemporarily !== false) { + writer.uint32(16).bool(message.bannedAllTemporarily); + } + if (message.betaAccess !== false) { + writer.uint32(24).bool(message.betaAccess); + } + if (message.accessAdminPanel !== false) { + writer.uint32(32).bool(message.accessAdminPanel); + } + if (message.createServerConfigs !== false) { + writer.uint32(40).bool(message.createServerConfigs); + } + if (message.modifyServerConfigs !== false) { + writer.uint32(48).bool(message.modifyServerConfigs); + } + if (message.deployServer !== false) { + writer.uint32(56).bool(message.deployServer); + } + if (message.modifyPnids !== false) { + writer.uint32(64).bool(message.modifyPnids); + } + if (message.modifyNexAccounts !== false) { + writer.uint32(72).bool(message.modifyNexAccounts); + } + if (message.modifyConsoles !== false) { + writer.uint32(80).bool(message.modifyConsoles); + } + if (message.banPnids !== false) { + writer.uint32(88).bool(message.banPnids); + } + if (message.banNexAccounts !== false) { + writer.uint32(96).bool(message.banNexAccounts); + } + if (message.banConsoles !== false) { + writer.uint32(104).bool(message.banConsoles); + } + if (message.moderateMiiverse !== false) { + writer.uint32(112).bool(message.moderateMiiverse); + } + if (message.createApiKeys !== false) { + writer.uint32(120).bool(message.createApiKeys); + } + if (message.createBossTasks !== false) { + writer.uint32(128).bool(message.createBossTasks); + } + if (message.updateBossTasks !== false) { + writer.uint32(136).bool(message.updateBossTasks); + } + if (message.deleteBossTasks !== false) { + writer.uint32(144).bool(message.deleteBossTasks); + } + if (message.uploadBossFiles !== false) { + writer.uint32(152).bool(message.uploadBossFiles); + } + if (message.updateBossFiles !== false) { + writer.uint32(160).bool(message.updateBossFiles); + } + if (message.deleteBossFiles !== false) { + writer.uint32(168).bool(message.deleteBossFiles); + } + if (message.updatePnidPermissions !== false) { + writer.uint32(176).bool(message.updatePnidPermissions); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePNIDPermissionFlags(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool banned_all_permanently */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.bannedAllPermanently = reader.bool(); - break; - case /* bool banned_all_temporarily */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.bannedAllTemporarily = reader.bool(); - break; - case /* bool beta_access */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.betaAccess = reader.bool(); - break; - case /* bool access_admin_panel */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessAdminPanel = reader.bool(); - break; - case /* bool create_server_configs */ 5: + continue; + } + case 5: { + if (tag !== 40) { + break; + } message.createServerConfigs = reader.bool(); - break; - case /* bool modify_server_configs */ 6: + continue; + } + case 6: { + if (tag !== 48) { + break; + } message.modifyServerConfigs = reader.bool(); - break; - case /* bool deploy_server */ 7: + continue; + } + case 7: { + if (tag !== 56) { + break; + } message.deployServer = reader.bool(); - break; - case /* bool modify_pnids */ 8: + continue; + } + case 8: { + if (tag !== 64) { + break; + } message.modifyPnids = reader.bool(); - break; - case /* bool modify_nex_accounts */ 9: + continue; + } + case 9: { + if (tag !== 72) { + break; + } message.modifyNexAccounts = reader.bool(); - break; - case /* bool modify_consoles */ 10: + continue; + } + case 10: { + if (tag !== 80) { + break; + } message.modifyConsoles = reader.bool(); - break; - case /* bool ban_pnids */ 11: + continue; + } + case 11: { + if (tag !== 88) { + break; + } message.banPnids = reader.bool(); - break; - case /* bool ban_nex_accounts */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.banNexAccounts = reader.bool(); - break; - case /* bool ban_consoles */ 13: + continue; + } + case 13: { + if (tag !== 104) { + break; + } message.banConsoles = reader.bool(); - break; - case /* bool moderate_miiverse */ 14: + continue; + } + case 14: { + if (tag !== 112) { + break; + } message.moderateMiiverse = reader.bool(); - break; - case /* bool create_api_keys */ 15: + continue; + } + case 15: { + if (tag !== 120) { + break; + } message.createApiKeys = reader.bool(); - break; - case /* bool create_boss_tasks */ 16: + continue; + } + case 16: { + if (tag !== 128) { + break; + } message.createBossTasks = reader.bool(); - break; - case /* bool update_boss_tasks */ 17: + continue; + } + case 17: { + if (tag !== 136) { + break; + } message.updateBossTasks = reader.bool(); - break; - case /* bool delete_boss_tasks */ 18: + continue; + } + case 18: { + if (tag !== 144) { + break; + } message.deleteBossTasks = reader.bool(); - break; - case /* bool upload_boss_files */ 19: + continue; + } + case 19: { + if (tag !== 152) { + break; + } message.uploadBossFiles = reader.bool(); - break; - case /* bool update_boss_files */ 20: + continue; + } + case 20: { + if (tag !== 160) { + break; + } message.updateBossFiles = reader.bool(); - break; - case /* bool delete_boss_files */ 21: + continue; + } + case 21: { + if (tag !== 168) { + break; + } message.deleteBossFiles = reader.bool(); - break; - case /* bool update_pnid_permissions */ 22: + continue; + } + case 22: { + if (tag !== 176) { + break; + } message.updatePnidPermissions = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool banned_all_permanently = 1; */ - if (message.bannedAllPermanently !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.bannedAllPermanently); - /* bool banned_all_temporarily = 2; */ - if (message.bannedAllTemporarily !== false) - writer.tag(2, runtime_1.WireType.Varint).bool(message.bannedAllTemporarily); - /* bool beta_access = 3; */ - if (message.betaAccess !== false) - writer.tag(3, runtime_1.WireType.Varint).bool(message.betaAccess); - /* bool access_admin_panel = 4; */ - if (message.accessAdminPanel !== false) - writer.tag(4, runtime_1.WireType.Varint).bool(message.accessAdminPanel); - /* bool create_server_configs = 5; */ - if (message.createServerConfigs !== false) - writer.tag(5, runtime_1.WireType.Varint).bool(message.createServerConfigs); - /* bool modify_server_configs = 6; */ - if (message.modifyServerConfigs !== false) - writer.tag(6, runtime_1.WireType.Varint).bool(message.modifyServerConfigs); - /* bool deploy_server = 7; */ - if (message.deployServer !== false) - writer.tag(7, runtime_1.WireType.Varint).bool(message.deployServer); - /* bool modify_pnids = 8; */ - if (message.modifyPnids !== false) - writer.tag(8, runtime_1.WireType.Varint).bool(message.modifyPnids); - /* bool modify_nex_accounts = 9; */ - if (message.modifyNexAccounts !== false) - writer.tag(9, runtime_1.WireType.Varint).bool(message.modifyNexAccounts); - /* bool modify_consoles = 10; */ - if (message.modifyConsoles !== false) - writer.tag(10, runtime_1.WireType.Varint).bool(message.modifyConsoles); - /* bool ban_pnids = 11; */ - if (message.banPnids !== false) - writer.tag(11, runtime_1.WireType.Varint).bool(message.banPnids); - /* bool ban_nex_accounts = 12; */ - if (message.banNexAccounts !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.banNexAccounts); - /* bool ban_consoles = 13; */ - if (message.banConsoles !== false) - writer.tag(13, runtime_1.WireType.Varint).bool(message.banConsoles); - /* bool moderate_miiverse = 14; */ - if (message.moderateMiiverse !== false) - writer.tag(14, runtime_1.WireType.Varint).bool(message.moderateMiiverse); - /* bool create_api_keys = 15; */ - if (message.createApiKeys !== false) - writer.tag(15, runtime_1.WireType.Varint).bool(message.createApiKeys); - /* bool create_boss_tasks = 16; */ - if (message.createBossTasks !== false) - writer.tag(16, runtime_1.WireType.Varint).bool(message.createBossTasks); - /* bool update_boss_tasks = 17; */ - if (message.updateBossTasks !== false) - writer.tag(17, runtime_1.WireType.Varint).bool(message.updateBossTasks); - /* bool delete_boss_tasks = 18; */ - if (message.deleteBossTasks !== false) - writer.tag(18, runtime_1.WireType.Varint).bool(message.deleteBossTasks); - /* bool upload_boss_files = 19; */ - if (message.uploadBossFiles !== false) - writer.tag(19, runtime_1.WireType.Varint).bool(message.uploadBossFiles); - /* bool update_boss_files = 20; */ - if (message.updateBossFiles !== false) - writer.tag(20, runtime_1.WireType.Varint).bool(message.updateBossFiles); - /* bool delete_boss_files = 21; */ - if (message.deleteBossFiles !== false) - writer.tag(21, runtime_1.WireType.Varint).bool(message.deleteBossFiles); - /* bool update_pnid_permissions = 22; */ - if (message.updatePnidPermissions !== false) - writer.tag(22, runtime_1.WireType.Varint).bool(message.updatePnidPermissions); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + bannedAllPermanently: isSet(object.bannedAllPermanently) + ? globalThis.Boolean(object.bannedAllPermanently) + : false, + bannedAllTemporarily: isSet(object.bannedAllTemporarily) + ? globalThis.Boolean(object.bannedAllTemporarily) + : false, + betaAccess: isSet(object.betaAccess) ? globalThis.Boolean(object.betaAccess) : false, + accessAdminPanel: isSet(object.accessAdminPanel) ? globalThis.Boolean(object.accessAdminPanel) : false, + createServerConfigs: isSet(object.createServerConfigs) ? globalThis.Boolean(object.createServerConfigs) : false, + modifyServerConfigs: isSet(object.modifyServerConfigs) ? globalThis.Boolean(object.modifyServerConfigs) : false, + deployServer: isSet(object.deployServer) ? globalThis.Boolean(object.deployServer) : false, + modifyPnids: isSet(object.modifyPnids) ? globalThis.Boolean(object.modifyPnids) : false, + modifyNexAccounts: isSet(object.modifyNexAccounts) ? globalThis.Boolean(object.modifyNexAccounts) : false, + modifyConsoles: isSet(object.modifyConsoles) ? globalThis.Boolean(object.modifyConsoles) : false, + banPnids: isSet(object.banPnids) ? globalThis.Boolean(object.banPnids) : false, + banNexAccounts: isSet(object.banNexAccounts) ? globalThis.Boolean(object.banNexAccounts) : false, + banConsoles: isSet(object.banConsoles) ? globalThis.Boolean(object.banConsoles) : false, + moderateMiiverse: isSet(object.moderateMiiverse) ? globalThis.Boolean(object.moderateMiiverse) : false, + createApiKeys: isSet(object.createApiKeys) ? globalThis.Boolean(object.createApiKeys) : false, + createBossTasks: isSet(object.createBossTasks) ? globalThis.Boolean(object.createBossTasks) : false, + updateBossTasks: isSet(object.updateBossTasks) ? globalThis.Boolean(object.updateBossTasks) : false, + deleteBossTasks: isSet(object.deleteBossTasks) ? globalThis.Boolean(object.deleteBossTasks) : false, + uploadBossFiles: isSet(object.uploadBossFiles) ? globalThis.Boolean(object.uploadBossFiles) : false, + updateBossFiles: isSet(object.updateBossFiles) ? globalThis.Boolean(object.updateBossFiles) : false, + deleteBossFiles: isSet(object.deleteBossFiles) ? globalThis.Boolean(object.deleteBossFiles) : false, + updatePnidPermissions: isSet(object.updatePnidPermissions) + ? globalThis.Boolean(object.updatePnidPermissions) + : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.bannedAllPermanently !== false) { + obj.bannedAllPermanently = message.bannedAllPermanently; + } + if (message.bannedAllTemporarily !== false) { + obj.bannedAllTemporarily = message.bannedAllTemporarily; + } + if (message.betaAccess !== false) { + obj.betaAccess = message.betaAccess; + } + if (message.accessAdminPanel !== false) { + obj.accessAdminPanel = message.accessAdminPanel; + } + if (message.createServerConfigs !== false) { + obj.createServerConfigs = message.createServerConfigs; + } + if (message.modifyServerConfigs !== false) { + obj.modifyServerConfigs = message.modifyServerConfigs; + } + if (message.deployServer !== false) { + obj.deployServer = message.deployServer; + } + if (message.modifyPnids !== false) { + obj.modifyPnids = message.modifyPnids; + } + if (message.modifyNexAccounts !== false) { + obj.modifyNexAccounts = message.modifyNexAccounts; + } + if (message.modifyConsoles !== false) { + obj.modifyConsoles = message.modifyConsoles; + } + if (message.banPnids !== false) { + obj.banPnids = message.banPnids; + } + if (message.banNexAccounts !== false) { + obj.banNexAccounts = message.banNexAccounts; + } + if (message.banConsoles !== false) { + obj.banConsoles = message.banConsoles; + } + if (message.moderateMiiverse !== false) { + obj.moderateMiiverse = message.moderateMiiverse; + } + if (message.createApiKeys !== false) { + obj.createApiKeys = message.createApiKeys; + } + if (message.createBossTasks !== false) { + obj.createBossTasks = message.createBossTasks; + } + if (message.updateBossTasks !== false) { + obj.updateBossTasks = message.updateBossTasks; + } + if (message.deleteBossTasks !== false) { + obj.deleteBossTasks = message.deleteBossTasks; + } + if (message.uploadBossFiles !== false) { + obj.uploadBossFiles = message.uploadBossFiles; + } + if (message.updateBossFiles !== false) { + obj.updateBossFiles = message.updateBossFiles; + } + if (message.deleteBossFiles !== false) { + obj.deleteBossFiles = message.deleteBossFiles; + } + if (message.updatePnidPermissions !== false) { + obj.updatePnidPermissions = message.updatePnidPermissions; + } + return obj; + }, + create(base) { + return exports.PNIDPermissionFlags.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBasePNIDPermissionFlags(); + message.bannedAllPermanently = object.bannedAllPermanently ?? false; + message.bannedAllTemporarily = object.bannedAllTemporarily ?? false; + message.betaAccess = object.betaAccess ?? false; + message.accessAdminPanel = object.accessAdminPanel ?? false; + message.createServerConfigs = object.createServerConfigs ?? false; + message.modifyServerConfigs = object.modifyServerConfigs ?? false; + message.deployServer = object.deployServer ?? false; + message.modifyPnids = object.modifyPnids ?? false; + message.modifyNexAccounts = object.modifyNexAccounts ?? false; + message.modifyConsoles = object.modifyConsoles ?? false; + message.banPnids = object.banPnids ?? false; + message.banNexAccounts = object.banNexAccounts ?? false; + message.banConsoles = object.banConsoles ?? false; + message.moderateMiiverse = object.moderateMiiverse ?? false; + message.createApiKeys = object.createApiKeys ?? false; + message.createBossTasks = object.createBossTasks ?? false; + message.updateBossTasks = object.updateBossTasks ?? false; + message.deleteBossTasks = object.deleteBossTasks ?? false; + message.uploadBossFiles = object.uploadBossFiles ?? false; + message.updateBossFiles = object.updateBossFiles ?? false; + message.deleteBossFiles = object.deleteBossFiles ?? false; + message.updatePnidPermissions = object.updatePnidPermissions ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.PNIDPermissionFlags - */ -exports.PNIDPermissionFlags = new PNIDPermissionFlags$Type(); diff --git a/javascript/account/pnid_permission_flags.ts b/javascript/account/pnid_permission_flags.ts new file mode 100644 index 0000000..93dab4c --- /dev/null +++ b/javascript/account/pnid_permission_flags.ts @@ -0,0 +1,481 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/pnid_permission_flags.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account"; + +export interface PNIDPermissionFlags { + bannedAllPermanently: boolean; + bannedAllTemporarily: boolean; + betaAccess: boolean; + accessAdminPanel: boolean; + createServerConfigs: boolean; + modifyServerConfigs: boolean; + deployServer: boolean; + modifyPnids: boolean; + modifyNexAccounts: boolean; + modifyConsoles: boolean; + banPnids: boolean; + banNexAccounts: boolean; + banConsoles: boolean; + moderateMiiverse: boolean; + createApiKeys: boolean; + createBossTasks: boolean; + updateBossTasks: boolean; + deleteBossTasks: boolean; + uploadBossFiles: boolean; + updateBossFiles: boolean; + deleteBossFiles: boolean; + updatePnidPermissions: boolean; +} + +function createBasePNIDPermissionFlags(): PNIDPermissionFlags { + return { + bannedAllPermanently: false, + bannedAllTemporarily: false, + betaAccess: false, + accessAdminPanel: false, + createServerConfigs: false, + modifyServerConfigs: false, + deployServer: false, + modifyPnids: false, + modifyNexAccounts: false, + modifyConsoles: false, + banPnids: false, + banNexAccounts: false, + banConsoles: false, + moderateMiiverse: false, + createApiKeys: false, + createBossTasks: false, + updateBossTasks: false, + deleteBossTasks: false, + uploadBossFiles: false, + updateBossFiles: false, + deleteBossFiles: false, + updatePnidPermissions: false, + }; +} + +export const PNIDPermissionFlags: MessageFns = { + encode(message: PNIDPermissionFlags, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bannedAllPermanently !== false) { + writer.uint32(8).bool(message.bannedAllPermanently); + } + if (message.bannedAllTemporarily !== false) { + writer.uint32(16).bool(message.bannedAllTemporarily); + } + if (message.betaAccess !== false) { + writer.uint32(24).bool(message.betaAccess); + } + if (message.accessAdminPanel !== false) { + writer.uint32(32).bool(message.accessAdminPanel); + } + if (message.createServerConfigs !== false) { + writer.uint32(40).bool(message.createServerConfigs); + } + if (message.modifyServerConfigs !== false) { + writer.uint32(48).bool(message.modifyServerConfigs); + } + if (message.deployServer !== false) { + writer.uint32(56).bool(message.deployServer); + } + if (message.modifyPnids !== false) { + writer.uint32(64).bool(message.modifyPnids); + } + if (message.modifyNexAccounts !== false) { + writer.uint32(72).bool(message.modifyNexAccounts); + } + if (message.modifyConsoles !== false) { + writer.uint32(80).bool(message.modifyConsoles); + } + if (message.banPnids !== false) { + writer.uint32(88).bool(message.banPnids); + } + if (message.banNexAccounts !== false) { + writer.uint32(96).bool(message.banNexAccounts); + } + if (message.banConsoles !== false) { + writer.uint32(104).bool(message.banConsoles); + } + if (message.moderateMiiverse !== false) { + writer.uint32(112).bool(message.moderateMiiverse); + } + if (message.createApiKeys !== false) { + writer.uint32(120).bool(message.createApiKeys); + } + if (message.createBossTasks !== false) { + writer.uint32(128).bool(message.createBossTasks); + } + if (message.updateBossTasks !== false) { + writer.uint32(136).bool(message.updateBossTasks); + } + if (message.deleteBossTasks !== false) { + writer.uint32(144).bool(message.deleteBossTasks); + } + if (message.uploadBossFiles !== false) { + writer.uint32(152).bool(message.uploadBossFiles); + } + if (message.updateBossFiles !== false) { + writer.uint32(160).bool(message.updateBossFiles); + } + if (message.deleteBossFiles !== false) { + writer.uint32(168).bool(message.deleteBossFiles); + } + if (message.updatePnidPermissions !== false) { + writer.uint32(176).bool(message.updatePnidPermissions); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PNIDPermissionFlags { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePNIDPermissionFlags(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.bannedAllPermanently = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.bannedAllTemporarily = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.betaAccess = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessAdminPanel = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.createServerConfigs = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.modifyServerConfigs = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.deployServer = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.modifyPnids = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.modifyNexAccounts = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.modifyConsoles = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.banPnids = reader.bool(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.banNexAccounts = reader.bool(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.banConsoles = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.moderateMiiverse = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.createApiKeys = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.createBossTasks = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.updateBossTasks = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.deleteBossTasks = reader.bool(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.uploadBossFiles = reader.bool(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.updateBossFiles = reader.bool(); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.deleteBossFiles = reader.bool(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.updatePnidPermissions = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PNIDPermissionFlags { + return { + bannedAllPermanently: isSet(object.bannedAllPermanently) + ? globalThis.Boolean(object.bannedAllPermanently) + : false, + bannedAllTemporarily: isSet(object.bannedAllTemporarily) + ? globalThis.Boolean(object.bannedAllTemporarily) + : false, + betaAccess: isSet(object.betaAccess) ? globalThis.Boolean(object.betaAccess) : false, + accessAdminPanel: isSet(object.accessAdminPanel) ? globalThis.Boolean(object.accessAdminPanel) : false, + createServerConfigs: isSet(object.createServerConfigs) ? globalThis.Boolean(object.createServerConfigs) : false, + modifyServerConfigs: isSet(object.modifyServerConfigs) ? globalThis.Boolean(object.modifyServerConfigs) : false, + deployServer: isSet(object.deployServer) ? globalThis.Boolean(object.deployServer) : false, + modifyPnids: isSet(object.modifyPnids) ? globalThis.Boolean(object.modifyPnids) : false, + modifyNexAccounts: isSet(object.modifyNexAccounts) ? globalThis.Boolean(object.modifyNexAccounts) : false, + modifyConsoles: isSet(object.modifyConsoles) ? globalThis.Boolean(object.modifyConsoles) : false, + banPnids: isSet(object.banPnids) ? globalThis.Boolean(object.banPnids) : false, + banNexAccounts: isSet(object.banNexAccounts) ? globalThis.Boolean(object.banNexAccounts) : false, + banConsoles: isSet(object.banConsoles) ? globalThis.Boolean(object.banConsoles) : false, + moderateMiiverse: isSet(object.moderateMiiverse) ? globalThis.Boolean(object.moderateMiiverse) : false, + createApiKeys: isSet(object.createApiKeys) ? globalThis.Boolean(object.createApiKeys) : false, + createBossTasks: isSet(object.createBossTasks) ? globalThis.Boolean(object.createBossTasks) : false, + updateBossTasks: isSet(object.updateBossTasks) ? globalThis.Boolean(object.updateBossTasks) : false, + deleteBossTasks: isSet(object.deleteBossTasks) ? globalThis.Boolean(object.deleteBossTasks) : false, + uploadBossFiles: isSet(object.uploadBossFiles) ? globalThis.Boolean(object.uploadBossFiles) : false, + updateBossFiles: isSet(object.updateBossFiles) ? globalThis.Boolean(object.updateBossFiles) : false, + deleteBossFiles: isSet(object.deleteBossFiles) ? globalThis.Boolean(object.deleteBossFiles) : false, + updatePnidPermissions: isSet(object.updatePnidPermissions) + ? globalThis.Boolean(object.updatePnidPermissions) + : false, + }; + }, + + toJSON(message: PNIDPermissionFlags): unknown { + const obj: any = {}; + if (message.bannedAllPermanently !== false) { + obj.bannedAllPermanently = message.bannedAllPermanently; + } + if (message.bannedAllTemporarily !== false) { + obj.bannedAllTemporarily = message.bannedAllTemporarily; + } + if (message.betaAccess !== false) { + obj.betaAccess = message.betaAccess; + } + if (message.accessAdminPanel !== false) { + obj.accessAdminPanel = message.accessAdminPanel; + } + if (message.createServerConfigs !== false) { + obj.createServerConfigs = message.createServerConfigs; + } + if (message.modifyServerConfigs !== false) { + obj.modifyServerConfigs = message.modifyServerConfigs; + } + if (message.deployServer !== false) { + obj.deployServer = message.deployServer; + } + if (message.modifyPnids !== false) { + obj.modifyPnids = message.modifyPnids; + } + if (message.modifyNexAccounts !== false) { + obj.modifyNexAccounts = message.modifyNexAccounts; + } + if (message.modifyConsoles !== false) { + obj.modifyConsoles = message.modifyConsoles; + } + if (message.banPnids !== false) { + obj.banPnids = message.banPnids; + } + if (message.banNexAccounts !== false) { + obj.banNexAccounts = message.banNexAccounts; + } + if (message.banConsoles !== false) { + obj.banConsoles = message.banConsoles; + } + if (message.moderateMiiverse !== false) { + obj.moderateMiiverse = message.moderateMiiverse; + } + if (message.createApiKeys !== false) { + obj.createApiKeys = message.createApiKeys; + } + if (message.createBossTasks !== false) { + obj.createBossTasks = message.createBossTasks; + } + if (message.updateBossTasks !== false) { + obj.updateBossTasks = message.updateBossTasks; + } + if (message.deleteBossTasks !== false) { + obj.deleteBossTasks = message.deleteBossTasks; + } + if (message.uploadBossFiles !== false) { + obj.uploadBossFiles = message.uploadBossFiles; + } + if (message.updateBossFiles !== false) { + obj.updateBossFiles = message.updateBossFiles; + } + if (message.deleteBossFiles !== false) { + obj.deleteBossFiles = message.deleteBossFiles; + } + if (message.updatePnidPermissions !== false) { + obj.updatePnidPermissions = message.updatePnidPermissions; + } + return obj; + }, + + create(base?: DeepPartial): PNIDPermissionFlags { + return PNIDPermissionFlags.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PNIDPermissionFlags { + const message = createBasePNIDPermissionFlags(); + message.bannedAllPermanently = object.bannedAllPermanently ?? false; + message.bannedAllTemporarily = object.bannedAllTemporarily ?? false; + message.betaAccess = object.betaAccess ?? false; + message.accessAdminPanel = object.accessAdminPanel ?? false; + message.createServerConfigs = object.createServerConfigs ?? false; + message.modifyServerConfigs = object.modifyServerConfigs ?? false; + message.deployServer = object.deployServer ?? false; + message.modifyPnids = object.modifyPnids ?? false; + message.modifyNexAccounts = object.modifyNexAccounts ?? false; + message.modifyConsoles = object.modifyConsoles ?? false; + message.banPnids = object.banPnids ?? false; + message.banNexAccounts = object.banNexAccounts ?? false; + message.banConsoles = object.banConsoles ?? false; + message.moderateMiiverse = object.moderateMiiverse ?? false; + message.createApiKeys = object.createApiKeys ?? false; + message.createBossTasks = object.createBossTasks ?? false; + message.updateBossTasks = object.updateBossTasks ?? false; + message.deleteBossTasks = object.deleteBossTasks ?? false; + message.uploadBossFiles = object.uploadBossFiles ?? false; + message.updateBossFiles = object.updateBossFiles ?? false; + message.deleteBossFiles = object.deleteBossFiles ?? false; + message.updatePnidPermissions = object.updatePnidPermissions ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/update_pnid_permissions.d.ts b/javascript/account/update_pnid_permissions.d.ts index 8194876..ceafa53 100644 --- a/javascript/account/update_pnid_permissions.d.ts +++ b/javascript/account/update_pnid_permissions.d.ts @@ -1,36 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/update_pnid_permissions.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { PNIDPermissionFlags } from "./pnid_permission_flags"; -/** - * @generated from protobuf message account.UpdatePNIDPermissionsRequest - */ +export declare const protobufPackage = "account"; export interface UpdatePNIDPermissionsRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: account.PNIDPermissionFlags permissions = 2; - */ - permissions?: PNIDPermissionFlags; + permissions: PNIDPermissionFlags | undefined; } -declare class UpdatePNIDPermissionsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdatePNIDPermissionsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdatePNIDPermissionsRequest): UpdatePNIDPermissionsRequest; - internalBinaryWrite(message: UpdatePNIDPermissionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdatePNIDPermissionsRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.UpdatePNIDPermissionsRequest - */ -export declare const UpdatePNIDPermissionsRequest: UpdatePNIDPermissionsRequest$Type; export {}; diff --git a/javascript/account/update_pnid_permissions.js b/javascript/account/update_pnid_permissions.js index e8d628c..674eeda 100644 --- a/javascript/account/update_pnid_permissions.js +++ b/javascript/account/update_pnid_permissions.js @@ -1,67 +1,85 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/update_pnid_permissions.proto" (package "account", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/update_pnid_permissions.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdatePNIDPermissionsRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.UpdatePNIDPermissionsRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const pnid_permission_flags_1 = require("./pnid_permission_flags"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdatePNIDPermissionsRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.UpdatePNIDPermissionsRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "permissions", kind: "message", T: () => pnid_permission_flags_1.PNIDPermissionFlags } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "account"; +function createBaseUpdatePNIDPermissionsRequest() { + return { pid: 0, permissions: undefined }; +} +exports.UpdatePNIDPermissionsRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.permissions !== undefined) { + pnid_permission_flags_1.PNIDPermissionFlags.encode(message.permissions, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* account.PNIDPermissionFlags permissions */ 2: - message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryRead(reader, reader.uint32(), options, message.permissions); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* account.PNIDPermissionFlags permissions = 2; */ - if (message.permissions) - pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryWrite(message.permissions, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + permissions: isSet(object.permissions) ? pnid_permission_flags_1.PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.permissions !== undefined) { + obj.permissions = pnid_permission_flags_1.PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + create(base) { + return exports.UpdatePNIDPermissionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdatePNIDPermissionsRequest(); + message.pid = object.pid ?? 0; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? pnid_permission_flags_1.PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.UpdatePNIDPermissionsRequest - */ -exports.UpdatePNIDPermissionsRequest = new UpdatePNIDPermissionsRequest$Type(); diff --git a/javascript/account/update_pnid_permissions.ts b/javascript/account/update_pnid_permissions.ts new file mode 100644 index 0000000..86d180d --- /dev/null +++ b/javascript/account/update_pnid_permissions.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/update_pnid_permissions.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { PNIDPermissionFlags } from "./pnid_permission_flags"; + +export const protobufPackage = "account"; + +export interface UpdatePNIDPermissionsRequest { + pid: number; + permissions: PNIDPermissionFlags | undefined; +} + +function createBaseUpdatePNIDPermissionsRequest(): UpdatePNIDPermissionsRequest { + return { pid: 0, permissions: undefined }; +} + +export const UpdatePNIDPermissionsRequest: MessageFns = { + encode(message: UpdatePNIDPermissionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.permissions !== undefined) { + PNIDPermissionFlags.encode(message.permissions, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdatePNIDPermissionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.permissions = PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdatePNIDPermissionsRequest { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + permissions: isSet(object.permissions) ? PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + + toJSON(message: UpdatePNIDPermissionsRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.permissions !== undefined) { + obj.permissions = PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + + create(base?: DeepPartial): UpdatePNIDPermissionsRequest { + return UpdatePNIDPermissionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdatePNIDPermissionsRequest { + const message = createBaseUpdatePNIDPermissionsRequest(); + message.pid = object.pid ?? 0; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/account_service.client.d.ts b/javascript/account/v2/account_service.client.d.ts deleted file mode 100644 index cec39f7..0000000 --- a/javascript/account/v2/account_service.client.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/account_service.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { ExchangeTokenForUserDataResponse } from "./exchange_token_for_user_data"; -import type { ExchangeTokenForUserDataRequest } from "./exchange_token_for_user_data"; -import type { UpdatePNIDPermissionsResponse } from "./update_pnid_permissions"; -import type { UpdatePNIDPermissionsRequest } from "./update_pnid_permissions"; -import type { GetNEXDataResponse } from "./get_nex_data_rpc"; -import type { GetNEXDataRequest } from "./get_nex_data_rpc"; -import type { GetNEXPasswordResponse } from "./get_nex_password_rpc"; -import type { GetNEXPasswordRequest } from "./get_nex_password_rpc"; -import type { GetUserDataResponse } from "./get_user_data_rpc"; -import type { GetUserDataRequest } from "./get_user_data_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service account.v2.AccountService - */ -export interface IAccountServiceClient { - /** - * @generated from protobuf rpc: GetUserData(account.v2.GetUserDataRequest) returns (account.v2.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXPassword(account.v2.GetNEXPasswordRequest) returns (account.v2.GetNEXPasswordResponse); - */ - getNEXPassword(input: GetNEXPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXData(account.v2.GetNEXDataRequest) returns (account.v2.GetNEXDataResponse); - */ - getNEXData(input: GetNEXDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.v2.UpdatePNIDPermissionsRequest) returns (account.v2.UpdatePNIDPermissionsResponse); - */ - updatePNIDPermissions(input: UpdatePNIDPermissionsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.v2.ExchangeTokenForUserDataRequest) returns (account.v2.ExchangeTokenForUserDataResponse); - */ - exchangeTokenForUserData(input: ExchangeTokenForUserDataRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service account.v2.AccountService - */ -export declare class AccountServiceClient implements IAccountServiceClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: GetUserData(account.v2.GetUserDataRequest) returns (account.v2.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXPassword(account.v2.GetNEXPasswordRequest) returns (account.v2.GetNEXPasswordResponse); - */ - getNEXPassword(input: GetNEXPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetNEXData(account.v2.GetNEXDataRequest) returns (account.v2.GetNEXDataResponse); - */ - getNEXData(input: GetNEXDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.v2.UpdatePNIDPermissionsRequest) returns (account.v2.UpdatePNIDPermissionsResponse); - */ - updatePNIDPermissions(input: UpdatePNIDPermissionsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.v2.ExchangeTokenForUserDataRequest) returns (account.v2.ExchangeTokenForUserDataResponse); - */ - exchangeTokenForUserData(input: ExchangeTokenForUserDataRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/account/v2/account_service.client.js b/javascript/account/v2/account_service.client.js deleted file mode 100644 index d26bbb0..0000000 --- a/javascript/account/v2/account_service.client.js +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/account_service.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AccountServiceClient = void 0; -const account_service_1 = require("./account_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service account.v2.AccountService - */ -class AccountServiceClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = account_service_1.AccountService.typeName; - this.methods = account_service_1.AccountService.methods; - this.options = account_service_1.AccountService.options; - } - /** - * @generated from protobuf rpc: GetUserData(account.v2.GetUserDataRequest) returns (account.v2.GetUserDataResponse); - */ - getUserData(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetNEXPassword(account.v2.GetNEXPasswordRequest) returns (account.v2.GetNEXPasswordResponse); - */ - getNEXPassword(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetNEXData(account.v2.GetNEXDataRequest) returns (account.v2.GetNEXDataResponse); - */ - getNEXData(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdatePNIDPermissions(account.v2.UpdatePNIDPermissionsRequest) returns (account.v2.UpdatePNIDPermissionsResponse); - */ - updatePNIDPermissions(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ExchangeTokenForUserData(account.v2.ExchangeTokenForUserDataRequest) returns (account.v2.ExchangeTokenForUserDataResponse); - */ - exchangeTokenForUserData(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.AccountServiceClient = AccountServiceClient; diff --git a/javascript/account/v2/account_service.d.ts b/javascript/account/v2/account_service.d.ts index 96cfea1..b38d770 100644 --- a/javascript/account/v2/account_service.d.ts +++ b/javascript/account/v2/account_service.d.ts @@ -1,9 +1,73 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/account_service.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service account.v2.AccountService - */ -export declare const AccountService: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { ExchangeTokenForUserDataRequest, ExchangeTokenForUserDataResponse } from "./exchange_token_for_user_data"; +import { GetNEXDataRequest, GetNEXDataResponse } from "./get_nex_data_rpc"; +import { GetNEXPasswordRequest, GetNEXPasswordResponse } from "./get_nex_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { UpdatePNIDPermissionsRequest, UpdatePNIDPermissionsResponse } from "./update_pnid_permissions"; +export declare const protobufPackage = "account.v2"; +export type AccountServiceDefinition = typeof AccountServiceDefinition; +export declare const AccountServiceDefinition: { + readonly name: "AccountService"; + readonly fullName: "account.v2.AccountService"; + readonly methods: { + readonly getUserData: { + readonly name: "GetUserData"; + readonly requestType: import("./get_user_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getNEXPassword: { + readonly name: "GetNEXPassword"; + readonly requestType: import("./get_nex_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_nex_password_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getNEXData: { + readonly name: "GetNEXData"; + readonly requestType: import("./get_nex_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_nex_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updatePNIDPermissions: { + readonly name: "UpdatePNIDPermissions"; + readonly requestType: import("./update_pnid_permissions").MessageFns; + readonly requestStream: false; + readonly responseType: import("./update_pnid_permissions").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly exchangeTokenForUserData: { + readonly name: "ExchangeTokenForUserData"; + readonly requestType: import("./exchange_token_for_user_data").MessageFns; + readonly requestStream: false; + readonly responseType: import("./exchange_token_for_user_data").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface AccountServiceImplementation { + getUserData(request: GetUserDataRequest, context: CallContext & CallContextExt): Promise>; + getNEXPassword(request: GetNEXPasswordRequest, context: CallContext & CallContextExt): Promise>; + getNEXData(request: GetNEXDataRequest, context: CallContext & CallContextExt): Promise>; + updatePNIDPermissions(request: UpdatePNIDPermissionsRequest, context: CallContext & CallContextExt): Promise>; + exchangeTokenForUserData(request: ExchangeTokenForUserDataRequest, context: CallContext & CallContextExt): Promise>; +} +export interface AccountServiceClient { + getUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getNEXPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getNEXData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updatePNIDPermissions(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + exchangeTokenForUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/account/v2/account_service.js b/javascript/account/v2/account_service.js index cc6b2c1..f305e7d 100644 --- a/javascript/account/v2/account_service.js +++ b/javascript/account/v2/account_service.js @@ -1,34 +1,60 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/account_service.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/account_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.AccountService = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/account_service.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck +exports.AccountServiceDefinition = exports.protobufPackage = void 0; const exchange_token_for_user_data_1 = require("./exchange_token_for_user_data"); -const exchange_token_for_user_data_2 = require("./exchange_token_for_user_data"); -const update_pnid_permissions_1 = require("./update_pnid_permissions"); -const update_pnid_permissions_2 = require("./update_pnid_permissions"); const get_nex_data_rpc_1 = require("./get_nex_data_rpc"); -const get_nex_data_rpc_2 = require("./get_nex_data_rpc"); const get_nex_password_rpc_1 = require("./get_nex_password_rpc"); -const get_nex_password_rpc_2 = require("./get_nex_password_rpc"); const get_user_data_rpc_1 = require("./get_user_data_rpc"); -const get_user_data_rpc_2 = require("./get_user_data_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service account.v2.AccountService - */ -exports.AccountService = new runtime_rpc_1.ServiceType("account.v2.AccountService", [ - { name: "GetUserData", options: {}, I: get_user_data_rpc_2.GetUserDataRequest, O: get_user_data_rpc_1.GetUserDataResponse }, - { name: "GetNEXPassword", options: {}, I: get_nex_password_rpc_2.GetNEXPasswordRequest, O: get_nex_password_rpc_1.GetNEXPasswordResponse }, - { name: "GetNEXData", options: {}, I: get_nex_data_rpc_2.GetNEXDataRequest, O: get_nex_data_rpc_1.GetNEXDataResponse }, - { name: "UpdatePNIDPermissions", options: {}, I: update_pnid_permissions_2.UpdatePNIDPermissionsRequest, O: update_pnid_permissions_1.UpdatePNIDPermissionsResponse }, - { name: "ExchangeTokenForUserData", options: {}, I: exchange_token_for_user_data_2.ExchangeTokenForUserDataRequest, O: exchange_token_for_user_data_1.ExchangeTokenForUserDataResponse } -]); +const update_pnid_permissions_1 = require("./update_pnid_permissions"); +exports.protobufPackage = "account.v2"; +exports.AccountServiceDefinition = { + name: "AccountService", + fullName: "account.v2.AccountService", + methods: { + getUserData: { + name: "GetUserData", + requestType: get_user_data_rpc_1.GetUserDataRequest, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + getNEXPassword: { + name: "GetNEXPassword", + requestType: get_nex_password_rpc_1.GetNEXPasswordRequest, + requestStream: false, + responseType: get_nex_password_rpc_1.GetNEXPasswordResponse, + responseStream: false, + options: {}, + }, + getNEXData: { + name: "GetNEXData", + requestType: get_nex_data_rpc_1.GetNEXDataRequest, + requestStream: false, + responseType: get_nex_data_rpc_1.GetNEXDataResponse, + responseStream: false, + options: {}, + }, + updatePNIDPermissions: { + name: "UpdatePNIDPermissions", + requestType: update_pnid_permissions_1.UpdatePNIDPermissionsRequest, + requestStream: false, + responseType: update_pnid_permissions_1.UpdatePNIDPermissionsResponse, + responseStream: false, + options: {}, + }, + exchangeTokenForUserData: { + name: "ExchangeTokenForUserData", + requestType: exchange_token_for_user_data_1.ExchangeTokenForUserDataRequest, + requestStream: false, + responseType: exchange_token_for_user_data_1.ExchangeTokenForUserDataResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/account/v2/account_service.ts b/javascript/account/v2/account_service.ts new file mode 100644 index 0000000..940fe43 --- /dev/null +++ b/javascript/account/v2/account_service.ts @@ -0,0 +1,117 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/account_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { ExchangeTokenForUserDataRequest, ExchangeTokenForUserDataResponse } from "./exchange_token_for_user_data"; +import { GetNEXDataRequest, GetNEXDataResponse } from "./get_nex_data_rpc"; +import { GetNEXPasswordRequest, GetNEXPasswordResponse } from "./get_nex_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { UpdatePNIDPermissionsRequest, UpdatePNIDPermissionsResponse } from "./update_pnid_permissions"; + +export const protobufPackage = "account.v2"; + +export type AccountServiceDefinition = typeof AccountServiceDefinition; +export const AccountServiceDefinition = { + name: "AccountService", + fullName: "account.v2.AccountService", + methods: { + getUserData: { + name: "GetUserData", + requestType: GetUserDataRequest, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + getNEXPassword: { + name: "GetNEXPassword", + requestType: GetNEXPasswordRequest, + requestStream: false, + responseType: GetNEXPasswordResponse, + responseStream: false, + options: {}, + }, + getNEXData: { + name: "GetNEXData", + requestType: GetNEXDataRequest, + requestStream: false, + responseType: GetNEXDataResponse, + responseStream: false, + options: {}, + }, + updatePNIDPermissions: { + name: "UpdatePNIDPermissions", + requestType: UpdatePNIDPermissionsRequest, + requestStream: false, + responseType: UpdatePNIDPermissionsResponse, + responseStream: false, + options: {}, + }, + exchangeTokenForUserData: { + name: "ExchangeTokenForUserData", + requestType: ExchangeTokenForUserDataRequest, + requestStream: false, + responseType: ExchangeTokenForUserDataResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface AccountServiceImplementation { + getUserData( + request: GetUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + getNEXPassword( + request: GetNEXPasswordRequest, + context: CallContext & CallContextExt, + ): Promise>; + getNEXData( + request: GetNEXDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + updatePNIDPermissions( + request: UpdatePNIDPermissionsRequest, + context: CallContext & CallContextExt, + ): Promise>; + exchangeTokenForUserData( + request: ExchangeTokenForUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface AccountServiceClient { + getUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getNEXPassword( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getNEXData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updatePNIDPermissions( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + exchangeTokenForUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/account/v2/exchange_token_for_user_data.d.ts b/javascript/account/v2/exchange_token_for_user_data.d.ts index 54a1a35..68e0aa4 100644 --- a/javascript/account/v2/exchange_token_for_user_data.d.ts +++ b/javascript/account/v2/exchange_token_for_user_data.d.ts @@ -1,104 +1,38 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/exchange_token_for_user_data.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { PNIDPermissionFlags } from "./pnid_permission_flags"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * @generated from protobuf message account.v2.ExchangeTokenForUserDataRequest - */ +import { PNIDPermissionFlags } from "./pnid_permission_flags"; +export declare const protobufPackage = "account.v2"; export interface ExchangeTokenForUserDataRequest { - /** - * @generated from protobuf field: string token = 1; - */ token: string; } -/** - * @generated from protobuf message account.v2.ExchangeTokenForUserDataResponse - */ export interface ExchangeTokenForUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: uint32 pid = 2; - */ pid: number; - /** - * @generated from protobuf field: string username = 3; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 4; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 5; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: account.v2.Mii mii = 6; - */ - mii?: Mii; - /** - * @generated from protobuf field: string creation_date = 7; - */ + mii: Mii | undefined; creationDate: string; - /** - * @generated from protobuf field: string birthdate = 8; - */ birthdate: string; - /** - * @generated from protobuf field: string gender = 9; - */ gender: string; - /** - * @generated from protobuf field: string country = 10; - */ country: string; - /** - * @generated from protobuf field: string language = 11; - */ language: string; - /** - * @generated from protobuf field: string email_address = 12; - */ emailAddress: string; - /** - * @generated from protobuf field: string tier_name = 13; - */ tierName: string; - /** - * @generated from protobuf field: account.v2.PNIDPermissionFlags permissions = 14; - */ - permissions?: PNIDPermissionFlags; -} -declare class ExchangeTokenForUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ExchangeTokenForUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExchangeTokenForUserDataRequest): ExchangeTokenForUserDataRequest; - internalBinaryWrite(message: ExchangeTokenForUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; + permissions: PNIDPermissionFlags | undefined; } -/** - * @generated MessageType for protobuf message account.v2.ExchangeTokenForUserDataRequest - */ -export declare const ExchangeTokenForUserDataRequest: ExchangeTokenForUserDataRequest$Type; -declare class ExchangeTokenForUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ExchangeTokenForUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExchangeTokenForUserDataResponse): ExchangeTokenForUserDataResponse; - internalBinaryWrite(message: ExchangeTokenForUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ExchangeTokenForUserDataRequest: MessageFns; +export declare const ExchangeTokenForUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.ExchangeTokenForUserDataResponse - */ -export declare const ExchangeTokenForUserDataResponse: ExchangeTokenForUserDataResponse$Type; export {}; diff --git a/javascript/account/v2/exchange_token_for_user_data.js b/javascript/account/v2/exchange_token_for_user_data.js index 1fecf9f..9c70085 100644 --- a/javascript/account/v2/exchange_token_for_user_data.js +++ b/javascript/account/v2/exchange_token_for_user_data.js @@ -1,210 +1,332 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/exchange_token_for_user_data.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/exchange_token_for_user_data.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ExchangeTokenForUserDataResponse = exports.ExchangeTokenForUserDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.ExchangeTokenForUserDataResponse = exports.ExchangeTokenForUserDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class ExchangeTokenForUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.ExchangeTokenForUserDataRequest", [ - { no: 1, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.token = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.protobufPackage = "account.v2"; +function createBaseExchangeTokenForUserDataRequest() { + return { token: "" }; +} +exports.ExchangeTokenForUserDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string token */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.token = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string token = 1; */ - if (message.token !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.token); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.v2.ExchangeTokenForUserDataRequest - */ -exports.ExchangeTokenForUserDataRequest = new ExchangeTokenForUserDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ExchangeTokenForUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.ExchangeTokenForUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 7, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "birthdate", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "tier_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "permissions", kind: "message", T: () => pnid_permission_flags_1.PNIDPermissionFlags } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.creationDate = ""; - message.birthdate = ""; - message.gender = ""; - message.country = ""; - message.language = ""; - message.emailAddress = ""; - message.tierName = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { token: isSet(object.token) ? globalThis.String(object.token) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + create(base) { + return exports.ExchangeTokenForUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseExchangeTokenForUserDataRequest(); + message.token = object.token ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseExchangeTokenForUserDataResponse() { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} +exports.ExchangeTokenForUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + pnid_permission_flags_1.PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* uint32 pid */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* account.v2.Mii mii */ 6: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string creation_date */ 7: + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.creationDate = reader.string(); - break; - case /* string birthdate */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.birthdate = reader.string(); - break; - case /* string gender */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.country = reader.string(); - break; - case /* string language */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.emailAddress = reader.string(); - break; - case /* string tier_name */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.tierName = reader.string(); - break; - case /* account.v2.PNIDPermissionFlags permissions */ 14: - message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryRead(reader, reader.uint32(), options, message.permissions); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* uint32 pid = 2; */ - if (message.pid !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 3; */ - if (message.username !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 4; */ - if (message.accessLevel !== 0) - writer.tag(4, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 5; */ - if (message.serverAccessLevel !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* account.v2.Mii mii = 6; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string creation_date = 7; */ - if (message.creationDate !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string birthdate = 8; */ - if (message.birthdate !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.birthdate); - /* string gender = 9; */ - if (message.gender !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 10; */ - if (message.country !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.country); - /* string language = 11; */ - if (message.language !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 12; */ - if (message.emailAddress !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* string tier_name = 13; */ - if (message.tierName !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* account.v2.PNIDPermissionFlags permissions = 14; */ - if (message.permissions) - pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryWrite(message.permissions, writer.tag(14, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? pnid_permission_flags_1.PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = pnid_permission_flags_1.PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + create(base) { + return exports.ExchangeTokenForUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseExchangeTokenForUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? pnid_permission_flags_1.PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.ExchangeTokenForUserDataResponse - */ -exports.ExchangeTokenForUserDataResponse = new ExchangeTokenForUserDataResponse$Type(); diff --git a/javascript/account/v2/exchange_token_for_user_data.ts b/javascript/account/v2/exchange_token_for_user_data.ts new file mode 100644 index 0000000..4614503 --- /dev/null +++ b/javascript/account/v2/exchange_token_for_user_data.ts @@ -0,0 +1,397 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/exchange_token_for_user_data.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { PNIDPermissionFlags } from "./pnid_permission_flags"; + +export const protobufPackage = "account.v2"; + +export interface ExchangeTokenForUserDataRequest { + token: string; +} + +export interface ExchangeTokenForUserDataResponse { + deleted: boolean; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + creationDate: string; + birthdate: string; + gender: string; + country: string; + language: string; + emailAddress: string; + tierName: string; + permissions: PNIDPermissionFlags | undefined; +} + +function createBaseExchangeTokenForUserDataRequest(): ExchangeTokenForUserDataRequest { + return { token: "" }; +} + +export const ExchangeTokenForUserDataRequest: MessageFns = { + encode(message: ExchangeTokenForUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.token !== "") { + writer.uint32(10).string(message.token); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExchangeTokenForUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExchangeTokenForUserDataRequest { + return { token: isSet(object.token) ? globalThis.String(object.token) : "" }; + }, + + toJSON(message: ExchangeTokenForUserDataRequest): unknown { + const obj: any = {}; + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + + create(base?: DeepPartial): ExchangeTokenForUserDataRequest { + return ExchangeTokenForUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExchangeTokenForUserDataRequest { + const message = createBaseExchangeTokenForUserDataRequest(); + message.token = object.token ?? ""; + return message; + }, +}; + +function createBaseExchangeTokenForUserDataResponse(): ExchangeTokenForUserDataResponse { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} + +export const ExchangeTokenForUserDataResponse: MessageFns = { + encode(message: ExchangeTokenForUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExchangeTokenForUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExchangeTokenForUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.username = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.birthdate = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.gender = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.country = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.language = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.permissions = PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExchangeTokenForUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + + toJSON(message: ExchangeTokenForUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + + create(base?: DeepPartial): ExchangeTokenForUserDataResponse { + return ExchangeTokenForUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExchangeTokenForUserDataResponse { + const message = createBaseExchangeTokenForUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/get_nex_data_rpc.d.ts b/javascript/account/v2/get_nex_data_rpc.d.ts index 7860c63..c8b2fc0 100644 --- a/javascript/account/v2/get_nex_data_rpc.d.ts +++ b/javascript/account/v2/get_nex_data_rpc.d.ts @@ -1,91 +1,37 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_nex_data_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.v2.GetNEXDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account.v2"; +export declare enum DeviceType { + DEVICE_TYPE_UNSPECIFIED = 0, + DEVICE_TYPE_CTR = 1, + DEVICE_TYPE_WUP = 2, + UNRECOGNIZED = -1 +} +export declare function deviceTypeFromJSON(object: any): DeviceType; +export declare function deviceTypeToJSON(object: DeviceType): string; export interface GetNEXDataRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.v2.GetNEXDataResponse - */ export interface GetNEXDataResponse { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: string password = 2; - */ password: string; - /** - * @generated from protobuf field: uint32 owning_pid = 3; - */ owningPid: number; - /** - * @generated from protobuf field: int32 access_level = 4; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 5; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: string friend_code = 6; - */ friendCode: string; - /** - * @generated from protobuf field: account.v2.DeviceType device_type = 7; - */ deviceType: DeviceType; } -/** - * @generated from protobuf enum account.v2.DeviceType - */ -export declare enum DeviceType { - /** - * @generated from protobuf enum value: DEVICE_TYPE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - /** - * @generated from protobuf enum value: DEVICE_TYPE_CTR = 1; - */ - CTR = 1, - /** - * @generated from protobuf enum value: DEVICE_TYPE_WUP = 2; - */ - WUP = 2 -} -declare class GetNEXDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXDataRequest): GetNEXDataRequest; - internalBinaryWrite(message: GetNEXDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message account.v2.GetNEXDataRequest - */ -export declare const GetNEXDataRequest: GetNEXDataRequest$Type; -declare class GetNEXDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXDataResponse): GetNEXDataResponse; - internalBinaryWrite(message: GetNEXDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetNEXDataRequest: MessageFns; +export declare const GetNEXDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.GetNEXDataResponse - */ -export declare const GetNEXDataResponse: GetNEXDataResponse$Type; export {}; diff --git a/javascript/account/v2/get_nex_data_rpc.js b/javascript/account/v2/get_nex_data_rpc.js index eb1c6e4..36330c1 100644 --- a/javascript/account/v2/get_nex_data_rpc.js +++ b/javascript/account/v2/get_nex_data_rpc.js @@ -1,172 +1,247 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_nex_data_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_nex_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetNEXDataResponse = exports.GetNEXDataRequest = exports.DeviceType = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -/** - * @generated from protobuf enum account.v2.DeviceType - */ +exports.GetNEXDataResponse = exports.GetNEXDataRequest = exports.DeviceType = exports.protobufPackage = void 0; +exports.deviceTypeFromJSON = deviceTypeFromJSON; +exports.deviceTypeToJSON = deviceTypeToJSON; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account.v2"; var DeviceType; (function (DeviceType) { - /** - * @generated from protobuf enum value: DEVICE_TYPE_UNSPECIFIED = 0; - */ - DeviceType[DeviceType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - /** - * @generated from protobuf enum value: DEVICE_TYPE_CTR = 1; - */ - DeviceType[DeviceType["CTR"] = 1] = "CTR"; - /** - * @generated from protobuf enum value: DEVICE_TYPE_WUP = 2; - */ - DeviceType[DeviceType["WUP"] = 2] = "WUP"; -})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetNEXDataRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); + DeviceType[DeviceType["DEVICE_TYPE_UNSPECIFIED"] = 0] = "DEVICE_TYPE_UNSPECIFIED"; + DeviceType[DeviceType["DEVICE_TYPE_CTR"] = 1] = "DEVICE_TYPE_CTR"; + DeviceType[DeviceType["DEVICE_TYPE_WUP"] = 2] = "DEVICE_TYPE_WUP"; + DeviceType[DeviceType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; +})(DeviceType || (exports.DeviceType = DeviceType = {})); +function deviceTypeFromJSON(object) { + switch (object) { + case 0: + case "DEVICE_TYPE_UNSPECIFIED": + return DeviceType.DEVICE_TYPE_UNSPECIFIED; + case 1: + case "DEVICE_TYPE_CTR": + return DeviceType.DEVICE_TYPE_CTR; + case 2: + case "DEVICE_TYPE_WUP": + return DeviceType.DEVICE_TYPE_WUP; + case -1: + case "UNRECOGNIZED": + default: + return DeviceType.UNRECOGNIZED; } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; +} +function deviceTypeToJSON(object) { + switch (object) { + case DeviceType.DEVICE_TYPE_UNSPECIFIED: + return "DEVICE_TYPE_UNSPECIFIED"; + case DeviceType.DEVICE_TYPE_CTR: + return "DEVICE_TYPE_CTR"; + case DeviceType.DEVICE_TYPE_WUP: + return "DEVICE_TYPE_WUP"; + case DeviceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +} +function createBaseGetNEXDataRequest() { + return { pid: 0 }; +} +exports.GetNEXDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.v2.GetNEXDataRequest - */ -exports.GetNEXDataRequest = new GetNEXDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetNEXDataResponse", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "owning_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "friend_code", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "device_type", kind: "enum", T: () => ["account.v2.DeviceType", DeviceType, "DEVICE_TYPE_"] } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - message.password = ""; - message.owningPid = 0; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.friendCode = ""; - message.deviceType = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetNEXDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXDataRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetNEXDataResponse() { + return { pid: 0, password: "", owningPid: 0, accessLevel: 0, serverAccessLevel: "", friendCode: "", deviceType: 0 }; +} +exports.GetNEXDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.password !== "") { + writer.uint32(18).string(message.password); + } + if (message.owningPid !== 0) { + writer.uint32(24).uint32(message.owningPid); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.friendCode !== "") { + writer.uint32(50).string(message.friendCode); + } + if (message.deviceType !== 0) { + writer.uint32(56).int32(message.deviceType); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* string password */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.password = reader.string(); - break; - case /* uint32 owning_pid */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.owningPid = reader.uint32(); - break; - case /* int32 access_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* string friend_code */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.friendCode = reader.string(); - break; - case /* account.v2.DeviceType device_type */ 7: + continue; + } + case 7: { + if (tag !== 56) { + break; + } message.deviceType = reader.int32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* string password = 2; */ - if (message.password !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.password); - /* uint32 owning_pid = 3; */ - if (message.owningPid !== 0) - writer.tag(3, runtime_1.WireType.Varint).uint32(message.owningPid); - /* int32 access_level = 4; */ - if (message.accessLevel !== 0) - writer.tag(4, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 5; */ - if (message.serverAccessLevel !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* string friend_code = 6; */ - if (message.friendCode !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.friendCode); - /* account.v2.DeviceType device_type = 7; */ - if (message.deviceType !== 0) - writer.tag(7, runtime_1.WireType.Varint).int32(message.deviceType); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + password: isSet(object.password) ? globalThis.String(object.password) : "", + owningPid: isSet(object.owningPid) ? globalThis.Number(object.owningPid) : 0, + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + friendCode: isSet(object.friendCode) ? globalThis.String(object.friendCode) : "", + deviceType: isSet(object.deviceType) ? deviceTypeFromJSON(object.deviceType) : 0, + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.owningPid !== 0) { + obj.owningPid = Math.round(message.owningPid); + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.friendCode !== "") { + obj.friendCode = message.friendCode; + } + if (message.deviceType !== 0) { + obj.deviceType = deviceTypeToJSON(message.deviceType); + } + return obj; + }, + create(base) { + return exports.GetNEXDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXDataResponse(); + message.pid = object.pid ?? 0; + message.password = object.password ?? ""; + message.owningPid = object.owningPid ?? 0; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.friendCode = object.friendCode ?? ""; + message.deviceType = object.deviceType ?? 0; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.GetNEXDataResponse - */ -exports.GetNEXDataResponse = new GetNEXDataResponse$Type(); diff --git a/javascript/account/v2/get_nex_data_rpc.ts b/javascript/account/v2/get_nex_data_rpc.ts new file mode 100644 index 0000000..c3fa555 --- /dev/null +++ b/javascript/account/v2/get_nex_data_rpc.ts @@ -0,0 +1,298 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_nex_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account.v2"; + +export enum DeviceType { + DEVICE_TYPE_UNSPECIFIED = 0, + DEVICE_TYPE_CTR = 1, + DEVICE_TYPE_WUP = 2, + UNRECOGNIZED = -1, +} + +export function deviceTypeFromJSON(object: any): DeviceType { + switch (object) { + case 0: + case "DEVICE_TYPE_UNSPECIFIED": + return DeviceType.DEVICE_TYPE_UNSPECIFIED; + case 1: + case "DEVICE_TYPE_CTR": + return DeviceType.DEVICE_TYPE_CTR; + case 2: + case "DEVICE_TYPE_WUP": + return DeviceType.DEVICE_TYPE_WUP; + case -1: + case "UNRECOGNIZED": + default: + return DeviceType.UNRECOGNIZED; + } +} + +export function deviceTypeToJSON(object: DeviceType): string { + switch (object) { + case DeviceType.DEVICE_TYPE_UNSPECIFIED: + return "DEVICE_TYPE_UNSPECIFIED"; + case DeviceType.DEVICE_TYPE_CTR: + return "DEVICE_TYPE_CTR"; + case DeviceType.DEVICE_TYPE_WUP: + return "DEVICE_TYPE_WUP"; + case DeviceType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface GetNEXDataRequest { + pid: number; +} + +export interface GetNEXDataResponse { + pid: number; + password: string; + owningPid: number; + accessLevel: number; + serverAccessLevel: string; + friendCode: string; + deviceType: DeviceType; +} + +function createBaseGetNEXDataRequest(): GetNEXDataRequest { + return { pid: 0 }; +} + +export const GetNEXDataRequest: MessageFns = { + encode(message: GetNEXDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXDataRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetNEXDataRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXDataRequest { + return GetNEXDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXDataRequest { + const message = createBaseGetNEXDataRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetNEXDataResponse(): GetNEXDataResponse { + return { pid: 0, password: "", owningPid: 0, accessLevel: 0, serverAccessLevel: "", friendCode: "", deviceType: 0 }; +} + +export const GetNEXDataResponse: MessageFns = { + encode(message: GetNEXDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.password !== "") { + writer.uint32(18).string(message.password); + } + if (message.owningPid !== 0) { + writer.uint32(24).uint32(message.owningPid); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.friendCode !== "") { + writer.uint32(50).string(message.friendCode); + } + if (message.deviceType !== 0) { + writer.uint32(56).int32(message.deviceType); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.password = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.owningPid = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.friendCode = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.deviceType = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXDataResponse { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + password: isSet(object.password) ? globalThis.String(object.password) : "", + owningPid: isSet(object.owningPid) ? globalThis.Number(object.owningPid) : 0, + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + friendCode: isSet(object.friendCode) ? globalThis.String(object.friendCode) : "", + deviceType: isSet(object.deviceType) ? deviceTypeFromJSON(object.deviceType) : 0, + }; + }, + + toJSON(message: GetNEXDataResponse): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.owningPid !== 0) { + obj.owningPid = Math.round(message.owningPid); + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.friendCode !== "") { + obj.friendCode = message.friendCode; + } + if (message.deviceType !== 0) { + obj.deviceType = deviceTypeToJSON(message.deviceType); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXDataResponse { + return GetNEXDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXDataResponse { + const message = createBaseGetNEXDataResponse(); + message.pid = object.pid ?? 0; + message.password = object.password ?? ""; + message.owningPid = object.owningPid ?? 0; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.friendCode = object.friendCode ?? ""; + message.deviceType = object.deviceType ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/get_nex_password_rpc.d.ts b/javascript/account/v2/get_nex_password_rpc.d.ts index c58079f..7f068de 100644 --- a/javascript/account/v2/get_nex_password_rpc.d.ts +++ b/javascript/account/v2/get_nex_password_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_nex_password_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.v2.GetNEXPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account.v2"; export interface GetNEXPasswordRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.v2.GetNEXPasswordResponse - */ export interface GetNEXPasswordResponse { - /** - * @generated from protobuf field: string password = 1; - */ password: string; } -declare class GetNEXPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXPasswordRequest): GetNEXPasswordRequest; - internalBinaryWrite(message: GetNEXPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetNEXPasswordRequest: MessageFns; +export declare const GetNEXPasswordResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.GetNEXPasswordRequest - */ -export declare const GetNEXPasswordRequest: GetNEXPasswordRequest$Type; -declare class GetNEXPasswordResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetNEXPasswordResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetNEXPasswordResponse): GetNEXPasswordResponse; - internalBinaryWrite(message: GetNEXPasswordResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message account.v2.GetNEXPasswordResponse - */ -export declare const GetNEXPasswordResponse: GetNEXPasswordResponse$Type; export {}; diff --git a/javascript/account/v2/get_nex_password_rpc.js b/javascript/account/v2/get_nex_password_rpc.js index 0f52315..792e754 100644 --- a/javascript/account/v2/get_nex_password_rpc.js +++ b/javascript/account/v2/get_nex_password_rpc.js @@ -1,106 +1,116 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_nex_password_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_nex_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetNEXPasswordResponse = exports.GetNEXPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetNEXPasswordRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.GetNEXPasswordResponse = exports.GetNEXPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account.v2"; +function createBaseGetNEXPasswordRequest() { + return { pid: 0 }; +} +exports.GetNEXPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.v2.GetNEXPasswordRequest - */ -exports.GetNEXPasswordRequest = new GetNEXPasswordRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetNEXPasswordResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetNEXPasswordResponse", [ - { no: 1, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.password = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetNEXPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXPasswordRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetNEXPasswordResponse() { + return { password: "" }; +} +exports.GetNEXPasswordResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string password */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.password = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string password = 1; */ - if (message.password !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.password); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { password: isSet(object.password) ? globalThis.String(object.password) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.password !== "") { + obj.password = message.password; + } + return obj; + }, + create(base) { + return exports.GetNEXPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetNEXPasswordResponse(); + message.password = object.password ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.GetNEXPasswordResponse - */ -exports.GetNEXPasswordResponse = new GetNEXPasswordResponse$Type(); diff --git a/javascript/account/v2/get_nex_password_rpc.ts b/javascript/account/v2/get_nex_password_rpc.ts new file mode 100644 index 0000000..4ef11cd --- /dev/null +++ b/javascript/account/v2/get_nex_password_rpc.ts @@ -0,0 +1,155 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_nex_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account.v2"; + +export interface GetNEXPasswordRequest { + pid: number; +} + +export interface GetNEXPasswordResponse { + password: string; +} + +function createBaseGetNEXPasswordRequest(): GetNEXPasswordRequest { + return { pid: 0 }; +} + +export const GetNEXPasswordRequest: MessageFns = { + encode(message: GetNEXPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXPasswordRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetNEXPasswordRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetNEXPasswordRequest { + return GetNEXPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXPasswordRequest { + const message = createBaseGetNEXPasswordRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetNEXPasswordResponse(): GetNEXPasswordResponse { + return { password: "" }; +} + +export const GetNEXPasswordResponse: MessageFns = { + encode(message: GetNEXPasswordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetNEXPasswordResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNEXPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.password = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetNEXPasswordResponse { + return { password: isSet(object.password) ? globalThis.String(object.password) : "" }; + }, + + toJSON(message: GetNEXPasswordResponse): unknown { + const obj: any = {}; + if (message.password !== "") { + obj.password = message.password; + } + return obj; + }, + + create(base?: DeepPartial): GetNEXPasswordResponse { + return GetNEXPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetNEXPasswordResponse { + const message = createBaseGetNEXPasswordResponse(); + message.password = object.password ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/get_user_data_rpc.d.ts b/javascript/account/v2/get_user_data_rpc.d.ts index 02355b0..5eb767e 100644 --- a/javascript/account/v2/get_user_data_rpc.d.ts +++ b/javascript/account/v2/get_user_data_rpc.d.ts @@ -1,104 +1,38 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_user_data_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { PNIDPermissionFlags } from "./pnid_permission_flags"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * @generated from protobuf message account.v2.GetUserDataRequest - */ +import { PNIDPermissionFlags } from "./pnid_permission_flags"; +export declare const protobufPackage = "account.v2"; export interface GetUserDataRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message account.v2.GetUserDataResponse - */ export interface GetUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: uint32 pid = 2; - */ pid: number; - /** - * @generated from protobuf field: string username = 3; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 4; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 5; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: account.v2.Mii mii = 6; - */ - mii?: Mii; - /** - * @generated from protobuf field: string creation_date = 7; - */ + mii: Mii | undefined; creationDate: string; - /** - * @generated from protobuf field: string birthdate = 8; - */ birthdate: string; - /** - * @generated from protobuf field: string gender = 9; - */ gender: string; - /** - * @generated from protobuf field: string country = 10; - */ country: string; - /** - * @generated from protobuf field: string language = 11; - */ language: string; - /** - * @generated from protobuf field: string email_address = 12; - */ emailAddress: string; - /** - * @generated from protobuf field: string tier_name = 13; - */ tierName: string; - /** - * @generated from protobuf field: account.v2.PNIDPermissionFlags permissions = 14; - */ - permissions?: PNIDPermissionFlags; -} -declare class GetUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataRequest): GetUserDataRequest; - internalBinaryWrite(message: GetUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; + permissions: PNIDPermissionFlags | undefined; } -/** - * @generated MessageType for protobuf message account.v2.GetUserDataRequest - */ -export declare const GetUserDataRequest: GetUserDataRequest$Type; -declare class GetUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataResponse): GetUserDataResponse; - internalBinaryWrite(message: GetUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserDataRequest: MessageFns; +export declare const GetUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.GetUserDataResponse - */ -export declare const GetUserDataResponse: GetUserDataResponse$Type; export {}; diff --git a/javascript/account/v2/get_user_data_rpc.js b/javascript/account/v2/get_user_data_rpc.js index 39b7fa6..325ab05 100644 --- a/javascript/account/v2/get_user_data_rpc.js +++ b/javascript/account/v2/get_user_data_rpc.js @@ -1,210 +1,332 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/get_user_data_rpc.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserDataResponse = exports.GetUserDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.GetUserDataResponse = exports.GetUserDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetUserDataRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +const pnid_permission_flags_1 = require("./pnid_permission_flags"); +exports.protobufPackage = "account.v2"; +function createBaseGetUserDataRequest() { + return { pid: 0 }; +} +exports.GetUserDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.v2.GetUserDataRequest - */ -exports.GetUserDataRequest = new GetUserDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.GetUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 5, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 7, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "birthdate", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "tier_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "permissions", kind: "message", T: () => pnid_permission_flags_1.PNIDPermissionFlags } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.creationDate = ""; - message.birthdate = ""; - message.gender = ""; - message.country = ""; - message.language = ""; - message.emailAddress = ""; - message.tierName = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserDataResponse() { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} +exports.GetUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + pnid_permission_flags_1.PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* uint32 pid */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* account.v2.Mii mii */ 6: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string creation_date */ 7: + continue; + } + case 6: { + if (tag !== 50) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.creationDate = reader.string(); - break; - case /* string birthdate */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.birthdate = reader.string(); - break; - case /* string gender */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.country = reader.string(); - break; - case /* string language */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.emailAddress = reader.string(); - break; - case /* string tier_name */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.tierName = reader.string(); - break; - case /* account.v2.PNIDPermissionFlags permissions */ 14: - message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryRead(reader, reader.uint32(), options, message.permissions); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* uint32 pid = 2; */ - if (message.pid !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 3; */ - if (message.username !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 4; */ - if (message.accessLevel !== 0) - writer.tag(4, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 5; */ - if (message.serverAccessLevel !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* account.v2.Mii mii = 6; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(6, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string creation_date = 7; */ - if (message.creationDate !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string birthdate = 8; */ - if (message.birthdate !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.birthdate); - /* string gender = 9; */ - if (message.gender !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 10; */ - if (message.country !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.country); - /* string language = 11; */ - if (message.language !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 12; */ - if (message.emailAddress !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* string tier_name = 13; */ - if (message.tierName !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* account.v2.PNIDPermissionFlags permissions = 14; */ - if (message.permissions) - pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryWrite(message.permissions, writer.tag(14, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? pnid_permission_flags_1.PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = pnid_permission_flags_1.PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + create(base) { + return exports.GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? pnid_permission_flags_1.PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.GetUserDataResponse - */ -exports.GetUserDataResponse = new GetUserDataResponse$Type(); diff --git a/javascript/account/v2/get_user_data_rpc.ts b/javascript/account/v2/get_user_data_rpc.ts new file mode 100644 index 0000000..5fbf390 --- /dev/null +++ b/javascript/account/v2/get_user_data_rpc.ts @@ -0,0 +1,397 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/get_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { PNIDPermissionFlags } from "./pnid_permission_flags"; + +export const protobufPackage = "account.v2"; + +export interface GetUserDataRequest { + pid: number; +} + +export interface GetUserDataResponse { + deleted: boolean; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + creationDate: string; + birthdate: string; + gender: string; + country: string; + language: string; + emailAddress: string; + tierName: string; + permissions: PNIDPermissionFlags | undefined; +} + +function createBaseGetUserDataRequest(): GetUserDataRequest { + return { pid: 0 }; +} + +export const GetUserDataRequest: MessageFns = { + encode(message: GetUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserDataRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataRequest { + return GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataRequest { + const message = createBaseGetUserDataRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserDataResponse(): GetUserDataResponse { + return { + deleted: false, + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + creationDate: "", + birthdate: "", + gender: "", + country: "", + language: "", + emailAddress: "", + tierName: "", + permissions: undefined, + }; +} + +export const GetUserDataResponse: MessageFns = { + encode(message: GetUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.pid !== 0) { + writer.uint32(16).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(26).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(32).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(42).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(50).fork()).join(); + } + if (message.creationDate !== "") { + writer.uint32(58).string(message.creationDate); + } + if (message.birthdate !== "") { + writer.uint32(66).string(message.birthdate); + } + if (message.gender !== "") { + writer.uint32(74).string(message.gender); + } + if (message.country !== "") { + writer.uint32(82).string(message.country); + } + if (message.language !== "") { + writer.uint32(90).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(98).string(message.emailAddress); + } + if (message.tierName !== "") { + writer.uint32(106).string(message.tierName); + } + if (message.permissions !== undefined) { + PNIDPermissionFlags.encode(message.permissions, writer.uint32(114).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.username = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.birthdate = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.gender = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.country = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.language = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.permissions = PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + birthdate: isSet(object.birthdate) ? globalThis.String(object.birthdate) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : "", + permissions: isSet(object.permissions) ? PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + + toJSON(message: GetUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.birthdate !== "") { + obj.birthdate = message.birthdate; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.tierName !== "") { + obj.tierName = message.tierName; + } + if (message.permissions !== undefined) { + obj.permissions = PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataResponse { + return GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataResponse { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.creationDate = object.creationDate ?? ""; + message.birthdate = object.birthdate ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.tierName = object.tierName ?? ""; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/mii.d.ts b/javascript/account/v2/mii.d.ts index 01191d7..03bd4cf 100644 --- a/javascript/account/v2/mii.d.ts +++ b/javascript/account/v2/mii.d.ts @@ -1,39 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/mii.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.v2.Mii - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account.v2"; export interface Mii { - /** - * @generated from protobuf field: string name = 1; - */ name: string; - /** - * @generated from protobuf field: string data = 2; - */ data: string; - /** - * @generated from protobuf field: string url = 3; - */ url: string; } -declare class Mii$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Mii; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mii): Mii; - internalBinaryWrite(message: Mii, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Mii: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.Mii - */ -export declare const Mii: Mii$Type; export {}; diff --git a/javascript/account/v2/mii.js b/javascript/account/v2/mii.js index 21470a4..a05c36f 100644 --- a/javascript/account/v2/mii.js +++ b/javascript/account/v2/mii.js @@ -1,75 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/mii.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/mii.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mii = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Mii$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.Mii", [ - { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "data", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.name = ""; - message.data = ""; - message.url = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Mii = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account.v2"; +function createBaseMii() { + return { name: "", data: "", url: "" }; +} +exports.Mii = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.name = reader.string(); - break; - case /* string data */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.data = reader.string(); - break; - case /* string url */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.url = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string name = 1; */ - if (message.name !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.name); - /* string data = 2; */ - if (message.data !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.data); - /* string url = 3; */ - if (message.url !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.url); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + create(base) { + return exports.Mii.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.Mii - */ -exports.Mii = new Mii$Type(); diff --git a/javascript/account/v2/mii.ts b/javascript/account/v2/mii.ts new file mode 100644 index 0000000..ee38006 --- /dev/null +++ b/javascript/account/v2/mii.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/mii.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account.v2"; + +export interface Mii { + name: string; + data: string; + url: string; +} + +function createBaseMii(): Mii { + return { name: "", data: "", url: "" }; +} + +export const Mii: MessageFns = { + encode(message: Mii, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Mii { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Mii { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: Mii): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): Mii { + return Mii.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Mii { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/pnid_permission_flags.d.ts b/javascript/account/v2/pnid_permission_flags.d.ts index 1a5a573..9565229 100644 --- a/javascript/account/v2/pnid_permission_flags.d.ts +++ b/javascript/account/v2/pnid_permission_flags.d.ts @@ -1,115 +1,40 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/pnid_permission_flags.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message account.v2.PNIDPermissionFlags - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "account.v2"; export interface PNIDPermissionFlags { - /** - * @generated from protobuf field: bool banned_all_permanently = 1; - */ bannedAllPermanently: boolean; - /** - * @generated from protobuf field: bool banned_all_temporarily = 2; - */ bannedAllTemporarily: boolean; - /** - * @generated from protobuf field: bool beta_access = 3; - */ betaAccess: boolean; - /** - * @generated from protobuf field: bool access_admin_panel = 4; - */ accessAdminPanel: boolean; - /** - * @generated from protobuf field: bool create_server_configs = 5; - */ createServerConfigs: boolean; - /** - * @generated from protobuf field: bool modify_server_configs = 6; - */ modifyServerConfigs: boolean; - /** - * @generated from protobuf field: bool deploy_server = 7; - */ deployServer: boolean; - /** - * @generated from protobuf field: bool modify_pnids = 8; - */ modifyPnids: boolean; - /** - * @generated from protobuf field: bool modify_nex_accounts = 9; - */ modifyNexAccounts: boolean; - /** - * @generated from protobuf field: bool modify_consoles = 10; - */ modifyConsoles: boolean; - /** - * @generated from protobuf field: bool ban_pnids = 11; - */ banPnids: boolean; - /** - * @generated from protobuf field: bool ban_nex_accounts = 12; - */ banNexAccounts: boolean; - /** - * @generated from protobuf field: bool ban_consoles = 13; - */ banConsoles: boolean; - /** - * @generated from protobuf field: bool moderate_miiverse = 14; - */ moderateMiiverse: boolean; - /** - * @generated from protobuf field: bool create_api_keys = 15; - */ createApiKeys: boolean; - /** - * @generated from protobuf field: bool create_boss_tasks = 16; - */ createBossTasks: boolean; - /** - * @generated from protobuf field: bool update_boss_tasks = 17; - */ updateBossTasks: boolean; - /** - * @generated from protobuf field: bool delete_boss_tasks = 18; - */ deleteBossTasks: boolean; - /** - * @generated from protobuf field: bool upload_boss_files = 19; - */ uploadBossFiles: boolean; - /** - * @generated from protobuf field: bool update_boss_files = 20; - */ updateBossFiles: boolean; - /** - * @generated from protobuf field: bool delete_boss_files = 21; - */ deleteBossFiles: boolean; - /** - * @generated from protobuf field: bool update_pnid_permissions = 22; - */ updatePnidPermissions: boolean; } -declare class PNIDPermissionFlags$Type extends MessageType { - constructor(); - create(value?: PartialMessage): PNIDPermissionFlags; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PNIDPermissionFlags): PNIDPermissionFlags; - internalBinaryWrite(message: PNIDPermissionFlags, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const PNIDPermissionFlags: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.PNIDPermissionFlags - */ -export declare const PNIDPermissionFlags: PNIDPermissionFlags$Type; export {}; diff --git a/javascript/account/v2/pnid_permission_flags.js b/javascript/account/v2/pnid_permission_flags.js index d2d75e9..4aeed9e 100644 --- a/javascript/account/v2/pnid_permission_flags.js +++ b/javascript/account/v2/pnid_permission_flags.js @@ -1,227 +1,411 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/pnid_permission_flags.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/pnid_permission_flags.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.PNIDPermissionFlags = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class PNIDPermissionFlags$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.PNIDPermissionFlags", [ - { no: 1, name: "banned_all_permanently", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "banned_all_temporarily", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "beta_access", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 4, name: "access_admin_panel", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 5, name: "create_server_configs", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 6, name: "modify_server_configs", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 7, name: "deploy_server", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 8, name: "modify_pnids", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 9, name: "modify_nex_accounts", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 10, name: "modify_consoles", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 11, name: "ban_pnids", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 12, name: "ban_nex_accounts", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 13, name: "ban_consoles", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 14, name: "moderate_miiverse", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 15, name: "create_api_keys", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 16, name: "create_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 17, name: "update_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "delete_boss_tasks", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 19, name: "upload_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 20, name: "update_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 21, name: "delete_boss_files", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 22, name: "update_pnid_permissions", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.bannedAllPermanently = false; - message.bannedAllTemporarily = false; - message.betaAccess = false; - message.accessAdminPanel = false; - message.createServerConfigs = false; - message.modifyServerConfigs = false; - message.deployServer = false; - message.modifyPnids = false; - message.modifyNexAccounts = false; - message.modifyConsoles = false; - message.banPnids = false; - message.banNexAccounts = false; - message.banConsoles = false; - message.moderateMiiverse = false; - message.createApiKeys = false; - message.createBossTasks = false; - message.updateBossTasks = false; - message.deleteBossTasks = false; - message.uploadBossFiles = false; - message.updateBossFiles = false; - message.deleteBossFiles = false; - message.updatePnidPermissions = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.PNIDPermissionFlags = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "account.v2"; +function createBasePNIDPermissionFlags() { + return { + bannedAllPermanently: false, + bannedAllTemporarily: false, + betaAccess: false, + accessAdminPanel: false, + createServerConfigs: false, + modifyServerConfigs: false, + deployServer: false, + modifyPnids: false, + modifyNexAccounts: false, + modifyConsoles: false, + banPnids: false, + banNexAccounts: false, + banConsoles: false, + moderateMiiverse: false, + createApiKeys: false, + createBossTasks: false, + updateBossTasks: false, + deleteBossTasks: false, + uploadBossFiles: false, + updateBossFiles: false, + deleteBossFiles: false, + updatePnidPermissions: false, + }; +} +exports.PNIDPermissionFlags = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.bannedAllPermanently !== false) { + writer.uint32(8).bool(message.bannedAllPermanently); + } + if (message.bannedAllTemporarily !== false) { + writer.uint32(16).bool(message.bannedAllTemporarily); + } + if (message.betaAccess !== false) { + writer.uint32(24).bool(message.betaAccess); + } + if (message.accessAdminPanel !== false) { + writer.uint32(32).bool(message.accessAdminPanel); + } + if (message.createServerConfigs !== false) { + writer.uint32(40).bool(message.createServerConfigs); + } + if (message.modifyServerConfigs !== false) { + writer.uint32(48).bool(message.modifyServerConfigs); + } + if (message.deployServer !== false) { + writer.uint32(56).bool(message.deployServer); + } + if (message.modifyPnids !== false) { + writer.uint32(64).bool(message.modifyPnids); + } + if (message.modifyNexAccounts !== false) { + writer.uint32(72).bool(message.modifyNexAccounts); + } + if (message.modifyConsoles !== false) { + writer.uint32(80).bool(message.modifyConsoles); + } + if (message.banPnids !== false) { + writer.uint32(88).bool(message.banPnids); + } + if (message.banNexAccounts !== false) { + writer.uint32(96).bool(message.banNexAccounts); + } + if (message.banConsoles !== false) { + writer.uint32(104).bool(message.banConsoles); + } + if (message.moderateMiiverse !== false) { + writer.uint32(112).bool(message.moderateMiiverse); + } + if (message.createApiKeys !== false) { + writer.uint32(120).bool(message.createApiKeys); + } + if (message.createBossTasks !== false) { + writer.uint32(128).bool(message.createBossTasks); + } + if (message.updateBossTasks !== false) { + writer.uint32(136).bool(message.updateBossTasks); + } + if (message.deleteBossTasks !== false) { + writer.uint32(144).bool(message.deleteBossTasks); + } + if (message.uploadBossFiles !== false) { + writer.uint32(152).bool(message.uploadBossFiles); + } + if (message.updateBossFiles !== false) { + writer.uint32(160).bool(message.updateBossFiles); + } + if (message.deleteBossFiles !== false) { + writer.uint32(168).bool(message.deleteBossFiles); + } + if (message.updatePnidPermissions !== false) { + writer.uint32(176).bool(message.updatePnidPermissions); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePNIDPermissionFlags(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool banned_all_permanently */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.bannedAllPermanently = reader.bool(); - break; - case /* bool banned_all_temporarily */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.bannedAllTemporarily = reader.bool(); - break; - case /* bool beta_access */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.betaAccess = reader.bool(); - break; - case /* bool access_admin_panel */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.accessAdminPanel = reader.bool(); - break; - case /* bool create_server_configs */ 5: + continue; + } + case 5: { + if (tag !== 40) { + break; + } message.createServerConfigs = reader.bool(); - break; - case /* bool modify_server_configs */ 6: + continue; + } + case 6: { + if (tag !== 48) { + break; + } message.modifyServerConfigs = reader.bool(); - break; - case /* bool deploy_server */ 7: + continue; + } + case 7: { + if (tag !== 56) { + break; + } message.deployServer = reader.bool(); - break; - case /* bool modify_pnids */ 8: + continue; + } + case 8: { + if (tag !== 64) { + break; + } message.modifyPnids = reader.bool(); - break; - case /* bool modify_nex_accounts */ 9: + continue; + } + case 9: { + if (tag !== 72) { + break; + } message.modifyNexAccounts = reader.bool(); - break; - case /* bool modify_consoles */ 10: + continue; + } + case 10: { + if (tag !== 80) { + break; + } message.modifyConsoles = reader.bool(); - break; - case /* bool ban_pnids */ 11: + continue; + } + case 11: { + if (tag !== 88) { + break; + } message.banPnids = reader.bool(); - break; - case /* bool ban_nex_accounts */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.banNexAccounts = reader.bool(); - break; - case /* bool ban_consoles */ 13: + continue; + } + case 13: { + if (tag !== 104) { + break; + } message.banConsoles = reader.bool(); - break; - case /* bool moderate_miiverse */ 14: + continue; + } + case 14: { + if (tag !== 112) { + break; + } message.moderateMiiverse = reader.bool(); - break; - case /* bool create_api_keys */ 15: + continue; + } + case 15: { + if (tag !== 120) { + break; + } message.createApiKeys = reader.bool(); - break; - case /* bool create_boss_tasks */ 16: + continue; + } + case 16: { + if (tag !== 128) { + break; + } message.createBossTasks = reader.bool(); - break; - case /* bool update_boss_tasks */ 17: + continue; + } + case 17: { + if (tag !== 136) { + break; + } message.updateBossTasks = reader.bool(); - break; - case /* bool delete_boss_tasks */ 18: + continue; + } + case 18: { + if (tag !== 144) { + break; + } message.deleteBossTasks = reader.bool(); - break; - case /* bool upload_boss_files */ 19: + continue; + } + case 19: { + if (tag !== 152) { + break; + } message.uploadBossFiles = reader.bool(); - break; - case /* bool update_boss_files */ 20: + continue; + } + case 20: { + if (tag !== 160) { + break; + } message.updateBossFiles = reader.bool(); - break; - case /* bool delete_boss_files */ 21: + continue; + } + case 21: { + if (tag !== 168) { + break; + } message.deleteBossFiles = reader.bool(); - break; - case /* bool update_pnid_permissions */ 22: + continue; + } + case 22: { + if (tag !== 176) { + break; + } message.updatePnidPermissions = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool banned_all_permanently = 1; */ - if (message.bannedAllPermanently !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.bannedAllPermanently); - /* bool banned_all_temporarily = 2; */ - if (message.bannedAllTemporarily !== false) - writer.tag(2, runtime_1.WireType.Varint).bool(message.bannedAllTemporarily); - /* bool beta_access = 3; */ - if (message.betaAccess !== false) - writer.tag(3, runtime_1.WireType.Varint).bool(message.betaAccess); - /* bool access_admin_panel = 4; */ - if (message.accessAdminPanel !== false) - writer.tag(4, runtime_1.WireType.Varint).bool(message.accessAdminPanel); - /* bool create_server_configs = 5; */ - if (message.createServerConfigs !== false) - writer.tag(5, runtime_1.WireType.Varint).bool(message.createServerConfigs); - /* bool modify_server_configs = 6; */ - if (message.modifyServerConfigs !== false) - writer.tag(6, runtime_1.WireType.Varint).bool(message.modifyServerConfigs); - /* bool deploy_server = 7; */ - if (message.deployServer !== false) - writer.tag(7, runtime_1.WireType.Varint).bool(message.deployServer); - /* bool modify_pnids = 8; */ - if (message.modifyPnids !== false) - writer.tag(8, runtime_1.WireType.Varint).bool(message.modifyPnids); - /* bool modify_nex_accounts = 9; */ - if (message.modifyNexAccounts !== false) - writer.tag(9, runtime_1.WireType.Varint).bool(message.modifyNexAccounts); - /* bool modify_consoles = 10; */ - if (message.modifyConsoles !== false) - writer.tag(10, runtime_1.WireType.Varint).bool(message.modifyConsoles); - /* bool ban_pnids = 11; */ - if (message.banPnids !== false) - writer.tag(11, runtime_1.WireType.Varint).bool(message.banPnids); - /* bool ban_nex_accounts = 12; */ - if (message.banNexAccounts !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.banNexAccounts); - /* bool ban_consoles = 13; */ - if (message.banConsoles !== false) - writer.tag(13, runtime_1.WireType.Varint).bool(message.banConsoles); - /* bool moderate_miiverse = 14; */ - if (message.moderateMiiverse !== false) - writer.tag(14, runtime_1.WireType.Varint).bool(message.moderateMiiverse); - /* bool create_api_keys = 15; */ - if (message.createApiKeys !== false) - writer.tag(15, runtime_1.WireType.Varint).bool(message.createApiKeys); - /* bool create_boss_tasks = 16; */ - if (message.createBossTasks !== false) - writer.tag(16, runtime_1.WireType.Varint).bool(message.createBossTasks); - /* bool update_boss_tasks = 17; */ - if (message.updateBossTasks !== false) - writer.tag(17, runtime_1.WireType.Varint).bool(message.updateBossTasks); - /* bool delete_boss_tasks = 18; */ - if (message.deleteBossTasks !== false) - writer.tag(18, runtime_1.WireType.Varint).bool(message.deleteBossTasks); - /* bool upload_boss_files = 19; */ - if (message.uploadBossFiles !== false) - writer.tag(19, runtime_1.WireType.Varint).bool(message.uploadBossFiles); - /* bool update_boss_files = 20; */ - if (message.updateBossFiles !== false) - writer.tag(20, runtime_1.WireType.Varint).bool(message.updateBossFiles); - /* bool delete_boss_files = 21; */ - if (message.deleteBossFiles !== false) - writer.tag(21, runtime_1.WireType.Varint).bool(message.deleteBossFiles); - /* bool update_pnid_permissions = 22; */ - if (message.updatePnidPermissions !== false) - writer.tag(22, runtime_1.WireType.Varint).bool(message.updatePnidPermissions); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + bannedAllPermanently: isSet(object.bannedAllPermanently) + ? globalThis.Boolean(object.bannedAllPermanently) + : false, + bannedAllTemporarily: isSet(object.bannedAllTemporarily) + ? globalThis.Boolean(object.bannedAllTemporarily) + : false, + betaAccess: isSet(object.betaAccess) ? globalThis.Boolean(object.betaAccess) : false, + accessAdminPanel: isSet(object.accessAdminPanel) ? globalThis.Boolean(object.accessAdminPanel) : false, + createServerConfigs: isSet(object.createServerConfigs) ? globalThis.Boolean(object.createServerConfigs) : false, + modifyServerConfigs: isSet(object.modifyServerConfigs) ? globalThis.Boolean(object.modifyServerConfigs) : false, + deployServer: isSet(object.deployServer) ? globalThis.Boolean(object.deployServer) : false, + modifyPnids: isSet(object.modifyPnids) ? globalThis.Boolean(object.modifyPnids) : false, + modifyNexAccounts: isSet(object.modifyNexAccounts) ? globalThis.Boolean(object.modifyNexAccounts) : false, + modifyConsoles: isSet(object.modifyConsoles) ? globalThis.Boolean(object.modifyConsoles) : false, + banPnids: isSet(object.banPnids) ? globalThis.Boolean(object.banPnids) : false, + banNexAccounts: isSet(object.banNexAccounts) ? globalThis.Boolean(object.banNexAccounts) : false, + banConsoles: isSet(object.banConsoles) ? globalThis.Boolean(object.banConsoles) : false, + moderateMiiverse: isSet(object.moderateMiiverse) ? globalThis.Boolean(object.moderateMiiverse) : false, + createApiKeys: isSet(object.createApiKeys) ? globalThis.Boolean(object.createApiKeys) : false, + createBossTasks: isSet(object.createBossTasks) ? globalThis.Boolean(object.createBossTasks) : false, + updateBossTasks: isSet(object.updateBossTasks) ? globalThis.Boolean(object.updateBossTasks) : false, + deleteBossTasks: isSet(object.deleteBossTasks) ? globalThis.Boolean(object.deleteBossTasks) : false, + uploadBossFiles: isSet(object.uploadBossFiles) ? globalThis.Boolean(object.uploadBossFiles) : false, + updateBossFiles: isSet(object.updateBossFiles) ? globalThis.Boolean(object.updateBossFiles) : false, + deleteBossFiles: isSet(object.deleteBossFiles) ? globalThis.Boolean(object.deleteBossFiles) : false, + updatePnidPermissions: isSet(object.updatePnidPermissions) + ? globalThis.Boolean(object.updatePnidPermissions) + : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.bannedAllPermanently !== false) { + obj.bannedAllPermanently = message.bannedAllPermanently; + } + if (message.bannedAllTemporarily !== false) { + obj.bannedAllTemporarily = message.bannedAllTemporarily; + } + if (message.betaAccess !== false) { + obj.betaAccess = message.betaAccess; + } + if (message.accessAdminPanel !== false) { + obj.accessAdminPanel = message.accessAdminPanel; + } + if (message.createServerConfigs !== false) { + obj.createServerConfigs = message.createServerConfigs; + } + if (message.modifyServerConfigs !== false) { + obj.modifyServerConfigs = message.modifyServerConfigs; + } + if (message.deployServer !== false) { + obj.deployServer = message.deployServer; + } + if (message.modifyPnids !== false) { + obj.modifyPnids = message.modifyPnids; + } + if (message.modifyNexAccounts !== false) { + obj.modifyNexAccounts = message.modifyNexAccounts; + } + if (message.modifyConsoles !== false) { + obj.modifyConsoles = message.modifyConsoles; + } + if (message.banPnids !== false) { + obj.banPnids = message.banPnids; + } + if (message.banNexAccounts !== false) { + obj.banNexAccounts = message.banNexAccounts; + } + if (message.banConsoles !== false) { + obj.banConsoles = message.banConsoles; + } + if (message.moderateMiiverse !== false) { + obj.moderateMiiverse = message.moderateMiiverse; + } + if (message.createApiKeys !== false) { + obj.createApiKeys = message.createApiKeys; + } + if (message.createBossTasks !== false) { + obj.createBossTasks = message.createBossTasks; + } + if (message.updateBossTasks !== false) { + obj.updateBossTasks = message.updateBossTasks; + } + if (message.deleteBossTasks !== false) { + obj.deleteBossTasks = message.deleteBossTasks; + } + if (message.uploadBossFiles !== false) { + obj.uploadBossFiles = message.uploadBossFiles; + } + if (message.updateBossFiles !== false) { + obj.updateBossFiles = message.updateBossFiles; + } + if (message.deleteBossFiles !== false) { + obj.deleteBossFiles = message.deleteBossFiles; + } + if (message.updatePnidPermissions !== false) { + obj.updatePnidPermissions = message.updatePnidPermissions; + } + return obj; + }, + create(base) { + return exports.PNIDPermissionFlags.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBasePNIDPermissionFlags(); + message.bannedAllPermanently = object.bannedAllPermanently ?? false; + message.bannedAllTemporarily = object.bannedAllTemporarily ?? false; + message.betaAccess = object.betaAccess ?? false; + message.accessAdminPanel = object.accessAdminPanel ?? false; + message.createServerConfigs = object.createServerConfigs ?? false; + message.modifyServerConfigs = object.modifyServerConfigs ?? false; + message.deployServer = object.deployServer ?? false; + message.modifyPnids = object.modifyPnids ?? false; + message.modifyNexAccounts = object.modifyNexAccounts ?? false; + message.modifyConsoles = object.modifyConsoles ?? false; + message.banPnids = object.banPnids ?? false; + message.banNexAccounts = object.banNexAccounts ?? false; + message.banConsoles = object.banConsoles ?? false; + message.moderateMiiverse = object.moderateMiiverse ?? false; + message.createApiKeys = object.createApiKeys ?? false; + message.createBossTasks = object.createBossTasks ?? false; + message.updateBossTasks = object.updateBossTasks ?? false; + message.deleteBossTasks = object.deleteBossTasks ?? false; + message.uploadBossFiles = object.uploadBossFiles ?? false; + message.updateBossFiles = object.updateBossFiles ?? false; + message.deleteBossFiles = object.deleteBossFiles ?? false; + message.updatePnidPermissions = object.updatePnidPermissions ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.PNIDPermissionFlags - */ -exports.PNIDPermissionFlags = new PNIDPermissionFlags$Type(); diff --git a/javascript/account/v2/pnid_permission_flags.ts b/javascript/account/v2/pnid_permission_flags.ts new file mode 100644 index 0000000..394103a --- /dev/null +++ b/javascript/account/v2/pnid_permission_flags.ts @@ -0,0 +1,481 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/pnid_permission_flags.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "account.v2"; + +export interface PNIDPermissionFlags { + bannedAllPermanently: boolean; + bannedAllTemporarily: boolean; + betaAccess: boolean; + accessAdminPanel: boolean; + createServerConfigs: boolean; + modifyServerConfigs: boolean; + deployServer: boolean; + modifyPnids: boolean; + modifyNexAccounts: boolean; + modifyConsoles: boolean; + banPnids: boolean; + banNexAccounts: boolean; + banConsoles: boolean; + moderateMiiverse: boolean; + createApiKeys: boolean; + createBossTasks: boolean; + updateBossTasks: boolean; + deleteBossTasks: boolean; + uploadBossFiles: boolean; + updateBossFiles: boolean; + deleteBossFiles: boolean; + updatePnidPermissions: boolean; +} + +function createBasePNIDPermissionFlags(): PNIDPermissionFlags { + return { + bannedAllPermanently: false, + bannedAllTemporarily: false, + betaAccess: false, + accessAdminPanel: false, + createServerConfigs: false, + modifyServerConfigs: false, + deployServer: false, + modifyPnids: false, + modifyNexAccounts: false, + modifyConsoles: false, + banPnids: false, + banNexAccounts: false, + banConsoles: false, + moderateMiiverse: false, + createApiKeys: false, + createBossTasks: false, + updateBossTasks: false, + deleteBossTasks: false, + uploadBossFiles: false, + updateBossFiles: false, + deleteBossFiles: false, + updatePnidPermissions: false, + }; +} + +export const PNIDPermissionFlags: MessageFns = { + encode(message: PNIDPermissionFlags, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bannedAllPermanently !== false) { + writer.uint32(8).bool(message.bannedAllPermanently); + } + if (message.bannedAllTemporarily !== false) { + writer.uint32(16).bool(message.bannedAllTemporarily); + } + if (message.betaAccess !== false) { + writer.uint32(24).bool(message.betaAccess); + } + if (message.accessAdminPanel !== false) { + writer.uint32(32).bool(message.accessAdminPanel); + } + if (message.createServerConfigs !== false) { + writer.uint32(40).bool(message.createServerConfigs); + } + if (message.modifyServerConfigs !== false) { + writer.uint32(48).bool(message.modifyServerConfigs); + } + if (message.deployServer !== false) { + writer.uint32(56).bool(message.deployServer); + } + if (message.modifyPnids !== false) { + writer.uint32(64).bool(message.modifyPnids); + } + if (message.modifyNexAccounts !== false) { + writer.uint32(72).bool(message.modifyNexAccounts); + } + if (message.modifyConsoles !== false) { + writer.uint32(80).bool(message.modifyConsoles); + } + if (message.banPnids !== false) { + writer.uint32(88).bool(message.banPnids); + } + if (message.banNexAccounts !== false) { + writer.uint32(96).bool(message.banNexAccounts); + } + if (message.banConsoles !== false) { + writer.uint32(104).bool(message.banConsoles); + } + if (message.moderateMiiverse !== false) { + writer.uint32(112).bool(message.moderateMiiverse); + } + if (message.createApiKeys !== false) { + writer.uint32(120).bool(message.createApiKeys); + } + if (message.createBossTasks !== false) { + writer.uint32(128).bool(message.createBossTasks); + } + if (message.updateBossTasks !== false) { + writer.uint32(136).bool(message.updateBossTasks); + } + if (message.deleteBossTasks !== false) { + writer.uint32(144).bool(message.deleteBossTasks); + } + if (message.uploadBossFiles !== false) { + writer.uint32(152).bool(message.uploadBossFiles); + } + if (message.updateBossFiles !== false) { + writer.uint32(160).bool(message.updateBossFiles); + } + if (message.deleteBossFiles !== false) { + writer.uint32(168).bool(message.deleteBossFiles); + } + if (message.updatePnidPermissions !== false) { + writer.uint32(176).bool(message.updatePnidPermissions); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PNIDPermissionFlags { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePNIDPermissionFlags(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.bannedAllPermanently = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.bannedAllTemporarily = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.betaAccess = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.accessAdminPanel = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.createServerConfigs = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.modifyServerConfigs = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.deployServer = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.modifyPnids = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.modifyNexAccounts = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.modifyConsoles = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.banPnids = reader.bool(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.banNexAccounts = reader.bool(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.banConsoles = reader.bool(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.moderateMiiverse = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.createApiKeys = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.createBossTasks = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.updateBossTasks = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.deleteBossTasks = reader.bool(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.uploadBossFiles = reader.bool(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.updateBossFiles = reader.bool(); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.deleteBossFiles = reader.bool(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.updatePnidPermissions = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PNIDPermissionFlags { + return { + bannedAllPermanently: isSet(object.bannedAllPermanently) + ? globalThis.Boolean(object.bannedAllPermanently) + : false, + bannedAllTemporarily: isSet(object.bannedAllTemporarily) + ? globalThis.Boolean(object.bannedAllTemporarily) + : false, + betaAccess: isSet(object.betaAccess) ? globalThis.Boolean(object.betaAccess) : false, + accessAdminPanel: isSet(object.accessAdminPanel) ? globalThis.Boolean(object.accessAdminPanel) : false, + createServerConfigs: isSet(object.createServerConfigs) ? globalThis.Boolean(object.createServerConfigs) : false, + modifyServerConfigs: isSet(object.modifyServerConfigs) ? globalThis.Boolean(object.modifyServerConfigs) : false, + deployServer: isSet(object.deployServer) ? globalThis.Boolean(object.deployServer) : false, + modifyPnids: isSet(object.modifyPnids) ? globalThis.Boolean(object.modifyPnids) : false, + modifyNexAccounts: isSet(object.modifyNexAccounts) ? globalThis.Boolean(object.modifyNexAccounts) : false, + modifyConsoles: isSet(object.modifyConsoles) ? globalThis.Boolean(object.modifyConsoles) : false, + banPnids: isSet(object.banPnids) ? globalThis.Boolean(object.banPnids) : false, + banNexAccounts: isSet(object.banNexAccounts) ? globalThis.Boolean(object.banNexAccounts) : false, + banConsoles: isSet(object.banConsoles) ? globalThis.Boolean(object.banConsoles) : false, + moderateMiiverse: isSet(object.moderateMiiverse) ? globalThis.Boolean(object.moderateMiiverse) : false, + createApiKeys: isSet(object.createApiKeys) ? globalThis.Boolean(object.createApiKeys) : false, + createBossTasks: isSet(object.createBossTasks) ? globalThis.Boolean(object.createBossTasks) : false, + updateBossTasks: isSet(object.updateBossTasks) ? globalThis.Boolean(object.updateBossTasks) : false, + deleteBossTasks: isSet(object.deleteBossTasks) ? globalThis.Boolean(object.deleteBossTasks) : false, + uploadBossFiles: isSet(object.uploadBossFiles) ? globalThis.Boolean(object.uploadBossFiles) : false, + updateBossFiles: isSet(object.updateBossFiles) ? globalThis.Boolean(object.updateBossFiles) : false, + deleteBossFiles: isSet(object.deleteBossFiles) ? globalThis.Boolean(object.deleteBossFiles) : false, + updatePnidPermissions: isSet(object.updatePnidPermissions) + ? globalThis.Boolean(object.updatePnidPermissions) + : false, + }; + }, + + toJSON(message: PNIDPermissionFlags): unknown { + const obj: any = {}; + if (message.bannedAllPermanently !== false) { + obj.bannedAllPermanently = message.bannedAllPermanently; + } + if (message.bannedAllTemporarily !== false) { + obj.bannedAllTemporarily = message.bannedAllTemporarily; + } + if (message.betaAccess !== false) { + obj.betaAccess = message.betaAccess; + } + if (message.accessAdminPanel !== false) { + obj.accessAdminPanel = message.accessAdminPanel; + } + if (message.createServerConfigs !== false) { + obj.createServerConfigs = message.createServerConfigs; + } + if (message.modifyServerConfigs !== false) { + obj.modifyServerConfigs = message.modifyServerConfigs; + } + if (message.deployServer !== false) { + obj.deployServer = message.deployServer; + } + if (message.modifyPnids !== false) { + obj.modifyPnids = message.modifyPnids; + } + if (message.modifyNexAccounts !== false) { + obj.modifyNexAccounts = message.modifyNexAccounts; + } + if (message.modifyConsoles !== false) { + obj.modifyConsoles = message.modifyConsoles; + } + if (message.banPnids !== false) { + obj.banPnids = message.banPnids; + } + if (message.banNexAccounts !== false) { + obj.banNexAccounts = message.banNexAccounts; + } + if (message.banConsoles !== false) { + obj.banConsoles = message.banConsoles; + } + if (message.moderateMiiverse !== false) { + obj.moderateMiiverse = message.moderateMiiverse; + } + if (message.createApiKeys !== false) { + obj.createApiKeys = message.createApiKeys; + } + if (message.createBossTasks !== false) { + obj.createBossTasks = message.createBossTasks; + } + if (message.updateBossTasks !== false) { + obj.updateBossTasks = message.updateBossTasks; + } + if (message.deleteBossTasks !== false) { + obj.deleteBossTasks = message.deleteBossTasks; + } + if (message.uploadBossFiles !== false) { + obj.uploadBossFiles = message.uploadBossFiles; + } + if (message.updateBossFiles !== false) { + obj.updateBossFiles = message.updateBossFiles; + } + if (message.deleteBossFiles !== false) { + obj.deleteBossFiles = message.deleteBossFiles; + } + if (message.updatePnidPermissions !== false) { + obj.updatePnidPermissions = message.updatePnidPermissions; + } + return obj; + }, + + create(base?: DeepPartial): PNIDPermissionFlags { + return PNIDPermissionFlags.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PNIDPermissionFlags { + const message = createBasePNIDPermissionFlags(); + message.bannedAllPermanently = object.bannedAllPermanently ?? false; + message.bannedAllTemporarily = object.bannedAllTemporarily ?? false; + message.betaAccess = object.betaAccess ?? false; + message.accessAdminPanel = object.accessAdminPanel ?? false; + message.createServerConfigs = object.createServerConfigs ?? false; + message.modifyServerConfigs = object.modifyServerConfigs ?? false; + message.deployServer = object.deployServer ?? false; + message.modifyPnids = object.modifyPnids ?? false; + message.modifyNexAccounts = object.modifyNexAccounts ?? false; + message.modifyConsoles = object.modifyConsoles ?? false; + message.banPnids = object.banPnids ?? false; + message.banNexAccounts = object.banNexAccounts ?? false; + message.banConsoles = object.banConsoles ?? false; + message.moderateMiiverse = object.moderateMiiverse ?? false; + message.createApiKeys = object.createApiKeys ?? false; + message.createBossTasks = object.createBossTasks ?? false; + message.updateBossTasks = object.updateBossTasks ?? false; + message.deleteBossTasks = object.deleteBossTasks ?? false; + message.uploadBossFiles = object.uploadBossFiles ?? false; + message.updateBossFiles = object.updateBossFiles ?? false; + message.deleteBossFiles = object.deleteBossFiles ?? false; + message.updatePnidPermissions = object.updatePnidPermissions ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/account/v2/update_pnid_permissions.d.ts b/javascript/account/v2/update_pnid_permissions.d.ts index 09ccddd..25eb8ab 100644 --- a/javascript/account/v2/update_pnid_permissions.d.ts +++ b/javascript/account/v2/update_pnid_permissions.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/update_pnid_permissions.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { PNIDPermissionFlags } from "./pnid_permission_flags"; -/** - * @generated from protobuf message account.v2.UpdatePNIDPermissionsRequest - */ +export declare const protobufPackage = "account.v2"; export interface UpdatePNIDPermissionsRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: account.v2.PNIDPermissionFlags permissions = 2; - */ - permissions?: PNIDPermissionFlags; + permissions: PNIDPermissionFlags | undefined; } -/** - * @generated from protobuf message account.v2.UpdatePNIDPermissionsResponse - */ export interface UpdatePNIDPermissionsResponse { } -declare class UpdatePNIDPermissionsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdatePNIDPermissionsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdatePNIDPermissionsRequest): UpdatePNIDPermissionsRequest; - internalBinaryWrite(message: UpdatePNIDPermissionsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdatePNIDPermissionsRequest: MessageFns; +export declare const UpdatePNIDPermissionsResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message account.v2.UpdatePNIDPermissionsRequest - */ -export declare const UpdatePNIDPermissionsRequest: UpdatePNIDPermissionsRequest$Type; -declare class UpdatePNIDPermissionsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdatePNIDPermissionsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdatePNIDPermissionsResponse): UpdatePNIDPermissionsResponse; - internalBinaryWrite(message: UpdatePNIDPermissionsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message account.v2.UpdatePNIDPermissionsResponse - */ -export declare const UpdatePNIDPermissionsResponse: UpdatePNIDPermissionsResponse$Type; export {}; diff --git a/javascript/account/v2/update_pnid_permissions.js b/javascript/account/v2/update_pnid_permissions.js index 9d79a0c..f622a40 100644 --- a/javascript/account/v2/update_pnid_permissions.js +++ b/javascript/account/v2/update_pnid_permissions.js @@ -1,92 +1,122 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "account/v2/update_pnid_permissions.proto" (package "account.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/update_pnid_permissions.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdatePNIDPermissionsResponse = exports.UpdatePNIDPermissionsRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.UpdatePNIDPermissionsResponse = exports.UpdatePNIDPermissionsRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const pnid_permission_flags_1 = require("./pnid_permission_flags"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdatePNIDPermissionsRequest$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.UpdatePNIDPermissionsRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "permissions", kind: "message", T: () => pnid_permission_flags_1.PNIDPermissionFlags } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "account.v2"; +function createBaseUpdatePNIDPermissionsRequest() { + return { pid: 0, permissions: undefined }; +} +exports.UpdatePNIDPermissionsRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.permissions !== undefined) { + pnid_permission_flags_1.PNIDPermissionFlags.encode(message.permissions, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* account.v2.PNIDPermissionFlags permissions */ 2: - message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryRead(reader, reader.uint32(), options, message.permissions); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.permissions = pnid_permission_flags_1.PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* account.v2.PNIDPermissionFlags permissions = 2; */ - if (message.permissions) - pnid_permission_flags_1.PNIDPermissionFlags.internalBinaryWrite(message.permissions, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message account.v2.UpdatePNIDPermissionsRequest - */ -exports.UpdatePNIDPermissionsRequest = new UpdatePNIDPermissionsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdatePNIDPermissionsResponse$Type extends runtime_4.MessageType { - constructor() { - super("account.v2.UpdatePNIDPermissionsResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + permissions: isSet(object.permissions) ? pnid_permission_flags_1.PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.permissions !== undefined) { + obj.permissions = pnid_permission_flags_1.PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + create(base) { + return exports.UpdatePNIDPermissionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdatePNIDPermissionsRequest(); + message.pid = object.pid ?? 0; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? pnid_permission_flags_1.PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseUpdatePNIDPermissionsResponse() { + return {}; +} +exports.UpdatePNIDPermissionsResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.UpdatePNIDPermissionsResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseUpdatePNIDPermissionsResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message account.v2.UpdatePNIDPermissionsResponse - */ -exports.UpdatePNIDPermissionsResponse = new UpdatePNIDPermissionsResponse$Type(); diff --git a/javascript/account/v2/update_pnid_permissions.ts b/javascript/account/v2/update_pnid_permissions.ts new file mode 100644 index 0000000..937ce57 --- /dev/null +++ b/javascript/account/v2/update_pnid_permissions.ts @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: account/v2/update_pnid_permissions.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { PNIDPermissionFlags } from "./pnid_permission_flags"; + +export const protobufPackage = "account.v2"; + +export interface UpdatePNIDPermissionsRequest { + pid: number; + permissions: PNIDPermissionFlags | undefined; +} + +export interface UpdatePNIDPermissionsResponse { +} + +function createBaseUpdatePNIDPermissionsRequest(): UpdatePNIDPermissionsRequest { + return { pid: 0, permissions: undefined }; +} + +export const UpdatePNIDPermissionsRequest: MessageFns = { + encode(message: UpdatePNIDPermissionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.permissions !== undefined) { + PNIDPermissionFlags.encode(message.permissions, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdatePNIDPermissionsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.permissions = PNIDPermissionFlags.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdatePNIDPermissionsRequest { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + permissions: isSet(object.permissions) ? PNIDPermissionFlags.fromJSON(object.permissions) : undefined, + }; + }, + + toJSON(message: UpdatePNIDPermissionsRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.permissions !== undefined) { + obj.permissions = PNIDPermissionFlags.toJSON(message.permissions); + } + return obj; + }, + + create(base?: DeepPartial): UpdatePNIDPermissionsRequest { + return UpdatePNIDPermissionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdatePNIDPermissionsRequest { + const message = createBaseUpdatePNIDPermissionsRequest(); + message.pid = object.pid ?? 0; + message.permissions = (object.permissions !== undefined && object.permissions !== null) + ? PNIDPermissionFlags.fromPartial(object.permissions) + : undefined; + return message; + }, +}; + +function createBaseUpdatePNIDPermissionsResponse(): UpdatePNIDPermissionsResponse { + return {}; +} + +export const UpdatePNIDPermissionsResponse: MessageFns = { + encode(_: UpdatePNIDPermissionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdatePNIDPermissionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePNIDPermissionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): UpdatePNIDPermissionsResponse { + return {}; + }, + + toJSON(_: UpdatePNIDPermissionsResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): UpdatePNIDPermissionsResponse { + return UpdatePNIDPermissionsResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): UpdatePNIDPermissionsResponse { + const message = createBaseUpdatePNIDPermissionsResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/api_service.client.d.ts b/javascript/api/api_service.client.d.ts deleted file mode 100644 index e88d061..0000000 --- a/javascript/api/api_service.client.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/api_service.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { SetStripeConnectionDataRequest } from "./set_stripe_connection_data_rpc"; -import type { SetDiscordConnectionDataRequest } from "./set_discord_connection_data_rpc"; -import type { ResetPasswordRequest } from "./reset_password_rpc"; -import type { ForgotPasswordRequest } from "./forgot_password_rpc"; -import type { UpdateUserDataRequest } from "./update_user_data_rpc"; -import type { GetUserDataResponse } from "./get_user_data_rpc"; -import type { Empty } from "../google/protobuf/empty"; -import type { LoginRequest } from "./login_rpc"; -import type { LoginResponse } from "./login_rpc"; -import type { RegisterRequest } from "./register_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service api.API - */ -export interface IAPIClient { - /** - * @generated from protobuf rpc: Register(api.RegisterRequest) returns (api.LoginResponse); - */ - register(input: RegisterRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: Login(api.LoginRequest) returns (api.LoginResponse); - */ - login(input: LoginRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserData(google.protobuf.Empty) returns (api.GetUserDataResponse); - */ - getUserData(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateUserData(api.UpdateUserDataRequest) returns (api.GetUserDataResponse); - */ - updateUserData(input: UpdateUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ForgotPassword(api.ForgotPasswordRequest) returns (google.protobuf.Empty); - */ - forgotPassword(input: ForgotPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ResetPassword(api.ResetPasswordRequest) returns (google.protobuf.Empty); - */ - resetPassword(input: ResetPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.SetDiscordConnectionDataRequest) returns (google.protobuf.Empty); - */ - setDiscordConnectionData(input: SetDiscordConnectionDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.SetStripeConnectionDataRequest) returns (google.protobuf.Empty); - */ - setStripeConnectionData(input: SetStripeConnectionDataRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service api.API - */ -export declare class APIClient implements IAPIClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: Register(api.RegisterRequest) returns (api.LoginResponse); - */ - register(input: RegisterRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: Login(api.LoginRequest) returns (api.LoginResponse); - */ - login(input: LoginRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserData(google.protobuf.Empty) returns (api.GetUserDataResponse); - */ - getUserData(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateUserData(api.UpdateUserDataRequest) returns (api.GetUserDataResponse); - */ - updateUserData(input: UpdateUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ForgotPassword(api.ForgotPasswordRequest) returns (google.protobuf.Empty); - */ - forgotPassword(input: ForgotPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ResetPassword(api.ResetPasswordRequest) returns (google.protobuf.Empty); - */ - resetPassword(input: ResetPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.SetDiscordConnectionDataRequest) returns (google.protobuf.Empty); - */ - setDiscordConnectionData(input: SetDiscordConnectionDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.SetStripeConnectionDataRequest) returns (google.protobuf.Empty); - */ - setStripeConnectionData(input: SetStripeConnectionDataRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/api/api_service.client.js b/javascript/api/api_service.client.js deleted file mode 100644 index 57b745f..0000000 --- a/javascript/api/api_service.client.js +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/api_service.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.APIClient = void 0; -const api_service_1 = require("./api_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service api.API - */ -class APIClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = api_service_1.API.typeName; - this.methods = api_service_1.API.methods; - this.options = api_service_1.API.options; - } - /** - * @generated from protobuf rpc: Register(api.RegisterRequest) returns (api.LoginResponse); - */ - register(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: Login(api.LoginRequest) returns (api.LoginResponse); - */ - login(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserData(google.protobuf.Empty) returns (api.GetUserDataResponse); - */ - getUserData(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateUserData(api.UpdateUserDataRequest) returns (api.GetUserDataResponse); - */ - updateUserData(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ForgotPassword(api.ForgotPasswordRequest) returns (google.protobuf.Empty); - */ - forgotPassword(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ResetPassword(api.ResetPasswordRequest) returns (google.protobuf.Empty); - */ - resetPassword(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.SetDiscordConnectionDataRequest) returns (google.protobuf.Empty); - */ - setDiscordConnectionData(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.SetStripeConnectionDataRequest) returns (google.protobuf.Empty); - */ - setStripeConnectionData(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.APIClient = APIClient; diff --git a/javascript/api/api_service.d.ts b/javascript/api/api_service.d.ts index f1d7a6a..1525334 100644 --- a/javascript/api/api_service.d.ts +++ b/javascript/api/api_service.d.ts @@ -1,9 +1,107 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/api_service.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service api.API - */ -export declare const API: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { ForgotPasswordRequest } from "./forgot_password_rpc"; +import { GetUserDataResponse } from "./get_user_data_rpc"; +import { LoginRequest, LoginResponse } from "./login_rpc"; +import { RegisterRequest } from "./register_rpc"; +import { ResetPasswordRequest } from "./reset_password_rpc"; +import { SetDiscordConnectionDataRequest } from "./set_discord_connection_data_rpc"; +import { SetStripeConnectionDataRequest } from "./set_stripe_connection_data_rpc"; +import { UpdateUserDataRequest } from "./update_user_data_rpc"; +export declare const protobufPackage = "api"; +export type APIDefinition = typeof APIDefinition; +export declare const APIDefinition: { + readonly name: "API"; + readonly fullName: "api.API"; + readonly methods: { + readonly register: { + readonly name: "Register"; + readonly requestType: import("./register_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./login_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly login: { + readonly name: "Login"; + readonly requestType: import("./login_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./login_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserData: { + readonly name: "GetUserData"; + readonly requestType: import("../google/protobuf/empty").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateUserData: { + readonly name: "UpdateUserData"; + readonly requestType: import("./update_user_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly forgotPassword: { + readonly name: "ForgotPassword"; + readonly requestType: import("./forgot_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly resetPassword: { + readonly name: "ResetPassword"; + readonly requestType: import("./reset_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly setDiscordConnectionData: { + readonly name: "SetDiscordConnectionData"; + readonly requestType: import("./set_discord_connection_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly setStripeConnectionData: { + readonly name: "SetStripeConnectionData"; + readonly requestType: import("./set_stripe_connection_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface APIServiceImplementation { + register(request: RegisterRequest, context: CallContext & CallContextExt): Promise>; + login(request: LoginRequest, context: CallContext & CallContextExt): Promise>; + getUserData(request: Empty, context: CallContext & CallContextExt): Promise>; + updateUserData(request: UpdateUserDataRequest, context: CallContext & CallContextExt): Promise>; + forgotPassword(request: ForgotPasswordRequest, context: CallContext & CallContextExt): Promise>; + resetPassword(request: ResetPasswordRequest, context: CallContext & CallContextExt): Promise>; + setDiscordConnectionData(request: SetDiscordConnectionDataRequest, context: CallContext & CallContextExt): Promise>; + setStripeConnectionData(request: SetStripeConnectionDataRequest, context: CallContext & CallContextExt): Promise>; +} +export interface APIClient { + register(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + login(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + forgotPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + resetPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + setDiscordConnectionData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + setStripeConnectionData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/api/api_service.js b/javascript/api/api_service.js index 3168c2f..9ec2b22 100644 --- a/javascript/api/api_service.js +++ b/javascript/api/api_service.js @@ -1,37 +1,88 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/api_service.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/api_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.API = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/api_service.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -const set_stripe_connection_data_rpc_1 = require("./set_stripe_connection_data_rpc"); -const set_discord_connection_data_rpc_1 = require("./set_discord_connection_data_rpc"); -const reset_password_rpc_1 = require("./reset_password_rpc"); +exports.APIDefinition = exports.protobufPackage = void 0; +const empty_1 = require("../google/protobuf/empty"); const forgot_password_rpc_1 = require("./forgot_password_rpc"); -const update_user_data_rpc_1 = require("./update_user_data_rpc"); const get_user_data_rpc_1 = require("./get_user_data_rpc"); -const empty_1 = require("../google/protobuf/empty"); const login_rpc_1 = require("./login_rpc"); -const login_rpc_2 = require("./login_rpc"); const register_rpc_1 = require("./register_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service api.API - */ -exports.API = new runtime_rpc_1.ServiceType("api.API", [ - { name: "Register", options: {}, I: register_rpc_1.RegisterRequest, O: login_rpc_2.LoginResponse }, - { name: "Login", options: {}, I: login_rpc_1.LoginRequest, O: login_rpc_2.LoginResponse }, - { name: "GetUserData", options: {}, I: empty_1.Empty, O: get_user_data_rpc_1.GetUserDataResponse }, - { name: "UpdateUserData", options: {}, I: update_user_data_rpc_1.UpdateUserDataRequest, O: get_user_data_rpc_1.GetUserDataResponse }, - { name: "ForgotPassword", options: {}, I: forgot_password_rpc_1.ForgotPasswordRequest, O: empty_1.Empty }, - { name: "ResetPassword", options: {}, I: reset_password_rpc_1.ResetPasswordRequest, O: empty_1.Empty }, - { name: "SetDiscordConnectionData", options: {}, I: set_discord_connection_data_rpc_1.SetDiscordConnectionDataRequest, O: empty_1.Empty }, - { name: "SetStripeConnectionData", options: {}, I: set_stripe_connection_data_rpc_1.SetStripeConnectionDataRequest, O: empty_1.Empty } -]); +const reset_password_rpc_1 = require("./reset_password_rpc"); +const set_discord_connection_data_rpc_1 = require("./set_discord_connection_data_rpc"); +const set_stripe_connection_data_rpc_1 = require("./set_stripe_connection_data_rpc"); +const update_user_data_rpc_1 = require("./update_user_data_rpc"); +exports.protobufPackage = "api"; +exports.APIDefinition = { + name: "API", + fullName: "api.API", + methods: { + register: { + name: "Register", + requestType: register_rpc_1.RegisterRequest, + requestStream: false, + responseType: login_rpc_1.LoginResponse, + responseStream: false, + options: {}, + }, + login: { + name: "Login", + requestType: login_rpc_1.LoginRequest, + requestStream: false, + responseType: login_rpc_1.LoginResponse, + responseStream: false, + options: {}, + }, + getUserData: { + name: "GetUserData", + requestType: empty_1.Empty, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + updateUserData: { + name: "UpdateUserData", + requestType: update_user_data_rpc_1.UpdateUserDataRequest, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + forgotPassword: { + name: "ForgotPassword", + requestType: forgot_password_rpc_1.ForgotPasswordRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + resetPassword: { + name: "ResetPassword", + requestType: reset_password_rpc_1.ResetPasswordRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + setDiscordConnectionData: { + name: "SetDiscordConnectionData", + requestType: set_discord_connection_data_rpc_1.SetDiscordConnectionDataRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + setStripeConnectionData: { + name: "SetStripeConnectionData", + requestType: set_stripe_connection_data_rpc_1.SetStripeConnectionDataRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/api/api_service.ts b/javascript/api/api_service.ts new file mode 100644 index 0000000..f3d7b80 --- /dev/null +++ b/javascript/api/api_service.ts @@ -0,0 +1,139 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/api_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { ForgotPasswordRequest } from "./forgot_password_rpc"; +import { GetUserDataResponse } from "./get_user_data_rpc"; +import { LoginRequest, LoginResponse } from "./login_rpc"; +import { RegisterRequest } from "./register_rpc"; +import { ResetPasswordRequest } from "./reset_password_rpc"; +import { SetDiscordConnectionDataRequest } from "./set_discord_connection_data_rpc"; +import { SetStripeConnectionDataRequest } from "./set_stripe_connection_data_rpc"; +import { UpdateUserDataRequest } from "./update_user_data_rpc"; + +export const protobufPackage = "api"; + +export type APIDefinition = typeof APIDefinition; +export const APIDefinition = { + name: "API", + fullName: "api.API", + methods: { + register: { + name: "Register", + requestType: RegisterRequest, + requestStream: false, + responseType: LoginResponse, + responseStream: false, + options: {}, + }, + login: { + name: "Login", + requestType: LoginRequest, + requestStream: false, + responseType: LoginResponse, + responseStream: false, + options: {}, + }, + getUserData: { + name: "GetUserData", + requestType: Empty, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + updateUserData: { + name: "UpdateUserData", + requestType: UpdateUserDataRequest, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + forgotPassword: { + name: "ForgotPassword", + requestType: ForgotPasswordRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + resetPassword: { + name: "ResetPassword", + requestType: ResetPasswordRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + setDiscordConnectionData: { + name: "SetDiscordConnectionData", + requestType: SetDiscordConnectionDataRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + setStripeConnectionData: { + name: "SetStripeConnectionData", + requestType: SetStripeConnectionDataRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface APIServiceImplementation { + register(request: RegisterRequest, context: CallContext & CallContextExt): Promise>; + login(request: LoginRequest, context: CallContext & CallContextExt): Promise>; + getUserData(request: Empty, context: CallContext & CallContextExt): Promise>; + updateUserData( + request: UpdateUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + forgotPassword(request: ForgotPasswordRequest, context: CallContext & CallContextExt): Promise>; + resetPassword(request: ResetPasswordRequest, context: CallContext & CallContextExt): Promise>; + setDiscordConnectionData( + request: SetDiscordConnectionDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + setStripeConnectionData( + request: SetStripeConnectionDataRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface APIClient { + register(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + login(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + forgotPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + resetPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + setDiscordConnectionData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + setStripeConnectionData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/api/forgot_password_rpc.d.ts b/javascript/api/forgot_password_rpc.d.ts index 826ff33..ade3275 100644 --- a/javascript/api/forgot_password_rpc.d.ts +++ b/javascript/api/forgot_password_rpc.d.ts @@ -1,31 +1,19 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/forgot_password_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.ForgotPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface ForgotPasswordRequest { - /** - * @generated from protobuf field: string email_address_or_username = 1; - */ emailAddressOrUsername: string; } -declare class ForgotPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForgotPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForgotPasswordRequest): ForgotPasswordRequest; - internalBinaryWrite(message: ForgotPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ForgotPasswordRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.ForgotPasswordRequest - */ -export declare const ForgotPasswordRequest: ForgotPasswordRequest$Type; export {}; diff --git a/javascript/api/forgot_password_rpc.js b/javascript/api/forgot_password_rpc.js index 64b9c8b..163b29b 100644 --- a/javascript/api/forgot_password_rpc.js +++ b/javascript/api/forgot_password_rpc.js @@ -1,59 +1,69 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/forgot_password_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/forgot_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ForgotPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class ForgotPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.ForgotPasswordRequest", [ - { no: 1, name: "email_address_or_username", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.emailAddressOrUsername = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ForgotPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseForgotPasswordRequest() { + return { emailAddressOrUsername: "" }; +} +exports.ForgotPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.emailAddressOrUsername !== "") { + writer.uint32(10).string(message.emailAddressOrUsername); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string email_address_or_username */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.emailAddressOrUsername = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string email_address_or_username = 1; */ - if (message.emailAddressOrUsername !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.emailAddressOrUsername); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + emailAddressOrUsername: isSet(object.emailAddressOrUsername) + ? globalThis.String(object.emailAddressOrUsername) + : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.emailAddressOrUsername !== "") { + obj.emailAddressOrUsername = message.emailAddressOrUsername; + } + return obj; + }, + create(base) { + return exports.ForgotPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseForgotPasswordRequest(); + message.emailAddressOrUsername = object.emailAddressOrUsername ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.ForgotPasswordRequest - */ -exports.ForgotPasswordRequest = new ForgotPasswordRequest$Type(); diff --git a/javascript/api/forgot_password_rpc.ts b/javascript/api/forgot_password_rpc.ts new file mode 100644 index 0000000..791abb4 --- /dev/null +++ b/javascript/api/forgot_password_rpc.ts @@ -0,0 +1,97 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/forgot_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface ForgotPasswordRequest { + emailAddressOrUsername: string; +} + +function createBaseForgotPasswordRequest(): ForgotPasswordRequest { + return { emailAddressOrUsername: "" }; +} + +export const ForgotPasswordRequest: MessageFns = { + encode(message: ForgotPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.emailAddressOrUsername !== "") { + writer.uint32(10).string(message.emailAddressOrUsername); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ForgotPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.emailAddressOrUsername = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ForgotPasswordRequest { + return { + emailAddressOrUsername: isSet(object.emailAddressOrUsername) + ? globalThis.String(object.emailAddressOrUsername) + : "", + }; + }, + + toJSON(message: ForgotPasswordRequest): unknown { + const obj: any = {}; + if (message.emailAddressOrUsername !== "") { + obj.emailAddressOrUsername = message.emailAddressOrUsername; + } + return obj; + }, + + create(base?: DeepPartial): ForgotPasswordRequest { + return ForgotPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ForgotPasswordRequest { + const message = createBaseForgotPasswordRequest(); + message.emailAddressOrUsername = object.emailAddressOrUsername ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/get_user_data_rpc.d.ts b/javascript/api/get_user_data_rpc.d.ts index 65dc0de..1dcf31d 100644 --- a/javascript/api/get_user_data_rpc.d.ts +++ b/javascript/api/get_user_data_rpc.d.ts @@ -1,93 +1,36 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/get_user_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { UserConnections } from "./user_connections"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * @generated from protobuf message api.GetUserDataResponse - */ +import { UserConnections } from "./user_connections"; +export declare const protobufPackage = "api"; export interface GetUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: string creation_date = 2; - */ creationDate: string; - /** - * @generated from protobuf field: string updated_date = 3; - */ updatedDate: string; - /** - * @generated from protobuf field: uint32 pid = 4; - */ pid: number; - /** - * @generated from protobuf field: string username = 5; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 6; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 7; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: api.Mii mii = 8; - */ - mii?: Mii; - /** - * @generated from protobuf field: string birthday = 9; - */ + mii: Mii | undefined; birthday: string; - /** - * @generated from protobuf field: string gender = 10; - */ gender: string; - /** - * @generated from protobuf field: string country = 11; - */ country: string; - /** - * @generated from protobuf field: string timezone = 12; - */ timezone: string; - /** - * @generated from protobuf field: string language = 13; - */ language: string; - /** - * @generated from protobuf field: string email_address = 14; - */ emailAddress: string; - /** - * @generated from protobuf field: api.UserConnections connections = 15; - */ - connections?: UserConnections; - /** - * @generated from protobuf field: bool marketing_flag = 16; - */ + connections: UserConnections | undefined; marketingFlag: boolean; } -declare class GetUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataResponse): GetUserDataResponse; - internalBinaryWrite(message: GetUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.GetUserDataResponse - */ -export declare const GetUserDataResponse: GetUserDataResponse$Type; export {}; diff --git a/javascript/api/get_user_data_rpc.js b/javascript/api/get_user_data_rpc.js index 1ff501c..63a3b1a 100644 --- a/javascript/api/get_user_data_rpc.js +++ b/javascript/api/get_user_data_rpc.js @@ -1,179 +1,313 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/get_user_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/get_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserDataResponse = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const user_connections_1 = require("./user_connections"); +exports.GetUserDataResponse = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.GetUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "updated_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 9, name: "birthday", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "timezone", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 15, name: "connections", kind: "message", T: () => user_connections_1.UserConnections }, - { no: 16, name: "marketing_flag", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.creationDate = ""; - message.updatedDate = ""; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.birthday = ""; - message.gender = ""; - message.country = ""; - message.timezone = ""; - message.language = ""; - message.emailAddress = ""; - message.marketingFlag = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +const user_connections_1 = require("./user_connections"); +exports.protobufPackage = "api"; +function createBaseGetUserDataResponse() { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} +exports.GetUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + user_connections_1.UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* string creation_date */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.creationDate = reader.string(); - break; - case /* string updated_date */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.updatedDate = reader.string(); - break; - case /* uint32 pid */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 6: + continue; + } + case 6: { + if (tag !== 48) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* api.Mii mii */ 8: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string birthday */ 9: + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.birthday = reader.string(); - break; - case /* string gender */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.country = reader.string(); - break; - case /* string timezone */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.timezone = reader.string(); - break; - case /* string language */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 14: + continue; + } + case 14: { + if (tag !== 114) { + break; + } message.emailAddress = reader.string(); - break; - case /* api.UserConnections connections */ 15: - message.connections = user_connections_1.UserConnections.internalBinaryRead(reader, reader.uint32(), options, message.connections); - break; - case /* bool marketing_flag */ 16: + continue; + } + case 15: { + if (tag !== 122) { + break; + } + message.connections = user_connections_1.UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } message.marketingFlag = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* string creation_date = 2; */ - if (message.creationDate !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string updated_date = 3; */ - if (message.updatedDate !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.updatedDate); - /* uint32 pid = 4; */ - if (message.pid !== 0) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 5; */ - if (message.username !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 6; */ - if (message.accessLevel !== 0) - writer.tag(6, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 7; */ - if (message.serverAccessLevel !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* api.Mii mii = 8; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(8, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string birthday = 9; */ - if (message.birthday !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.birthday); - /* string gender = 10; */ - if (message.gender !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 11; */ - if (message.country !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.country); - /* string timezone = 12; */ - if (message.timezone !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.timezone); - /* string language = 13; */ - if (message.language !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 14; */ - if (message.emailAddress !== "") - writer.tag(14, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* api.UserConnections connections = 15; */ - if (message.connections) - user_connections_1.UserConnections.internalBinaryWrite(message.connections, writer.tag(15, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* bool marketing_flag = 16; */ - if (message.marketingFlag !== false) - writer.tag(16, runtime_1.WireType.Varint).bool(message.marketingFlag); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? user_connections_1.UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = user_connections_1.UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + create(base) { + return exports.GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? user_connections_1.UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.GetUserDataResponse - */ -exports.GetUserDataResponse = new GetUserDataResponse$Type(); diff --git a/javascript/api/get_user_data_rpc.ts b/javascript/api/get_user_data_rpc.ts new file mode 100644 index 0000000..4a9b683 --- /dev/null +++ b/javascript/api/get_user_data_rpc.ts @@ -0,0 +1,371 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/get_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { UserConnections } from "./user_connections"; + +export const protobufPackage = "api"; + +export interface GetUserDataResponse { + deleted: boolean; + creationDate: string; + updatedDate: string; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + birthday: string; + gender: string; + country: string; + timezone: string; + language: string; + emailAddress: string; + connections: UserConnections | undefined; + marketingFlag: boolean; +} + +function createBaseGetUserDataResponse(): GetUserDataResponse { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} + +export const GetUserDataResponse: MessageFns = { + encode(message: GetUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updatedDate = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.username = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.birthday = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.gender = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.country = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.timezone = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.language = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.connections = UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.marketingFlag = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + + toJSON(message: GetUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataResponse { + return GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataResponse { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/login_rpc.d.ts b/javascript/api/login_rpc.d.ts index e95c3d5..b8d8258 100644 --- a/javascript/api/login_rpc.d.ts +++ b/javascript/api/login_rpc.d.ts @@ -1,74 +1,29 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/login_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.LoginRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface LoginRequest { - /** - * @generated from protobuf field: string grant_type = 1; - */ grantType: string; - /** - * @generated from protobuf field: optional string username = 2; - */ - username?: string; - /** - * @generated from protobuf field: optional string password = 3; - */ - password?: string; - /** - * @generated from protobuf field: optional string refresh_token = 4; - */ - refreshToken?: string; + username?: string | undefined; + password?: string | undefined; + refreshToken?: string | undefined; } -/** - * @generated from protobuf message api.LoginResponse - */ export interface LoginResponse { - /** - * @generated from protobuf field: uint32 expires_in = 1; - */ expiresIn: number; - /** - * @generated from protobuf field: string token_type = 2; - */ tokenType: string; - /** - * @generated from protobuf field: string access_token = 3; - */ accessToken: string; - /** - * @generated from protobuf field: string refresh_token = 4; - */ refreshToken: string; } -declare class LoginRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LoginRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LoginRequest): LoginRequest; - internalBinaryWrite(message: LoginRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const LoginRequest: MessageFns; +export declare const LoginResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.LoginRequest - */ -export declare const LoginRequest: LoginRequest$Type; -declare class LoginResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LoginResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LoginResponse): LoginResponse; - internalBinaryWrite(message: LoginResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.LoginResponse - */ -export declare const LoginResponse: LoginResponse$Type; export {}; diff --git a/javascript/api/login_rpc.js b/javascript/api/login_rpc.js index 5552d05..50aa72f 100644 --- a/javascript/api/login_rpc.js +++ b/javascript/api/login_rpc.js @@ -1,151 +1,210 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/login_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/login_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.LoginResponse = exports.LoginRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class LoginRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.LoginRequest", [ - { no: 1, name: "grant_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "username", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "password", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "refresh_token", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.grantType = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.LoginResponse = exports.LoginRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseLoginRequest() { + return { grantType: "", username: undefined, password: undefined, refreshToken: undefined }; +} +exports.LoginRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.grantType !== "") { + writer.uint32(10).string(message.grantType); + } + if (message.username !== undefined) { + writer.uint32(18).string(message.username); + } + if (message.password !== undefined) { + writer.uint32(26).string(message.password); + } + if (message.refreshToken !== undefined) { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string grant_type */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.grantType = reader.string(); - break; - case /* optional string username */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.username = reader.string(); - break; - case /* optional string password */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.password = reader.string(); - break; - case /* optional string refresh_token */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.refreshToken = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string grant_type = 1; */ - if (message.grantType !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.grantType); - /* optional string username = 2; */ - if (message.username !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.username); - /* optional string password = 3; */ - if (message.password !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.password); - /* optional string refresh_token = 4; */ - if (message.refreshToken !== undefined) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.refreshToken); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.LoginRequest - */ -exports.LoginRequest = new LoginRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LoginResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.LoginResponse", [ - { no: 1, name: "expires_in", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "token_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "access_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "refresh_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.expiresIn = 0; - message.tokenType = ""; - message.accessToken = ""; - message.refreshToken = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + grantType: isSet(object.grantType) ? globalThis.String(object.grantType) : "", + username: isSet(object.username) ? globalThis.String(object.username) : undefined, + password: isSet(object.password) ? globalThis.String(object.password) : undefined, + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.grantType !== "") { + obj.grantType = message.grantType; + } + if (message.username !== undefined) { + obj.username = message.username; + } + if (message.password !== undefined) { + obj.password = message.password; + } + if (message.refreshToken !== undefined) { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + create(base) { + return exports.LoginRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseLoginRequest(); + message.grantType = object.grantType ?? ""; + message.username = object.username ?? undefined; + message.password = object.password ?? undefined; + message.refreshToken = object.refreshToken ?? undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseLoginResponse() { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} +exports.LoginResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 expires_in */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.expiresIn = reader.uint32(); - break; - case /* string token_type */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.tokenType = reader.string(); - break; - case /* string access_token */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.accessToken = reader.string(); - break; - case /* string refresh_token */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.refreshToken = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 expires_in = 1; */ - if (message.expiresIn !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.expiresIn); - /* string token_type = 2; */ - if (message.tokenType !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.tokenType); - /* string access_token = 3; */ - if (message.accessToken !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.accessToken); - /* string refresh_token = 4; */ - if (message.refreshToken !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.refreshToken); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + create(base) { + return exports.LoginResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseLoginResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.LoginResponse - */ -exports.LoginResponse = new LoginResponse$Type(); diff --git a/javascript/api/login_rpc.ts b/javascript/api/login_rpc.ts new file mode 100644 index 0000000..f206849 --- /dev/null +++ b/javascript/api/login_rpc.ts @@ -0,0 +1,261 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/login_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface LoginRequest { + grantType: string; + username?: string | undefined; + password?: string | undefined; + refreshToken?: string | undefined; +} + +export interface LoginResponse { + expiresIn: number; + tokenType: string; + accessToken: string; + refreshToken: string; +} + +function createBaseLoginRequest(): LoginRequest { + return { grantType: "", username: undefined, password: undefined, refreshToken: undefined }; +} + +export const LoginRequest: MessageFns = { + encode(message: LoginRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.grantType !== "") { + writer.uint32(10).string(message.grantType); + } + if (message.username !== undefined) { + writer.uint32(18).string(message.username); + } + if (message.password !== undefined) { + writer.uint32(26).string(message.password); + } + if (message.refreshToken !== undefined) { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): LoginRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.grantType = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.username = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.password = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.refreshToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): LoginRequest { + return { + grantType: isSet(object.grantType) ? globalThis.String(object.grantType) : "", + username: isSet(object.username) ? globalThis.String(object.username) : undefined, + password: isSet(object.password) ? globalThis.String(object.password) : undefined, + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : undefined, + }; + }, + + toJSON(message: LoginRequest): unknown { + const obj: any = {}; + if (message.grantType !== "") { + obj.grantType = message.grantType; + } + if (message.username !== undefined) { + obj.username = message.username; + } + if (message.password !== undefined) { + obj.password = message.password; + } + if (message.refreshToken !== undefined) { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + + create(base?: DeepPartial): LoginRequest { + return LoginRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LoginRequest { + const message = createBaseLoginRequest(); + message.grantType = object.grantType ?? ""; + message.username = object.username ?? undefined; + message.password = object.password ?? undefined; + message.refreshToken = object.refreshToken ?? undefined; + return message; + }, +}; + +function createBaseLoginResponse(): LoginResponse { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} + +export const LoginResponse: MessageFns = { + encode(message: LoginResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): LoginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.expiresIn = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tokenType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.accessToken = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.refreshToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): LoginResponse { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + + toJSON(message: LoginResponse): unknown { + const obj: any = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + + create(base?: DeepPartial): LoginResponse { + return LoginResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LoginResponse { + const message = createBaseLoginResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/mii.d.ts b/javascript/api/mii.d.ts index 93d8957..d76e27f 100644 --- a/javascript/api/mii.d.ts +++ b/javascript/api/mii.d.ts @@ -1,39 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/mii.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.Mii - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface Mii { - /** - * @generated from protobuf field: string name = 1; - */ name: string; - /** - * @generated from protobuf field: string data = 2; - */ data: string; - /** - * @generated from protobuf field: string url = 3; - */ url: string; } -declare class Mii$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Mii; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mii): Mii; - internalBinaryWrite(message: Mii, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Mii: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.Mii - */ -export declare const Mii: Mii$Type; export {}; diff --git a/javascript/api/mii.js b/javascript/api/mii.js index 7277cf3..bc871af 100644 --- a/javascript/api/mii.js +++ b/javascript/api/mii.js @@ -1,75 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/mii.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/mii.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mii = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Mii$Type extends runtime_4.MessageType { - constructor() { - super("api.Mii", [ - { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "data", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.name = ""; - message.data = ""; - message.url = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Mii = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseMii() { + return { name: "", data: "", url: "" }; +} +exports.Mii = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.name = reader.string(); - break; - case /* string data */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.data = reader.string(); - break; - case /* string url */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.url = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string name = 1; */ - if (message.name !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.name); - /* string data = 2; */ - if (message.data !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.data); - /* string url = 3; */ - if (message.url !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.url); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + create(base) { + return exports.Mii.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.Mii - */ -exports.Mii = new Mii$Type(); diff --git a/javascript/api/mii.ts b/javascript/api/mii.ts new file mode 100644 index 0000000..3c6dcd6 --- /dev/null +++ b/javascript/api/mii.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/mii.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface Mii { + name: string; + data: string; + url: string; +} + +function createBaseMii(): Mii { + return { name: "", data: "", url: "" }; +} + +export const Mii: MessageFns = { + encode(message: Mii, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Mii { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Mii { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: Mii): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): Mii { + return Mii.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Mii { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/register_rpc.d.ts b/javascript/api/register_rpc.d.ts index 01fab9a..d166c54 100644 --- a/javascript/api/register_rpc.d.ts +++ b/javascript/api/register_rpc.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/register_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.RegisterRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface RegisterRequest { - /** - * @generated from protobuf field: string email = 1; - */ email: string; - /** - * @generated from protobuf field: string username = 2; - */ username: string; - /** - * @generated from protobuf field: string mii_name = 3; - */ miiName: string; - /** - * @generated from protobuf field: string password = 4; - */ password: string; - /** - * @generated from protobuf field: string password_confirm = 5; - */ passwordConfirm: string; - /** - * @generated from protobuf field: optional string captcha_response = 6; - */ - captchaResponse?: string; + captchaResponse?: string | undefined; } -declare class RegisterRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterRequest): RegisterRequest; - internalBinaryWrite(message: RegisterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const RegisterRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.RegisterRequest - */ -export declare const RegisterRequest: RegisterRequest$Type; export {}; diff --git a/javascript/api/register_rpc.js b/javascript/api/register_rpc.js index d7c5dc0..4be81a8 100644 --- a/javascript/api/register_rpc.js +++ b/javascript/api/register_rpc.js @@ -1,98 +1,142 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/register_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/register_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.RegisterRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.RegisterRequest", [ - { no: 1, name: "email", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "mii_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password_confirm", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "captcha_response", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.email = ""; - message.username = ""; - message.miiName = ""; - message.password = ""; - message.passwordConfirm = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.RegisterRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseRegisterRequest() { + return { email: "", username: "", miiName: "", password: "", passwordConfirm: "", captchaResponse: undefined }; +} +exports.RegisterRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.email !== "") { + writer.uint32(10).string(message.email); + } + if (message.username !== "") { + writer.uint32(18).string(message.username); + } + if (message.miiName !== "") { + writer.uint32(26).string(message.miiName); + } + if (message.password !== "") { + writer.uint32(34).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(42).string(message.passwordConfirm); + } + if (message.captchaResponse !== undefined) { + writer.uint32(50).string(message.captchaResponse); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string email */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.email = reader.string(); - break; - case /* string username */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.username = reader.string(); - break; - case /* string mii_name */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.miiName = reader.string(); - break; - case /* string password */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.password = reader.string(); - break; - case /* string password_confirm */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.passwordConfirm = reader.string(); - break; - case /* optional string captcha_response */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.captchaResponse = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string email = 1; */ - if (message.email !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.email); - /* string username = 2; */ - if (message.username !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.username); - /* string mii_name = 3; */ - if (message.miiName !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.miiName); - /* string password = 4; */ - if (message.password !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.password); - /* string password_confirm = 5; */ - if (message.passwordConfirm !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.passwordConfirm); - /* optional string captcha_response = 6; */ - if (message.captchaResponse !== undefined) - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.captchaResponse); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + email: isSet(object.email) ? globalThis.String(object.email) : "", + username: isSet(object.username) ? globalThis.String(object.username) : "", + miiName: isSet(object.miiName) ? globalThis.String(object.miiName) : "", + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + captchaResponse: isSet(object.captchaResponse) ? globalThis.String(object.captchaResponse) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.email !== "") { + obj.email = message.email; + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.miiName !== "") { + obj.miiName = message.miiName; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.captchaResponse !== undefined) { + obj.captchaResponse = message.captchaResponse; + } + return obj; + }, + create(base) { + return exports.RegisterRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterRequest(); + message.email = object.email ?? ""; + message.username = object.username ?? ""; + message.miiName = object.miiName ?? ""; + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.captchaResponse = object.captchaResponse ?? undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.RegisterRequest - */ -exports.RegisterRequest = new RegisterRequest$Type(); diff --git a/javascript/api/register_rpc.ts b/javascript/api/register_rpc.ts new file mode 100644 index 0000000..1aa4fb0 --- /dev/null +++ b/javascript/api/register_rpc.ts @@ -0,0 +1,180 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/register_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface RegisterRequest { + email: string; + username: string; + miiName: string; + password: string; + passwordConfirm: string; + captchaResponse?: string | undefined; +} + +function createBaseRegisterRequest(): RegisterRequest { + return { email: "", username: "", miiName: "", password: "", passwordConfirm: "", captchaResponse: undefined }; +} + +export const RegisterRequest: MessageFns = { + encode(message: RegisterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.email !== "") { + writer.uint32(10).string(message.email); + } + if (message.username !== "") { + writer.uint32(18).string(message.username); + } + if (message.miiName !== "") { + writer.uint32(26).string(message.miiName); + } + if (message.password !== "") { + writer.uint32(34).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(42).string(message.passwordConfirm); + } + if (message.captchaResponse !== undefined) { + writer.uint32(50).string(message.captchaResponse); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.email = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.username = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.miiName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.password = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.passwordConfirm = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.captchaResponse = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterRequest { + return { + email: isSet(object.email) ? globalThis.String(object.email) : "", + username: isSet(object.username) ? globalThis.String(object.username) : "", + miiName: isSet(object.miiName) ? globalThis.String(object.miiName) : "", + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + captchaResponse: isSet(object.captchaResponse) ? globalThis.String(object.captchaResponse) : undefined, + }; + }, + + toJSON(message: RegisterRequest): unknown { + const obj: any = {}; + if (message.email !== "") { + obj.email = message.email; + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.miiName !== "") { + obj.miiName = message.miiName; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.captchaResponse !== undefined) { + obj.captchaResponse = message.captchaResponse; + } + return obj; + }, + + create(base?: DeepPartial): RegisterRequest { + return RegisterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterRequest { + const message = createBaseRegisterRequest(); + message.email = object.email ?? ""; + message.username = object.username ?? ""; + message.miiName = object.miiName ?? ""; + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.captchaResponse = object.captchaResponse ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/reset_password_rpc.d.ts b/javascript/api/reset_password_rpc.d.ts index 0e6653e..5b55fcf 100644 --- a/javascript/api/reset_password_rpc.d.ts +++ b/javascript/api/reset_password_rpc.d.ts @@ -1,39 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/reset_password_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.ResetPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface ResetPasswordRequest { - /** - * @generated from protobuf field: string password = 1; - */ password: string; - /** - * @generated from protobuf field: string password_confirm = 2; - */ passwordConfirm: string; - /** - * @generated from protobuf field: string token = 3; - */ token: string; } -declare class ResetPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ResetPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetPasswordRequest): ResetPasswordRequest; - internalBinaryWrite(message: ResetPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ResetPasswordRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.ResetPasswordRequest - */ -export declare const ResetPasswordRequest: ResetPasswordRequest$Type; export {}; diff --git a/javascript/api/reset_password_rpc.js b/javascript/api/reset_password_rpc.js index 797ced4..37840e5 100644 --- a/javascript/api/reset_password_rpc.js +++ b/javascript/api/reset_password_rpc.js @@ -1,75 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/reset_password_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/reset_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResetPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class ResetPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.ResetPasswordRequest", [ - { no: 1, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "password_confirm", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.password = ""; - message.passwordConfirm = ""; - message.token = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ResetPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseResetPasswordRequest() { + return { password: "", passwordConfirm: "", token: "" }; +} +exports.ResetPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(18).string(message.passwordConfirm); + } + if (message.token !== "") { + writer.uint32(26).string(message.token); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string password */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.password = reader.string(); - break; - case /* string password_confirm */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.passwordConfirm = reader.string(); - break; - case /* string token */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.token = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string password = 1; */ - if (message.password !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.password); - /* string password_confirm = 2; */ - if (message.passwordConfirm !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.passwordConfirm); - /* string token = 3; */ - if (message.token !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.token); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + token: isSet(object.token) ? globalThis.String(object.token) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + create(base) { + return exports.ResetPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseResetPasswordRequest(); + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.token = object.token ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.ResetPasswordRequest - */ -exports.ResetPasswordRequest = new ResetPasswordRequest$Type(); diff --git a/javascript/api/reset_password_rpc.ts b/javascript/api/reset_password_rpc.ts new file mode 100644 index 0000000..db2314d --- /dev/null +++ b/javascript/api/reset_password_rpc.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/reset_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface ResetPasswordRequest { + password: string; + passwordConfirm: string; + token: string; +} + +function createBaseResetPasswordRequest(): ResetPasswordRequest { + return { password: "", passwordConfirm: "", token: "" }; +} + +export const ResetPasswordRequest: MessageFns = { + encode(message: ResetPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(18).string(message.passwordConfirm); + } + if (message.token !== "") { + writer.uint32(26).string(message.token); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ResetPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.password = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.passwordConfirm = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResetPasswordRequest { + return { + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + token: isSet(object.token) ? globalThis.String(object.token) : "", + }; + }, + + toJSON(message: ResetPasswordRequest): unknown { + const obj: any = {}; + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + + create(base?: DeepPartial): ResetPasswordRequest { + return ResetPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ResetPasswordRequest { + const message = createBaseResetPasswordRequest(); + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.token = object.token ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/set_discord_connection_data_rpc.d.ts b/javascript/api/set_discord_connection_data_rpc.d.ts index a8ec87c..93c5d5d 100644 --- a/javascript/api/set_discord_connection_data_rpc.d.ts +++ b/javascript/api/set_discord_connection_data_rpc.d.ts @@ -1,31 +1,19 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/set_discord_connection_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.SetDiscordConnectionDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface SetDiscordConnectionDataRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; } -declare class SetDiscordConnectionDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetDiscordConnectionDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetDiscordConnectionDataRequest): SetDiscordConnectionDataRequest; - internalBinaryWrite(message: SetDiscordConnectionDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SetDiscordConnectionDataRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.SetDiscordConnectionDataRequest - */ -export declare const SetDiscordConnectionDataRequest: SetDiscordConnectionDataRequest$Type; export {}; diff --git a/javascript/api/set_discord_connection_data_rpc.js b/javascript/api/set_discord_connection_data_rpc.js index 32a7188..1b47f7d 100644 --- a/javascript/api/set_discord_connection_data_rpc.js +++ b/javascript/api/set_discord_connection_data_rpc.js @@ -1,59 +1,65 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/set_discord_connection_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/set_discord_connection_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SetDiscordConnectionDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SetDiscordConnectionDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.SetDiscordConnectionDataRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SetDiscordConnectionDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseSetDiscordConnectionDataRequest() { + return { id: "" }; +} +exports.SetDiscordConnectionDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return exports.SetDiscordConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSetDiscordConnectionDataRequest(); + message.id = object.id ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.SetDiscordConnectionDataRequest - */ -exports.SetDiscordConnectionDataRequest = new SetDiscordConnectionDataRequest$Type(); diff --git a/javascript/api/set_discord_connection_data_rpc.ts b/javascript/api/set_discord_connection_data_rpc.ts new file mode 100644 index 0000000..8f80846 --- /dev/null +++ b/javascript/api/set_discord_connection_data_rpc.ts @@ -0,0 +1,93 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/set_discord_connection_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface SetDiscordConnectionDataRequest { + id: string; +} + +function createBaseSetDiscordConnectionDataRequest(): SetDiscordConnectionDataRequest { + return { id: "" }; +} + +export const SetDiscordConnectionDataRequest: MessageFns = { + encode(message: SetDiscordConnectionDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetDiscordConnectionDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SetDiscordConnectionDataRequest { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + + toJSON(message: SetDiscordConnectionDataRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): SetDiscordConnectionDataRequest { + return SetDiscordConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SetDiscordConnectionDataRequest { + const message = createBaseSetDiscordConnectionDataRequest(); + message.id = object.id ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/set_stripe_connection_data_rpc.d.ts b/javascript/api/set_stripe_connection_data_rpc.d.ts index 10099cd..903e1af 100644 --- a/javascript/api/set_stripe_connection_data_rpc.d.ts +++ b/javascript/api/set_stripe_connection_data_rpc.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/set_stripe_connection_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.SetStripeConnectionDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface SetStripeConnectionDataRequest { - /** - * @generated from protobuf field: optional string customer_id = 1; - */ - customerId?: string; - /** - * @generated from protobuf field: optional string subscription_id = 2; - */ - subscriptionId?: string; - /** - * @generated from protobuf field: optional string price_id = 3; - */ - priceId?: string; - /** - * @generated from protobuf field: optional uint32 tier_level = 4; - */ - tierLevel?: number; - /** - * @generated from protobuf field: optional string tier_name = 5; - */ - tierName?: string; - /** - * @generated from protobuf field: uint64 timestamp = 6; - */ + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; timestamp: bigint; } -declare class SetStripeConnectionDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetStripeConnectionDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetStripeConnectionDataRequest): SetStripeConnectionDataRequest; - internalBinaryWrite(message: SetStripeConnectionDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SetStripeConnectionDataRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.SetStripeConnectionDataRequest - */ -export declare const SetStripeConnectionDataRequest: SetStripeConnectionDataRequest$Type; export {}; diff --git a/javascript/api/set_stripe_connection_data_rpc.js b/javascript/api/set_stripe_connection_data_rpc.js index 1f22975..0524807 100644 --- a/javascript/api/set_stripe_connection_data_rpc.js +++ b/javascript/api/set_stripe_connection_data_rpc.js @@ -1,94 +1,152 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/set_stripe_connection_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/set_stripe_connection_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SetStripeConnectionDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SetStripeConnectionDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.SetStripeConnectionDataRequest", [ - { no: 1, name: "customer_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "subscription_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "price_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "tier_level", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "tier_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.timestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SetStripeConnectionDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseSetStripeConnectionDataRequest() { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + timestamp: 0n, + }; +} +exports.SetStripeConnectionDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.timestamp !== 0n) { + if (BigInt.asUintN(64, message.timestamp) !== message.timestamp) { + throw new globalThis.Error("value provided for field message.timestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.timestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string customer_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.customerId = reader.string(); - break; - case /* optional string subscription_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.subscriptionId = reader.string(); - break; - case /* optional string price_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.priceId = reader.string(); - break; - case /* optional uint32 tier_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.tierLevel = reader.uint32(); - break; - case /* optional string tier_name */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tierName = reader.string(); - break; - case /* uint64 timestamp */ 6: - message.timestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.timestamp = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* optional string customer_id = 1; */ - if (message.customerId !== undefined) - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId); - /* optional string subscription_id = 2; */ - if (message.subscriptionId !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.subscriptionId); - /* optional string price_id = 3; */ - if (message.priceId !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.priceId); - /* optional uint32 tier_level = 4; */ - if (message.tierLevel !== undefined) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.tierLevel); - /* optional string tier_name = 5; */ - if (message.tierName !== undefined) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* uint64 timestamp = 6; */ - if (message.timestamp !== 0n) - writer.tag(6, runtime_1.WireType.Varint).uint64(message.timestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.timestamp !== 0n) { + obj.timestamp = message.timestamp.toString(); + } + return obj; + }, + create(base) { + return exports.SetStripeConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSetStripeConnectionDataRequest(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.timestamp = object.timestamp ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.SetStripeConnectionDataRequest - */ -exports.SetStripeConnectionDataRequest = new SetStripeConnectionDataRequest$Type(); diff --git a/javascript/api/set_stripe_connection_data_rpc.ts b/javascript/api/set_stripe_connection_data_rpc.ts new file mode 100644 index 0000000..cbc8fb3 --- /dev/null +++ b/javascript/api/set_stripe_connection_data_rpc.ts @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/set_stripe_connection_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface SetStripeConnectionDataRequest { + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; + timestamp: bigint; +} + +function createBaseSetStripeConnectionDataRequest(): SetStripeConnectionDataRequest { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + timestamp: 0n, + }; +} + +export const SetStripeConnectionDataRequest: MessageFns = { + encode(message: SetStripeConnectionDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.timestamp !== 0n) { + if (BigInt.asUintN(64, message.timestamp) !== message.timestamp) { + throw new globalThis.Error("value provided for field message.timestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.timestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetStripeConnectionDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.customerId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.subscriptionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.priceId = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.tierLevel = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.timestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SetStripeConnectionDataRequest { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n, + }; + }, + + toJSON(message: SetStripeConnectionDataRequest): unknown { + const obj: any = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.timestamp !== 0n) { + obj.timestamp = message.timestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SetStripeConnectionDataRequest { + return SetStripeConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SetStripeConnectionDataRequest { + const message = createBaseSetStripeConnectionDataRequest(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.timestamp = object.timestamp ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/update_user_data_rpc.d.ts b/javascript/api/update_user_data_rpc.d.ts index 4ce5ad5..de0e1c6 100644 --- a/javascript/api/update_user_data_rpc.d.ts +++ b/javascript/api/update_user_data_rpc.d.ts @@ -1,29 +1,19 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/update_user_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * TODO - Not implemented yet, stubbed - * - * @generated from protobuf message api.UpdateUserDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; +/** TODO - Not implemented yet, stubbed */ export interface UpdateUserDataRequest { } -declare class UpdateUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateUserDataRequest): UpdateUserDataRequest; - internalBinaryWrite(message: UpdateUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateUserDataRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.UpdateUserDataRequest - */ -export declare const UpdateUserDataRequest: UpdateUserDataRequest$Type; export {}; diff --git a/javascript/api/update_user_data_rpc.js b/javascript/api/update_user_data_rpc.js index 0adf751..886f55b 100644 --- a/javascript/api/update_user_data_rpc.js +++ b/javascript/api/update_user_data_rpc.js @@ -1,36 +1,48 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/update_user_data_rpc.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/update_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateUserDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateUserDataRequest$Type extends runtime_3.MessageType { - constructor() { - super("api.UpdateUserDataRequest", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_2.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } +exports.UpdateUserDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseUpdateUserDataRequest() { + return {}; } -/** - * @generated MessageType for protobuf message api.UpdateUserDataRequest - */ -exports.UpdateUserDataRequest = new UpdateUserDataRequest$Type(); +exports.UpdateUserDataRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.UpdateUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseUpdateUserDataRequest(); + return message; + }, +}; diff --git a/javascript/api/update_user_data_rpc.ts b/javascript/api/update_user_data_rpc.ts new file mode 100644 index 0000000..fca0862 --- /dev/null +++ b/javascript/api/update_user_data_rpc.ts @@ -0,0 +1,74 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/update_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +/** TODO - Not implemented yet, stubbed */ +export interface UpdateUserDataRequest { +} + +function createBaseUpdateUserDataRequest(): UpdateUserDataRequest { + return {}; +} + +export const UpdateUserDataRequest: MessageFns = { + encode(_: UpdateUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): UpdateUserDataRequest { + return {}; + }, + + toJSON(_: UpdateUserDataRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): UpdateUserDataRequest { + return UpdateUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): UpdateUserDataRequest { + const message = createBaseUpdateUserDataRequest(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/user_connections.d.ts b/javascript/api/user_connections.d.ts index 0738c7b..2c0e0df 100644 --- a/javascript/api/user_connections.d.ts +++ b/javascript/api/user_connections.d.ts @@ -1,93 +1,33 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/user_connections.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.DiscordConnection - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api"; export interface DiscordConnection { - /** - * @generated from protobuf field: string id = 1; - */ id: string; } -/** - * @generated from protobuf message api.StripeConnection - */ export interface StripeConnection { - /** - * @generated from protobuf field: optional string customer_id = 1; - */ - customerId?: string; - /** - * @generated from protobuf field: optional string subscription_id = 2; - */ - subscriptionId?: string; - /** - * @generated from protobuf field: optional string price_id = 3; - */ - priceId?: string; - /** - * @generated from protobuf field: optional uint32 tier_level = 4; - */ - tierLevel?: number; - /** - * @generated from protobuf field: optional string tier_name = 5; - */ - tierName?: string; - /** - * @generated from protobuf field: uint64 latest_webhook_timestamp = 6; - */ + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; latestWebhookTimestamp: bigint; } -/** - * @generated from protobuf message api.UserConnections - */ export interface UserConnections { - /** - * @generated from protobuf field: api.DiscordConnection discord = 1; - */ - discord?: DiscordConnection; - /** - * @generated from protobuf field: api.StripeConnection stripe = 2; - */ - stripe?: StripeConnection; + discord: DiscordConnection | undefined; + stripe: StripeConnection | undefined; } -declare class DiscordConnection$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DiscordConnection; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiscordConnection): DiscordConnection; - internalBinaryWrite(message: DiscordConnection, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DiscordConnection: MessageFns; +export declare const StripeConnection: MessageFns; +export declare const UserConnections: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.DiscordConnection - */ -export declare const DiscordConnection: DiscordConnection$Type; -declare class StripeConnection$Type extends MessageType { - constructor(); - create(value?: PartialMessage): StripeConnection; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StripeConnection): StripeConnection; - internalBinaryWrite(message: StripeConnection, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.StripeConnection - */ -export declare const StripeConnection: StripeConnection$Type; -declare class UserConnections$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UserConnections; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserConnections): UserConnections; - internalBinaryWrite(message: UserConnections, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.UserConnections - */ -export declare const UserConnections: UserConnections$Type; export {}; diff --git a/javascript/api/user_connections.js b/javascript/api/user_connections.js index 14e4889..80c3150 100644 --- a/javascript/api/user_connections.js +++ b/javascript/api/user_connections.js @@ -1,194 +1,275 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/user_connections.proto" (package "api", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/user_connections.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserConnections = exports.StripeConnection = exports.DiscordConnection = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DiscordConnection$Type extends runtime_4.MessageType { - constructor() { - super("api.DiscordConnection", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UserConnections = exports.StripeConnection = exports.DiscordConnection = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api"; +function createBaseDiscordConnection() { + return { id: "" }; +} +exports.DiscordConnection = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDiscordConnection(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.DiscordConnection - */ -exports.DiscordConnection = new DiscordConnection$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StripeConnection$Type extends runtime_4.MessageType { - constructor() { - super("api.StripeConnection", [ - { no: 1, name: "customer_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "subscription_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "price_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "tier_level", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "tier_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "latest_webhook_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.latestWebhookTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return exports.DiscordConnection.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDiscordConnection(); + message.id = object.id ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseStripeConnection() { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + latestWebhookTimestamp: 0n, + }; +} +exports.StripeConnection = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.latestWebhookTimestamp !== 0n) { + if (BigInt.asUintN(64, message.latestWebhookTimestamp) !== message.latestWebhookTimestamp) { + throw new globalThis.Error("value provided for field message.latestWebhookTimestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.latestWebhookTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStripeConnection(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string customer_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.customerId = reader.string(); - break; - case /* optional string subscription_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.subscriptionId = reader.string(); - break; - case /* optional string price_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.priceId = reader.string(); - break; - case /* optional uint32 tier_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.tierLevel = reader.uint32(); - break; - case /* optional string tier_name */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tierName = reader.string(); - break; - case /* uint64 latest_webhook_timestamp */ 6: - message.latestWebhookTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.latestWebhookTimestamp = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* optional string customer_id = 1; */ - if (message.customerId !== undefined) - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId); - /* optional string subscription_id = 2; */ - if (message.subscriptionId !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.subscriptionId); - /* optional string price_id = 3; */ - if (message.priceId !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.priceId); - /* optional uint32 tier_level = 4; */ - if (message.tierLevel !== undefined) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.tierLevel); - /* optional string tier_name = 5; */ - if (message.tierName !== undefined) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* uint64 latest_webhook_timestamp = 6; */ - if (message.latestWebhookTimestamp !== 0n) - writer.tag(6, runtime_1.WireType.Varint).uint64(message.latestWebhookTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.StripeConnection - */ -exports.StripeConnection = new StripeConnection$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UserConnections$Type extends runtime_4.MessageType { - constructor() { - super("api.UserConnections", [ - { no: 1, name: "discord", kind: "message", T: () => exports.DiscordConnection }, - { no: 2, name: "stripe", kind: "message", T: () => exports.StripeConnection } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + latestWebhookTimestamp: isSet(object.latestWebhookTimestamp) ? BigInt(object.latestWebhookTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.latestWebhookTimestamp !== 0n) { + obj.latestWebhookTimestamp = message.latestWebhookTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.StripeConnection.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseStripeConnection(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.latestWebhookTimestamp = object.latestWebhookTimestamp ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUserConnections() { + return { discord: undefined, stripe: undefined }; +} +exports.UserConnections = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.discord !== undefined) { + exports.DiscordConnection.encode(message.discord, writer.uint32(10).fork()).join(); + } + if (message.stripe !== undefined) { + exports.StripeConnection.encode(message.stripe, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserConnections(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* api.DiscordConnection discord */ 1: - message.discord = exports.DiscordConnection.internalBinaryRead(reader, reader.uint32(), options, message.discord); - break; - case /* api.StripeConnection stripe */ 2: - message.stripe = exports.StripeConnection.internalBinaryRead(reader, reader.uint32(), options, message.stripe); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.discord = exports.DiscordConnection.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.stripe = exports.StripeConnection.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* api.DiscordConnection discord = 1; */ - if (message.discord) - exports.DiscordConnection.internalBinaryWrite(message.discord, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* api.StripeConnection stripe = 2; */ - if (message.stripe) - exports.StripeConnection.internalBinaryWrite(message.stripe, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + discord: isSet(object.discord) ? exports.DiscordConnection.fromJSON(object.discord) : undefined, + stripe: isSet(object.stripe) ? exports.StripeConnection.fromJSON(object.stripe) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.discord !== undefined) { + obj.discord = exports.DiscordConnection.toJSON(message.discord); + } + if (message.stripe !== undefined) { + obj.stripe = exports.StripeConnection.toJSON(message.stripe); + } + return obj; + }, + create(base) { + return exports.UserConnections.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUserConnections(); + message.discord = (object.discord !== undefined && object.discord !== null) + ? exports.DiscordConnection.fromPartial(object.discord) + : undefined; + message.stripe = (object.stripe !== undefined && object.stripe !== null) + ? exports.StripeConnection.fromPartial(object.stripe) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.UserConnections - */ -exports.UserConnections = new UserConnections$Type(); diff --git a/javascript/api/user_connections.ts b/javascript/api/user_connections.ts new file mode 100644 index 0000000..b73586e --- /dev/null +++ b/javascript/api/user_connections.ts @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/user_connections.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api"; + +export interface DiscordConnection { + id: string; +} + +export interface StripeConnection { + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; + latestWebhookTimestamp: bigint; +} + +export interface UserConnections { + discord: DiscordConnection | undefined; + stripe: StripeConnection | undefined; +} + +function createBaseDiscordConnection(): DiscordConnection { + return { id: "" }; +} + +export const DiscordConnection: MessageFns = { + encode(message: DiscordConnection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DiscordConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDiscordConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DiscordConnection { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + + toJSON(message: DiscordConnection): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): DiscordConnection { + return DiscordConnection.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DiscordConnection { + const message = createBaseDiscordConnection(); + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseStripeConnection(): StripeConnection { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + latestWebhookTimestamp: 0n, + }; +} + +export const StripeConnection: MessageFns = { + encode(message: StripeConnection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.latestWebhookTimestamp !== 0n) { + if (BigInt.asUintN(64, message.latestWebhookTimestamp) !== message.latestWebhookTimestamp) { + throw new globalThis.Error("value provided for field message.latestWebhookTimestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.latestWebhookTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StripeConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStripeConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.customerId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.subscriptionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.priceId = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.tierLevel = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.latestWebhookTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StripeConnection { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + latestWebhookTimestamp: isSet(object.latestWebhookTimestamp) ? BigInt(object.latestWebhookTimestamp) : 0n, + }; + }, + + toJSON(message: StripeConnection): unknown { + const obj: any = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.latestWebhookTimestamp !== 0n) { + obj.latestWebhookTimestamp = message.latestWebhookTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): StripeConnection { + return StripeConnection.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StripeConnection { + const message = createBaseStripeConnection(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.latestWebhookTimestamp = object.latestWebhookTimestamp ?? 0n; + return message; + }, +}; + +function createBaseUserConnections(): UserConnections { + return { discord: undefined, stripe: undefined }; +} + +export const UserConnections: MessageFns = { + encode(message: UserConnections, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.discord !== undefined) { + DiscordConnection.encode(message.discord, writer.uint32(10).fork()).join(); + } + if (message.stripe !== undefined) { + StripeConnection.encode(message.stripe, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UserConnections { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserConnections(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.discord = DiscordConnection.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.stripe = StripeConnection.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UserConnections { + return { + discord: isSet(object.discord) ? DiscordConnection.fromJSON(object.discord) : undefined, + stripe: isSet(object.stripe) ? StripeConnection.fromJSON(object.stripe) : undefined, + }; + }, + + toJSON(message: UserConnections): unknown { + const obj: any = {}; + if (message.discord !== undefined) { + obj.discord = DiscordConnection.toJSON(message.discord); + } + if (message.stripe !== undefined) { + obj.stripe = StripeConnection.toJSON(message.stripe); + } + return obj; + }, + + create(base?: DeepPartial): UserConnections { + return UserConnections.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UserConnections { + const message = createBaseUserConnections(); + message.discord = (object.discord !== undefined && object.discord !== null) + ? DiscordConnection.fromPartial(object.discord) + : undefined; + message.stripe = (object.stripe !== undefined && object.stripe !== null) + ? StripeConnection.fromPartial(object.stripe) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/api_service.client.d.ts b/javascript/api/v2/api_service.client.d.ts deleted file mode 100644 index 5e00c50..0000000 --- a/javascript/api/v2/api_service.client.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/api_service.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { SetStripeConnectionDataResponse } from "./set_stripe_connection_data_rpc"; -import type { SetStripeConnectionDataRequest } from "./set_stripe_connection_data_rpc"; -import type { SetDiscordConnectionDataResponse } from "./set_discord_connection_data_rpc"; -import type { SetDiscordConnectionDataRequest } from "./set_discord_connection_data_rpc"; -import type { ResetPasswordResponse } from "./reset_password_rpc"; -import type { ResetPasswordRequest } from "./reset_password_rpc"; -import type { ForgotPasswordResponse } from "./forgot_password_rpc"; -import type { ForgotPasswordRequest } from "./forgot_password_rpc"; -import type { UpdateUserDataResponse } from "./update_user_data_rpc"; -import type { UpdateUserDataRequest } from "./update_user_data_rpc"; -import type { GetUserDataResponse } from "./get_user_data_rpc"; -import type { GetUserDataRequest } from "./get_user_data_rpc"; -import type { LoginResponse } from "./login_rpc"; -import type { LoginRequest } from "./login_rpc"; -import type { RegisterResponse } from "./register_rpc"; -import type { RegisterRequest } from "./register_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service api.v2.ApiService - */ -export interface IApiServiceClient { - /** - * @generated from protobuf rpc: Register(api.v2.RegisterRequest) returns (api.v2.RegisterResponse); - */ - register(input: RegisterRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: Login(api.v2.LoginRequest) returns (api.v2.LoginResponse); - */ - login(input: LoginRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserData(api.v2.GetUserDataRequest) returns (api.v2.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateUserData(api.v2.UpdateUserDataRequest) returns (api.v2.UpdateUserDataResponse); - */ - updateUserData(input: UpdateUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ForgotPassword(api.v2.ForgotPasswordRequest) returns (api.v2.ForgotPasswordResponse); - */ - forgotPassword(input: ForgotPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ResetPassword(api.v2.ResetPasswordRequest) returns (api.v2.ResetPasswordResponse); - */ - resetPassword(input: ResetPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.v2.SetDiscordConnectionDataRequest) returns (api.v2.SetDiscordConnectionDataResponse); - */ - setDiscordConnectionData(input: SetDiscordConnectionDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.v2.SetStripeConnectionDataRequest) returns (api.v2.SetStripeConnectionDataResponse); - */ - setStripeConnectionData(input: SetStripeConnectionDataRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service api.v2.ApiService - */ -export declare class ApiServiceClient implements IApiServiceClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: Register(api.v2.RegisterRequest) returns (api.v2.RegisterResponse); - */ - register(input: RegisterRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: Login(api.v2.LoginRequest) returns (api.v2.LoginResponse); - */ - login(input: LoginRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserData(api.v2.GetUserDataRequest) returns (api.v2.GetUserDataResponse); - */ - getUserData(input: GetUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateUserData(api.v2.UpdateUserDataRequest) returns (api.v2.UpdateUserDataResponse); - */ - updateUserData(input: UpdateUserDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ForgotPassword(api.v2.ForgotPasswordRequest) returns (api.v2.ForgotPasswordResponse); - */ - forgotPassword(input: ForgotPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ResetPassword(api.v2.ResetPasswordRequest) returns (api.v2.ResetPasswordResponse); - */ - resetPassword(input: ResetPasswordRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.v2.SetDiscordConnectionDataRequest) returns (api.v2.SetDiscordConnectionDataResponse); - */ - setDiscordConnectionData(input: SetDiscordConnectionDataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.v2.SetStripeConnectionDataRequest) returns (api.v2.SetStripeConnectionDataResponse); - */ - setStripeConnectionData(input: SetStripeConnectionDataRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/api/v2/api_service.client.js b/javascript/api/v2/api_service.client.js deleted file mode 100644 index 099ba49..0000000 --- a/javascript/api/v2/api_service.client.js +++ /dev/null @@ -1,78 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/api_service.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ApiServiceClient = void 0; -const api_service_1 = require("./api_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service api.v2.ApiService - */ -class ApiServiceClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = api_service_1.ApiService.typeName; - this.methods = api_service_1.ApiService.methods; - this.options = api_service_1.ApiService.options; - } - /** - * @generated from protobuf rpc: Register(api.v2.RegisterRequest) returns (api.v2.RegisterResponse); - */ - register(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: Login(api.v2.LoginRequest) returns (api.v2.LoginResponse); - */ - login(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserData(api.v2.GetUserDataRequest) returns (api.v2.GetUserDataResponse); - */ - getUserData(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateUserData(api.v2.UpdateUserDataRequest) returns (api.v2.UpdateUserDataResponse); - */ - updateUserData(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ForgotPassword(api.v2.ForgotPasswordRequest) returns (api.v2.ForgotPasswordResponse); - */ - forgotPassword(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ResetPassword(api.v2.ResetPasswordRequest) returns (api.v2.ResetPasswordResponse); - */ - resetPassword(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SetDiscordConnectionData(api.v2.SetDiscordConnectionDataRequest) returns (api.v2.SetDiscordConnectionDataResponse); - */ - setDiscordConnectionData(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SetStripeConnectionData(api.v2.SetStripeConnectionDataRequest) returns (api.v2.SetStripeConnectionDataResponse); - */ - setStripeConnectionData(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.ApiServiceClient = ApiServiceClient; diff --git a/javascript/api/v2/api_service.d.ts b/javascript/api/v2/api_service.d.ts index 7ca2244..4d8daaa 100644 --- a/javascript/api/v2/api_service.d.ts +++ b/javascript/api/v2/api_service.d.ts @@ -1,9 +1,106 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/api_service.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service api.v2.ApiService - */ -export declare const ApiService: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { ForgotPasswordRequest, ForgotPasswordResponse } from "./forgot_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { LoginRequest, LoginResponse } from "./login_rpc"; +import { RegisterRequest, RegisterResponse } from "./register_rpc"; +import { ResetPasswordRequest, ResetPasswordResponse } from "./reset_password_rpc"; +import { SetDiscordConnectionDataRequest, SetDiscordConnectionDataResponse } from "./set_discord_connection_data_rpc"; +import { SetStripeConnectionDataRequest, SetStripeConnectionDataResponse } from "./set_stripe_connection_data_rpc"; +import { UpdateUserDataRequest, UpdateUserDataResponse } from "./update_user_data_rpc"; +export declare const protobufPackage = "api.v2"; +export type ApiServiceDefinition = typeof ApiServiceDefinition; +export declare const ApiServiceDefinition: { + readonly name: "ApiService"; + readonly fullName: "api.v2.ApiService"; + readonly methods: { + readonly register: { + readonly name: "Register"; + readonly requestType: import("./register_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./register_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly login: { + readonly name: "Login"; + readonly requestType: import("./login_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./login_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserData: { + readonly name: "GetUserData"; + readonly requestType: import("./get_user_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateUserData: { + readonly name: "UpdateUserData"; + readonly requestType: import("./update_user_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./update_user_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly forgotPassword: { + readonly name: "ForgotPassword"; + readonly requestType: import("./forgot_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./forgot_password_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly resetPassword: { + readonly name: "ResetPassword"; + readonly requestType: import("./reset_password_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./reset_password_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly setDiscordConnectionData: { + readonly name: "SetDiscordConnectionData"; + readonly requestType: import("./set_discord_connection_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./set_discord_connection_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly setStripeConnectionData: { + readonly name: "SetStripeConnectionData"; + readonly requestType: import("./set_stripe_connection_data_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./set_stripe_connection_data_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface ApiServiceImplementation { + register(request: RegisterRequest, context: CallContext & CallContextExt): Promise>; + login(request: LoginRequest, context: CallContext & CallContextExt): Promise>; + getUserData(request: GetUserDataRequest, context: CallContext & CallContextExt): Promise>; + updateUserData(request: UpdateUserDataRequest, context: CallContext & CallContextExt): Promise>; + forgotPassword(request: ForgotPasswordRequest, context: CallContext & CallContextExt): Promise>; + resetPassword(request: ResetPasswordRequest, context: CallContext & CallContextExt): Promise>; + setDiscordConnectionData(request: SetDiscordConnectionDataRequest, context: CallContext & CallContextExt): Promise>; + setStripeConnectionData(request: SetStripeConnectionDataRequest, context: CallContext & CallContextExt): Promise>; +} +export interface ApiServiceClient { + register(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + login(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateUserData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + forgotPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + resetPassword(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + setDiscordConnectionData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + setStripeConnectionData(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/api/v2/api_service.js b/javascript/api/v2/api_service.js index 4ab9a02..a126c29 100644 --- a/javascript/api/v2/api_service.js +++ b/javascript/api/v2/api_service.js @@ -1,43 +1,87 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/api_service.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/api_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ApiService = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/api_service.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -const set_stripe_connection_data_rpc_1 = require("./set_stripe_connection_data_rpc"); -const set_stripe_connection_data_rpc_2 = require("./set_stripe_connection_data_rpc"); -const set_discord_connection_data_rpc_1 = require("./set_discord_connection_data_rpc"); -const set_discord_connection_data_rpc_2 = require("./set_discord_connection_data_rpc"); -const reset_password_rpc_1 = require("./reset_password_rpc"); -const reset_password_rpc_2 = require("./reset_password_rpc"); +exports.ApiServiceDefinition = exports.protobufPackage = void 0; const forgot_password_rpc_1 = require("./forgot_password_rpc"); -const forgot_password_rpc_2 = require("./forgot_password_rpc"); -const update_user_data_rpc_1 = require("./update_user_data_rpc"); -const update_user_data_rpc_2 = require("./update_user_data_rpc"); const get_user_data_rpc_1 = require("./get_user_data_rpc"); -const get_user_data_rpc_2 = require("./get_user_data_rpc"); const login_rpc_1 = require("./login_rpc"); -const login_rpc_2 = require("./login_rpc"); const register_rpc_1 = require("./register_rpc"); -const register_rpc_2 = require("./register_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service api.v2.ApiService - */ -exports.ApiService = new runtime_rpc_1.ServiceType("api.v2.ApiService", [ - { name: "Register", options: {}, I: register_rpc_2.RegisterRequest, O: register_rpc_1.RegisterResponse }, - { name: "Login", options: {}, I: login_rpc_2.LoginRequest, O: login_rpc_1.LoginResponse }, - { name: "GetUserData", options: {}, I: get_user_data_rpc_2.GetUserDataRequest, O: get_user_data_rpc_1.GetUserDataResponse }, - { name: "UpdateUserData", options: {}, I: update_user_data_rpc_2.UpdateUserDataRequest, O: update_user_data_rpc_1.UpdateUserDataResponse }, - { name: "ForgotPassword", options: {}, I: forgot_password_rpc_2.ForgotPasswordRequest, O: forgot_password_rpc_1.ForgotPasswordResponse }, - { name: "ResetPassword", options: {}, I: reset_password_rpc_2.ResetPasswordRequest, O: reset_password_rpc_1.ResetPasswordResponse }, - { name: "SetDiscordConnectionData", options: {}, I: set_discord_connection_data_rpc_2.SetDiscordConnectionDataRequest, O: set_discord_connection_data_rpc_1.SetDiscordConnectionDataResponse }, - { name: "SetStripeConnectionData", options: {}, I: set_stripe_connection_data_rpc_2.SetStripeConnectionDataRequest, O: set_stripe_connection_data_rpc_1.SetStripeConnectionDataResponse } -]); +const reset_password_rpc_1 = require("./reset_password_rpc"); +const set_discord_connection_data_rpc_1 = require("./set_discord_connection_data_rpc"); +const set_stripe_connection_data_rpc_1 = require("./set_stripe_connection_data_rpc"); +const update_user_data_rpc_1 = require("./update_user_data_rpc"); +exports.protobufPackage = "api.v2"; +exports.ApiServiceDefinition = { + name: "ApiService", + fullName: "api.v2.ApiService", + methods: { + register: { + name: "Register", + requestType: register_rpc_1.RegisterRequest, + requestStream: false, + responseType: register_rpc_1.RegisterResponse, + responseStream: false, + options: {}, + }, + login: { + name: "Login", + requestType: login_rpc_1.LoginRequest, + requestStream: false, + responseType: login_rpc_1.LoginResponse, + responseStream: false, + options: {}, + }, + getUserData: { + name: "GetUserData", + requestType: get_user_data_rpc_1.GetUserDataRequest, + requestStream: false, + responseType: get_user_data_rpc_1.GetUserDataResponse, + responseStream: false, + options: {}, + }, + updateUserData: { + name: "UpdateUserData", + requestType: update_user_data_rpc_1.UpdateUserDataRequest, + requestStream: false, + responseType: update_user_data_rpc_1.UpdateUserDataResponse, + responseStream: false, + options: {}, + }, + forgotPassword: { + name: "ForgotPassword", + requestType: forgot_password_rpc_1.ForgotPasswordRequest, + requestStream: false, + responseType: forgot_password_rpc_1.ForgotPasswordResponse, + responseStream: false, + options: {}, + }, + resetPassword: { + name: "ResetPassword", + requestType: reset_password_rpc_1.ResetPasswordRequest, + requestStream: false, + responseType: reset_password_rpc_1.ResetPasswordResponse, + responseStream: false, + options: {}, + }, + setDiscordConnectionData: { + name: "SetDiscordConnectionData", + requestType: set_discord_connection_data_rpc_1.SetDiscordConnectionDataRequest, + requestStream: false, + responseType: set_discord_connection_data_rpc_1.SetDiscordConnectionDataResponse, + responseStream: false, + options: {}, + }, + setStripeConnectionData: { + name: "SetStripeConnectionData", + requestType: set_stripe_connection_data_rpc_1.SetStripeConnectionDataRequest, + requestStream: false, + responseType: set_stripe_connection_data_rpc_1.SetStripeConnectionDataResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/api/v2/api_service.ts b/javascript/api/v2/api_service.ts new file mode 100644 index 0000000..ba9a06e --- /dev/null +++ b/javascript/api/v2/api_service.ts @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/api_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { ForgotPasswordRequest, ForgotPasswordResponse } from "./forgot_password_rpc"; +import { GetUserDataRequest, GetUserDataResponse } from "./get_user_data_rpc"; +import { LoginRequest, LoginResponse } from "./login_rpc"; +import { RegisterRequest, RegisterResponse } from "./register_rpc"; +import { ResetPasswordRequest, ResetPasswordResponse } from "./reset_password_rpc"; +import { SetDiscordConnectionDataRequest, SetDiscordConnectionDataResponse } from "./set_discord_connection_data_rpc"; +import { SetStripeConnectionDataRequest, SetStripeConnectionDataResponse } from "./set_stripe_connection_data_rpc"; +import { UpdateUserDataRequest, UpdateUserDataResponse } from "./update_user_data_rpc"; + +export const protobufPackage = "api.v2"; + +export type ApiServiceDefinition = typeof ApiServiceDefinition; +export const ApiServiceDefinition = { + name: "ApiService", + fullName: "api.v2.ApiService", + methods: { + register: { + name: "Register", + requestType: RegisterRequest, + requestStream: false, + responseType: RegisterResponse, + responseStream: false, + options: {}, + }, + login: { + name: "Login", + requestType: LoginRequest, + requestStream: false, + responseType: LoginResponse, + responseStream: false, + options: {}, + }, + getUserData: { + name: "GetUserData", + requestType: GetUserDataRequest, + requestStream: false, + responseType: GetUserDataResponse, + responseStream: false, + options: {}, + }, + updateUserData: { + name: "UpdateUserData", + requestType: UpdateUserDataRequest, + requestStream: false, + responseType: UpdateUserDataResponse, + responseStream: false, + options: {}, + }, + forgotPassword: { + name: "ForgotPassword", + requestType: ForgotPasswordRequest, + requestStream: false, + responseType: ForgotPasswordResponse, + responseStream: false, + options: {}, + }, + resetPassword: { + name: "ResetPassword", + requestType: ResetPasswordRequest, + requestStream: false, + responseType: ResetPasswordResponse, + responseStream: false, + options: {}, + }, + setDiscordConnectionData: { + name: "SetDiscordConnectionData", + requestType: SetDiscordConnectionDataRequest, + requestStream: false, + responseType: SetDiscordConnectionDataResponse, + responseStream: false, + options: {}, + }, + setStripeConnectionData: { + name: "SetStripeConnectionData", + requestType: SetStripeConnectionDataRequest, + requestStream: false, + responseType: SetStripeConnectionDataResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface ApiServiceImplementation { + register(request: RegisterRequest, context: CallContext & CallContextExt): Promise>; + login(request: LoginRequest, context: CallContext & CallContextExt): Promise>; + getUserData( + request: GetUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + updateUserData( + request: UpdateUserDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + forgotPassword( + request: ForgotPasswordRequest, + context: CallContext & CallContextExt, + ): Promise>; + resetPassword( + request: ResetPasswordRequest, + context: CallContext & CallContextExt, + ): Promise>; + setDiscordConnectionData( + request: SetDiscordConnectionDataRequest, + context: CallContext & CallContextExt, + ): Promise>; + setStripeConnectionData( + request: SetStripeConnectionDataRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface ApiServiceClient { + register(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + login(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updateUserData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + forgotPassword( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + resetPassword( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + setDiscordConnectionData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + setStripeConnectionData( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/api/v2/forgot_password_rpc.d.ts b/javascript/api/v2/forgot_password_rpc.d.ts index 178bd49..6ee675a 100644 --- a/javascript/api/v2/forgot_password_rpc.d.ts +++ b/javascript/api/v2/forgot_password_rpc.d.ts @@ -1,46 +1,22 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/forgot_password_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.ForgotPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface ForgotPasswordRequest { - /** - * @generated from protobuf field: string email_address_or_username = 1; - */ emailAddressOrUsername: string; } -/** - * @generated from protobuf message api.v2.ForgotPasswordResponse - */ export interface ForgotPasswordResponse { } -declare class ForgotPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForgotPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForgotPasswordRequest): ForgotPasswordRequest; - internalBinaryWrite(message: ForgotPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ForgotPasswordRequest: MessageFns; +export declare const ForgotPasswordResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.ForgotPasswordRequest - */ -export declare const ForgotPasswordRequest: ForgotPasswordRequest$Type; -declare class ForgotPasswordResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ForgotPasswordResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ForgotPasswordResponse): ForgotPasswordResponse; - internalBinaryWrite(message: ForgotPasswordResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.ForgotPasswordResponse - */ -export declare const ForgotPasswordResponse: ForgotPasswordResponse$Type; export {}; diff --git a/javascript/api/v2/forgot_password_rpc.js b/javascript/api/v2/forgot_password_rpc.js index f60bbf5..cca73e4 100644 --- a/javascript/api/v2/forgot_password_rpc.js +++ b/javascript/api/v2/forgot_password_rpc.js @@ -1,84 +1,106 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/forgot_password_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/forgot_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ForgotPasswordResponse = exports.ForgotPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class ForgotPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.ForgotPasswordRequest", [ - { no: 1, name: "email_address_or_username", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.emailAddressOrUsername = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ForgotPasswordResponse = exports.ForgotPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseForgotPasswordRequest() { + return { emailAddressOrUsername: "" }; +} +exports.ForgotPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.emailAddressOrUsername !== "") { + writer.uint32(10).string(message.emailAddressOrUsername); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string email_address_or_username */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.emailAddressOrUsername = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string email_address_or_username = 1; */ - if (message.emailAddressOrUsername !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.emailAddressOrUsername); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.ForgotPasswordRequest - */ -exports.ForgotPasswordRequest = new ForgotPasswordRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ForgotPasswordResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.ForgotPasswordResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + emailAddressOrUsername: isSet(object.emailAddressOrUsername) + ? globalThis.String(object.emailAddressOrUsername) + : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.emailAddressOrUsername !== "") { + obj.emailAddressOrUsername = message.emailAddressOrUsername; + } + return obj; + }, + create(base) { + return exports.ForgotPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseForgotPasswordRequest(); + message.emailAddressOrUsername = object.emailAddressOrUsername ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseForgotPasswordResponse() { + return {}; +} +exports.ForgotPasswordResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.ForgotPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseForgotPasswordResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.ForgotPasswordResponse - */ -exports.ForgotPasswordResponse = new ForgotPasswordResponse$Type(); diff --git a/javascript/api/v2/forgot_password_rpc.ts b/javascript/api/v2/forgot_password_rpc.ts new file mode 100644 index 0000000..ec3b7ce --- /dev/null +++ b/javascript/api/v2/forgot_password_rpc.ts @@ -0,0 +1,143 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/forgot_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface ForgotPasswordRequest { + emailAddressOrUsername: string; +} + +export interface ForgotPasswordResponse { +} + +function createBaseForgotPasswordRequest(): ForgotPasswordRequest { + return { emailAddressOrUsername: "" }; +} + +export const ForgotPasswordRequest: MessageFns = { + encode(message: ForgotPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.emailAddressOrUsername !== "") { + writer.uint32(10).string(message.emailAddressOrUsername); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ForgotPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.emailAddressOrUsername = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ForgotPasswordRequest { + return { + emailAddressOrUsername: isSet(object.emailAddressOrUsername) + ? globalThis.String(object.emailAddressOrUsername) + : "", + }; + }, + + toJSON(message: ForgotPasswordRequest): unknown { + const obj: any = {}; + if (message.emailAddressOrUsername !== "") { + obj.emailAddressOrUsername = message.emailAddressOrUsername; + } + return obj; + }, + + create(base?: DeepPartial): ForgotPasswordRequest { + return ForgotPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ForgotPasswordRequest { + const message = createBaseForgotPasswordRequest(); + message.emailAddressOrUsername = object.emailAddressOrUsername ?? ""; + return message; + }, +}; + +function createBaseForgotPasswordResponse(): ForgotPasswordResponse { + return {}; +} + +export const ForgotPasswordResponse: MessageFns = { + encode(_: ForgotPasswordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ForgotPasswordResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseForgotPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ForgotPasswordResponse { + return {}; + }, + + toJSON(_: ForgotPasswordResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ForgotPasswordResponse { + return ForgotPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ForgotPasswordResponse { + const message = createBaseForgotPasswordResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/get_user_data_rpc.d.ts b/javascript/api/v2/get_user_data_rpc.d.ts index 8081763..5c96bb6 100644 --- a/javascript/api/v2/get_user_data_rpc.d.ts +++ b/javascript/api/v2/get_user_data_rpc.d.ts @@ -1,108 +1,39 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/get_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { UserConnections } from "./user_connections"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * @generated from protobuf message api.v2.GetUserDataRequest - */ +import { UserConnections } from "./user_connections"; +export declare const protobufPackage = "api.v2"; export interface GetUserDataRequest { } -/** - * @generated from protobuf message api.v2.GetUserDataResponse - */ export interface GetUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: string creation_date = 2; - */ creationDate: string; - /** - * @generated from protobuf field: string updated_date = 3; - */ updatedDate: string; - /** - * @generated from protobuf field: uint32 pid = 4; - */ pid: number; - /** - * @generated from protobuf field: string username = 5; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 6; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 7; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: api.v2.Mii mii = 8; - */ - mii?: Mii; - /** - * @generated from protobuf field: string birthday = 9; - */ + mii: Mii | undefined; birthday: string; - /** - * @generated from protobuf field: string gender = 10; - */ gender: string; - /** - * @generated from protobuf field: string country = 11; - */ country: string; - /** - * @generated from protobuf field: string timezone = 12; - */ timezone: string; - /** - * @generated from protobuf field: string language = 13; - */ language: string; - /** - * @generated from protobuf field: string email_address = 14; - */ emailAddress: string; - /** - * @generated from protobuf field: api.v2.UserConnections connections = 15; - */ - connections?: UserConnections; - /** - * @generated from protobuf field: bool marketing_flag = 16; - */ + connections: UserConnections | undefined; marketingFlag: boolean; } -declare class GetUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataRequest): GetUserDataRequest; - internalBinaryWrite(message: GetUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.GetUserDataRequest - */ -export declare const GetUserDataRequest: GetUserDataRequest$Type; -declare class GetUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserDataResponse): GetUserDataResponse; - internalBinaryWrite(message: GetUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserDataRequest: MessageFns; +export declare const GetUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.GetUserDataResponse - */ -export declare const GetUserDataResponse: GetUserDataResponse$Type; export {}; diff --git a/javascript/api/v2/get_user_data_rpc.js b/javascript/api/v2/get_user_data_rpc.js index 952ae46..086f1cf 100644 --- a/javascript/api/v2/get_user_data_rpc.js +++ b/javascript/api/v2/get_user_data_rpc.js @@ -1,209 +1,350 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/get_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/get_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserDataResponse = exports.GetUserDataRequest = void 0; +exports.GetUserDataResponse = exports.GetUserDataRequest = exports.protobufPackage = void 0; /* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/get_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const user_connections_1 = require("./user_connections"); +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.GetUserDataRequest", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } +const user_connections_1 = require("./user_connections"); +exports.protobufPackage = "api.v2"; +function createBaseGetUserDataRequest() { + return {}; } -/** - * @generated MessageType for protobuf message api.v2.GetUserDataRequest - */ -exports.GetUserDataRequest = new GetUserDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.GetUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "updated_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 9, name: "birthday", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "timezone", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 15, name: "connections", kind: "message", T: () => user_connections_1.UserConnections }, - { no: 16, name: "marketing_flag", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.creationDate = ""; - message.updatedDate = ""; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.birthday = ""; - message.gender = ""; - message.country = ""; - message.timezone = ""; - message.language = ""; - message.emailAddress = ""; - message.marketingFlag = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); +exports.GetUserDataRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseGetUserDataRequest(); return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserDataResponse() { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} +exports.GetUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + user_connections_1.UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* string creation_date */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.creationDate = reader.string(); - break; - case /* string updated_date */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.updatedDate = reader.string(); - break; - case /* uint32 pid */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 6: + continue; + } + case 6: { + if (tag !== 48) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* api.v2.Mii mii */ 8: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string birthday */ 9: + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.birthday = reader.string(); - break; - case /* string gender */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.country = reader.string(); - break; - case /* string timezone */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.timezone = reader.string(); - break; - case /* string language */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 14: + continue; + } + case 14: { + if (tag !== 114) { + break; + } message.emailAddress = reader.string(); - break; - case /* api.v2.UserConnections connections */ 15: - message.connections = user_connections_1.UserConnections.internalBinaryRead(reader, reader.uint32(), options, message.connections); - break; - case /* bool marketing_flag */ 16: + continue; + } + case 15: { + if (tag !== 122) { + break; + } + message.connections = user_connections_1.UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } message.marketingFlag = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* string creation_date = 2; */ - if (message.creationDate !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string updated_date = 3; */ - if (message.updatedDate !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.updatedDate); - /* uint32 pid = 4; */ - if (message.pid !== 0) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 5; */ - if (message.username !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 6; */ - if (message.accessLevel !== 0) - writer.tag(6, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 7; */ - if (message.serverAccessLevel !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* api.v2.Mii mii = 8; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(8, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string birthday = 9; */ - if (message.birthday !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.birthday); - /* string gender = 10; */ - if (message.gender !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 11; */ - if (message.country !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.country); - /* string timezone = 12; */ - if (message.timezone !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.timezone); - /* string language = 13; */ - if (message.language !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 14; */ - if (message.emailAddress !== "") - writer.tag(14, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* api.v2.UserConnections connections = 15; */ - if (message.connections) - user_connections_1.UserConnections.internalBinaryWrite(message.connections, writer.tag(15, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* bool marketing_flag = 16; */ - if (message.marketingFlag !== false) - writer.tag(16, runtime_1.WireType.Varint).bool(message.marketingFlag); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? user_connections_1.UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = user_connections_1.UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + create(base) { + return exports.GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? user_connections_1.UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.GetUserDataResponse - */ -exports.GetUserDataResponse = new GetUserDataResponse$Type(); diff --git a/javascript/api/v2/get_user_data_rpc.ts b/javascript/api/v2/get_user_data_rpc.ts new file mode 100644 index 0000000..9128042 --- /dev/null +++ b/javascript/api/v2/get_user_data_rpc.ts @@ -0,0 +1,417 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/get_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { UserConnections } from "./user_connections"; + +export const protobufPackage = "api.v2"; + +export interface GetUserDataRequest { +} + +export interface GetUserDataResponse { + deleted: boolean; + creationDate: string; + updatedDate: string; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + birthday: string; + gender: string; + country: string; + timezone: string; + language: string; + emailAddress: string; + connections: UserConnections | undefined; + marketingFlag: boolean; +} + +function createBaseGetUserDataRequest(): GetUserDataRequest { + return {}; +} + +export const GetUserDataRequest: MessageFns = { + encode(_: GetUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): GetUserDataRequest { + return {}; + }, + + toJSON(_: GetUserDataRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): GetUserDataRequest { + return GetUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): GetUserDataRequest { + const message = createBaseGetUserDataRequest(); + return message; + }, +}; + +function createBaseGetUserDataResponse(): GetUserDataResponse { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} + +export const GetUserDataResponse: MessageFns = { + encode(message: GetUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updatedDate = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.username = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.birthday = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.gender = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.country = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.timezone = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.language = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.connections = UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.marketingFlag = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + + toJSON(message: GetUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + + create(base?: DeepPartial): GetUserDataResponse { + return GetUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserDataResponse { + const message = createBaseGetUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/login_rpc.d.ts b/javascript/api/v2/login_rpc.d.ts index 6bc63eb..e28a51c 100644 --- a/javascript/api/v2/login_rpc.d.ts +++ b/javascript/api/v2/login_rpc.d.ts @@ -1,74 +1,29 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/login_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.LoginRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface LoginRequest { - /** - * @generated from protobuf field: string grant_type = 1; - */ grantType: string; - /** - * @generated from protobuf field: optional string username = 2; - */ - username?: string; - /** - * @generated from protobuf field: optional string password = 3; - */ - password?: string; - /** - * @generated from protobuf field: optional string refresh_token = 4; - */ - refreshToken?: string; + username?: string | undefined; + password?: string | undefined; + refreshToken?: string | undefined; } -/** - * @generated from protobuf message api.v2.LoginResponse - */ export interface LoginResponse { - /** - * @generated from protobuf field: uint32 expires_in = 1; - */ expiresIn: number; - /** - * @generated from protobuf field: string token_type = 2; - */ tokenType: string; - /** - * @generated from protobuf field: string access_token = 3; - */ accessToken: string; - /** - * @generated from protobuf field: string refresh_token = 4; - */ refreshToken: string; } -declare class LoginRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LoginRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LoginRequest): LoginRequest; - internalBinaryWrite(message: LoginRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const LoginRequest: MessageFns; +export declare const LoginResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.LoginRequest - */ -export declare const LoginRequest: LoginRequest$Type; -declare class LoginResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): LoginResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LoginResponse): LoginResponse; - internalBinaryWrite(message: LoginResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.LoginResponse - */ -export declare const LoginResponse: LoginResponse$Type; export {}; diff --git a/javascript/api/v2/login_rpc.js b/javascript/api/v2/login_rpc.js index a0080d4..db5c680 100644 --- a/javascript/api/v2/login_rpc.js +++ b/javascript/api/v2/login_rpc.js @@ -1,151 +1,210 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/login_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/login_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.LoginResponse = exports.LoginRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class LoginRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.LoginRequest", [ - { no: 1, name: "grant_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "username", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "password", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "refresh_token", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.grantType = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.LoginResponse = exports.LoginRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseLoginRequest() { + return { grantType: "", username: undefined, password: undefined, refreshToken: undefined }; +} +exports.LoginRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.grantType !== "") { + writer.uint32(10).string(message.grantType); + } + if (message.username !== undefined) { + writer.uint32(18).string(message.username); + } + if (message.password !== undefined) { + writer.uint32(26).string(message.password); + } + if (message.refreshToken !== undefined) { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string grant_type */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.grantType = reader.string(); - break; - case /* optional string username */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.username = reader.string(); - break; - case /* optional string password */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.password = reader.string(); - break; - case /* optional string refresh_token */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.refreshToken = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string grant_type = 1; */ - if (message.grantType !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.grantType); - /* optional string username = 2; */ - if (message.username !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.username); - /* optional string password = 3; */ - if (message.password !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.password); - /* optional string refresh_token = 4; */ - if (message.refreshToken !== undefined) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.refreshToken); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.LoginRequest - */ -exports.LoginRequest = new LoginRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class LoginResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.LoginResponse", [ - { no: 1, name: "expires_in", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "token_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "access_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "refresh_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.expiresIn = 0; - message.tokenType = ""; - message.accessToken = ""; - message.refreshToken = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + grantType: isSet(object.grantType) ? globalThis.String(object.grantType) : "", + username: isSet(object.username) ? globalThis.String(object.username) : undefined, + password: isSet(object.password) ? globalThis.String(object.password) : undefined, + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.grantType !== "") { + obj.grantType = message.grantType; + } + if (message.username !== undefined) { + obj.username = message.username; + } + if (message.password !== undefined) { + obj.password = message.password; + } + if (message.refreshToken !== undefined) { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + create(base) { + return exports.LoginRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseLoginRequest(); + message.grantType = object.grantType ?? ""; + message.username = object.username ?? undefined; + message.password = object.password ?? undefined; + message.refreshToken = object.refreshToken ?? undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseLoginResponse() { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} +exports.LoginResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 expires_in */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.expiresIn = reader.uint32(); - break; - case /* string token_type */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.tokenType = reader.string(); - break; - case /* string access_token */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.accessToken = reader.string(); - break; - case /* string refresh_token */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.refreshToken = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 expires_in = 1; */ - if (message.expiresIn !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.expiresIn); - /* string token_type = 2; */ - if (message.tokenType !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.tokenType); - /* string access_token = 3; */ - if (message.accessToken !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.accessToken); - /* string refresh_token = 4; */ - if (message.refreshToken !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.refreshToken); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + create(base) { + return exports.LoginResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseLoginResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.LoginResponse - */ -exports.LoginResponse = new LoginResponse$Type(); diff --git a/javascript/api/v2/login_rpc.ts b/javascript/api/v2/login_rpc.ts new file mode 100644 index 0000000..2729110 --- /dev/null +++ b/javascript/api/v2/login_rpc.ts @@ -0,0 +1,261 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/login_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface LoginRequest { + grantType: string; + username?: string | undefined; + password?: string | undefined; + refreshToken?: string | undefined; +} + +export interface LoginResponse { + expiresIn: number; + tokenType: string; + accessToken: string; + refreshToken: string; +} + +function createBaseLoginRequest(): LoginRequest { + return { grantType: "", username: undefined, password: undefined, refreshToken: undefined }; +} + +export const LoginRequest: MessageFns = { + encode(message: LoginRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.grantType !== "") { + writer.uint32(10).string(message.grantType); + } + if (message.username !== undefined) { + writer.uint32(18).string(message.username); + } + if (message.password !== undefined) { + writer.uint32(26).string(message.password); + } + if (message.refreshToken !== undefined) { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): LoginRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.grantType = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.username = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.password = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.refreshToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): LoginRequest { + return { + grantType: isSet(object.grantType) ? globalThis.String(object.grantType) : "", + username: isSet(object.username) ? globalThis.String(object.username) : undefined, + password: isSet(object.password) ? globalThis.String(object.password) : undefined, + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : undefined, + }; + }, + + toJSON(message: LoginRequest): unknown { + const obj: any = {}; + if (message.grantType !== "") { + obj.grantType = message.grantType; + } + if (message.username !== undefined) { + obj.username = message.username; + } + if (message.password !== undefined) { + obj.password = message.password; + } + if (message.refreshToken !== undefined) { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + + create(base?: DeepPartial): LoginRequest { + return LoginRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LoginRequest { + const message = createBaseLoginRequest(); + message.grantType = object.grantType ?? ""; + message.username = object.username ?? undefined; + message.password = object.password ?? undefined; + message.refreshToken = object.refreshToken ?? undefined; + return message; + }, +}; + +function createBaseLoginResponse(): LoginResponse { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} + +export const LoginResponse: MessageFns = { + encode(message: LoginResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): LoginResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLoginResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.expiresIn = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tokenType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.accessToken = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.refreshToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): LoginResponse { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + + toJSON(message: LoginResponse): unknown { + const obj: any = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + + create(base?: DeepPartial): LoginResponse { + return LoginResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): LoginResponse { + const message = createBaseLoginResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/mii.d.ts b/javascript/api/v2/mii.d.ts index 73121ce..db42e8c 100644 --- a/javascript/api/v2/mii.d.ts +++ b/javascript/api/v2/mii.d.ts @@ -1,39 +1,21 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/mii.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.Mii - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface Mii { - /** - * @generated from protobuf field: string name = 1; - */ name: string; - /** - * @generated from protobuf field: string data = 2; - */ data: string; - /** - * @generated from protobuf field: string url = 3; - */ url: string; } -declare class Mii$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Mii; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mii): Mii; - internalBinaryWrite(message: Mii, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Mii: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.Mii - */ -export declare const Mii: Mii$Type; export {}; diff --git a/javascript/api/v2/mii.js b/javascript/api/v2/mii.js index ff7f7d6..1f85551 100644 --- a/javascript/api/v2/mii.js +++ b/javascript/api/v2/mii.js @@ -1,75 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/mii.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/mii.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Mii = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Mii$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.Mii", [ - { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "data", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.name = ""; - message.data = ""; - message.url = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Mii = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseMii() { + return { name: "", data: "", url: "" }; +} +exports.Mii = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string name */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.name = reader.string(); - break; - case /* string data */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.data = reader.string(); - break; - case /* string url */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.url = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string name = 1; */ - if (message.name !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.name); - /* string data = 2; */ - if (message.data !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.data); - /* string url = 3; */ - if (message.url !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.url); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + create(base) { + return exports.Mii.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.Mii - */ -exports.Mii = new Mii$Type(); diff --git a/javascript/api/v2/mii.ts b/javascript/api/v2/mii.ts new file mode 100644 index 0000000..3390bc4 --- /dev/null +++ b/javascript/api/v2/mii.ts @@ -0,0 +1,129 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/mii.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface Mii { + name: string; + data: string; + url: string; +} + +function createBaseMii(): Mii { + return { name: "", data: "", url: "" }; +} + +export const Mii: MessageFns = { + encode(message: Mii, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.data !== "") { + writer.uint32(18).string(message.data); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Mii { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMii(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Mii { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + data: isSet(object.data) ? globalThis.String(object.data) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: Mii): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.data !== "") { + obj.data = message.data; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): Mii { + return Mii.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Mii { + const message = createBaseMii(); + message.name = object.name ?? ""; + message.data = object.data ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/register_rpc.d.ts b/javascript/api/v2/register_rpc.d.ts index 778214f..56dabc7 100644 --- a/javascript/api/v2/register_rpc.d.ts +++ b/javascript/api/v2/register_rpc.d.ts @@ -1,82 +1,31 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/register_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.RegisterRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface RegisterRequest { - /** - * @generated from protobuf field: string email = 1; - */ email: string; - /** - * @generated from protobuf field: string username = 2; - */ username: string; - /** - * @generated from protobuf field: string mii_name = 3; - */ miiName: string; - /** - * @generated from protobuf field: string password = 4; - */ password: string; - /** - * @generated from protobuf field: string password_confirm = 5; - */ passwordConfirm: string; - /** - * @generated from protobuf field: optional string captcha_response = 6; - */ - captchaResponse?: string; + captchaResponse?: string | undefined; } -/** - * @generated from protobuf message api.v2.RegisterResponse - */ export interface RegisterResponse { - /** - * @generated from protobuf field: uint32 expires_in = 1; - */ expiresIn: number; - /** - * @generated from protobuf field: string token_type = 2; - */ tokenType: string; - /** - * @generated from protobuf field: string access_token = 3; - */ accessToken: string; - /** - * @generated from protobuf field: string refresh_token = 4; - */ refreshToken: string; } -declare class RegisterRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterRequest): RegisterRequest; - internalBinaryWrite(message: RegisterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const RegisterRequest: MessageFns; +export declare const RegisterResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.RegisterRequest - */ -export declare const RegisterRequest: RegisterRequest$Type; -declare class RegisterResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterResponse): RegisterResponse; - internalBinaryWrite(message: RegisterResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.RegisterResponse - */ -export declare const RegisterResponse: RegisterResponse$Type; export {}; diff --git a/javascript/api/v2/register_rpc.js b/javascript/api/v2/register_rpc.js index 505efd0..d660955 100644 --- a/javascript/api/v2/register_rpc.js +++ b/javascript/api/v2/register_rpc.js @@ -1,169 +1,240 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/register_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/register_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.RegisterResponse = exports.RegisterRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.RegisterRequest", [ - { no: 1, name: "email", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "mii_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password_confirm", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "captcha_response", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.email = ""; - message.username = ""; - message.miiName = ""; - message.password = ""; - message.passwordConfirm = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.RegisterResponse = exports.RegisterRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseRegisterRequest() { + return { email: "", username: "", miiName: "", password: "", passwordConfirm: "", captchaResponse: undefined }; +} +exports.RegisterRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.email !== "") { + writer.uint32(10).string(message.email); + } + if (message.username !== "") { + writer.uint32(18).string(message.username); + } + if (message.miiName !== "") { + writer.uint32(26).string(message.miiName); + } + if (message.password !== "") { + writer.uint32(34).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(42).string(message.passwordConfirm); + } + if (message.captchaResponse !== undefined) { + writer.uint32(50).string(message.captchaResponse); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string email */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.email = reader.string(); - break; - case /* string username */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.username = reader.string(); - break; - case /* string mii_name */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.miiName = reader.string(); - break; - case /* string password */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.password = reader.string(); - break; - case /* string password_confirm */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.passwordConfirm = reader.string(); - break; - case /* optional string captcha_response */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.captchaResponse = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string email = 1; */ - if (message.email !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.email); - /* string username = 2; */ - if (message.username !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.username); - /* string mii_name = 3; */ - if (message.miiName !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.miiName); - /* string password = 4; */ - if (message.password !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.password); - /* string password_confirm = 5; */ - if (message.passwordConfirm !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.passwordConfirm); - /* optional string captcha_response = 6; */ - if (message.captchaResponse !== undefined) - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.captchaResponse); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.RegisterRequest - */ -exports.RegisterRequest = new RegisterRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.RegisterResponse", [ - { no: 1, name: "expires_in", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "token_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "access_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "refresh_token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.expiresIn = 0; - message.tokenType = ""; - message.accessToken = ""; - message.refreshToken = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + email: isSet(object.email) ? globalThis.String(object.email) : "", + username: isSet(object.username) ? globalThis.String(object.username) : "", + miiName: isSet(object.miiName) ? globalThis.String(object.miiName) : "", + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + captchaResponse: isSet(object.captchaResponse) ? globalThis.String(object.captchaResponse) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.email !== "") { + obj.email = message.email; + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.miiName !== "") { + obj.miiName = message.miiName; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.captchaResponse !== undefined) { + obj.captchaResponse = message.captchaResponse; + } + return obj; + }, + create(base) { + return exports.RegisterRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterRequest(); + message.email = object.email ?? ""; + message.username = object.username ?? ""; + message.miiName = object.miiName ?? ""; + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.captchaResponse = object.captchaResponse ?? undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseRegisterResponse() { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} +exports.RegisterResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 expires_in */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.expiresIn = reader.uint32(); - break; - case /* string token_type */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.tokenType = reader.string(); - break; - case /* string access_token */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.accessToken = reader.string(); - break; - case /* string refresh_token */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.refreshToken = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 expires_in = 1; */ - if (message.expiresIn !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.expiresIn); - /* string token_type = 2; */ - if (message.tokenType !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.tokenType); - /* string access_token = 3; */ - if (message.accessToken !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.accessToken); - /* string refresh_token = 4; */ - if (message.refreshToken !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.refreshToken); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + create(base) { + return exports.RegisterResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.RegisterResponse - */ -exports.RegisterResponse = new RegisterResponse$Type(); diff --git a/javascript/api/v2/register_rpc.ts b/javascript/api/v2/register_rpc.ts new file mode 100644 index 0000000..043b4e7 --- /dev/null +++ b/javascript/api/v2/register_rpc.ts @@ -0,0 +1,295 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/register_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface RegisterRequest { + email: string; + username: string; + miiName: string; + password: string; + passwordConfirm: string; + captchaResponse?: string | undefined; +} + +export interface RegisterResponse { + expiresIn: number; + tokenType: string; + accessToken: string; + refreshToken: string; +} + +function createBaseRegisterRequest(): RegisterRequest { + return { email: "", username: "", miiName: "", password: "", passwordConfirm: "", captchaResponse: undefined }; +} + +export const RegisterRequest: MessageFns = { + encode(message: RegisterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.email !== "") { + writer.uint32(10).string(message.email); + } + if (message.username !== "") { + writer.uint32(18).string(message.username); + } + if (message.miiName !== "") { + writer.uint32(26).string(message.miiName); + } + if (message.password !== "") { + writer.uint32(34).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(42).string(message.passwordConfirm); + } + if (message.captchaResponse !== undefined) { + writer.uint32(50).string(message.captchaResponse); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.email = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.username = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.miiName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.password = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.passwordConfirm = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.captchaResponse = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterRequest { + return { + email: isSet(object.email) ? globalThis.String(object.email) : "", + username: isSet(object.username) ? globalThis.String(object.username) : "", + miiName: isSet(object.miiName) ? globalThis.String(object.miiName) : "", + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + captchaResponse: isSet(object.captchaResponse) ? globalThis.String(object.captchaResponse) : undefined, + }; + }, + + toJSON(message: RegisterRequest): unknown { + const obj: any = {}; + if (message.email !== "") { + obj.email = message.email; + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.miiName !== "") { + obj.miiName = message.miiName; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.captchaResponse !== undefined) { + obj.captchaResponse = message.captchaResponse; + } + return obj; + }, + + create(base?: DeepPartial): RegisterRequest { + return RegisterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterRequest { + const message = createBaseRegisterRequest(); + message.email = object.email ?? ""; + message.username = object.username ?? ""; + message.miiName = object.miiName ?? ""; + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.captchaResponse = object.captchaResponse ?? undefined; + return message; + }, +}; + +function createBaseRegisterResponse(): RegisterResponse { + return { expiresIn: 0, tokenType: "", accessToken: "", refreshToken: "" }; +} + +export const RegisterResponse: MessageFns = { + encode(message: RegisterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.expiresIn !== 0) { + writer.uint32(8).uint32(message.expiresIn); + } + if (message.tokenType !== "") { + writer.uint32(18).string(message.tokenType); + } + if (message.accessToken !== "") { + writer.uint32(26).string(message.accessToken); + } + if (message.refreshToken !== "") { + writer.uint32(34).string(message.refreshToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.expiresIn = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tokenType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.accessToken = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.refreshToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterResponse { + return { + expiresIn: isSet(object.expiresIn) ? globalThis.Number(object.expiresIn) : 0, + tokenType: isSet(object.tokenType) ? globalThis.String(object.tokenType) : "", + accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : "", + refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : "", + }; + }, + + toJSON(message: RegisterResponse): unknown { + const obj: any = {}; + if (message.expiresIn !== 0) { + obj.expiresIn = Math.round(message.expiresIn); + } + if (message.tokenType !== "") { + obj.tokenType = message.tokenType; + } + if (message.accessToken !== "") { + obj.accessToken = message.accessToken; + } + if (message.refreshToken !== "") { + obj.refreshToken = message.refreshToken; + } + return obj; + }, + + create(base?: DeepPartial): RegisterResponse { + return RegisterResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterResponse { + const message = createBaseRegisterResponse(); + message.expiresIn = object.expiresIn ?? 0; + message.tokenType = object.tokenType ?? ""; + message.accessToken = object.accessToken ?? ""; + message.refreshToken = object.refreshToken ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/reset_password_rpc.d.ts b/javascript/api/v2/reset_password_rpc.d.ts index c647ac5..3e1430e 100644 --- a/javascript/api/v2/reset_password_rpc.d.ts +++ b/javascript/api/v2/reset_password_rpc.d.ts @@ -1,54 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/reset_password_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.ResetPasswordRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface ResetPasswordRequest { - /** - * @generated from protobuf field: string password = 1; - */ password: string; - /** - * @generated from protobuf field: string password_confirm = 2; - */ passwordConfirm: string; - /** - * @generated from protobuf field: string token = 3; - */ token: string; } -/** - * @generated from protobuf message api.v2.ResetPasswordResponse - */ export interface ResetPasswordResponse { } -declare class ResetPasswordRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ResetPasswordRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetPasswordRequest): ResetPasswordRequest; - internalBinaryWrite(message: ResetPasswordRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ResetPasswordRequest: MessageFns; +export declare const ResetPasswordResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.ResetPasswordRequest - */ -export declare const ResetPasswordRequest: ResetPasswordRequest$Type; -declare class ResetPasswordResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ResetPasswordResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResetPasswordResponse): ResetPasswordResponse; - internalBinaryWrite(message: ResetPasswordResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.ResetPasswordResponse - */ -export declare const ResetPasswordResponse: ResetPasswordResponse$Type; export {}; diff --git a/javascript/api/v2/reset_password_rpc.js b/javascript/api/v2/reset_password_rpc.js index c7f81aa..412d426 100644 --- a/javascript/api/v2/reset_password_rpc.js +++ b/javascript/api/v2/reset_password_rpc.js @@ -1,100 +1,134 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/reset_password_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/reset_password_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ResetPasswordResponse = exports.ResetPasswordRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class ResetPasswordRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.ResetPasswordRequest", [ - { no: 1, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "password_confirm", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "token", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.password = ""; - message.passwordConfirm = ""; - message.token = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ResetPasswordResponse = exports.ResetPasswordRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseResetPasswordRequest() { + return { password: "", passwordConfirm: "", token: "" }; +} +exports.ResetPasswordRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(18).string(message.passwordConfirm); + } + if (message.token !== "") { + writer.uint32(26).string(message.token); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string password */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.password = reader.string(); - break; - case /* string password_confirm */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.passwordConfirm = reader.string(); - break; - case /* string token */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.token = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string password = 1; */ - if (message.password !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.password); - /* string password_confirm = 2; */ - if (message.passwordConfirm !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.passwordConfirm); - /* string token = 3; */ - if (message.token !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.token); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.ResetPasswordRequest - */ -exports.ResetPasswordRequest = new ResetPasswordRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ResetPasswordResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.ResetPasswordResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + token: isSet(object.token) ? globalThis.String(object.token) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + create(base) { + return exports.ResetPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseResetPasswordRequest(); + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.token = object.token ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseResetPasswordResponse() { + return {}; +} +exports.ResetPasswordResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.ResetPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseResetPasswordResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.ResetPasswordResponse - */ -exports.ResetPasswordResponse = new ResetPasswordResponse$Type(); diff --git a/javascript/api/v2/reset_password_rpc.ts b/javascript/api/v2/reset_password_rpc.ts new file mode 100644 index 0000000..90224d8 --- /dev/null +++ b/javascript/api/v2/reset_password_rpc.ts @@ -0,0 +1,175 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/reset_password_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface ResetPasswordRequest { + password: string; + passwordConfirm: string; + token: string; +} + +export interface ResetPasswordResponse { +} + +function createBaseResetPasswordRequest(): ResetPasswordRequest { + return { password: "", passwordConfirm: "", token: "" }; +} + +export const ResetPasswordRequest: MessageFns = { + encode(message: ResetPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.password !== "") { + writer.uint32(10).string(message.password); + } + if (message.passwordConfirm !== "") { + writer.uint32(18).string(message.passwordConfirm); + } + if (message.token !== "") { + writer.uint32(26).string(message.token); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ResetPasswordRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.password = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.passwordConfirm = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.token = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ResetPasswordRequest { + return { + password: isSet(object.password) ? globalThis.String(object.password) : "", + passwordConfirm: isSet(object.passwordConfirm) ? globalThis.String(object.passwordConfirm) : "", + token: isSet(object.token) ? globalThis.String(object.token) : "", + }; + }, + + toJSON(message: ResetPasswordRequest): unknown { + const obj: any = {}; + if (message.password !== "") { + obj.password = message.password; + } + if (message.passwordConfirm !== "") { + obj.passwordConfirm = message.passwordConfirm; + } + if (message.token !== "") { + obj.token = message.token; + } + return obj; + }, + + create(base?: DeepPartial): ResetPasswordRequest { + return ResetPasswordRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ResetPasswordRequest { + const message = createBaseResetPasswordRequest(); + message.password = object.password ?? ""; + message.passwordConfirm = object.passwordConfirm ?? ""; + message.token = object.token ?? ""; + return message; + }, +}; + +function createBaseResetPasswordResponse(): ResetPasswordResponse { + return {}; +} + +export const ResetPasswordResponse: MessageFns = { + encode(_: ResetPasswordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ResetPasswordResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResetPasswordResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ResetPasswordResponse { + return {}; + }, + + toJSON(_: ResetPasswordResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ResetPasswordResponse { + return ResetPasswordResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ResetPasswordResponse { + const message = createBaseResetPasswordResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/set_discord_connection_data_rpc.d.ts b/javascript/api/v2/set_discord_connection_data_rpc.d.ts index ffc9803..680ce02 100644 --- a/javascript/api/v2/set_discord_connection_data_rpc.d.ts +++ b/javascript/api/v2/set_discord_connection_data_rpc.d.ts @@ -1,46 +1,22 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/set_discord_connection_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.SetDiscordConnectionDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface SetDiscordConnectionDataRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; } -/** - * @generated from protobuf message api.v2.SetDiscordConnectionDataResponse - */ export interface SetDiscordConnectionDataResponse { } -declare class SetDiscordConnectionDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetDiscordConnectionDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetDiscordConnectionDataRequest): SetDiscordConnectionDataRequest; - internalBinaryWrite(message: SetDiscordConnectionDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SetDiscordConnectionDataRequest: MessageFns; +export declare const SetDiscordConnectionDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.SetDiscordConnectionDataRequest - */ -export declare const SetDiscordConnectionDataRequest: SetDiscordConnectionDataRequest$Type; -declare class SetDiscordConnectionDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetDiscordConnectionDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetDiscordConnectionDataResponse): SetDiscordConnectionDataResponse; - internalBinaryWrite(message: SetDiscordConnectionDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.SetDiscordConnectionDataResponse - */ -export declare const SetDiscordConnectionDataResponse: SetDiscordConnectionDataResponse$Type; export {}; diff --git a/javascript/api/v2/set_discord_connection_data_rpc.js b/javascript/api/v2/set_discord_connection_data_rpc.js index ad523f8..b9544ee 100644 --- a/javascript/api/v2/set_discord_connection_data_rpc.js +++ b/javascript/api/v2/set_discord_connection_data_rpc.js @@ -1,84 +1,102 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/set_discord_connection_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/set_discord_connection_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SetDiscordConnectionDataResponse = exports.SetDiscordConnectionDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SetDiscordConnectionDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.SetDiscordConnectionDataRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SetDiscordConnectionDataResponse = exports.SetDiscordConnectionDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseSetDiscordConnectionDataRequest() { + return { id: "" }; +} +exports.SetDiscordConnectionDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.SetDiscordConnectionDataRequest - */ -exports.SetDiscordConnectionDataRequest = new SetDiscordConnectionDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetDiscordConnectionDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.SetDiscordConnectionDataResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return exports.SetDiscordConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSetDiscordConnectionDataRequest(); + message.id = object.id ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseSetDiscordConnectionDataResponse() { + return {}; +} +exports.SetDiscordConnectionDataResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.SetDiscordConnectionDataResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseSetDiscordConnectionDataResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.SetDiscordConnectionDataResponse - */ -exports.SetDiscordConnectionDataResponse = new SetDiscordConnectionDataResponse$Type(); diff --git a/javascript/api/v2/set_discord_connection_data_rpc.ts b/javascript/api/v2/set_discord_connection_data_rpc.ts new file mode 100644 index 0000000..f0ba8cc --- /dev/null +++ b/javascript/api/v2/set_discord_connection_data_rpc.ts @@ -0,0 +1,139 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/set_discord_connection_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface SetDiscordConnectionDataRequest { + id: string; +} + +export interface SetDiscordConnectionDataResponse { +} + +function createBaseSetDiscordConnectionDataRequest(): SetDiscordConnectionDataRequest { + return { id: "" }; +} + +export const SetDiscordConnectionDataRequest: MessageFns = { + encode(message: SetDiscordConnectionDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetDiscordConnectionDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SetDiscordConnectionDataRequest { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + + toJSON(message: SetDiscordConnectionDataRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): SetDiscordConnectionDataRequest { + return SetDiscordConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SetDiscordConnectionDataRequest { + const message = createBaseSetDiscordConnectionDataRequest(); + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseSetDiscordConnectionDataResponse(): SetDiscordConnectionDataResponse { + return {}; +} + +export const SetDiscordConnectionDataResponse: MessageFns = { + encode(_: SetDiscordConnectionDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetDiscordConnectionDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetDiscordConnectionDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): SetDiscordConnectionDataResponse { + return {}; + }, + + toJSON(_: SetDiscordConnectionDataResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): SetDiscordConnectionDataResponse { + return SetDiscordConnectionDataResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): SetDiscordConnectionDataResponse { + const message = createBaseSetDiscordConnectionDataResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/set_stripe_connection_data_rpc.d.ts b/javascript/api/v2/set_stripe_connection_data_rpc.d.ts index 4180519..5553131 100644 --- a/javascript/api/v2/set_stripe_connection_data_rpc.d.ts +++ b/javascript/api/v2/set_stripe_connection_data_rpc.d.ts @@ -1,66 +1,27 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/set_stripe_connection_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.SetStripeConnectionDataRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface SetStripeConnectionDataRequest { - /** - * @generated from protobuf field: optional string customer_id = 1; - */ - customerId?: string; - /** - * @generated from protobuf field: optional string subscription_id = 2; - */ - subscriptionId?: string; - /** - * @generated from protobuf field: optional string price_id = 3; - */ - priceId?: string; - /** - * @generated from protobuf field: optional uint32 tier_level = 4; - */ - tierLevel?: number; - /** - * @generated from protobuf field: optional string tier_name = 5; - */ - tierName?: string; - /** - * @generated from protobuf field: uint64 timestamp = 6; - */ + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; timestamp: bigint; } -/** - * @generated from protobuf message api.v2.SetStripeConnectionDataResponse - */ export interface SetStripeConnectionDataResponse { } -declare class SetStripeConnectionDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetStripeConnectionDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetStripeConnectionDataRequest): SetStripeConnectionDataRequest; - internalBinaryWrite(message: SetStripeConnectionDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SetStripeConnectionDataRequest: MessageFns; +export declare const SetStripeConnectionDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.SetStripeConnectionDataRequest - */ -export declare const SetStripeConnectionDataRequest: SetStripeConnectionDataRequest$Type; -declare class SetStripeConnectionDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SetStripeConnectionDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SetStripeConnectionDataResponse): SetStripeConnectionDataResponse; - internalBinaryWrite(message: SetStripeConnectionDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.SetStripeConnectionDataResponse - */ -export declare const SetStripeConnectionDataResponse: SetStripeConnectionDataResponse$Type; export {}; diff --git a/javascript/api/v2/set_stripe_connection_data_rpc.js b/javascript/api/v2/set_stripe_connection_data_rpc.js index 2f2f859..fd0e6c6 100644 --- a/javascript/api/v2/set_stripe_connection_data_rpc.js +++ b/javascript/api/v2/set_stripe_connection_data_rpc.js @@ -1,119 +1,189 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/set_stripe_connection_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/set_stripe_connection_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SetStripeConnectionDataResponse = exports.SetStripeConnectionDataRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SetStripeConnectionDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.SetStripeConnectionDataRequest", [ - { no: 1, name: "customer_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "subscription_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "price_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "tier_level", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "tier_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.timestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SetStripeConnectionDataResponse = exports.SetStripeConnectionDataRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseSetStripeConnectionDataRequest() { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + timestamp: 0n, + }; +} +exports.SetStripeConnectionDataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.timestamp !== 0n) { + if (BigInt.asUintN(64, message.timestamp) !== message.timestamp) { + throw new globalThis.Error("value provided for field message.timestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.timestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string customer_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.customerId = reader.string(); - break; - case /* optional string subscription_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.subscriptionId = reader.string(); - break; - case /* optional string price_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.priceId = reader.string(); - break; - case /* optional uint32 tier_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.tierLevel = reader.uint32(); - break; - case /* optional string tier_name */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tierName = reader.string(); - break; - case /* uint64 timestamp */ 6: - message.timestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.timestamp = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* optional string customer_id = 1; */ - if (message.customerId !== undefined) - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId); - /* optional string subscription_id = 2; */ - if (message.subscriptionId !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.subscriptionId); - /* optional string price_id = 3; */ - if (message.priceId !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.priceId); - /* optional uint32 tier_level = 4; */ - if (message.tierLevel !== undefined) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.tierLevel); - /* optional string tier_name = 5; */ - if (message.tierName !== undefined) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* uint64 timestamp = 6; */ - if (message.timestamp !== 0n) - writer.tag(6, runtime_1.WireType.Varint).uint64(message.timestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.SetStripeConnectionDataRequest - */ -exports.SetStripeConnectionDataRequest = new SetStripeConnectionDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SetStripeConnectionDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.SetStripeConnectionDataResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.timestamp !== 0n) { + obj.timestamp = message.timestamp.toString(); + } + return obj; + }, + create(base) { + return exports.SetStripeConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSetStripeConnectionDataRequest(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.timestamp = object.timestamp ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseSetStripeConnectionDataResponse() { + return {}; +} +exports.SetStripeConnectionDataResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.SetStripeConnectionDataResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseSetStripeConnectionDataResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.SetStripeConnectionDataResponse - */ -exports.SetStripeConnectionDataResponse = new SetStripeConnectionDataResponse$Type(); diff --git a/javascript/api/v2/set_stripe_connection_data_rpc.ts b/javascript/api/v2/set_stripe_connection_data_rpc.ts new file mode 100644 index 0000000..edb469f --- /dev/null +++ b/javascript/api/v2/set_stripe_connection_data_rpc.ts @@ -0,0 +1,236 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/set_stripe_connection_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface SetStripeConnectionDataRequest { + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; + timestamp: bigint; +} + +export interface SetStripeConnectionDataResponse { +} + +function createBaseSetStripeConnectionDataRequest(): SetStripeConnectionDataRequest { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + timestamp: 0n, + }; +} + +export const SetStripeConnectionDataRequest: MessageFns = { + encode(message: SetStripeConnectionDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.timestamp !== 0n) { + if (BigInt.asUintN(64, message.timestamp) !== message.timestamp) { + throw new globalThis.Error("value provided for field message.timestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.timestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetStripeConnectionDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.customerId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.subscriptionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.priceId = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.tierLevel = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.timestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SetStripeConnectionDataRequest { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + timestamp: isSet(object.timestamp) ? BigInt(object.timestamp) : 0n, + }; + }, + + toJSON(message: SetStripeConnectionDataRequest): unknown { + const obj: any = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.timestamp !== 0n) { + obj.timestamp = message.timestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SetStripeConnectionDataRequest { + return SetStripeConnectionDataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SetStripeConnectionDataRequest { + const message = createBaseSetStripeConnectionDataRequest(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.timestamp = object.timestamp ?? 0n; + return message; + }, +}; + +function createBaseSetStripeConnectionDataResponse(): SetStripeConnectionDataResponse { + return {}; +} + +export const SetStripeConnectionDataResponse: MessageFns = { + encode(_: SetStripeConnectionDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SetStripeConnectionDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSetStripeConnectionDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): SetStripeConnectionDataResponse { + return {}; + }, + + toJSON(_: SetStripeConnectionDataResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): SetStripeConnectionDataResponse { + return SetStripeConnectionDataResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): SetStripeConnectionDataResponse { + const message = createBaseSetStripeConnectionDataResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/update_user_data_rpc.d.ts b/javascript/api/v2/update_user_data_rpc.d.ts index 72e78a7..218c6be 100644 --- a/javascript/api/v2/update_user_data_rpc.d.ts +++ b/javascript/api/v2/update_user_data_rpc.d.ts @@ -1,110 +1,40 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/update_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -import { UserConnections } from "./user_connections"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Mii } from "./mii"; -/** - * TODO - Not implemented yet, stubbed - * - * @generated from protobuf message api.v2.UpdateUserDataRequest - */ +import { UserConnections } from "./user_connections"; +export declare const protobufPackage = "api.v2"; +/** TODO - Not implemented yet, stubbed */ export interface UpdateUserDataRequest { } -/** - * @generated from protobuf message api.v2.UpdateUserDataResponse - */ export interface UpdateUserDataResponse { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: string creation_date = 2; - */ creationDate: string; - /** - * @generated from protobuf field: string updated_date = 3; - */ updatedDate: string; - /** - * @generated from protobuf field: uint32 pid = 4; - */ pid: number; - /** - * @generated from protobuf field: string username = 5; - */ username: string; - /** - * @generated from protobuf field: int32 access_level = 6; - */ accessLevel: number; - /** - * @generated from protobuf field: string server_access_level = 7; - */ serverAccessLevel: string; - /** - * @generated from protobuf field: api.v2.Mii mii = 8; - */ - mii?: Mii; - /** - * @generated from protobuf field: string birthday = 9; - */ + mii: Mii | undefined; birthday: string; - /** - * @generated from protobuf field: string gender = 10; - */ gender: string; - /** - * @generated from protobuf field: string country = 11; - */ country: string; - /** - * @generated from protobuf field: string timezone = 12; - */ timezone: string; - /** - * @generated from protobuf field: string language = 13; - */ language: string; - /** - * @generated from protobuf field: string email_address = 14; - */ emailAddress: string; - /** - * @generated from protobuf field: api.v2.UserConnections connections = 15; - */ - connections?: UserConnections; - /** - * @generated from protobuf field: bool marketing_flag = 16; - */ + connections: UserConnections | undefined; marketingFlag: boolean; } -declare class UpdateUserDataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateUserDataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateUserDataRequest): UpdateUserDataRequest; - internalBinaryWrite(message: UpdateUserDataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.UpdateUserDataRequest - */ -export declare const UpdateUserDataRequest: UpdateUserDataRequest$Type; -declare class UpdateUserDataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateUserDataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateUserDataResponse): UpdateUserDataResponse; - internalBinaryWrite(message: UpdateUserDataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateUserDataRequest: MessageFns; +export declare const UpdateUserDataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.UpdateUserDataResponse - */ -export declare const UpdateUserDataResponse: UpdateUserDataResponse$Type; export {}; diff --git a/javascript/api/v2/update_user_data_rpc.js b/javascript/api/v2/update_user_data_rpc.js index d1a1647..8955150 100644 --- a/javascript/api/v2/update_user_data_rpc.js +++ b/javascript/api/v2/update_user_data_rpc.js @@ -1,209 +1,350 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/update_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/update_user_data_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateUserDataResponse = exports.UpdateUserDataRequest = void 0; +exports.UpdateUserDataResponse = exports.UpdateUserDataRequest = exports.protobufPackage = void 0; /* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/update_user_data_rpc.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -const user_connections_1 = require("./user_connections"); +const wire_1 = require("@bufbuild/protobuf/wire"); const mii_1 = require("./mii"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateUserDataRequest$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.UpdateUserDataRequest", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } +const user_connections_1 = require("./user_connections"); +exports.protobufPackage = "api.v2"; +function createBaseUpdateUserDataRequest() { + return {}; } -/** - * @generated MessageType for protobuf message api.v2.UpdateUserDataRequest - */ -exports.UpdateUserDataRequest = new UpdateUserDataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateUserDataResponse$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.UpdateUserDataResponse", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "creation_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "updated_date", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "username", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "access_level", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, - { no: 7, name: "server_access_level", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "mii", kind: "message", T: () => mii_1.Mii }, - { no: 9, name: "birthday", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "gender", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "timezone", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "language", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "email_address", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 15, name: "connections", kind: "message", T: () => user_connections_1.UserConnections }, - { no: 16, name: "marketing_flag", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.creationDate = ""; - message.updatedDate = ""; - message.pid = 0; - message.username = ""; - message.accessLevel = 0; - message.serverAccessLevel = ""; - message.birthday = ""; - message.gender = ""; - message.country = ""; - message.timezone = ""; - message.language = ""; - message.emailAddress = ""; - message.marketingFlag = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); +exports.UpdateUserDataRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.UpdateUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseUpdateUserDataRequest(); return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUpdateUserDataResponse() { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} +exports.UpdateUserDataResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + mii_1.Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + user_connections_1.UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* string creation_date */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.creationDate = reader.string(); - break; - case /* string updated_date */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.updatedDate = reader.string(); - break; - case /* uint32 pid */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.pid = reader.uint32(); - break; - case /* string username */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.username = reader.string(); - break; - case /* int32 access_level */ 6: + continue; + } + case 6: { + if (tag !== 48) { + break; + } message.accessLevel = reader.int32(); - break; - case /* string server_access_level */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.serverAccessLevel = reader.string(); - break; - case /* api.v2.Mii mii */ 8: - message.mii = mii_1.Mii.internalBinaryRead(reader, reader.uint32(), options, message.mii); - break; - case /* string birthday */ 9: + continue; + } + case 8: { + if (tag !== 66) { + break; + } + message.mii = mii_1.Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.birthday = reader.string(); - break; - case /* string gender */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.gender = reader.string(); - break; - case /* string country */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.country = reader.string(); - break; - case /* string timezone */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.timezone = reader.string(); - break; - case /* string language */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.language = reader.string(); - break; - case /* string email_address */ 14: + continue; + } + case 14: { + if (tag !== 114) { + break; + } message.emailAddress = reader.string(); - break; - case /* api.v2.UserConnections connections */ 15: - message.connections = user_connections_1.UserConnections.internalBinaryRead(reader, reader.uint32(), options, message.connections); - break; - case /* bool marketing_flag */ 16: + continue; + } + case 15: { + if (tag !== 122) { + break; + } + message.connections = user_connections_1.UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } message.marketingFlag = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* string creation_date = 2; */ - if (message.creationDate !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.creationDate); - /* string updated_date = 3; */ - if (message.updatedDate !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.updatedDate); - /* uint32 pid = 4; */ - if (message.pid !== 0) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.pid); - /* string username = 5; */ - if (message.username !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.username); - /* int32 access_level = 6; */ - if (message.accessLevel !== 0) - writer.tag(6, runtime_1.WireType.Varint).int32(message.accessLevel); - /* string server_access_level = 7; */ - if (message.serverAccessLevel !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.serverAccessLevel); - /* api.v2.Mii mii = 8; */ - if (message.mii) - mii_1.Mii.internalBinaryWrite(message.mii, writer.tag(8, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* string birthday = 9; */ - if (message.birthday !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.birthday); - /* string gender = 10; */ - if (message.gender !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.gender); - /* string country = 11; */ - if (message.country !== "") - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.country); - /* string timezone = 12; */ - if (message.timezone !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.timezone); - /* string language = 13; */ - if (message.language !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.language); - /* string email_address = 14; */ - if (message.emailAddress !== "") - writer.tag(14, runtime_1.WireType.LengthDelimited).string(message.emailAddress); - /* api.v2.UserConnections connections = 15; */ - if (message.connections) - user_connections_1.UserConnections.internalBinaryWrite(message.connections, writer.tag(15, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* bool marketing_flag = 16; */ - if (message.marketingFlag !== false) - writer.tag(16, runtime_1.WireType.Varint).bool(message.marketingFlag); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? mii_1.Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? user_connections_1.UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = mii_1.Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = user_connections_1.UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + create(base) { + return exports.UpdateUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? mii_1.Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? user_connections_1.UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.UpdateUserDataResponse - */ -exports.UpdateUserDataResponse = new UpdateUserDataResponse$Type(); diff --git a/javascript/api/v2/update_user_data_rpc.ts b/javascript/api/v2/update_user_data_rpc.ts new file mode 100644 index 0000000..0708ee7 --- /dev/null +++ b/javascript/api/v2/update_user_data_rpc.ts @@ -0,0 +1,418 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/update_user_data_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Mii } from "./mii"; +import { UserConnections } from "./user_connections"; + +export const protobufPackage = "api.v2"; + +/** TODO - Not implemented yet, stubbed */ +export interface UpdateUserDataRequest { +} + +export interface UpdateUserDataResponse { + deleted: boolean; + creationDate: string; + updatedDate: string; + pid: number; + username: string; + accessLevel: number; + serverAccessLevel: string; + mii: Mii | undefined; + birthday: string; + gender: string; + country: string; + timezone: string; + language: string; + emailAddress: string; + connections: UserConnections | undefined; + marketingFlag: boolean; +} + +function createBaseUpdateUserDataRequest(): UpdateUserDataRequest { + return {}; +} + +export const UpdateUserDataRequest: MessageFns = { + encode(_: UpdateUserDataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateUserDataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): UpdateUserDataRequest { + return {}; + }, + + toJSON(_: UpdateUserDataRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): UpdateUserDataRequest { + return UpdateUserDataRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): UpdateUserDataRequest { + const message = createBaseUpdateUserDataRequest(); + return message; + }, +}; + +function createBaseUpdateUserDataResponse(): UpdateUserDataResponse { + return { + deleted: false, + creationDate: "", + updatedDate: "", + pid: 0, + username: "", + accessLevel: 0, + serverAccessLevel: "", + mii: undefined, + birthday: "", + gender: "", + country: "", + timezone: "", + language: "", + emailAddress: "", + connections: undefined, + marketingFlag: false, + }; +} + +export const UpdateUserDataResponse: MessageFns = { + encode(message: UpdateUserDataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.creationDate !== "") { + writer.uint32(18).string(message.creationDate); + } + if (message.updatedDate !== "") { + writer.uint32(26).string(message.updatedDate); + } + if (message.pid !== 0) { + writer.uint32(32).uint32(message.pid); + } + if (message.username !== "") { + writer.uint32(42).string(message.username); + } + if (message.accessLevel !== 0) { + writer.uint32(48).int32(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + writer.uint32(58).string(message.serverAccessLevel); + } + if (message.mii !== undefined) { + Mii.encode(message.mii, writer.uint32(66).fork()).join(); + } + if (message.birthday !== "") { + writer.uint32(74).string(message.birthday); + } + if (message.gender !== "") { + writer.uint32(82).string(message.gender); + } + if (message.country !== "") { + writer.uint32(90).string(message.country); + } + if (message.timezone !== "") { + writer.uint32(98).string(message.timezone); + } + if (message.language !== "") { + writer.uint32(106).string(message.language); + } + if (message.emailAddress !== "") { + writer.uint32(114).string(message.emailAddress); + } + if (message.connections !== undefined) { + UserConnections.encode(message.connections, writer.uint32(122).fork()).join(); + } + if (message.marketingFlag !== false) { + writer.uint32(128).bool(message.marketingFlag); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateUserDataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserDataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.creationDate = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updatedDate = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.username = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.accessLevel = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.serverAccessLevel = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.mii = Mii.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.birthday = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.gender = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.country = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.timezone = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.language = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.emailAddress = reader.string(); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.connections = UserConnections.decode(reader, reader.uint32()); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.marketingFlag = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateUserDataResponse { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + creationDate: isSet(object.creationDate) ? globalThis.String(object.creationDate) : "", + updatedDate: isSet(object.updatedDate) ? globalThis.String(object.updatedDate) : "", + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + username: isSet(object.username) ? globalThis.String(object.username) : "", + accessLevel: isSet(object.accessLevel) ? globalThis.Number(object.accessLevel) : 0, + serverAccessLevel: isSet(object.serverAccessLevel) ? globalThis.String(object.serverAccessLevel) : "", + mii: isSet(object.mii) ? Mii.fromJSON(object.mii) : undefined, + birthday: isSet(object.birthday) ? globalThis.String(object.birthday) : "", + gender: isSet(object.gender) ? globalThis.String(object.gender) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + timezone: isSet(object.timezone) ? globalThis.String(object.timezone) : "", + language: isSet(object.language) ? globalThis.String(object.language) : "", + emailAddress: isSet(object.emailAddress) ? globalThis.String(object.emailAddress) : "", + connections: isSet(object.connections) ? UserConnections.fromJSON(object.connections) : undefined, + marketingFlag: isSet(object.marketingFlag) ? globalThis.Boolean(object.marketingFlag) : false, + }; + }, + + toJSON(message: UpdateUserDataResponse): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.creationDate !== "") { + obj.creationDate = message.creationDate; + } + if (message.updatedDate !== "") { + obj.updatedDate = message.updatedDate; + } + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.username !== "") { + obj.username = message.username; + } + if (message.accessLevel !== 0) { + obj.accessLevel = Math.round(message.accessLevel); + } + if (message.serverAccessLevel !== "") { + obj.serverAccessLevel = message.serverAccessLevel; + } + if (message.mii !== undefined) { + obj.mii = Mii.toJSON(message.mii); + } + if (message.birthday !== "") { + obj.birthday = message.birthday; + } + if (message.gender !== "") { + obj.gender = message.gender; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.timezone !== "") { + obj.timezone = message.timezone; + } + if (message.language !== "") { + obj.language = message.language; + } + if (message.emailAddress !== "") { + obj.emailAddress = message.emailAddress; + } + if (message.connections !== undefined) { + obj.connections = UserConnections.toJSON(message.connections); + } + if (message.marketingFlag !== false) { + obj.marketingFlag = message.marketingFlag; + } + return obj; + }, + + create(base?: DeepPartial): UpdateUserDataResponse { + return UpdateUserDataResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateUserDataResponse { + const message = createBaseUpdateUserDataResponse(); + message.deleted = object.deleted ?? false; + message.creationDate = object.creationDate ?? ""; + message.updatedDate = object.updatedDate ?? ""; + message.pid = object.pid ?? 0; + message.username = object.username ?? ""; + message.accessLevel = object.accessLevel ?? 0; + message.serverAccessLevel = object.serverAccessLevel ?? ""; + message.mii = (object.mii !== undefined && object.mii !== null) ? Mii.fromPartial(object.mii) : undefined; + message.birthday = object.birthday ?? ""; + message.gender = object.gender ?? ""; + message.country = object.country ?? ""; + message.timezone = object.timezone ?? ""; + message.language = object.language ?? ""; + message.emailAddress = object.emailAddress ?? ""; + message.connections = (object.connections !== undefined && object.connections !== null) + ? UserConnections.fromPartial(object.connections) + : undefined; + message.marketingFlag = object.marketingFlag ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/api/v2/user_connections.d.ts b/javascript/api/v2/user_connections.d.ts index 6e068af..29674b1 100644 --- a/javascript/api/v2/user_connections.d.ts +++ b/javascript/api/v2/user_connections.d.ts @@ -1,93 +1,33 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/user_connections.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message api.v2.DiscordConnection - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "api.v2"; export interface DiscordConnection { - /** - * @generated from protobuf field: string id = 1; - */ id: string; } -/** - * @generated from protobuf message api.v2.StripeConnection - */ export interface StripeConnection { - /** - * @generated from protobuf field: optional string customer_id = 1; - */ - customerId?: string; - /** - * @generated from protobuf field: optional string subscription_id = 2; - */ - subscriptionId?: string; - /** - * @generated from protobuf field: optional string price_id = 3; - */ - priceId?: string; - /** - * @generated from protobuf field: optional uint32 tier_level = 4; - */ - tierLevel?: number; - /** - * @generated from protobuf field: optional string tier_name = 5; - */ - tierName?: string; - /** - * @generated from protobuf field: uint64 latest_webhook_timestamp = 6; - */ + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; latestWebhookTimestamp: bigint; } -/** - * @generated from protobuf message api.v2.UserConnections - */ export interface UserConnections { - /** - * @generated from protobuf field: api.v2.DiscordConnection discord = 1; - */ - discord?: DiscordConnection; - /** - * @generated from protobuf field: api.v2.StripeConnection stripe = 2; - */ - stripe?: StripeConnection; + discord: DiscordConnection | undefined; + stripe: StripeConnection | undefined; } -declare class DiscordConnection$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DiscordConnection; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DiscordConnection): DiscordConnection; - internalBinaryWrite(message: DiscordConnection, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DiscordConnection: MessageFns; +export declare const StripeConnection: MessageFns; +export declare const UserConnections: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message api.v2.DiscordConnection - */ -export declare const DiscordConnection: DiscordConnection$Type; -declare class StripeConnection$Type extends MessageType { - constructor(); - create(value?: PartialMessage): StripeConnection; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StripeConnection): StripeConnection; - internalBinaryWrite(message: StripeConnection, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.StripeConnection - */ -export declare const StripeConnection: StripeConnection$Type; -declare class UserConnections$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UserConnections; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserConnections): UserConnections; - internalBinaryWrite(message: UserConnections, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message api.v2.UserConnections - */ -export declare const UserConnections: UserConnections$Type; export {}; diff --git a/javascript/api/v2/user_connections.js b/javascript/api/v2/user_connections.js index b335b31..994dac6 100644 --- a/javascript/api/v2/user_connections.js +++ b/javascript/api/v2/user_connections.js @@ -1,194 +1,275 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "api/v2/user_connections.proto" (package "api.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/user_connections.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UserConnections = exports.StripeConnection = exports.DiscordConnection = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DiscordConnection$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.DiscordConnection", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UserConnections = exports.StripeConnection = exports.DiscordConnection = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "api.v2"; +function createBaseDiscordConnection() { + return { id: "" }; +} +exports.DiscordConnection = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDiscordConnection(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.DiscordConnection - */ -exports.DiscordConnection = new DiscordConnection$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class StripeConnection$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.StripeConnection", [ - { no: 1, name: "customer_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "subscription_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "price_id", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "tier_level", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, - { no: 5, name: "tier_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "latest_webhook_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.latestWebhookTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + create(base) { + return exports.DiscordConnection.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDiscordConnection(); + message.id = object.id ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseStripeConnection() { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + latestWebhookTimestamp: 0n, + }; +} +exports.StripeConnection = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.latestWebhookTimestamp !== 0n) { + if (BigInt.asUintN(64, message.latestWebhookTimestamp) !== message.latestWebhookTimestamp) { + throw new globalThis.Error("value provided for field message.latestWebhookTimestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.latestWebhookTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStripeConnection(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* optional string customer_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.customerId = reader.string(); - break; - case /* optional string subscription_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.subscriptionId = reader.string(); - break; - case /* optional string price_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.priceId = reader.string(); - break; - case /* optional uint32 tier_level */ 4: + continue; + } + case 4: { + if (tag !== 32) { + break; + } message.tierLevel = reader.uint32(); - break; - case /* optional string tier_name */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tierName = reader.string(); - break; - case /* uint64 latest_webhook_timestamp */ 6: - message.latestWebhookTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + message.latestWebhookTimestamp = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* optional string customer_id = 1; */ - if (message.customerId !== undefined) - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.customerId); - /* optional string subscription_id = 2; */ - if (message.subscriptionId !== undefined) - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.subscriptionId); - /* optional string price_id = 3; */ - if (message.priceId !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.priceId); - /* optional uint32 tier_level = 4; */ - if (message.tierLevel !== undefined) - writer.tag(4, runtime_1.WireType.Varint).uint32(message.tierLevel); - /* optional string tier_name = 5; */ - if (message.tierName !== undefined) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tierName); - /* uint64 latest_webhook_timestamp = 6; */ - if (message.latestWebhookTimestamp !== 0n) - writer.tag(6, runtime_1.WireType.Varint).uint64(message.latestWebhookTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.v2.StripeConnection - */ -exports.StripeConnection = new StripeConnection$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UserConnections$Type extends runtime_4.MessageType { - constructor() { - super("api.v2.UserConnections", [ - { no: 1, name: "discord", kind: "message", T: () => exports.DiscordConnection }, - { no: 2, name: "stripe", kind: "message", T: () => exports.StripeConnection } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + latestWebhookTimestamp: isSet(object.latestWebhookTimestamp) ? BigInt(object.latestWebhookTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.latestWebhookTimestamp !== 0n) { + obj.latestWebhookTimestamp = message.latestWebhookTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.StripeConnection.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseStripeConnection(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.latestWebhookTimestamp = object.latestWebhookTimestamp ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUserConnections() { + return { discord: undefined, stripe: undefined }; +} +exports.UserConnections = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.discord !== undefined) { + exports.DiscordConnection.encode(message.discord, writer.uint32(10).fork()).join(); + } + if (message.stripe !== undefined) { + exports.StripeConnection.encode(message.stripe, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserConnections(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* api.v2.DiscordConnection discord */ 1: - message.discord = exports.DiscordConnection.internalBinaryRead(reader, reader.uint32(), options, message.discord); - break; - case /* api.v2.StripeConnection stripe */ 2: - message.stripe = exports.StripeConnection.internalBinaryRead(reader, reader.uint32(), options, message.stripe); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.discord = exports.DiscordConnection.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.stripe = exports.StripeConnection.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* api.v2.DiscordConnection discord = 1; */ - if (message.discord) - exports.DiscordConnection.internalBinaryWrite(message.discord, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - /* api.v2.StripeConnection stripe = 2; */ - if (message.stripe) - exports.StripeConnection.internalBinaryWrite(message.stripe, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + discord: isSet(object.discord) ? exports.DiscordConnection.fromJSON(object.discord) : undefined, + stripe: isSet(object.stripe) ? exports.StripeConnection.fromJSON(object.stripe) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.discord !== undefined) { + obj.discord = exports.DiscordConnection.toJSON(message.discord); + } + if (message.stripe !== undefined) { + obj.stripe = exports.StripeConnection.toJSON(message.stripe); + } + return obj; + }, + create(base) { + return exports.UserConnections.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUserConnections(); + message.discord = (object.discord !== undefined && object.discord !== null) + ? exports.DiscordConnection.fromPartial(object.discord) + : undefined; + message.stripe = (object.stripe !== undefined && object.stripe !== null) + ? exports.StripeConnection.fromPartial(object.stripe) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message api.v2.UserConnections - */ -exports.UserConnections = new UserConnections$Type(); diff --git a/javascript/api/v2/user_connections.ts b/javascript/api/v2/user_connections.ts new file mode 100644 index 0000000..bea8b9a --- /dev/null +++ b/javascript/api/v2/user_connections.ts @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: api/v2/user_connections.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "api.v2"; + +export interface DiscordConnection { + id: string; +} + +export interface StripeConnection { + customerId?: string | undefined; + subscriptionId?: string | undefined; + priceId?: string | undefined; + tierLevel?: number | undefined; + tierName?: string | undefined; + latestWebhookTimestamp: bigint; +} + +export interface UserConnections { + discord: DiscordConnection | undefined; + stripe: StripeConnection | undefined; +} + +function createBaseDiscordConnection(): DiscordConnection { + return { id: "" }; +} + +export const DiscordConnection: MessageFns = { + encode(message: DiscordConnection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DiscordConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDiscordConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DiscordConnection { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + + toJSON(message: DiscordConnection): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): DiscordConnection { + return DiscordConnection.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DiscordConnection { + const message = createBaseDiscordConnection(); + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseStripeConnection(): StripeConnection { + return { + customerId: undefined, + subscriptionId: undefined, + priceId: undefined, + tierLevel: undefined, + tierName: undefined, + latestWebhookTimestamp: 0n, + }; +} + +export const StripeConnection: MessageFns = { + encode(message: StripeConnection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.customerId !== undefined) { + writer.uint32(10).string(message.customerId); + } + if (message.subscriptionId !== undefined) { + writer.uint32(18).string(message.subscriptionId); + } + if (message.priceId !== undefined) { + writer.uint32(26).string(message.priceId); + } + if (message.tierLevel !== undefined) { + writer.uint32(32).uint32(message.tierLevel); + } + if (message.tierName !== undefined) { + writer.uint32(42).string(message.tierName); + } + if (message.latestWebhookTimestamp !== 0n) { + if (BigInt.asUintN(64, message.latestWebhookTimestamp) !== message.latestWebhookTimestamp) { + throw new globalThis.Error("value provided for field message.latestWebhookTimestamp of type uint64 too large"); + } + writer.uint32(48).uint64(message.latestWebhookTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StripeConnection { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStripeConnection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.customerId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.subscriptionId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.priceId = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.tierLevel = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tierName = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.latestWebhookTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StripeConnection { + return { + customerId: isSet(object.customerId) ? globalThis.String(object.customerId) : undefined, + subscriptionId: isSet(object.subscriptionId) ? globalThis.String(object.subscriptionId) : undefined, + priceId: isSet(object.priceId) ? globalThis.String(object.priceId) : undefined, + tierLevel: isSet(object.tierLevel) ? globalThis.Number(object.tierLevel) : undefined, + tierName: isSet(object.tierName) ? globalThis.String(object.tierName) : undefined, + latestWebhookTimestamp: isSet(object.latestWebhookTimestamp) ? BigInt(object.latestWebhookTimestamp) : 0n, + }; + }, + + toJSON(message: StripeConnection): unknown { + const obj: any = {}; + if (message.customerId !== undefined) { + obj.customerId = message.customerId; + } + if (message.subscriptionId !== undefined) { + obj.subscriptionId = message.subscriptionId; + } + if (message.priceId !== undefined) { + obj.priceId = message.priceId; + } + if (message.tierLevel !== undefined) { + obj.tierLevel = Math.round(message.tierLevel); + } + if (message.tierName !== undefined) { + obj.tierName = message.tierName; + } + if (message.latestWebhookTimestamp !== 0n) { + obj.latestWebhookTimestamp = message.latestWebhookTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): StripeConnection { + return StripeConnection.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StripeConnection { + const message = createBaseStripeConnection(); + message.customerId = object.customerId ?? undefined; + message.subscriptionId = object.subscriptionId ?? undefined; + message.priceId = object.priceId ?? undefined; + message.tierLevel = object.tierLevel ?? undefined; + message.tierName = object.tierName ?? undefined; + message.latestWebhookTimestamp = object.latestWebhookTimestamp ?? 0n; + return message; + }, +}; + +function createBaseUserConnections(): UserConnections { + return { discord: undefined, stripe: undefined }; +} + +export const UserConnections: MessageFns = { + encode(message: UserConnections, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.discord !== undefined) { + DiscordConnection.encode(message.discord, writer.uint32(10).fork()).join(); + } + if (message.stripe !== undefined) { + StripeConnection.encode(message.stripe, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UserConnections { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserConnections(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.discord = DiscordConnection.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.stripe = StripeConnection.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UserConnections { + return { + discord: isSet(object.discord) ? DiscordConnection.fromJSON(object.discord) : undefined, + stripe: isSet(object.stripe) ? StripeConnection.fromJSON(object.stripe) : undefined, + }; + }, + + toJSON(message: UserConnections): unknown { + const obj: any = {}; + if (message.discord !== undefined) { + obj.discord = DiscordConnection.toJSON(message.discord); + } + if (message.stripe !== undefined) { + obj.stripe = StripeConnection.toJSON(message.stripe); + } + return obj; + }, + + create(base?: DeepPartial): UserConnections { + return UserConnections.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UserConnections { + const message = createBaseUserConnections(); + message.discord = (object.discord !== undefined && object.discord !== null) + ? DiscordConnection.fromPartial(object.discord) + : undefined; + message.stripe = (object.stripe !== undefined && object.stripe !== null) + ? StripeConnection.fromPartial(object.stripe) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/boss_service.client.d.ts b/javascript/boss/boss_service.client.d.ts deleted file mode 100644 index e051204..0000000 --- a/javascript/boss/boss_service.client.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/boss_service.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { DeleteFileRequest } from "./delete_file"; -import type { UpdateFileMetadataRequest } from "./update_file_metadata"; -import type { UploadFileResponse } from "./upload_file"; -import type { UploadFileRequest } from "./upload_file"; -import type { ListFilesResponse } from "./list_files"; -import type { ListFilesRequest } from "./list_files"; -import type { DeleteTaskRequest } from "./delete_task"; -import type { UpdateTaskRequest } from "./update_task"; -import type { RegisterTaskResponse } from "./register_task"; -import type { RegisterTaskRequest } from "./register_task"; -import type { ListTasksResponse } from "./list_tasks"; -import type { ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; -import type { Empty } from "../google/protobuf/empty"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service boss.BOSS - */ -export interface IBOSSClient { - /** - * @generated from protobuf rpc: ListKnownBOSSApps(google.protobuf.Empty) returns (boss.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListTasks(google.protobuf.Empty) returns (boss.ListTasksResponse); - */ - listTasks(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: RegisterTask(boss.RegisterTaskRequest) returns (boss.RegisterTaskResponse); - */ - registerTask(input: RegisterTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateTask(boss.UpdateTaskRequest) returns (google.protobuf.Empty); - */ - updateTask(input: UpdateTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteTask(boss.DeleteTaskRequest) returns (google.protobuf.Empty); - */ - deleteTask(input: DeleteTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListFiles(boss.ListFilesRequest) returns (boss.ListFilesResponse); - */ - listFiles(input: ListFilesRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UploadFile(boss.UploadFileRequest) returns (boss.UploadFileResponse); - */ - uploadFile(input: UploadFileRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.UpdateFileMetadataRequest) returns (google.protobuf.Empty); - */ - updateFileMetadata(input: UpdateFileMetadataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteFile(boss.DeleteFileRequest) returns (google.protobuf.Empty); - */ - deleteFile(input: DeleteFileRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service boss.BOSS - */ -export declare class BOSSClient implements IBOSSClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: ListKnownBOSSApps(google.protobuf.Empty) returns (boss.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListTasks(google.protobuf.Empty) returns (boss.ListTasksResponse); - */ - listTasks(input: Empty, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: RegisterTask(boss.RegisterTaskRequest) returns (boss.RegisterTaskResponse); - */ - registerTask(input: RegisterTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateTask(boss.UpdateTaskRequest) returns (google.protobuf.Empty); - */ - updateTask(input: UpdateTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteTask(boss.DeleteTaskRequest) returns (google.protobuf.Empty); - */ - deleteTask(input: DeleteTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListFiles(boss.ListFilesRequest) returns (boss.ListFilesResponse); - */ - listFiles(input: ListFilesRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UploadFile(boss.UploadFileRequest) returns (boss.UploadFileResponse); - */ - uploadFile(input: UploadFileRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.UpdateFileMetadataRequest) returns (google.protobuf.Empty); - */ - updateFileMetadata(input: UpdateFileMetadataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteFile(boss.DeleteFileRequest) returns (google.protobuf.Empty); - */ - deleteFile(input: DeleteFileRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/boss/boss_service.client.js b/javascript/boss/boss_service.client.js deleted file mode 100644 index f10f4d9..0000000 --- a/javascript/boss/boss_service.client.js +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/boss_service.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BOSSClient = void 0; -const boss_service_1 = require("./boss_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service boss.BOSS - */ -class BOSSClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = boss_service_1.BOSS.typeName; - this.methods = boss_service_1.BOSS.methods; - this.options = boss_service_1.BOSS.options; - } - /** - * @generated from protobuf rpc: ListKnownBOSSApps(google.protobuf.Empty) returns (boss.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ListTasks(google.protobuf.Empty) returns (boss.ListTasksResponse); - */ - listTasks(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: RegisterTask(boss.RegisterTaskRequest) returns (boss.RegisterTaskResponse); - */ - registerTask(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateTask(boss.UpdateTaskRequest) returns (google.protobuf.Empty); - */ - updateTask(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DeleteTask(boss.DeleteTaskRequest) returns (google.protobuf.Empty); - */ - deleteTask(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ListFiles(boss.ListFilesRequest) returns (boss.ListFilesResponse); - */ - listFiles(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UploadFile(boss.UploadFileRequest) returns (boss.UploadFileResponse); - */ - uploadFile(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.UpdateFileMetadataRequest) returns (google.protobuf.Empty); - */ - updateFileMetadata(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DeleteFile(boss.DeleteFileRequest) returns (google.protobuf.Empty); - */ - deleteFile(input, options) { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.BOSSClient = BOSSClient; diff --git a/javascript/boss/boss_service.d.ts b/javascript/boss/boss_service.d.ts index 585eb23..99436d9 100644 --- a/javascript/boss/boss_service.d.ts +++ b/javascript/boss/boss_service.d.ts @@ -1,9 +1,118 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/boss_service.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service boss.BOSS - */ -export declare const BOSS: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { DeleteFileRequest } from "./delete_file"; +import { DeleteTaskRequest } from "./delete_task"; +import { ListFilesRequest, ListFilesResponse } from "./list_files"; +import { ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; +import { ListTasksResponse } from "./list_tasks"; +import { RegisterTaskRequest, RegisterTaskResponse } from "./register_task"; +import { UpdateFileMetadataRequest } from "./update_file_metadata"; +import { UpdateTaskRequest } from "./update_task"; +import { UploadFileRequest, UploadFileResponse } from "./upload_file"; +export declare const protobufPackage = "boss"; +export type BOSSDefinition = typeof BOSSDefinition; +export declare const BOSSDefinition: { + readonly name: "BOSS"; + readonly fullName: "boss.BOSS"; + readonly methods: { + readonly listKnownBOSSApps: { + readonly name: "ListKnownBOSSApps"; + readonly requestType: import("../google/protobuf/empty").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_known_boss_apps").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly listTasks: { + readonly name: "ListTasks"; + readonly requestType: import("../google/protobuf/empty").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_tasks").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly registerTask: { + readonly name: "RegisterTask"; + readonly requestType: import("./register_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("./register_task").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateTask: { + readonly name: "UpdateTask"; + readonly requestType: import("./update_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly deleteTask: { + readonly name: "DeleteTask"; + readonly requestType: import("./delete_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly listFiles: { + readonly name: "ListFiles"; + readonly requestType: import("./list_files").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_files").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly uploadFile: { + readonly name: "UploadFile"; + readonly requestType: import("./upload_file").MessageFns; + readonly requestStream: false; + readonly responseType: import("./upload_file").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateFileMetadata: { + readonly name: "UpdateFileMetadata"; + readonly requestType: import("./update_file_metadata").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly deleteFile: { + readonly name: "DeleteFile"; + readonly requestType: import("./delete_file").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface BOSSServiceImplementation { + listKnownBOSSApps(request: Empty, context: CallContext & CallContextExt): Promise>; + listTasks(request: Empty, context: CallContext & CallContextExt): Promise>; + registerTask(request: RegisterTaskRequest, context: CallContext & CallContextExt): Promise>; + updateTask(request: UpdateTaskRequest, context: CallContext & CallContextExt): Promise>; + deleteTask(request: DeleteTaskRequest, context: CallContext & CallContextExt): Promise>; + listFiles(request: ListFilesRequest, context: CallContext & CallContextExt): Promise>; + uploadFile(request: UploadFileRequest, context: CallContext & CallContextExt): Promise>; + updateFileMetadata(request: UpdateFileMetadataRequest, context: CallContext & CallContextExt): Promise>; + deleteFile(request: DeleteFileRequest, context: CallContext & CallContextExt): Promise>; +} +export interface BOSSClient { + listKnownBOSSApps(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + listTasks(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + registerTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + deleteTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + listFiles(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + uploadFile(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateFileMetadata(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + deleteFile(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/boss/boss_service.js b/javascript/boss/boss_service.js index 669b386..5dfa091 100644 --- a/javascript/boss/boss_service.js +++ b/javascript/boss/boss_service.js @@ -1,41 +1,97 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/boss_service.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/boss_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.BOSS = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/boss_service.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck +exports.BOSSDefinition = exports.protobufPackage = void 0; +const empty_1 = require("../google/protobuf/empty"); const delete_file_1 = require("./delete_file"); -const update_file_metadata_1 = require("./update_file_metadata"); -const upload_file_1 = require("./upload_file"); -const upload_file_2 = require("./upload_file"); -const list_files_1 = require("./list_files"); -const list_files_2 = require("./list_files"); const delete_task_1 = require("./delete_task"); -const update_task_1 = require("./update_task"); -const register_task_1 = require("./register_task"); -const register_task_2 = require("./register_task"); -const list_tasks_1 = require("./list_tasks"); +const list_files_1 = require("./list_files"); const list_known_boss_apps_1 = require("./list_known_boss_apps"); -const empty_1 = require("../google/protobuf/empty"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service boss.BOSS - */ -exports.BOSS = new runtime_rpc_1.ServiceType("boss.BOSS", [ - { name: "ListKnownBOSSApps", options: {}, I: empty_1.Empty, O: list_known_boss_apps_1.ListKnownBOSSAppsResponse }, - { name: "ListTasks", options: {}, I: empty_1.Empty, O: list_tasks_1.ListTasksResponse }, - { name: "RegisterTask", options: {}, I: register_task_2.RegisterTaskRequest, O: register_task_1.RegisterTaskResponse }, - { name: "UpdateTask", options: {}, I: update_task_1.UpdateTaskRequest, O: empty_1.Empty }, - { name: "DeleteTask", options: {}, I: delete_task_1.DeleteTaskRequest, O: empty_1.Empty }, - { name: "ListFiles", options: {}, I: list_files_2.ListFilesRequest, O: list_files_1.ListFilesResponse }, - { name: "UploadFile", options: {}, I: upload_file_2.UploadFileRequest, O: upload_file_1.UploadFileResponse }, - { name: "UpdateFileMetadata", options: {}, I: update_file_metadata_1.UpdateFileMetadataRequest, O: empty_1.Empty }, - { name: "DeleteFile", options: {}, I: delete_file_1.DeleteFileRequest, O: empty_1.Empty } -]); +const list_tasks_1 = require("./list_tasks"); +const register_task_1 = require("./register_task"); +const update_file_metadata_1 = require("./update_file_metadata"); +const update_task_1 = require("./update_task"); +const upload_file_1 = require("./upload_file"); +exports.protobufPackage = "boss"; +exports.BOSSDefinition = { + name: "BOSS", + fullName: "boss.BOSS", + methods: { + listKnownBOSSApps: { + name: "ListKnownBOSSApps", + requestType: empty_1.Empty, + requestStream: false, + responseType: list_known_boss_apps_1.ListKnownBOSSAppsResponse, + responseStream: false, + options: {}, + }, + listTasks: { + name: "ListTasks", + requestType: empty_1.Empty, + requestStream: false, + responseType: list_tasks_1.ListTasksResponse, + responseStream: false, + options: {}, + }, + registerTask: { + name: "RegisterTask", + requestType: register_task_1.RegisterTaskRequest, + requestStream: false, + responseType: register_task_1.RegisterTaskResponse, + responseStream: false, + options: {}, + }, + updateTask: { + name: "UpdateTask", + requestType: update_task_1.UpdateTaskRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + deleteTask: { + name: "DeleteTask", + requestType: delete_task_1.DeleteTaskRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + listFiles: { + name: "ListFiles", + requestType: list_files_1.ListFilesRequest, + requestStream: false, + responseType: list_files_1.ListFilesResponse, + responseStream: false, + options: {}, + }, + uploadFile: { + name: "UploadFile", + requestType: upload_file_1.UploadFileRequest, + requestStream: false, + responseType: upload_file_1.UploadFileResponse, + responseStream: false, + options: {}, + }, + updateFileMetadata: { + name: "UpdateFileMetadata", + requestType: update_file_metadata_1.UpdateFileMetadataRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + deleteFile: { + name: "DeleteFile", + requestType: delete_file_1.DeleteFileRequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/boss/boss_service.ts b/javascript/boss/boss_service.ts new file mode 100644 index 0000000..4003446 --- /dev/null +++ b/javascript/boss/boss_service.ts @@ -0,0 +1,156 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/boss_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { DeleteFileRequest } from "./delete_file"; +import { DeleteTaskRequest } from "./delete_task"; +import { ListFilesRequest, ListFilesResponse } from "./list_files"; +import { ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; +import { ListTasksResponse } from "./list_tasks"; +import { RegisterTaskRequest, RegisterTaskResponse } from "./register_task"; +import { UpdateFileMetadataRequest } from "./update_file_metadata"; +import { UpdateTaskRequest } from "./update_task"; +import { UploadFileRequest, UploadFileResponse } from "./upload_file"; + +export const protobufPackage = "boss"; + +export type BOSSDefinition = typeof BOSSDefinition; +export const BOSSDefinition = { + name: "BOSS", + fullName: "boss.BOSS", + methods: { + listKnownBOSSApps: { + name: "ListKnownBOSSApps", + requestType: Empty, + requestStream: false, + responseType: ListKnownBOSSAppsResponse, + responseStream: false, + options: {}, + }, + listTasks: { + name: "ListTasks", + requestType: Empty, + requestStream: false, + responseType: ListTasksResponse, + responseStream: false, + options: {}, + }, + registerTask: { + name: "RegisterTask", + requestType: RegisterTaskRequest, + requestStream: false, + responseType: RegisterTaskResponse, + responseStream: false, + options: {}, + }, + updateTask: { + name: "UpdateTask", + requestType: UpdateTaskRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + deleteTask: { + name: "DeleteTask", + requestType: DeleteTaskRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + listFiles: { + name: "ListFiles", + requestType: ListFilesRequest, + requestStream: false, + responseType: ListFilesResponse, + responseStream: false, + options: {}, + }, + uploadFile: { + name: "UploadFile", + requestType: UploadFileRequest, + requestStream: false, + responseType: UploadFileResponse, + responseStream: false, + options: {}, + }, + updateFileMetadata: { + name: "UpdateFileMetadata", + requestType: UpdateFileMetadataRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + deleteFile: { + name: "DeleteFile", + requestType: DeleteFileRequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface BOSSServiceImplementation { + listKnownBOSSApps( + request: Empty, + context: CallContext & CallContextExt, + ): Promise>; + listTasks(request: Empty, context: CallContext & CallContextExt): Promise>; + registerTask( + request: RegisterTaskRequest, + context: CallContext & CallContextExt, + ): Promise>; + updateTask(request: UpdateTaskRequest, context: CallContext & CallContextExt): Promise>; + deleteTask(request: DeleteTaskRequest, context: CallContext & CallContextExt): Promise>; + listFiles(request: ListFilesRequest, context: CallContext & CallContextExt): Promise>; + uploadFile( + request: UploadFileRequest, + context: CallContext & CallContextExt, + ): Promise>; + updateFileMetadata( + request: UpdateFileMetadataRequest, + context: CallContext & CallContextExt, + ): Promise>; + deleteFile(request: DeleteFileRequest, context: CallContext & CallContextExt): Promise>; +} + +export interface BOSSClient { + listKnownBOSSApps( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + listTasks(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + registerTask( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updateTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + deleteTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + listFiles(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + uploadFile( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updateFileMetadata( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + deleteFile(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/boss/delete_file.d.ts b/javascript/boss/delete_file.d.ts index 9a37c72..153cee1 100644 --- a/javascript/boss/delete_file.d.ts +++ b/javascript/boss/delete_file.d.ts @@ -1,35 +1,20 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/delete_file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.DeleteFileRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface DeleteFileRequest { - /** - * @generated from protobuf field: uint64 data_id = 1; - */ dataId: bigint; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; } -declare class DeleteFileRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteFileRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteFileRequest): DeleteFileRequest; - internalBinaryWrite(message: DeleteFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DeleteFileRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.DeleteFileRequest - */ -export declare const DeleteFileRequest: DeleteFileRequest$Type; export {}; diff --git a/javascript/boss/delete_file.js b/javascript/boss/delete_file.js index 5d1f372..fc9fdda 100644 --- a/javascript/boss/delete_file.js +++ b/javascript/boss/delete_file.js @@ -1,67 +1,85 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/delete_file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/delete_file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DeleteFileRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteFileRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.DeleteFileRequest", [ - { no: 1, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.dataId = 0n; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DeleteFileRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseDeleteFileRequest() { + return { dataId: 0n, bossAppId: "" }; +} +exports.DeleteFileRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 data_id */ 1: - message.dataId = reader.uint64().toBigInt(); - break; - case /* string boss_app_id */ 2: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 data_id = 1; */ - if (message.dataId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.dataId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + create(base) { + return exports.DeleteFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDeleteFileRequest(); + message.dataId = object.dataId ?? 0n; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.DeleteFileRequest - */ -exports.DeleteFileRequest = new DeleteFileRequest$Type(); diff --git a/javascript/boss/delete_file.ts b/javascript/boss/delete_file.ts new file mode 100644 index 0000000..26d866d --- /dev/null +++ b/javascript/boss/delete_file.ts @@ -0,0 +1,115 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/delete_file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface DeleteFileRequest { + dataId: bigint; + bossAppId: string; +} + +function createBaseDeleteFileRequest(): DeleteFileRequest { + return { dataId: 0n, bossAppId: "" }; +} + +export const DeleteFileRequest: MessageFns = { + encode(message: DeleteFileRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteFileRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteFileRequest { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + + toJSON(message: DeleteFileRequest): unknown { + const obj: any = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteFileRequest { + return DeleteFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteFileRequest { + const message = createBaseDeleteFileRequest(); + message.dataId = object.dataId ?? 0n; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/delete_task.d.ts b/javascript/boss/delete_task.d.ts index 28b0944..f35539b 100644 --- a/javascript/boss/delete_task.d.ts +++ b/javascript/boss/delete_task.d.ts @@ -1,35 +1,20 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/delete_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.DeleteTaskRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface DeleteTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; } -declare class DeleteTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteTaskRequest): DeleteTaskRequest; - internalBinaryWrite(message: DeleteTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DeleteTaskRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.DeleteTaskRequest - */ -export declare const DeleteTaskRequest: DeleteTaskRequest$Type; export {}; diff --git a/javascript/boss/delete_task.js b/javascript/boss/delete_task.js index 8843317..dc45a3d 100644 --- a/javascript/boss/delete_task.js +++ b/javascript/boss/delete_task.js @@ -1,67 +1,82 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/delete_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/delete_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DeleteTaskRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.DeleteTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DeleteTaskRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseDeleteTaskRequest() { + return { id: "", bossAppId: "" }; +} +exports.DeleteTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + create(base) { + return exports.DeleteTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDeleteTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.DeleteTaskRequest - */ -exports.DeleteTaskRequest = new DeleteTaskRequest$Type(); diff --git a/javascript/boss/delete_task.ts b/javascript/boss/delete_task.ts new file mode 100644 index 0000000..314690d --- /dev/null +++ b/javascript/boss/delete_task.ts @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/delete_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface DeleteTaskRequest { + id: string; + bossAppId: string; +} + +function createBaseDeleteTaskRequest(): DeleteTaskRequest { + return { id: "", bossAppId: "" }; +} + +export const DeleteTaskRequest: MessageFns = { + encode(message: DeleteTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + + toJSON(message: DeleteTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteTaskRequest { + return DeleteTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteTaskRequest { + const message = createBaseDeleteTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/file.d.ts b/javascript/boss/file.d.ts index 8ea7f1d..d80acfe 100644 --- a/javascript/boss/file.d.ts +++ b/javascript/boss/file.d.ts @@ -1,103 +1,37 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.File - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface File { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: uint64 data_id = 2; - */ dataId: bigint; - /** - * @generated from protobuf field: string task_id = 3; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 4; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 5; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 6; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 7; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 8; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 9; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 10; - */ attribute3: string; - /** - * @generated from protobuf field: uint32 creator_pid = 11; - */ creatorPid: number; - /** - * @generated from protobuf field: string name = 12; - */ name: string; - /** - * @generated from protobuf field: string type = 13; - */ type: string; - /** - * @generated from protobuf field: string hash = 14; - */ hash: string; - /** - * @generated from protobuf field: uint64 size = 15; - */ size: bigint; - /** - * @generated from protobuf field: repeated string notify_on_new = 16; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 17; - */ notifyLed: boolean; - /** - * @generated from protobuf field: uint64 created_timestamp = 18; - */ createdTimestamp: bigint; - /** - * @generated from protobuf field: uint64 updated_timestamp = 19; - */ updatedTimestamp: bigint; } -declare class File$Type extends MessageType { - constructor(); - create(value?: PartialMessage): File; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: File): File; - internalBinaryWrite(message: File, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const File: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.File - */ -export declare const File: File$Type; export {}; diff --git a/javascript/boss/file.js b/javascript/boss/file.js index de6044a..e89afb9 100644 --- a/javascript/boss/file.js +++ b/javascript/boss/file.js @@ -1,203 +1,375 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.File = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class File$Type extends runtime_4.MessageType { - constructor() { - super("boss.File", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "creator_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 12, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 15, name: "size", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 16, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 17, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "created_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 19, name: "updated_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.dataId = 0n; - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.creatorPid = 0; - message.name = ""; - message.type = ""; - message.hash = ""; - message.size = 0n; - message.notifyOnNew = []; - message.notifyLed = false; - message.createdTimestamp = 0n; - message.updatedTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.File = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseFile() { + return { + deleted: false, + dataId: 0n, + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + creatorPid: 0, + name: "", + type: "", + hash: "", + size: 0n, + notifyOnNew: [], + notifyLed: false, + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} +exports.File = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(16).uint64(message.dataId); + } + if (message.taskId !== "") { + writer.uint32(26).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(42).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(50).string(v); + } + if (message.password !== "") { + writer.uint32(58).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(66).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(74).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(82).string(message.attribute3); + } + if (message.creatorPid !== 0) { + writer.uint32(88).uint32(message.creatorPid); + } + if (message.name !== "") { + writer.uint32(98).string(message.name); + } + if (message.type !== "") { + writer.uint32(106).string(message.type); + } + if (message.hash !== "") { + writer.uint32(114).string(message.hash); + } + if (message.size !== 0n) { + if (BigInt.asUintN(64, message.size) !== message.size) { + throw new globalThis.Error("value provided for field message.size of type uint64 too large"); + } + writer.uint32(120).uint64(message.size); + } + for (const v of message.notifyOnNew) { + writer.uint32(130).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(136).bool(message.notifyLed); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(144).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(152).uint64(message.updatedTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFile(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* uint64 data_id */ 2: - message.dataId = reader.uint64().toBigInt(); - break; - case /* string task_id */ 3: + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.attribute3 = reader.string(); - break; - case /* uint32 creator_pid */ 11: + continue; + } + case 11: { + if (tag !== 88) { + break; + } message.creatorPid = reader.uint32(); - break; - case /* string name */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.name = reader.string(); - break; - case /* string type */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.type = reader.string(); - break; - case /* string hash */ 14: + continue; + } + case 14: { + if (tag !== 114) { + break; + } message.hash = reader.string(); - break; - case /* uint64 size */ 15: - message.size = reader.uint64().toBigInt(); - break; - case /* repeated string notify_on_new */ 16: + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.size = reader.uint64(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 17: + continue; + } + case 17: { + if (tag !== 136) { + break; + } message.notifyLed = reader.bool(); - break; - case /* uint64 created_timestamp */ 18: - message.createdTimestamp = reader.uint64().toBigInt(); - break; - case /* uint64 updated_timestamp */ 19: - message.updatedTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + message.createdTimestamp = reader.uint64(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + message.updatedTimestamp = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* uint64 data_id = 2; */ - if (message.dataId !== 0n) - writer.tag(2, runtime_1.WireType.Varint).uint64(message.dataId); - /* string task_id = 3; */ - if (message.taskId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 4; */ - if (message.bossAppId !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 5; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 6; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 7; */ - if (message.password !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 8; */ - if (message.attribute1 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 9; */ - if (message.attribute2 !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 10; */ - if (message.attribute3 !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* uint32 creator_pid = 11; */ - if (message.creatorPid !== 0) - writer.tag(11, runtime_1.WireType.Varint).uint32(message.creatorPid); - /* string name = 12; */ - if (message.name !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 13; */ - if (message.type !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.type); - /* string hash = 14; */ - if (message.hash !== "") - writer.tag(14, runtime_1.WireType.LengthDelimited).string(message.hash); - /* uint64 size = 15; */ - if (message.size !== 0n) - writer.tag(15, runtime_1.WireType.Varint).uint64(message.size); - /* repeated string notify_on_new = 16; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(16, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 17; */ - if (message.notifyLed !== false) - writer.tag(17, runtime_1.WireType.Varint).bool(message.notifyLed); - /* uint64 created_timestamp = 18; */ - if (message.createdTimestamp !== 0n) - writer.tag(18, runtime_1.WireType.Varint).uint64(message.createdTimestamp); - /* uint64 updated_timestamp = 19; */ - if (message.updatedTimestamp !== 0n) - writer.tag(19, runtime_1.WireType.Varint).uint64(message.updatedTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + hash: isSet(object.hash) ? globalThis.String(object.hash) : "", + size: isSet(object.size) ? BigInt(object.size) : 0n, + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.hash !== "") { + obj.hash = message.hash; + } + if (message.size !== 0n) { + obj.size = message.size.toString(); + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.File.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseFile(); + message.deleted = object.deleted ?? false; + message.dataId = object.dataId ?? 0n; + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.hash = object.hash ?? ""; + message.size = object.size ?? 0n; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.File - */ -exports.File = new File$Type(); diff --git a/javascript/boss/file.ts b/javascript/boss/file.ts new file mode 100644 index 0000000..9eb1ede --- /dev/null +++ b/javascript/boss/file.ts @@ -0,0 +1,439 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface File { + deleted: boolean; + dataId: bigint; + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + creatorPid: number; + name: string; + type: string; + hash: string; + size: bigint; + notifyOnNew: string[]; + notifyLed: boolean; + createdTimestamp: bigint; + updatedTimestamp: bigint; +} + +function createBaseFile(): File { + return { + deleted: false, + dataId: 0n, + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + creatorPid: 0, + name: "", + type: "", + hash: "", + size: 0n, + notifyOnNew: [], + notifyLed: false, + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} + +export const File: MessageFns = { + encode(message: File, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(16).uint64(message.dataId); + } + if (message.taskId !== "") { + writer.uint32(26).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(42).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(50).string(v!); + } + if (message.password !== "") { + writer.uint32(58).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(66).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(74).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(82).string(message.attribute3); + } + if (message.creatorPid !== 0) { + writer.uint32(88).uint32(message.creatorPid); + } + if (message.name !== "") { + writer.uint32(98).string(message.name); + } + if (message.type !== "") { + writer.uint32(106).string(message.type); + } + if (message.hash !== "") { + writer.uint32(114).string(message.hash); + } + if (message.size !== 0n) { + if (BigInt.asUintN(64, message.size) !== message.size) { + throw new globalThis.Error("value provided for field message.size of type uint64 too large"); + } + writer.uint32(120).uint64(message.size); + } + for (const v of message.notifyOnNew) { + writer.uint32(130).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(136).bool(message.notifyLed); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(144).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(152).uint64(message.updatedTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): File { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFile(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.password = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.creatorPid = reader.uint32(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.name = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.type = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.hash = reader.string(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.size = reader.uint64() as bigint; + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.createdTimestamp = reader.uint64() as bigint; + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.updatedTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): File { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + hash: isSet(object.hash) ? globalThis.String(object.hash) : "", + size: isSet(object.size) ? BigInt(object.size) : 0n, + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + + toJSON(message: File): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.hash !== "") { + obj.hash = message.hash; + } + if (message.size !== 0n) { + obj.size = message.size.toString(); + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): File { + return File.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): File { + const message = createBaseFile(); + message.deleted = object.deleted ?? false; + message.dataId = object.dataId ?? 0n; + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.hash = object.hash ?? ""; + message.size = object.size ?? 0n; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/list_files.d.ts b/javascript/boss/list_files.d.ts index 809fb7f..422550a 100644 --- a/javascript/boss/list_files.d.ts +++ b/javascript/boss/list_files.d.ts @@ -1,63 +1,27 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_files.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { File } from "./file"; -/** - * @generated from protobuf message boss.ListFilesRequest - */ +export declare const protobufPackage = "boss"; export interface ListFilesRequest { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: optional string country = 3; - */ - country?: string; - /** - * @generated from protobuf field: optional string language = 4; - */ - language?: string; + country?: string | undefined; + language?: string | undefined; } -/** - * @generated from protobuf message boss.ListFilesResponse - */ export interface ListFilesResponse { - /** - * @generated from protobuf field: repeated boss.File files = 1; - */ files: File[]; } -declare class ListFilesRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListFilesRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesRequest): ListFilesRequest; - internalBinaryWrite(message: ListFilesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ListFilesRequest: MessageFns; +export declare const ListFilesResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.ListFilesRequest - */ -export declare const ListFilesRequest: ListFilesRequest$Type; -declare class ListFilesResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListFilesResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesResponse): ListFilesResponse; - internalBinaryWrite(message: ListFilesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.ListFilesResponse - */ -export declare const ListFilesResponse: ListFilesResponse$Type; export {}; diff --git a/javascript/boss/list_files.js b/javascript/boss/list_files.js index 5d9f483..af2f15e 100644 --- a/javascript/boss/list_files.js +++ b/javascript/boss/list_files.js @@ -1,129 +1,164 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_files.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_files.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListFilesResponse = exports.ListFilesRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.ListFilesResponse = exports.ListFilesRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const file_1 = require("./file"); -// @generated message type with reflection information, may provide speed optimized methods -class ListFilesRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.ListFilesRequest", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "country", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "language", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss"; +function createBaseListFilesRequest() { + return { taskId: "", bossAppId: "", country: undefined, language: undefined }; +} +exports.ListFilesRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.country !== undefined) { + writer.uint32(26).string(message.country); + } + if (message.language !== undefined) { + writer.uint32(34).string(message.language); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* optional string country */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.country = reader.string(); - break; - case /* optional string language */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.language = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* optional string country = 3; */ - if (message.country !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.country); - /* optional string language = 4; */ - if (message.language !== undefined) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.language); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.ListFilesRequest - */ -exports.ListFilesRequest = new ListFilesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListFilesResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.ListFilesResponse", [ - { no: 1, name: "files", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => file_1.File } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.files = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : undefined, + language: isSet(object.language) ? globalThis.String(object.language) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.country !== undefined) { + obj.country = message.country; + } + if (message.language !== undefined) { + obj.language = message.language; + } + return obj; + }, + create(base) { + return exports.ListFilesRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListFilesRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.country = object.country ?? undefined; + message.language = object.language ?? undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseListFilesResponse() { + return { files: [] }; +} +exports.ListFilesResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.files) { + file_1.File.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.File files */ 1: - message.files.push(file_1.File.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.files.push(file_1.File.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.File files = 1; */ - for (let i = 0; i < message.files.length; i++) - file_1.File.internalBinaryWrite(message.files[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { files: globalThis.Array.isArray(object?.files) ? object.files.map((e) => file_1.File.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.files?.length) { + obj.files = message.files.map((e) => file_1.File.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListFilesResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListFilesResponse(); + message.files = object.files?.map((e) => file_1.File.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.ListFilesResponse - */ -exports.ListFilesResponse = new ListFilesResponse$Type(); diff --git a/javascript/boss/list_files.ts b/javascript/boss/list_files.ts new file mode 100644 index 0000000..fc61ce6 --- /dev/null +++ b/javascript/boss/list_files.ts @@ -0,0 +1,209 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_files.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { File } from "./file"; + +export const protobufPackage = "boss"; + +export interface ListFilesRequest { + taskId: string; + bossAppId: string; + country?: string | undefined; + language?: string | undefined; +} + +export interface ListFilesResponse { + files: File[]; +} + +function createBaseListFilesRequest(): ListFilesRequest { + return { taskId: "", bossAppId: "", country: undefined, language: undefined }; +} + +export const ListFilesRequest: MessageFns = { + encode(message: ListFilesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.country !== undefined) { + writer.uint32(26).string(message.country); + } + if (message.language !== undefined) { + writer.uint32(34).string(message.language); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListFilesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.country = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.language = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListFilesRequest { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : undefined, + language: isSet(object.language) ? globalThis.String(object.language) : undefined, + }; + }, + + toJSON(message: ListFilesRequest): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.country !== undefined) { + obj.country = message.country; + } + if (message.language !== undefined) { + obj.language = message.language; + } + return obj; + }, + + create(base?: DeepPartial): ListFilesRequest { + return ListFilesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListFilesRequest { + const message = createBaseListFilesRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.country = object.country ?? undefined; + message.language = object.language ?? undefined; + return message; + }, +}; + +function createBaseListFilesResponse(): ListFilesResponse { + return { files: [] }; +} + +export const ListFilesResponse: MessageFns = { + encode(message: ListFilesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.files) { + File.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListFilesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.files.push(File.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListFilesResponse { + return { files: globalThis.Array.isArray(object?.files) ? object.files.map((e: any) => File.fromJSON(e)) : [] }; + }, + + toJSON(message: ListFilesResponse): unknown { + const obj: any = {}; + if (message.files?.length) { + obj.files = message.files.map((e) => File.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListFilesResponse { + return ListFilesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListFilesResponse { + const message = createBaseListFilesResponse(); + message.files = object.files?.map((e) => File.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/list_known_boss_apps.d.ts b/javascript/boss/list_known_boss_apps.d.ts index c57911c..2326fca 100644 --- a/javascript/boss/list_known_boss_apps.d.ts +++ b/javascript/boss/list_known_boss_apps.d.ts @@ -1,66 +1,27 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_known_boss_apps.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.BOSSApp - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface BOSSApp { - /** - * @generated from protobuf field: string boss_app_id = 1; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 2; - */ titleId: string; - /** - * @generated from protobuf field: string title_region = 3; - */ titleRegion: string; - /** - * @generated from protobuf field: string name = 4; - */ name: string; - /** - * @generated from protobuf field: repeated string tasks = 5; - */ tasks: string[]; } -/** - * @generated from protobuf message boss.ListKnownBOSSAppsResponse - */ export interface ListKnownBOSSAppsResponse { - /** - * @generated from protobuf field: repeated boss.BOSSApp apps = 1; - */ apps: BOSSApp[]; } -declare class BOSSApp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BOSSApp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BOSSApp): BOSSApp; - internalBinaryWrite(message: BOSSApp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const BOSSApp: MessageFns; +export declare const ListKnownBOSSAppsResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.BOSSApp - */ -export declare const BOSSApp: BOSSApp$Type; -declare class ListKnownBOSSAppsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListKnownBOSSAppsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListKnownBOSSAppsResponse): ListKnownBOSSAppsResponse; - internalBinaryWrite(message: ListKnownBOSSAppsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.ListKnownBOSSAppsResponse - */ -export declare const ListKnownBOSSAppsResponse: ListKnownBOSSAppsResponse$Type; export {}; diff --git a/javascript/boss/list_known_boss_apps.js b/javascript/boss/list_known_boss_apps.js index 77a5df5..3e980f1 100644 --- a/javascript/boss/list_known_boss_apps.js +++ b/javascript/boss/list_known_boss_apps.js @@ -1,138 +1,178 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_known_boss_apps.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_known_boss_apps.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListKnownBOSSAppsResponse = exports.BOSSApp = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class BOSSApp$Type extends runtime_4.MessageType { - constructor() { - super("boss.BOSSApp", [ - { no: 1, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_region", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "tasks", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.bossAppId = ""; - message.titleId = ""; - message.titleRegion = ""; - message.name = ""; - message.tasks = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ListKnownBOSSAppsResponse = exports.BOSSApp = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseBOSSApp() { + return { bossAppId: "", titleId: "", titleRegion: "", name: "", tasks: [] }; +} +exports.BOSSApp = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.bossAppId !== "") { + writer.uint32(10).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(18).string(message.titleId); + } + if (message.titleRegion !== "") { + writer.uint32(26).string(message.titleRegion); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + for (const v of message.tasks) { + writer.uint32(42).string(v); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBOSSApp(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string boss_app_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.titleId = reader.string(); - break; - case /* string title_region */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleRegion = reader.string(); - break; - case /* string name */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.name = reader.string(); - break; - case /* repeated string tasks */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tasks.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string boss_app_id = 1; */ - if (message.bossAppId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 2; */ - if (message.titleId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string title_region = 3; */ - if (message.titleRegion !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleRegion); - /* string name = 4; */ - if (message.name !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.name); - /* repeated string tasks = 5; */ - for (let i = 0; i < message.tasks.length; i++) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tasks[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.BOSSApp - */ -exports.BOSSApp = new BOSSApp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListKnownBOSSAppsResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.ListKnownBOSSAppsResponse", [ - { no: 1, name: "apps", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.BOSSApp } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.apps = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + titleRegion: isSet(object.titleRegion) ? globalThis.String(object.titleRegion) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + const obj = {}; + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.titleRegion !== "") { + obj.titleRegion = message.titleRegion; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.tasks?.length) { + obj.tasks = message.tasks; + } + return obj; + }, + create(base) { + return exports.BOSSApp.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseBOSSApp(); + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.titleRegion = object.titleRegion ?? ""; + message.name = object.name ?? ""; + message.tasks = object.tasks?.map((e) => e) || []; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseListKnownBOSSAppsResponse() { + return { apps: [] }; +} +exports.ListKnownBOSSAppsResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.apps) { + exports.BOSSApp.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.BOSSApp apps */ 1: - message.apps.push(exports.BOSSApp.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.apps.push(exports.BOSSApp.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.BOSSApp apps = 1; */ - for (let i = 0; i < message.apps.length; i++) - exports.BOSSApp.internalBinaryWrite(message.apps[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { apps: globalThis.Array.isArray(object?.apps) ? object.apps.map((e) => exports.BOSSApp.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.apps?.length) { + obj.apps = message.apps.map((e) => exports.BOSSApp.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListKnownBOSSAppsResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListKnownBOSSAppsResponse(); + message.apps = object.apps?.map((e) => exports.BOSSApp.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.ListKnownBOSSAppsResponse - */ -exports.ListKnownBOSSAppsResponse = new ListKnownBOSSAppsResponse$Type(); diff --git a/javascript/boss/list_known_boss_apps.ts b/javascript/boss/list_known_boss_apps.ts new file mode 100644 index 0000000..d8ab8f8 --- /dev/null +++ b/javascript/boss/list_known_boss_apps.ts @@ -0,0 +1,225 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_known_boss_apps.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface BOSSApp { + bossAppId: string; + titleId: string; + titleRegion: string; + name: string; + tasks: string[]; +} + +export interface ListKnownBOSSAppsResponse { + apps: BOSSApp[]; +} + +function createBaseBOSSApp(): BOSSApp { + return { bossAppId: "", titleId: "", titleRegion: "", name: "", tasks: [] }; +} + +export const BOSSApp: MessageFns = { + encode(message: BOSSApp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bossAppId !== "") { + writer.uint32(10).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(18).string(message.titleId); + } + if (message.titleRegion !== "") { + writer.uint32(26).string(message.titleRegion); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + for (const v of message.tasks) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BOSSApp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBOSSApp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleRegion = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.name = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tasks.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BOSSApp { + return { + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + titleRegion: isSet(object.titleRegion) ? globalThis.String(object.titleRegion) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: BOSSApp): unknown { + const obj: any = {}; + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.titleRegion !== "") { + obj.titleRegion = message.titleRegion; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.tasks?.length) { + obj.tasks = message.tasks; + } + return obj; + }, + + create(base?: DeepPartial): BOSSApp { + return BOSSApp.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BOSSApp { + const message = createBaseBOSSApp(); + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.titleRegion = object.titleRegion ?? ""; + message.name = object.name ?? ""; + message.tasks = object.tasks?.map((e) => e) || []; + return message; + }, +}; + +function createBaseListKnownBOSSAppsResponse(): ListKnownBOSSAppsResponse { + return { apps: [] }; +} + +export const ListKnownBOSSAppsResponse: MessageFns = { + encode(message: ListKnownBOSSAppsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.apps) { + BOSSApp.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListKnownBOSSAppsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.apps.push(BOSSApp.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListKnownBOSSAppsResponse { + return { apps: globalThis.Array.isArray(object?.apps) ? object.apps.map((e: any) => BOSSApp.fromJSON(e)) : [] }; + }, + + toJSON(message: ListKnownBOSSAppsResponse): unknown { + const obj: any = {}; + if (message.apps?.length) { + obj.apps = message.apps.map((e) => BOSSApp.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListKnownBOSSAppsResponse { + return ListKnownBOSSAppsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListKnownBOSSAppsResponse { + const message = createBaseListKnownBOSSAppsResponse(); + message.apps = object.apps?.map((e) => BOSSApp.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/list_tasks.d.ts b/javascript/boss/list_tasks.d.ts index 2b801a0..65f68bf 100644 --- a/javascript/boss/list_tasks.d.ts +++ b/javascript/boss/list_tasks.d.ts @@ -1,32 +1,20 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_tasks.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Task } from "./task"; -/** - * @generated from protobuf message boss.ListTasksResponse - */ +export declare const protobufPackage = "boss"; export interface ListTasksResponse { - /** - * @generated from protobuf field: repeated boss.Task tasks = 1; - */ tasks: Task[]; } -declare class ListTasksResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListTasksResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListTasksResponse): ListTasksResponse; - internalBinaryWrite(message: ListTasksResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ListTasksResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.ListTasksResponse - */ -export declare const ListTasksResponse: ListTasksResponse$Type; export {}; diff --git a/javascript/boss/list_tasks.js b/javascript/boss/list_tasks.js index ece0acf..8257469 100644 --- a/javascript/boss/list_tasks.js +++ b/javascript/boss/list_tasks.js @@ -1,60 +1,63 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/list_tasks.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_tasks.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListTasksResponse = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.ListTasksResponse = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const task_1 = require("./task"); -// @generated message type with reflection information, may provide speed optimized methods -class ListTasksResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.ListTasksResponse", [ - { no: 1, name: "tasks", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => task_1.Task } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.tasks = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss"; +function createBaseListTasksResponse() { + return { tasks: [] }; +} +exports.ListTasksResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.tasks) { + task_1.Task.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.Task tasks */ 1: - message.tasks.push(task_1.Task.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.tasks.push(task_1.Task.decode(reader, reader.uint32())); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.Task tasks = 1; */ - for (let i = 0; i < message.tasks.length; i++) - task_1.Task.internalBinaryWrite(message.tasks[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.ListTasksResponse - */ -exports.ListTasksResponse = new ListTasksResponse$Type(); + }, + fromJSON(object) { + return { tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => task_1.Task.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.tasks?.length) { + obj.tasks = message.tasks.map((e) => task_1.Task.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListTasksResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListTasksResponse(); + message.tasks = object.tasks?.map((e) => task_1.Task.fromPartial(e)) || []; + return message; + }, +}; diff --git a/javascript/boss/list_tasks.ts b/javascript/boss/list_tasks.ts new file mode 100644 index 0000000..4438018 --- /dev/null +++ b/javascript/boss/list_tasks.ts @@ -0,0 +1,90 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/list_tasks.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Task } from "./task"; + +export const protobufPackage = "boss"; + +export interface ListTasksResponse { + tasks: Task[]; +} + +function createBaseListTasksResponse(): ListTasksResponse { + return { tasks: [] }; +} + +export const ListTasksResponse: MessageFns = { + encode(message: ListTasksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tasks) { + Task.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListTasksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tasks.push(Task.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListTasksResponse { + return { tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => Task.fromJSON(e)) : [] }; + }, + + toJSON(message: ListTasksResponse): unknown { + const obj: any = {}; + if (message.tasks?.length) { + obj.tasks = message.tasks.map((e) => Task.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListTasksResponse { + return ListTasksResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListTasksResponse { + const message = createBaseListTasksResponse(); + message.tasks = object.tasks?.map((e) => Task.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/register_task.d.ts b/javascript/boss/register_task.d.ts index 9c6a61e..8bbfb26 100644 --- a/javascript/boss/register_task.d.ts +++ b/javascript/boss/register_task.d.ts @@ -1,67 +1,28 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/register_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Task } from "./task"; -/** - * @generated from protobuf message boss.RegisterTaskRequest - */ +export declare const protobufPackage = "boss"; export interface RegisterTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 3; - */ titleId: string; - /** - * @generated from protobuf field: string country = 4; - */ country: string; - /** - * @generated from protobuf field: string description = 5; - */ description: string; } -/** - * @generated from protobuf message boss.RegisterTaskResponse - */ export interface RegisterTaskResponse { - /** - * @generated from protobuf field: boss.Task task = 1; - */ - task?: Task; + task: Task | undefined; } -declare class RegisterTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterTaskRequest): RegisterTaskRequest; - internalBinaryWrite(message: RegisterTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const RegisterTaskRequest: MessageFns; +export declare const RegisterTaskResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.RegisterTaskRequest - */ -export declare const RegisterTaskRequest: RegisterTaskRequest$Type; -declare class RegisterTaskResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterTaskResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterTaskResponse): RegisterTaskResponse; - internalBinaryWrite(message: RegisterTaskResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.RegisterTaskResponse - */ -export declare const RegisterTaskResponse: RegisterTaskResponse$Type; export {}; diff --git a/javascript/boss/register_task.js b/javascript/boss/register_task.js index 3ac9791..71ec374 100644 --- a/javascript/boss/register_task.js +++ b/javascript/boss/register_task.js @@ -1,138 +1,179 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/register_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/register_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.RegisterTaskResponse = exports.RegisterTaskRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.RegisterTaskResponse = exports.RegisterTaskRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const task_1 = require("./task"); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.RegisterTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - message.titleId = ""; - message.country = ""; - message.description = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss"; +function createBaseRegisterTaskRequest() { + return { id: "", bossAppId: "", titleId: "", country: "", description: "" }; +} +exports.RegisterTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.country !== "") { + writer.uint32(34).string(message.country); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleId = reader.string(); - break; - case /* string country */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.country = reader.string(); - break; - case /* string description */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.description = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 3; */ - if (message.titleId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string country = 4; */ - if (message.country !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.country); - /* string description = 5; */ - if (message.description !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.description); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.RegisterTaskRequest - */ -exports.RegisterTaskRequest = new RegisterTaskRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterTaskResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.RegisterTaskResponse", [ - { no: 1, name: "task", kind: "message", T: () => task_1.Task } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + create(base) { + return exports.RegisterTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.country = object.country ?? ""; + message.description = object.description ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseRegisterTaskResponse() { + return { task: undefined }; +} +exports.RegisterTaskResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.task !== undefined) { + task_1.Task.encode(message.task, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* boss.Task task */ 1: - message.task = task_1.Task.internalBinaryRead(reader, reader.uint32(), options, message.task); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.task = task_1.Task.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* boss.Task task = 1; */ - if (message.task) - task_1.Task.internalBinaryWrite(message.task, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { task: isSet(object.task) ? task_1.Task.fromJSON(object.task) : undefined }; + }, + toJSON(message) { + const obj = {}; + if (message.task !== undefined) { + obj.task = task_1.Task.toJSON(message.task); + } + return obj; + }, + create(base) { + return exports.RegisterTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterTaskResponse(); + message.task = (object.task !== undefined && object.task !== null) ? task_1.Task.fromPartial(object.task) : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.RegisterTaskResponse - */ -exports.RegisterTaskResponse = new RegisterTaskResponse$Type(); diff --git a/javascript/boss/register_task.ts b/javascript/boss/register_task.ts new file mode 100644 index 0000000..3b100e5 --- /dev/null +++ b/javascript/boss/register_task.ts @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/register_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Task } from "./task"; + +export const protobufPackage = "boss"; + +export interface RegisterTaskRequest { + id: string; + bossAppId: string; + titleId: string; + country: string; + description: string; +} + +export interface RegisterTaskResponse { + task: Task | undefined; +} + +function createBaseRegisterTaskRequest(): RegisterTaskRequest { + return { id: "", bossAppId: "", titleId: "", country: "", description: "" }; +} + +export const RegisterTaskRequest: MessageFns = { + encode(message: RegisterTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.country !== "") { + writer.uint32(34).string(message.country); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.country = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.description = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + + toJSON(message: RegisterTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + + create(base?: DeepPartial): RegisterTaskRequest { + return RegisterTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterTaskRequest { + const message = createBaseRegisterTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.country = object.country ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseRegisterTaskResponse(): RegisterTaskResponse { + return { task: undefined }; +} + +export const RegisterTaskResponse: MessageFns = { + encode(message: RegisterTaskResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.task !== undefined) { + Task.encode(message.task, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterTaskResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.task = Task.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterTaskResponse { + return { task: isSet(object.task) ? Task.fromJSON(object.task) : undefined }; + }, + + toJSON(message: RegisterTaskResponse): unknown { + const obj: any = {}; + if (message.task !== undefined) { + obj.task = Task.toJSON(message.task); + } + return obj; + }, + + create(base?: DeepPartial): RegisterTaskResponse { + return RegisterTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterTaskResponse { + const message = createBaseRegisterTaskResponse(); + message.task = (object.task !== undefined && object.task !== null) ? Task.fromPartial(object.task) : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/task.d.ts b/javascript/boss/task.d.ts index dc2b17e..f78ab46 100644 --- a/javascript/boss/task.d.ts +++ b/javascript/boss/task.d.ts @@ -1,67 +1,28 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.Task - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface Task { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: string id = 2; - */ id: string; - /** - * @generated from protobuf field: string in_game_id = 3; - */ inGameId: string; - /** - * @generated from protobuf field: string boss_app_id = 4; - */ bossAppId: string; - /** - * @generated from protobuf field: uint32 creator_pid = 5; - */ creatorPid: number; - /** - * @generated from protobuf field: string status = 6; - */ status: string; - /** - * @generated from protobuf field: string title_id = 7; - */ titleId: string; - /** - * @generated from protobuf field: string description = 8; - */ description: string; - /** - * @generated from protobuf field: uint64 created_timestamp = 9; - */ createdTimestamp: bigint; - /** - * @generated from protobuf field: uint64 updated_timestamp = 10; - */ updatedTimestamp: bigint; } -declare class Task$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Task; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Task): Task; - internalBinaryWrite(message: Task, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Task: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.Task - */ -export declare const Task: Task$Type; export {}; diff --git a/javascript/boss/task.js b/javascript/boss/task.js index 4cae6af..24217ea 100644 --- a/javascript/boss/task.js +++ b/javascript/boss/task.js @@ -1,131 +1,219 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Task = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Task$Type extends runtime_4.MessageType { - constructor() { - super("boss.Task", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "in_game_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "creator_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "created_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "updated_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.id = ""; - message.inGameId = ""; - message.bossAppId = ""; - message.creatorPid = 0; - message.status = ""; - message.titleId = ""; - message.description = ""; - message.createdTimestamp = 0n; - message.updatedTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Task = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseTask() { + return { + deleted: false, + id: "", + inGameId: "", + bossAppId: "", + creatorPid: 0, + status: "", + titleId: "", + description: "", + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} +exports.Task = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.inGameId !== "") { + writer.uint32(26).string(message.inGameId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + if (message.creatorPid !== 0) { + writer.uint32(40).uint32(message.creatorPid); + } + if (message.status !== "") { + writer.uint32(50).string(message.status); + } + if (message.titleId !== "") { + writer.uint32(58).string(message.titleId); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(72).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(80).uint64(message.updatedTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTask(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* string id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.id = reader.string(); - break; - case /* string in_game_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.inGameId = reader.string(); - break; - case /* string boss_app_id */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.bossAppId = reader.string(); - break; - case /* uint32 creator_pid */ 5: + continue; + } + case 5: { + if (tag !== 40) { + break; + } message.creatorPid = reader.uint32(); - break; - case /* string status */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.status = reader.string(); - break; - case /* string title_id */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.titleId = reader.string(); - break; - case /* string description */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.description = reader.string(); - break; - case /* uint64 created_timestamp */ 9: - message.createdTimestamp = reader.uint64().toBigInt(); - break; - case /* uint64 updated_timestamp */ 10: - message.updatedTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.createdTimestamp = reader.uint64(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.updatedTimestamp = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* string id = 2; */ - if (message.id !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.id); - /* string in_game_id = 3; */ - if (message.inGameId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.inGameId); - /* string boss_app_id = 4; */ - if (message.bossAppId !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* uint32 creator_pid = 5; */ - if (message.creatorPid !== 0) - writer.tag(5, runtime_1.WireType.Varint).uint32(message.creatorPid); - /* string status = 6; */ - if (message.status !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.status); - /* string title_id = 7; */ - if (message.titleId !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string description = 8; */ - if (message.description !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.description); - /* uint64 created_timestamp = 9; */ - if (message.createdTimestamp !== 0n) - writer.tag(9, runtime_1.WireType.Varint).uint64(message.createdTimestamp); - /* uint64 updated_timestamp = 10; */ - if (message.updatedTimestamp !== 0n) - writer.tag(10, runtime_1.WireType.Varint).uint64(message.updatedTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + id: isSet(object.id) ? globalThis.String(object.id) : "", + inGameId: isSet(object.inGameId) ? globalThis.String(object.inGameId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + status: isSet(object.status) ? globalThis.String(object.status) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.id !== "") { + obj.id = message.id; + } + if (message.inGameId !== "") { + obj.inGameId = message.inGameId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.Task.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseTask(); + message.deleted = object.deleted ?? false; + message.id = object.id ?? ""; + message.inGameId = object.inGameId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.status = object.status ?? ""; + message.titleId = object.titleId ?? ""; + message.description = object.description ?? ""; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.Task - */ -exports.Task = new Task$Type(); diff --git a/javascript/boss/task.ts b/javascript/boss/task.ts new file mode 100644 index 0000000..0a384aa --- /dev/null +++ b/javascript/boss/task.ts @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface Task { + deleted: boolean; + id: string; + inGameId: string; + bossAppId: string; + creatorPid: number; + status: string; + titleId: string; + description: string; + createdTimestamp: bigint; + updatedTimestamp: bigint; +} + +function createBaseTask(): Task { + return { + deleted: false, + id: "", + inGameId: "", + bossAppId: "", + creatorPid: 0, + status: "", + titleId: "", + description: "", + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} + +export const Task: MessageFns = { + encode(message: Task, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.inGameId !== "") { + writer.uint32(26).string(message.inGameId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + if (message.creatorPid !== 0) { + writer.uint32(40).uint32(message.creatorPid); + } + if (message.status !== "") { + writer.uint32(50).string(message.status); + } + if (message.titleId !== "") { + writer.uint32(58).string(message.titleId); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(72).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(80).uint64(message.updatedTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Task { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTask(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.id = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.inGameId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.creatorPid = reader.uint32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.status = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.description = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.createdTimestamp = reader.uint64() as bigint; + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.updatedTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Task { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + id: isSet(object.id) ? globalThis.String(object.id) : "", + inGameId: isSet(object.inGameId) ? globalThis.String(object.inGameId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + status: isSet(object.status) ? globalThis.String(object.status) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + + toJSON(message: Task): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.id !== "") { + obj.id = message.id; + } + if (message.inGameId !== "") { + obj.inGameId = message.inGameId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): Task { + return Task.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Task { + const message = createBaseTask(); + message.deleted = object.deleted ?? false; + message.id = object.id ?? ""; + message.inGameId = object.inGameId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.status = object.status ?? ""; + message.titleId = object.titleId ?? ""; + message.description = object.description ?? ""; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/update_file_metadata.d.ts b/javascript/boss/update_file_metadata.d.ts index 93e04c4..3236a69 100644 --- a/javascript/boss/update_file_metadata.d.ts +++ b/javascript/boss/update_file_metadata.d.ts @@ -1,98 +1,35 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/update_file_metadata.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.UpdateFileMetadataData - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface UpdateFileMetadataData { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 3; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 4; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 5; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 6; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 7; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 8; - */ attribute3: string; - /** - * @generated from protobuf field: string name = 9; - */ name: string; - /** - * @generated from protobuf field: string type = 10; - */ type: string; - /** - * @generated from protobuf field: repeated string notify_on_new = 11; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 12; - */ notifyLed: boolean; } -/** - * @generated from protobuf message boss.UpdateFileMetadataRequest - */ export interface UpdateFileMetadataRequest { - /** - * @generated from protobuf field: uint64 data_id = 1; - */ dataId: bigint; - /** - * @generated from protobuf field: boss.UpdateFileMetadataData update_data = 2; - */ - updateData?: UpdateFileMetadataData; + updateData: UpdateFileMetadataData | undefined; } -declare class UpdateFileMetadataData$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateFileMetadataData; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFileMetadataData): UpdateFileMetadataData; - internalBinaryWrite(message: UpdateFileMetadataData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateFileMetadataData: MessageFns; +export declare const UpdateFileMetadataRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.UpdateFileMetadataData - */ -export declare const UpdateFileMetadataData: UpdateFileMetadataData$Type; -declare class UpdateFileMetadataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateFileMetadataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFileMetadataRequest): UpdateFileMetadataRequest; - internalBinaryWrite(message: UpdateFileMetadataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.UpdateFileMetadataRequest - */ -export declare const UpdateFileMetadataRequest: UpdateFileMetadataRequest$Type; export {}; diff --git a/javascript/boss/update_file_metadata.js b/javascript/boss/update_file_metadata.js index 13cdc2c..9b0086a 100644 --- a/javascript/boss/update_file_metadata.js +++ b/javascript/boss/update_file_metadata.js @@ -1,201 +1,324 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/update_file_metadata.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/update_file_metadata.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateFileMetadataRequest = exports.UpdateFileMetadataData = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateFileMetadataData$Type extends runtime_4.MessageType { - constructor() { - super("boss.UpdateFileMetadataData", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.name = ""; - message.type = ""; - message.notifyOnNew = []; - message.notifyLed = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UpdateFileMetadataRequest = exports.UpdateFileMetadataData = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseUpdateFileMetadataData() { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + }; +} +exports.UpdateFileMetadataData = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataData(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute3 = reader.string(); - break; - case /* string name */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.name = reader.string(); - break; - case /* string type */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.type = reader.string(); - break; - case /* repeated string notify_on_new */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.notifyLed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 3; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 4; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 5; */ - if (message.password !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 6; */ - if (message.attribute1 !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 7; */ - if (message.attribute2 !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 8; */ - if (message.attribute3 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* string name = 9; */ - if (message.name !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 10; */ - if (message.type !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.type); - /* repeated string notify_on_new = 11; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 12; */ - if (message.notifyLed !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.notifyLed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.UpdateFileMetadataData - */ -exports.UpdateFileMetadataData = new UpdateFileMetadataData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateFileMetadataRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.UpdateFileMetadataRequest", [ - { no: 1, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "update_data", kind: "message", T: () => exports.UpdateFileMetadataData } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.dataId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + return obj; + }, + create(base) { + return exports.UpdateFileMetadataData.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateFileMetadataData(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUpdateFileMetadataRequest() { + return { dataId: 0n, updateData: undefined }; +} +exports.UpdateFileMetadataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.updateData !== undefined) { + exports.UpdateFileMetadataData.encode(message.updateData, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 data_id */ 1: - message.dataId = reader.uint64().toBigInt(); - break; - case /* boss.UpdateFileMetadataData update_data */ 2: - message.updateData = exports.UpdateFileMetadataData.internalBinaryRead(reader, reader.uint32(), options, message.updateData); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.updateData = exports.UpdateFileMetadataData.decode(reader, reader.uint32()); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 data_id = 1; */ - if (message.dataId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.dataId); - /* boss.UpdateFileMetadataData update_data = 2; */ - if (message.updateData) - exports.UpdateFileMetadataData.internalBinaryWrite(message.updateData, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + updateData: isSet(object.updateData) ? exports.UpdateFileMetadataData.fromJSON(object.updateData) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.updateData !== undefined) { + obj.updateData = exports.UpdateFileMetadataData.toJSON(message.updateData); + } + return obj; + }, + create(base) { + return exports.UpdateFileMetadataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateFileMetadataRequest(); + message.dataId = object.dataId ?? 0n; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? exports.UpdateFileMetadataData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.UpdateFileMetadataRequest - */ -exports.UpdateFileMetadataRequest = new UpdateFileMetadataRequest$Type(); diff --git a/javascript/boss/update_file_metadata.ts b/javascript/boss/update_file_metadata.ts new file mode 100644 index 0000000..4a3e43d --- /dev/null +++ b/javascript/boss/update_file_metadata.ts @@ -0,0 +1,387 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/update_file_metadata.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface UpdateFileMetadataData { + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + name: string; + type: string; + notifyOnNew: string[]; + notifyLed: boolean; +} + +export interface UpdateFileMetadataRequest { + dataId: bigint; + updateData: UpdateFileMetadataData | undefined; +} + +function createBaseUpdateFileMetadataData(): UpdateFileMetadataData { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + }; +} + +export const UpdateFileMetadataData: MessageFns = { + encode(message: UpdateFileMetadataData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v!); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateFileMetadataData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.password = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.name = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.type = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFileMetadataData { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + }; + }, + + toJSON(message: UpdateFileMetadataData): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + return obj; + }, + + create(base?: DeepPartial): UpdateFileMetadataData { + return UpdateFileMetadataData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateFileMetadataData { + const message = createBaseUpdateFileMetadataData(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + return message; + }, +}; + +function createBaseUpdateFileMetadataRequest(): UpdateFileMetadataRequest { + return { dataId: 0n, updateData: undefined }; +} + +export const UpdateFileMetadataRequest: MessageFns = { + encode(message: UpdateFileMetadataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.updateData !== undefined) { + UpdateFileMetadataData.encode(message.updateData, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateFileMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.updateData = UpdateFileMetadataData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFileMetadataRequest { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + updateData: isSet(object.updateData) ? UpdateFileMetadataData.fromJSON(object.updateData) : undefined, + }; + }, + + toJSON(message: UpdateFileMetadataRequest): unknown { + const obj: any = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.updateData !== undefined) { + obj.updateData = UpdateFileMetadataData.toJSON(message.updateData); + } + return obj; + }, + + create(base?: DeepPartial): UpdateFileMetadataRequest { + return UpdateFileMetadataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateFileMetadataRequest { + const message = createBaseUpdateFileMetadataRequest(); + message.dataId = object.dataId ?? 0n; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? UpdateFileMetadataData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/update_task.d.ts b/javascript/boss/update_task.d.ts index 2b8e014..43f144b 100644 --- a/javascript/boss/update_task.d.ts +++ b/javascript/boss/update_task.d.ts @@ -1,74 +1,29 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/update_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.UpdateTaskData - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss"; export interface UpdateTaskData { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 3; - */ titleId: string; - /** - * @generated from protobuf field: string status = 4; - */ status: string; - /** - * @generated from protobuf field: string description = 5; - */ description: string; } -/** - * @generated from protobuf message boss.UpdateTaskRequest - */ export interface UpdateTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: boss.UpdateTaskData update_data = 3; - */ - updateData?: UpdateTaskData; + updateData: UpdateTaskData | undefined; } -declare class UpdateTaskData$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateTaskData; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTaskData): UpdateTaskData; - internalBinaryWrite(message: UpdateTaskData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateTaskData: MessageFns; +export declare const UpdateTaskRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.UpdateTaskData - */ -export declare const UpdateTaskData: UpdateTaskData$Type; -declare class UpdateTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTaskRequest): UpdateTaskRequest; - internalBinaryWrite(message: UpdateTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.UpdateTaskRequest - */ -export declare const UpdateTaskRequest: UpdateTaskRequest$Type; export {}; diff --git a/javascript/boss/update_task.js b/javascript/boss/update_task.js index bf70c65..5d27270 100644 --- a/javascript/boss/update_task.js +++ b/javascript/boss/update_task.js @@ -1,153 +1,212 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/update_task.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/update_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateTaskRequest = exports.UpdateTaskData = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateTaskData$Type extends runtime_4.MessageType { - constructor() { - super("boss.UpdateTaskData", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - message.titleId = ""; - message.status = ""; - message.description = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UpdateTaskRequest = exports.UpdateTaskData = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss"; +function createBaseUpdateTaskData() { + return { id: "", bossAppId: "", titleId: "", status: "", description: "" }; +} +exports.UpdateTaskData = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.status !== "") { + writer.uint32(34).string(message.status); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskData(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleId = reader.string(); - break; - case /* string status */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.status = reader.string(); - break; - case /* string description */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.description = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 3; */ - if (message.titleId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string status = 4; */ - if (message.status !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.status); - /* string description = 5; */ - if (message.description !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.description); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.UpdateTaskData - */ -exports.UpdateTaskData = new UpdateTaskData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.UpdateTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "update_data", kind: "message", T: () => exports.UpdateTaskData } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + status: isSet(object.status) ? globalThis.String(object.status) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + create(base) { + return exports.UpdateTaskData.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateTaskData(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.status = object.status ?? ""; + message.description = object.description ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUpdateTaskRequest() { + return { id: "", bossAppId: "", updateData: undefined }; +} +exports.UpdateTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.updateData !== undefined) { + exports.UpdateTaskData.encode(message.updateData, writer.uint32(26).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* boss.UpdateTaskData update_data */ 3: - message.updateData = exports.UpdateTaskData.internalBinaryRead(reader, reader.uint32(), options, message.updateData); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.updateData = exports.UpdateTaskData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* boss.UpdateTaskData update_data = 3; */ - if (message.updateData) - exports.UpdateTaskData.internalBinaryWrite(message.updateData, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + updateData: isSet(object.updateData) ? exports.UpdateTaskData.fromJSON(object.updateData) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.updateData !== undefined) { + obj.updateData = exports.UpdateTaskData.toJSON(message.updateData); + } + return obj; + }, + create(base) { + return exports.UpdateTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? exports.UpdateTaskData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.UpdateTaskRequest - */ -exports.UpdateTaskRequest = new UpdateTaskRequest$Type(); diff --git a/javascript/boss/update_task.ts b/javascript/boss/update_task.ts new file mode 100644 index 0000000..fdc3516 --- /dev/null +++ b/javascript/boss/update_task.ts @@ -0,0 +1,263 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/update_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss"; + +export interface UpdateTaskData { + id: string; + bossAppId: string; + titleId: string; + status: string; + description: string; +} + +export interface UpdateTaskRequest { + id: string; + bossAppId: string; + updateData: UpdateTaskData | undefined; +} + +function createBaseUpdateTaskData(): UpdateTaskData { + return { id: "", bossAppId: "", titleId: "", status: "", description: "" }; +} + +export const UpdateTaskData: MessageFns = { + encode(message: UpdateTaskData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.status !== "") { + writer.uint32(34).string(message.status); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateTaskData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.status = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.description = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateTaskData { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + status: isSet(object.status) ? globalThis.String(object.status) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + + toJSON(message: UpdateTaskData): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + + create(base?: DeepPartial): UpdateTaskData { + return UpdateTaskData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateTaskData { + const message = createBaseUpdateTaskData(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.status = object.status ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseUpdateTaskRequest(): UpdateTaskRequest { + return { id: "", bossAppId: "", updateData: undefined }; +} + +export const UpdateTaskRequest: MessageFns = { + encode(message: UpdateTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.updateData !== undefined) { + UpdateTaskData.encode(message.updateData, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updateData = UpdateTaskData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + updateData: isSet(object.updateData) ? UpdateTaskData.fromJSON(object.updateData) : undefined, + }; + }, + + toJSON(message: UpdateTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.updateData !== undefined) { + obj.updateData = UpdateTaskData.toJSON(message.updateData); + } + return obj; + }, + + create(base?: DeepPartial): UpdateTaskRequest { + return UpdateTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateTaskRequest { + const message = createBaseUpdateTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? UpdateTaskData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/upload_file.d.ts b/javascript/boss/upload_file.d.ts index dda99a6..253545b 100644 --- a/javascript/boss/upload_file.d.ts +++ b/javascript/boss/upload_file.d.ts @@ -1,103 +1,37 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/upload_file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { File } from "./file"; -/** - * @generated from protobuf message boss.UploadFileRequest - */ +export declare const protobufPackage = "boss"; export interface UploadFileRequest { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 3; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 4; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 5; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 6; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 7; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 8; - */ attribute3: string; - /** - * @generated from protobuf field: string name = 9; - */ name: string; - /** - * @generated from protobuf field: string type = 10; - */ type: string; - /** - * @generated from protobuf field: repeated string notify_on_new = 11; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 12; - */ notifyLed: boolean; - /** - * @generated from protobuf field: bytes data = 13; - */ - data: Uint8Array; - /** - * @generated from protobuf field: bool name_equals_data_id = 14; - */ + data: Buffer; nameEqualsDataId: boolean; } -/** - * @generated from protobuf message boss.UploadFileResponse - */ export interface UploadFileResponse { - /** - * @generated from protobuf field: boss.File file = 1; - */ - file?: File; + file: File | undefined; } -declare class UploadFileRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UploadFileRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileRequest): UploadFileRequest; - internalBinaryWrite(message: UploadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UploadFileRequest: MessageFns; +export declare const UploadFileResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.UploadFileRequest - */ -export declare const UploadFileRequest: UploadFileRequest$Type; -declare class UploadFileResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UploadFileResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileResponse): UploadFileResponse; - internalBinaryWrite(message: UploadFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.UploadFileResponse - */ -export declare const UploadFileResponse: UploadFileResponse$Type; export {}; diff --git a/javascript/boss/upload_file.js b/javascript/boss/upload_file.js index 7b120be..4db2083 100644 --- a/javascript/boss/upload_file.js +++ b/javascript/boss/upload_file.js @@ -1,210 +1,341 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/upload_file.proto" (package "boss", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/upload_file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UploadFileResponse = exports.UploadFileRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.UploadFileResponse = exports.UploadFileRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const file_1 = require("./file"); -// @generated message type with reflection information, may provide speed optimized methods -class UploadFileRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.UploadFileRequest", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 13, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 14, name: "name_equals_data_id", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.name = ""; - message.type = ""; - message.notifyOnNew = []; - message.notifyLed = false; - message.data = new Uint8Array(0); - message.nameEqualsDataId = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss"; +function createBaseUploadFileRequest() { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + data: Buffer.alloc(0), + nameEqualsDataId: false, + }; +} +exports.UploadFileRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + if (message.data.length !== 0) { + writer.uint32(106).bytes(message.data); + } + if (message.nameEqualsDataId !== false) { + writer.uint32(112).bool(message.nameEqualsDataId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute3 = reader.string(); - break; - case /* string name */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.name = reader.string(); - break; - case /* string type */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.type = reader.string(); - break; - case /* repeated string notify_on_new */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.notifyLed = reader.bool(); - break; - case /* bytes data */ 13: - message.data = reader.bytes(); - break; - case /* bool name_equals_data_id */ 14: + continue; + } + case 13: { + if (tag !== 106) { + break; + } + message.data = Buffer.from(reader.bytes()); + continue; + } + case 14: { + if (tag !== 112) { + break; + } message.nameEqualsDataId = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 3; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 4; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 5; */ - if (message.password !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 6; */ - if (message.attribute1 !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 7; */ - if (message.attribute2 !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 8; */ - if (message.attribute3 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* string name = 9; */ - if (message.name !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 10; */ - if (message.type !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.type); - /* repeated string notify_on_new = 11; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 12; */ - if (message.notifyLed !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.notifyLed); - /* bytes data = 13; */ - if (message.data.length) - writer.tag(13, runtime_1.WireType.LengthDelimited).bytes(message.data); - /* bool name_equals_data_id = 14; */ - if (message.nameEqualsDataId !== false) - writer.tag(14, runtime_1.WireType.Varint).bool(message.nameEqualsDataId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.UploadFileRequest - */ -exports.UploadFileRequest = new UploadFileRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UploadFileResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.UploadFileResponse", [ - { no: 1, name: "file", kind: "message", T: () => file_1.File } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + data: isSet(object.data) ? Buffer.from(bytesFromBase64(object.data)) : Buffer.alloc(0), + nameEqualsDataId: isSet(object.nameEqualsDataId) ? globalThis.Boolean(object.nameEqualsDataId) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + if (message.nameEqualsDataId !== false) { + obj.nameEqualsDataId = message.nameEqualsDataId; + } + return obj; + }, + create(base) { + return exports.UploadFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUploadFileRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.data = object.data ?? Buffer.alloc(0); + message.nameEqualsDataId = object.nameEqualsDataId ?? false; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUploadFileResponse() { + return { file: undefined }; +} +exports.UploadFileResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.file !== undefined) { + file_1.File.encode(message.file, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* boss.File file */ 1: - message.file = file_1.File.internalBinaryRead(reader, reader.uint32(), options, message.file); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.file = file_1.File.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* boss.File file = 1; */ - if (message.file) - file_1.File.internalBinaryWrite(message.file, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { file: isSet(object.file) ? file_1.File.fromJSON(object.file) : undefined }; + }, + toJSON(message) { + const obj = {}; + if (message.file !== undefined) { + obj.file = file_1.File.toJSON(message.file); + } + return obj; + }, + create(base) { + return exports.UploadFileResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUploadFileResponse(); + message.file = (object.file !== undefined && object.file !== null) ? file_1.File.fromPartial(object.file) : undefined; + return message; + }, +}; +function bytesFromBase64(b64) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} +function base64FromBytes(arr) { + return globalThis.Buffer.from(arr).toString("base64"); +} +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.UploadFileResponse - */ -exports.UploadFileResponse = new UploadFileResponse$Type(); diff --git a/javascript/boss/upload_file.ts b/javascript/boss/upload_file.ts new file mode 100644 index 0000000..44b1e89 --- /dev/null +++ b/javascript/boss/upload_file.ts @@ -0,0 +1,408 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/upload_file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { File } from "./file"; + +export const protobufPackage = "boss"; + +export interface UploadFileRequest { + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + name: string; + type: string; + notifyOnNew: string[]; + notifyLed: boolean; + data: Buffer; + nameEqualsDataId: boolean; +} + +export interface UploadFileResponse { + file: File | undefined; +} + +function createBaseUploadFileRequest(): UploadFileRequest { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + data: Buffer.alloc(0), + nameEqualsDataId: false, + }; +} + +export const UploadFileRequest: MessageFns = { + encode(message: UploadFileRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v!); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + if (message.data.length !== 0) { + writer.uint32(106).bytes(message.data); + } + if (message.nameEqualsDataId !== false) { + writer.uint32(112).bool(message.nameEqualsDataId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UploadFileRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.password = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.name = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.type = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.data = Buffer.from(reader.bytes()); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.nameEqualsDataId = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadFileRequest { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + data: isSet(object.data) ? Buffer.from(bytesFromBase64(object.data)) : Buffer.alloc(0), + nameEqualsDataId: isSet(object.nameEqualsDataId) ? globalThis.Boolean(object.nameEqualsDataId) : false, + }; + }, + + toJSON(message: UploadFileRequest): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + if (message.nameEqualsDataId !== false) { + obj.nameEqualsDataId = message.nameEqualsDataId; + } + return obj; + }, + + create(base?: DeepPartial): UploadFileRequest { + return UploadFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UploadFileRequest { + const message = createBaseUploadFileRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.data = object.data ?? Buffer.alloc(0); + message.nameEqualsDataId = object.nameEqualsDataId ?? false; + return message; + }, +}; + +function createBaseUploadFileResponse(): UploadFileResponse { + return { file: undefined }; +} + +export const UploadFileResponse: MessageFns = { + encode(message: UploadFileResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.file !== undefined) { + File.encode(message.file, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UploadFileResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.file = File.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadFileResponse { + return { file: isSet(object.file) ? File.fromJSON(object.file) : undefined }; + }, + + toJSON(message: UploadFileResponse): unknown { + const obj: any = {}; + if (message.file !== undefined) { + obj.file = File.toJSON(message.file); + } + return obj; + }, + + create(base?: DeepPartial): UploadFileResponse { + return UploadFileResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UploadFileResponse { + const message = createBaseUploadFileResponse(); + message.file = (object.file !== undefined && object.file !== null) ? File.fromPartial(object.file) : undefined; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/boss_service.client.d.ts b/javascript/boss/v2/boss_service.client.d.ts deleted file mode 100644 index 18c08df..0000000 --- a/javascript/boss/v2/boss_service.client.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/boss_service.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { DeleteFileResponse } from "./delete_file"; -import type { DeleteFileRequest } from "./delete_file"; -import type { UpdateFileMetadataResponse } from "./update_file_metadata"; -import type { UpdateFileMetadataRequest } from "./update_file_metadata"; -import type { UploadFileResponse } from "./upload_file"; -import type { UploadFileRequest } from "./upload_file"; -import type { ListFilesResponse } from "./list_files"; -import type { ListFilesRequest } from "./list_files"; -import type { DeleteTaskResponse } from "./delete_task"; -import type { DeleteTaskRequest } from "./delete_task"; -import type { UpdateTaskResponse } from "./update_task"; -import type { UpdateTaskRequest } from "./update_task"; -import type { RegisterTaskResponse } from "./register_task"; -import type { RegisterTaskRequest } from "./register_task"; -import type { ListTasksResponse } from "./list_tasks"; -import type { ListTasksRequest } from "./list_tasks"; -import type { ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; -import type { ListKnownBOSSAppsRequest } from "./list_known_boss_apps"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service boss.v2.BossService - */ -export interface IBossServiceClient { - /** - * @generated from protobuf rpc: ListKnownBOSSApps(boss.v2.ListKnownBOSSAppsRequest) returns (boss.v2.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input: ListKnownBOSSAppsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListTasks(boss.v2.ListTasksRequest) returns (boss.v2.ListTasksResponse); - */ - listTasks(input: ListTasksRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: RegisterTask(boss.v2.RegisterTaskRequest) returns (boss.v2.RegisterTaskResponse); - */ - registerTask(input: RegisterTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateTask(boss.v2.UpdateTaskRequest) returns (boss.v2.UpdateTaskResponse); - */ - updateTask(input: UpdateTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteTask(boss.v2.DeleteTaskRequest) returns (boss.v2.DeleteTaskResponse); - */ - deleteTask(input: DeleteTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListFiles(boss.v2.ListFilesRequest) returns (boss.v2.ListFilesResponse); - */ - listFiles(input: ListFilesRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UploadFile(boss.v2.UploadFileRequest) returns (boss.v2.UploadFileResponse); - */ - uploadFile(input: UploadFileRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.v2.UpdateFileMetadataRequest) returns (boss.v2.UpdateFileMetadataResponse); - */ - updateFileMetadata(input: UpdateFileMetadataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteFile(boss.v2.DeleteFileRequest) returns (boss.v2.DeleteFileResponse); - */ - deleteFile(input: DeleteFileRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service boss.v2.BossService - */ -export declare class BossServiceClient implements IBossServiceClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: ListKnownBOSSApps(boss.v2.ListKnownBOSSAppsRequest) returns (boss.v2.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input: ListKnownBOSSAppsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListTasks(boss.v2.ListTasksRequest) returns (boss.v2.ListTasksResponse); - */ - listTasks(input: ListTasksRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: RegisterTask(boss.v2.RegisterTaskRequest) returns (boss.v2.RegisterTaskResponse); - */ - registerTask(input: RegisterTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateTask(boss.v2.UpdateTaskRequest) returns (boss.v2.UpdateTaskResponse); - */ - updateTask(input: UpdateTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteTask(boss.v2.DeleteTaskRequest) returns (boss.v2.DeleteTaskResponse); - */ - deleteTask(input: DeleteTaskRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: ListFiles(boss.v2.ListFilesRequest) returns (boss.v2.ListFilesResponse); - */ - listFiles(input: ListFilesRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UploadFile(boss.v2.UploadFileRequest) returns (boss.v2.UploadFileResponse); - */ - uploadFile(input: UploadFileRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.v2.UpdateFileMetadataRequest) returns (boss.v2.UpdateFileMetadataResponse); - */ - updateFileMetadata(input: UpdateFileMetadataRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DeleteFile(boss.v2.DeleteFileRequest) returns (boss.v2.DeleteFileResponse); - */ - deleteFile(input: DeleteFileRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/boss/v2/boss_service.client.js b/javascript/boss/v2/boss_service.client.js deleted file mode 100644 index 36a3134..0000000 --- a/javascript/boss/v2/boss_service.client.js +++ /dev/null @@ -1,85 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/boss_service.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.BossServiceClient = void 0; -const boss_service_1 = require("./boss_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service boss.v2.BossService - */ -class BossServiceClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = boss_service_1.BossService.typeName; - this.methods = boss_service_1.BossService.methods; - this.options = boss_service_1.BossService.options; - } - /** - * @generated from protobuf rpc: ListKnownBOSSApps(boss.v2.ListKnownBOSSAppsRequest) returns (boss.v2.ListKnownBOSSAppsResponse); - */ - listKnownBOSSApps(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ListTasks(boss.v2.ListTasksRequest) returns (boss.v2.ListTasksResponse); - */ - listTasks(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: RegisterTask(boss.v2.RegisterTaskRequest) returns (boss.v2.RegisterTaskResponse); - */ - registerTask(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateTask(boss.v2.UpdateTaskRequest) returns (boss.v2.UpdateTaskResponse); - */ - updateTask(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DeleteTask(boss.v2.DeleteTaskRequest) returns (boss.v2.DeleteTaskResponse); - */ - deleteTask(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: ListFiles(boss.v2.ListFilesRequest) returns (boss.v2.ListFilesResponse); - */ - listFiles(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UploadFile(boss.v2.UploadFileRequest) returns (boss.v2.UploadFileResponse); - */ - uploadFile(input, options) { - const method = this.methods[6], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: UpdateFileMetadata(boss.v2.UpdateFileMetadataRequest) returns (boss.v2.UpdateFileMetadataResponse); - */ - updateFileMetadata(input, options) { - const method = this.methods[7], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DeleteFile(boss.v2.DeleteFileRequest) returns (boss.v2.DeleteFileResponse); - */ - deleteFile(input, options) { - const method = this.methods[8], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.BossServiceClient = BossServiceClient; diff --git a/javascript/boss/v2/boss_service.d.ts b/javascript/boss/v2/boss_service.d.ts index 07676b9..90b5322 100644 --- a/javascript/boss/v2/boss_service.d.ts +++ b/javascript/boss/v2/boss_service.d.ts @@ -1,9 +1,117 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/boss_service.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service boss.v2.BossService - */ -export declare const BossService: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { DeleteFileRequest, DeleteFileResponse } from "./delete_file"; +import { DeleteTaskRequest, DeleteTaskResponse } from "./delete_task"; +import { ListFilesRequest, ListFilesResponse } from "./list_files"; +import { ListKnownBOSSAppsRequest, ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; +import { ListTasksRequest, ListTasksResponse } from "./list_tasks"; +import { RegisterTaskRequest, RegisterTaskResponse } from "./register_task"; +import { UpdateFileMetadataRequest, UpdateFileMetadataResponse } from "./update_file_metadata"; +import { UpdateTaskRequest, UpdateTaskResponse } from "./update_task"; +import { UploadFileRequest, UploadFileResponse } from "./upload_file"; +export declare const protobufPackage = "boss.v2"; +export type BossServiceDefinition = typeof BossServiceDefinition; +export declare const BossServiceDefinition: { + readonly name: "BossService"; + readonly fullName: "boss.v2.BossService"; + readonly methods: { + readonly listKnownBOSSApps: { + readonly name: "ListKnownBOSSApps"; + readonly requestType: import("./list_known_boss_apps").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_known_boss_apps").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly listTasks: { + readonly name: "ListTasks"; + readonly requestType: import("./list_tasks").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_tasks").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly registerTask: { + readonly name: "RegisterTask"; + readonly requestType: import("./register_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("./register_task").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateTask: { + readonly name: "UpdateTask"; + readonly requestType: import("./update_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("./update_task").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly deleteTask: { + readonly name: "DeleteTask"; + readonly requestType: import("./delete_task").MessageFns; + readonly requestStream: false; + readonly responseType: import("./delete_task").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly listFiles: { + readonly name: "ListFiles"; + readonly requestType: import("./list_files").MessageFns; + readonly requestStream: false; + readonly responseType: import("./list_files").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly uploadFile: { + readonly name: "UploadFile"; + readonly requestType: import("./upload_file").MessageFns; + readonly requestStream: false; + readonly responseType: import("./upload_file").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly updateFileMetadata: { + readonly name: "UpdateFileMetadata"; + readonly requestType: import("./update_file_metadata").MessageFns; + readonly requestStream: false; + readonly responseType: import("./update_file_metadata").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly deleteFile: { + readonly name: "DeleteFile"; + readonly requestType: import("./delete_file").MessageFns; + readonly requestStream: false; + readonly responseType: import("./delete_file").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface BossServiceImplementation { + listKnownBOSSApps(request: ListKnownBOSSAppsRequest, context: CallContext & CallContextExt): Promise>; + listTasks(request: ListTasksRequest, context: CallContext & CallContextExt): Promise>; + registerTask(request: RegisterTaskRequest, context: CallContext & CallContextExt): Promise>; + updateTask(request: UpdateTaskRequest, context: CallContext & CallContextExt): Promise>; + deleteTask(request: DeleteTaskRequest, context: CallContext & CallContextExt): Promise>; + listFiles(request: ListFilesRequest, context: CallContext & CallContextExt): Promise>; + uploadFile(request: UploadFileRequest, context: CallContext & CallContextExt): Promise>; + updateFileMetadata(request: UpdateFileMetadataRequest, context: CallContext & CallContextExt): Promise>; + deleteFile(request: DeleteFileRequest, context: CallContext & CallContextExt): Promise>; +} +export interface BossServiceClient { + listKnownBOSSApps(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + listTasks(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + registerTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + deleteTask(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + listFiles(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + uploadFile(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + updateFileMetadata(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + deleteFile(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/boss/v2/boss_service.js b/javascript/boss/v2/boss_service.js index 351884b..81938e7 100644 --- a/javascript/boss/v2/boss_service.js +++ b/javascript/boss/v2/boss_service.js @@ -1,46 +1,96 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/boss_service.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/boss_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.BossService = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/boss_service.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck +exports.BossServiceDefinition = exports.protobufPackage = void 0; const delete_file_1 = require("./delete_file"); -const delete_file_2 = require("./delete_file"); -const update_file_metadata_1 = require("./update_file_metadata"); -const update_file_metadata_2 = require("./update_file_metadata"); -const upload_file_1 = require("./upload_file"); -const upload_file_2 = require("./upload_file"); -const list_files_1 = require("./list_files"); -const list_files_2 = require("./list_files"); const delete_task_1 = require("./delete_task"); -const delete_task_2 = require("./delete_task"); -const update_task_1 = require("./update_task"); -const update_task_2 = require("./update_task"); -const register_task_1 = require("./register_task"); -const register_task_2 = require("./register_task"); -const list_tasks_1 = require("./list_tasks"); -const list_tasks_2 = require("./list_tasks"); +const list_files_1 = require("./list_files"); const list_known_boss_apps_1 = require("./list_known_boss_apps"); -const list_known_boss_apps_2 = require("./list_known_boss_apps"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service boss.v2.BossService - */ -exports.BossService = new runtime_rpc_1.ServiceType("boss.v2.BossService", [ - { name: "ListKnownBOSSApps", options: {}, I: list_known_boss_apps_2.ListKnownBOSSAppsRequest, O: list_known_boss_apps_1.ListKnownBOSSAppsResponse }, - { name: "ListTasks", options: {}, I: list_tasks_2.ListTasksRequest, O: list_tasks_1.ListTasksResponse }, - { name: "RegisterTask", options: {}, I: register_task_2.RegisterTaskRequest, O: register_task_1.RegisterTaskResponse }, - { name: "UpdateTask", options: {}, I: update_task_2.UpdateTaskRequest, O: update_task_1.UpdateTaskResponse }, - { name: "DeleteTask", options: {}, I: delete_task_2.DeleteTaskRequest, O: delete_task_1.DeleteTaskResponse }, - { name: "ListFiles", options: {}, I: list_files_2.ListFilesRequest, O: list_files_1.ListFilesResponse }, - { name: "UploadFile", options: {}, I: upload_file_2.UploadFileRequest, O: upload_file_1.UploadFileResponse }, - { name: "UpdateFileMetadata", options: {}, I: update_file_metadata_2.UpdateFileMetadataRequest, O: update_file_metadata_1.UpdateFileMetadataResponse }, - { name: "DeleteFile", options: {}, I: delete_file_2.DeleteFileRequest, O: delete_file_1.DeleteFileResponse } -]); +const list_tasks_1 = require("./list_tasks"); +const register_task_1 = require("./register_task"); +const update_file_metadata_1 = require("./update_file_metadata"); +const update_task_1 = require("./update_task"); +const upload_file_1 = require("./upload_file"); +exports.protobufPackage = "boss.v2"; +exports.BossServiceDefinition = { + name: "BossService", + fullName: "boss.v2.BossService", + methods: { + listKnownBOSSApps: { + name: "ListKnownBOSSApps", + requestType: list_known_boss_apps_1.ListKnownBOSSAppsRequest, + requestStream: false, + responseType: list_known_boss_apps_1.ListKnownBOSSAppsResponse, + responseStream: false, + options: {}, + }, + listTasks: { + name: "ListTasks", + requestType: list_tasks_1.ListTasksRequest, + requestStream: false, + responseType: list_tasks_1.ListTasksResponse, + responseStream: false, + options: {}, + }, + registerTask: { + name: "RegisterTask", + requestType: register_task_1.RegisterTaskRequest, + requestStream: false, + responseType: register_task_1.RegisterTaskResponse, + responseStream: false, + options: {}, + }, + updateTask: { + name: "UpdateTask", + requestType: update_task_1.UpdateTaskRequest, + requestStream: false, + responseType: update_task_1.UpdateTaskResponse, + responseStream: false, + options: {}, + }, + deleteTask: { + name: "DeleteTask", + requestType: delete_task_1.DeleteTaskRequest, + requestStream: false, + responseType: delete_task_1.DeleteTaskResponse, + responseStream: false, + options: {}, + }, + listFiles: { + name: "ListFiles", + requestType: list_files_1.ListFilesRequest, + requestStream: false, + responseType: list_files_1.ListFilesResponse, + responseStream: false, + options: {}, + }, + uploadFile: { + name: "UploadFile", + requestType: upload_file_1.UploadFileRequest, + requestStream: false, + responseType: upload_file_1.UploadFileResponse, + responseStream: false, + options: {}, + }, + updateFileMetadata: { + name: "UpdateFileMetadata", + requestType: update_file_metadata_1.UpdateFileMetadataRequest, + requestStream: false, + responseType: update_file_metadata_1.UpdateFileMetadataResponse, + responseStream: false, + options: {}, + }, + deleteFile: { + name: "DeleteFile", + requestType: delete_file_1.DeleteFileRequest, + requestStream: false, + responseType: delete_file_1.DeleteFileResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/boss/v2/boss_service.ts b/javascript/boss/v2/boss_service.ts new file mode 100644 index 0000000..98785e0 --- /dev/null +++ b/javascript/boss/v2/boss_service.ts @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/boss_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { DeleteFileRequest, DeleteFileResponse } from "./delete_file"; +import { DeleteTaskRequest, DeleteTaskResponse } from "./delete_task"; +import { ListFilesRequest, ListFilesResponse } from "./list_files"; +import { ListKnownBOSSAppsRequest, ListKnownBOSSAppsResponse } from "./list_known_boss_apps"; +import { ListTasksRequest, ListTasksResponse } from "./list_tasks"; +import { RegisterTaskRequest, RegisterTaskResponse } from "./register_task"; +import { UpdateFileMetadataRequest, UpdateFileMetadataResponse } from "./update_file_metadata"; +import { UpdateTaskRequest, UpdateTaskResponse } from "./update_task"; +import { UploadFileRequest, UploadFileResponse } from "./upload_file"; + +export const protobufPackage = "boss.v2"; + +export type BossServiceDefinition = typeof BossServiceDefinition; +export const BossServiceDefinition = { + name: "BossService", + fullName: "boss.v2.BossService", + methods: { + listKnownBOSSApps: { + name: "ListKnownBOSSApps", + requestType: ListKnownBOSSAppsRequest, + requestStream: false, + responseType: ListKnownBOSSAppsResponse, + responseStream: false, + options: {}, + }, + listTasks: { + name: "ListTasks", + requestType: ListTasksRequest, + requestStream: false, + responseType: ListTasksResponse, + responseStream: false, + options: {}, + }, + registerTask: { + name: "RegisterTask", + requestType: RegisterTaskRequest, + requestStream: false, + responseType: RegisterTaskResponse, + responseStream: false, + options: {}, + }, + updateTask: { + name: "UpdateTask", + requestType: UpdateTaskRequest, + requestStream: false, + responseType: UpdateTaskResponse, + responseStream: false, + options: {}, + }, + deleteTask: { + name: "DeleteTask", + requestType: DeleteTaskRequest, + requestStream: false, + responseType: DeleteTaskResponse, + responseStream: false, + options: {}, + }, + listFiles: { + name: "ListFiles", + requestType: ListFilesRequest, + requestStream: false, + responseType: ListFilesResponse, + responseStream: false, + options: {}, + }, + uploadFile: { + name: "UploadFile", + requestType: UploadFileRequest, + requestStream: false, + responseType: UploadFileResponse, + responseStream: false, + options: {}, + }, + updateFileMetadata: { + name: "UpdateFileMetadata", + requestType: UpdateFileMetadataRequest, + requestStream: false, + responseType: UpdateFileMetadataResponse, + responseStream: false, + options: {}, + }, + deleteFile: { + name: "DeleteFile", + requestType: DeleteFileRequest, + requestStream: false, + responseType: DeleteFileResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface BossServiceImplementation { + listKnownBOSSApps( + request: ListKnownBOSSAppsRequest, + context: CallContext & CallContextExt, + ): Promise>; + listTasks(request: ListTasksRequest, context: CallContext & CallContextExt): Promise>; + registerTask( + request: RegisterTaskRequest, + context: CallContext & CallContextExt, + ): Promise>; + updateTask( + request: UpdateTaskRequest, + context: CallContext & CallContextExt, + ): Promise>; + deleteTask( + request: DeleteTaskRequest, + context: CallContext & CallContextExt, + ): Promise>; + listFiles(request: ListFilesRequest, context: CallContext & CallContextExt): Promise>; + uploadFile( + request: UploadFileRequest, + context: CallContext & CallContextExt, + ): Promise>; + updateFileMetadata( + request: UpdateFileMetadataRequest, + context: CallContext & CallContextExt, + ): Promise>; + deleteFile( + request: DeleteFileRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface BossServiceClient { + listKnownBOSSApps( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + listTasks(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + registerTask( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updateTask( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + deleteTask( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + listFiles(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + uploadFile( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + updateFileMetadata( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + deleteFile( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/boss/v2/delete_file.d.ts b/javascript/boss/v2/delete_file.d.ts index b1e9e93..4a3943c 100644 --- a/javascript/boss/v2/delete_file.d.ts +++ b/javascript/boss/v2/delete_file.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/delete_file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.DeleteFileRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface DeleteFileRequest { - /** - * @generated from protobuf field: uint64 data_id = 1; - */ dataId: bigint; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; } -/** - * @generated from protobuf message boss.v2.DeleteFileResponse - */ export interface DeleteFileResponse { } -declare class DeleteFileRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteFileRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteFileRequest): DeleteFileRequest; - internalBinaryWrite(message: DeleteFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DeleteFileRequest: MessageFns; +export declare const DeleteFileResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.DeleteFileRequest - */ -export declare const DeleteFileRequest: DeleteFileRequest$Type; -declare class DeleteFileResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteFileResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteFileResponse): DeleteFileResponse; - internalBinaryWrite(message: DeleteFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.DeleteFileResponse - */ -export declare const DeleteFileResponse: DeleteFileResponse$Type; export {}; diff --git a/javascript/boss/v2/delete_file.js b/javascript/boss/v2/delete_file.js index 1eb56dc..6d9a212 100644 --- a/javascript/boss/v2/delete_file.js +++ b/javascript/boss/v2/delete_file.js @@ -1,92 +1,122 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/delete_file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/delete_file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DeleteFileResponse = exports.DeleteFileRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteFileRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.DeleteFileRequest", [ - { no: 1, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.dataId = 0n; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DeleteFileResponse = exports.DeleteFileRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseDeleteFileRequest() { + return { dataId: 0n, bossAppId: "" }; +} +exports.DeleteFileRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 data_id */ 1: - message.dataId = reader.uint64().toBigInt(); - break; - case /* string boss_app_id */ 2: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 data_id = 1; */ - if (message.dataId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.dataId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.DeleteFileRequest - */ -exports.DeleteFileRequest = new DeleteFileRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteFileResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.DeleteFileResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + create(base) { + return exports.DeleteFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDeleteFileRequest(); + message.dataId = object.dataId ?? 0n; + message.bossAppId = object.bossAppId ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseDeleteFileResponse() { + return {}; +} +exports.DeleteFileResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.DeleteFileResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseDeleteFileResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.DeleteFileResponse - */ -exports.DeleteFileResponse = new DeleteFileResponse$Type(); diff --git a/javascript/boss/v2/delete_file.ts b/javascript/boss/v2/delete_file.ts new file mode 100644 index 0000000..dce7313 --- /dev/null +++ b/javascript/boss/v2/delete_file.ts @@ -0,0 +1,161 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/delete_file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface DeleteFileRequest { + dataId: bigint; + bossAppId: string; +} + +export interface DeleteFileResponse { +} + +function createBaseDeleteFileRequest(): DeleteFileRequest { + return { dataId: 0n, bossAppId: "" }; +} + +export const DeleteFileRequest: MessageFns = { + encode(message: DeleteFileRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteFileRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteFileRequest { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + + toJSON(message: DeleteFileRequest): unknown { + const obj: any = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteFileRequest { + return DeleteFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteFileRequest { + const message = createBaseDeleteFileRequest(); + message.dataId = object.dataId ?? 0n; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; + +function createBaseDeleteFileResponse(): DeleteFileResponse { + return {}; +} + +export const DeleteFileResponse: MessageFns = { + encode(_: DeleteFileResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteFileResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteFileResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DeleteFileResponse { + return {}; + }, + + toJSON(_: DeleteFileResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DeleteFileResponse { + return DeleteFileResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DeleteFileResponse { + const message = createBaseDeleteFileResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/delete_task.d.ts b/javascript/boss/v2/delete_task.d.ts index f2f68c1..bed56b4 100644 --- a/javascript/boss/v2/delete_task.d.ts +++ b/javascript/boss/v2/delete_task.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/delete_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.DeleteTaskRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface DeleteTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; } -/** - * @generated from protobuf message boss.v2.DeleteTaskResponse - */ export interface DeleteTaskResponse { } -declare class DeleteTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteTaskRequest): DeleteTaskRequest; - internalBinaryWrite(message: DeleteTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DeleteTaskRequest: MessageFns; +export declare const DeleteTaskResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.DeleteTaskRequest - */ -export declare const DeleteTaskRequest: DeleteTaskRequest$Type; -declare class DeleteTaskResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DeleteTaskResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteTaskResponse): DeleteTaskResponse; - internalBinaryWrite(message: DeleteTaskResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.DeleteTaskResponse - */ -export declare const DeleteTaskResponse: DeleteTaskResponse$Type; export {}; diff --git a/javascript/boss/v2/delete_task.js b/javascript/boss/v2/delete_task.js index 12011fc..17c2830 100644 --- a/javascript/boss/v2/delete_task.js +++ b/javascript/boss/v2/delete_task.js @@ -1,92 +1,119 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/delete_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/delete_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DeleteTaskResponse = exports.DeleteTaskRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.DeleteTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DeleteTaskResponse = exports.DeleteTaskRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseDeleteTaskRequest() { + return { id: "", bossAppId: "" }; +} +exports.DeleteTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.DeleteTaskRequest - */ -exports.DeleteTaskRequest = new DeleteTaskRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DeleteTaskResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.DeleteTaskResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + create(base) { + return exports.DeleteTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDeleteTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseDeleteTaskResponse() { + return {}; +} +exports.DeleteTaskResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.DeleteTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseDeleteTaskResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.DeleteTaskResponse - */ -exports.DeleteTaskResponse = new DeleteTaskResponse$Type(); diff --git a/javascript/boss/v2/delete_task.ts b/javascript/boss/v2/delete_task.ts new file mode 100644 index 0000000..3059d2c --- /dev/null +++ b/javascript/boss/v2/delete_task.ts @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/delete_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface DeleteTaskRequest { + id: string; + bossAppId: string; +} + +export interface DeleteTaskResponse { +} + +function createBaseDeleteTaskRequest(): DeleteTaskRequest { + return { id: "", bossAppId: "" }; +} + +export const DeleteTaskRequest: MessageFns = { + encode(message: DeleteTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + }; + }, + + toJSON(message: DeleteTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteTaskRequest { + return DeleteTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteTaskRequest { + const message = createBaseDeleteTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + return message; + }, +}; + +function createBaseDeleteTaskResponse(): DeleteTaskResponse { + return {}; +} + +export const DeleteTaskResponse: MessageFns = { + encode(_: DeleteTaskResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteTaskResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DeleteTaskResponse { + return {}; + }, + + toJSON(_: DeleteTaskResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DeleteTaskResponse { + return DeleteTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DeleteTaskResponse { + const message = createBaseDeleteTaskResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/file.d.ts b/javascript/boss/v2/file.d.ts index 0765e32..47424c4 100644 --- a/javascript/boss/v2/file.d.ts +++ b/javascript/boss/v2/file.d.ts @@ -1,103 +1,37 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.File - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface File { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: uint64 data_id = 2; - */ dataId: bigint; - /** - * @generated from protobuf field: string task_id = 3; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 4; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 5; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 6; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 7; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 8; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 9; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 10; - */ attribute3: string; - /** - * @generated from protobuf field: uint32 creator_pid = 11; - */ creatorPid: number; - /** - * @generated from protobuf field: string name = 12; - */ name: string; - /** - * @generated from protobuf field: string type = 13; - */ type: string; - /** - * @generated from protobuf field: string hash = 14; - */ hash: string; - /** - * @generated from protobuf field: uint64 size = 15; - */ size: bigint; - /** - * @generated from protobuf field: repeated string notify_on_new = 16; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 17; - */ notifyLed: boolean; - /** - * @generated from protobuf field: uint64 created_timestamp = 18; - */ createdTimestamp: bigint; - /** - * @generated from protobuf field: uint64 updated_timestamp = 19; - */ updatedTimestamp: bigint; } -declare class File$Type extends MessageType { - constructor(); - create(value?: PartialMessage): File; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: File): File; - internalBinaryWrite(message: File, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const File: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.File - */ -export declare const File: File$Type; export {}; diff --git a/javascript/boss/v2/file.js b/javascript/boss/v2/file.js index 8d20402..7b7b9aa 100644 --- a/javascript/boss/v2/file.js +++ b/javascript/boss/v2/file.js @@ -1,203 +1,375 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.File = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class File$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.File", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 3, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "creator_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 12, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 13, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 14, name: "hash", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 15, name: "size", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 16, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 17, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 18, name: "created_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 19, name: "updated_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.dataId = 0n; - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.creatorPid = 0; - message.name = ""; - message.type = ""; - message.hash = ""; - message.size = 0n; - message.notifyOnNew = []; - message.notifyLed = false; - message.createdTimestamp = 0n; - message.updatedTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.File = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseFile() { + return { + deleted: false, + dataId: 0n, + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + creatorPid: 0, + name: "", + type: "", + hash: "", + size: 0n, + notifyOnNew: [], + notifyLed: false, + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} +exports.File = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(16).uint64(message.dataId); + } + if (message.taskId !== "") { + writer.uint32(26).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(42).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(50).string(v); + } + if (message.password !== "") { + writer.uint32(58).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(66).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(74).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(82).string(message.attribute3); + } + if (message.creatorPid !== 0) { + writer.uint32(88).uint32(message.creatorPid); + } + if (message.name !== "") { + writer.uint32(98).string(message.name); + } + if (message.type !== "") { + writer.uint32(106).string(message.type); + } + if (message.hash !== "") { + writer.uint32(114).string(message.hash); + } + if (message.size !== 0n) { + if (BigInt.asUintN(64, message.size) !== message.size) { + throw new globalThis.Error("value provided for field message.size of type uint64 too large"); + } + writer.uint32(120).uint64(message.size); + } + for (const v of message.notifyOnNew) { + writer.uint32(130).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(136).bool(message.notifyLed); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(144).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(152).uint64(message.updatedTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFile(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* uint64 data_id */ 2: - message.dataId = reader.uint64().toBigInt(); - break; - case /* string task_id */ 3: + continue; + } + case 2: { + if (tag !== 16) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.attribute3 = reader.string(); - break; - case /* uint32 creator_pid */ 11: + continue; + } + case 11: { + if (tag !== 88) { + break; + } message.creatorPid = reader.uint32(); - break; - case /* string name */ 12: + continue; + } + case 12: { + if (tag !== 98) { + break; + } message.name = reader.string(); - break; - case /* string type */ 13: + continue; + } + case 13: { + if (tag !== 106) { + break; + } message.type = reader.string(); - break; - case /* string hash */ 14: + continue; + } + case 14: { + if (tag !== 114) { + break; + } message.hash = reader.string(); - break; - case /* uint64 size */ 15: - message.size = reader.uint64().toBigInt(); - break; - case /* repeated string notify_on_new */ 16: + continue; + } + case 15: { + if (tag !== 120) { + break; + } + message.size = reader.uint64(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 17: + continue; + } + case 17: { + if (tag !== 136) { + break; + } message.notifyLed = reader.bool(); - break; - case /* uint64 created_timestamp */ 18: - message.createdTimestamp = reader.uint64().toBigInt(); - break; - case /* uint64 updated_timestamp */ 19: - message.updatedTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + message.createdTimestamp = reader.uint64(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + message.updatedTimestamp = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* uint64 data_id = 2; */ - if (message.dataId !== 0n) - writer.tag(2, runtime_1.WireType.Varint).uint64(message.dataId); - /* string task_id = 3; */ - if (message.taskId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 4; */ - if (message.bossAppId !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 5; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 6; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 7; */ - if (message.password !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 8; */ - if (message.attribute1 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 9; */ - if (message.attribute2 !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 10; */ - if (message.attribute3 !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* uint32 creator_pid = 11; */ - if (message.creatorPid !== 0) - writer.tag(11, runtime_1.WireType.Varint).uint32(message.creatorPid); - /* string name = 12; */ - if (message.name !== "") - writer.tag(12, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 13; */ - if (message.type !== "") - writer.tag(13, runtime_1.WireType.LengthDelimited).string(message.type); - /* string hash = 14; */ - if (message.hash !== "") - writer.tag(14, runtime_1.WireType.LengthDelimited).string(message.hash); - /* uint64 size = 15; */ - if (message.size !== 0n) - writer.tag(15, runtime_1.WireType.Varint).uint64(message.size); - /* repeated string notify_on_new = 16; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(16, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 17; */ - if (message.notifyLed !== false) - writer.tag(17, runtime_1.WireType.Varint).bool(message.notifyLed); - /* uint64 created_timestamp = 18; */ - if (message.createdTimestamp !== 0n) - writer.tag(18, runtime_1.WireType.Varint).uint64(message.createdTimestamp); - /* uint64 updated_timestamp = 19; */ - if (message.updatedTimestamp !== 0n) - writer.tag(19, runtime_1.WireType.Varint).uint64(message.updatedTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + hash: isSet(object.hash) ? globalThis.String(object.hash) : "", + size: isSet(object.size) ? BigInt(object.size) : 0n, + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.hash !== "") { + obj.hash = message.hash; + } + if (message.size !== 0n) { + obj.size = message.size.toString(); + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.File.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseFile(); + message.deleted = object.deleted ?? false; + message.dataId = object.dataId ?? 0n; + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.hash = object.hash ?? ""; + message.size = object.size ?? 0n; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.File - */ -exports.File = new File$Type(); diff --git a/javascript/boss/v2/file.ts b/javascript/boss/v2/file.ts new file mode 100644 index 0000000..d1f2cca --- /dev/null +++ b/javascript/boss/v2/file.ts @@ -0,0 +1,439 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface File { + deleted: boolean; + dataId: bigint; + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + creatorPid: number; + name: string; + type: string; + hash: string; + size: bigint; + notifyOnNew: string[]; + notifyLed: boolean; + createdTimestamp: bigint; + updatedTimestamp: bigint; +} + +function createBaseFile(): File { + return { + deleted: false, + dataId: 0n, + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + creatorPid: 0, + name: "", + type: "", + hash: "", + size: 0n, + notifyOnNew: [], + notifyLed: false, + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} + +export const File: MessageFns = { + encode(message: File, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(16).uint64(message.dataId); + } + if (message.taskId !== "") { + writer.uint32(26).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(42).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(50).string(v!); + } + if (message.password !== "") { + writer.uint32(58).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(66).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(74).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(82).string(message.attribute3); + } + if (message.creatorPid !== 0) { + writer.uint32(88).uint32(message.creatorPid); + } + if (message.name !== "") { + writer.uint32(98).string(message.name); + } + if (message.type !== "") { + writer.uint32(106).string(message.type); + } + if (message.hash !== "") { + writer.uint32(114).string(message.hash); + } + if (message.size !== 0n) { + if (BigInt.asUintN(64, message.size) !== message.size) { + throw new globalThis.Error("value provided for field message.size of type uint64 too large"); + } + writer.uint32(120).uint64(message.size); + } + for (const v of message.notifyOnNew) { + writer.uint32(130).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(136).bool(message.notifyLed); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(144).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(152).uint64(message.updatedTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): File { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFile(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.password = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.creatorPid = reader.uint32(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.name = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.type = reader.string(); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.hash = reader.string(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.size = reader.uint64() as bigint; + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.createdTimestamp = reader.uint64() as bigint; + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.updatedTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): File { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + hash: isSet(object.hash) ? globalThis.String(object.hash) : "", + size: isSet(object.size) ? BigInt(object.size) : 0n, + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + + toJSON(message: File): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.hash !== "") { + obj.hash = message.hash; + } + if (message.size !== 0n) { + obj.size = message.size.toString(); + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): File { + return File.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): File { + const message = createBaseFile(); + message.deleted = object.deleted ?? false; + message.dataId = object.dataId ?? 0n; + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.hash = object.hash ?? ""; + message.size = object.size ?? 0n; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/list_files.d.ts b/javascript/boss/v2/list_files.d.ts index 901caab..3e98718 100644 --- a/javascript/boss/v2/list_files.d.ts +++ b/javascript/boss/v2/list_files.d.ts @@ -1,63 +1,27 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_files.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { File } from "./file"; -/** - * @generated from protobuf message boss.v2.ListFilesRequest - */ +export declare const protobufPackage = "boss.v2"; export interface ListFilesRequest { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: optional string country = 3; - */ - country?: string; - /** - * @generated from protobuf field: optional string language = 4; - */ - language?: string; + country?: string | undefined; + language?: string | undefined; } -/** - * @generated from protobuf message boss.v2.ListFilesResponse - */ export interface ListFilesResponse { - /** - * @generated from protobuf field: repeated boss.v2.File files = 1; - */ files: File[]; } -declare class ListFilesRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListFilesRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesRequest): ListFilesRequest; - internalBinaryWrite(message: ListFilesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ListFilesRequest: MessageFns; +export declare const ListFilesResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.ListFilesRequest - */ -export declare const ListFilesRequest: ListFilesRequest$Type; -declare class ListFilesResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListFilesResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListFilesResponse): ListFilesResponse; - internalBinaryWrite(message: ListFilesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.ListFilesResponse - */ -export declare const ListFilesResponse: ListFilesResponse$Type; export {}; diff --git a/javascript/boss/v2/list_files.js b/javascript/boss/v2/list_files.js index 72d54e2..aa461a7 100644 --- a/javascript/boss/v2/list_files.js +++ b/javascript/boss/v2/list_files.js @@ -1,129 +1,164 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_files.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_files.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListFilesResponse = exports.ListFilesRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.ListFilesResponse = exports.ListFilesRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const file_1 = require("./file"); -// @generated message type with reflection information, may provide speed optimized methods -class ListFilesRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListFilesRequest", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "country", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "language", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss.v2"; +function createBaseListFilesRequest() { + return { taskId: "", bossAppId: "", country: undefined, language: undefined }; +} +exports.ListFilesRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.country !== undefined) { + writer.uint32(26).string(message.country); + } + if (message.language !== undefined) { + writer.uint32(34).string(message.language); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* optional string country */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.country = reader.string(); - break; - case /* optional string language */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.language = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* optional string country = 3; */ - if (message.country !== undefined) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.country); - /* optional string language = 4; */ - if (message.language !== undefined) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.language); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.ListFilesRequest - */ -exports.ListFilesRequest = new ListFilesRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListFilesResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListFilesResponse", [ - { no: 1, name: "files", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => file_1.File } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.files = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : undefined, + language: isSet(object.language) ? globalThis.String(object.language) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.country !== undefined) { + obj.country = message.country; + } + if (message.language !== undefined) { + obj.language = message.language; + } + return obj; + }, + create(base) { + return exports.ListFilesRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListFilesRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.country = object.country ?? undefined; + message.language = object.language ?? undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseListFilesResponse() { + return { files: [] }; +} +exports.ListFilesResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.files) { + file_1.File.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.v2.File files */ 1: - message.files.push(file_1.File.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.files.push(file_1.File.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.v2.File files = 1; */ - for (let i = 0; i < message.files.length; i++) - file_1.File.internalBinaryWrite(message.files[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { files: globalThis.Array.isArray(object?.files) ? object.files.map((e) => file_1.File.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.files?.length) { + obj.files = message.files.map((e) => file_1.File.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListFilesResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListFilesResponse(); + message.files = object.files?.map((e) => file_1.File.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.ListFilesResponse - */ -exports.ListFilesResponse = new ListFilesResponse$Type(); diff --git a/javascript/boss/v2/list_files.ts b/javascript/boss/v2/list_files.ts new file mode 100644 index 0000000..9fb27cd --- /dev/null +++ b/javascript/boss/v2/list_files.ts @@ -0,0 +1,209 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_files.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { File } from "./file"; + +export const protobufPackage = "boss.v2"; + +export interface ListFilesRequest { + taskId: string; + bossAppId: string; + country?: string | undefined; + language?: string | undefined; +} + +export interface ListFilesResponse { + files: File[]; +} + +function createBaseListFilesRequest(): ListFilesRequest { + return { taskId: "", bossAppId: "", country: undefined, language: undefined }; +} + +export const ListFilesRequest: MessageFns = { + encode(message: ListFilesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.country !== undefined) { + writer.uint32(26).string(message.country); + } + if (message.language !== undefined) { + writer.uint32(34).string(message.language); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListFilesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.country = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.language = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListFilesRequest { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : undefined, + language: isSet(object.language) ? globalThis.String(object.language) : undefined, + }; + }, + + toJSON(message: ListFilesRequest): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.country !== undefined) { + obj.country = message.country; + } + if (message.language !== undefined) { + obj.language = message.language; + } + return obj; + }, + + create(base?: DeepPartial): ListFilesRequest { + return ListFilesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListFilesRequest { + const message = createBaseListFilesRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.country = object.country ?? undefined; + message.language = object.language ?? undefined; + return message; + }, +}; + +function createBaseListFilesResponse(): ListFilesResponse { + return { files: [] }; +} + +export const ListFilesResponse: MessageFns = { + encode(message: ListFilesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.files) { + File.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListFilesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListFilesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.files.push(File.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListFilesResponse { + return { files: globalThis.Array.isArray(object?.files) ? object.files.map((e: any) => File.fromJSON(e)) : [] }; + }, + + toJSON(message: ListFilesResponse): unknown { + const obj: any = {}; + if (message.files?.length) { + obj.files = message.files.map((e) => File.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListFilesResponse { + return ListFilesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListFilesResponse { + const message = createBaseListFilesResponse(); + message.files = object.files?.map((e) => File.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/list_known_boss_apps.d.ts b/javascript/boss/v2/list_known_boss_apps.d.ts index 085e74d..c8d5a3a 100644 --- a/javascript/boss/v2/list_known_boss_apps.d.ts +++ b/javascript/boss/v2/list_known_boss_apps.d.ts @@ -1,81 +1,30 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_known_boss_apps.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.BOSSApp - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface BOSSApp { - /** - * @generated from protobuf field: string boss_app_id = 1; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 2; - */ titleId: string; - /** - * @generated from protobuf field: string title_region = 3; - */ titleRegion: string; - /** - * @generated from protobuf field: string name = 4; - */ name: string; - /** - * @generated from protobuf field: repeated string tasks = 5; - */ tasks: string[]; } -/** - * @generated from protobuf message boss.v2.ListKnownBOSSAppsRequest - */ export interface ListKnownBOSSAppsRequest { } -/** - * @generated from protobuf message boss.v2.ListKnownBOSSAppsResponse - */ export interface ListKnownBOSSAppsResponse { - /** - * @generated from protobuf field: repeated boss.v2.BOSSApp apps = 1; - */ apps: BOSSApp[]; } -declare class BOSSApp$Type extends MessageType { - constructor(); - create(value?: PartialMessage): BOSSApp; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BOSSApp): BOSSApp; - internalBinaryWrite(message: BOSSApp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const BOSSApp: MessageFns; +export declare const ListKnownBOSSAppsRequest: MessageFns; +export declare const ListKnownBOSSAppsResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.BOSSApp - */ -export declare const BOSSApp: BOSSApp$Type; -declare class ListKnownBOSSAppsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListKnownBOSSAppsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListKnownBOSSAppsRequest): ListKnownBOSSAppsRequest; - internalBinaryWrite(message: ListKnownBOSSAppsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.ListKnownBOSSAppsRequest - */ -export declare const ListKnownBOSSAppsRequest: ListKnownBOSSAppsRequest$Type; -declare class ListKnownBOSSAppsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListKnownBOSSAppsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListKnownBOSSAppsResponse): ListKnownBOSSAppsResponse; - internalBinaryWrite(message: ListKnownBOSSAppsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.ListKnownBOSSAppsResponse - */ -export declare const ListKnownBOSSAppsResponse: ListKnownBOSSAppsResponse$Type; export {}; diff --git a/javascript/boss/v2/list_known_boss_apps.js b/javascript/boss/v2/list_known_boss_apps.js index fedef2d..565e687 100644 --- a/javascript/boss/v2/list_known_boss_apps.js +++ b/javascript/boss/v2/list_known_boss_apps.js @@ -1,163 +1,215 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_known_boss_apps.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_known_boss_apps.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListKnownBOSSAppsResponse = exports.ListKnownBOSSAppsRequest = exports.BOSSApp = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class BOSSApp$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.BOSSApp", [ - { no: 1, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_region", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "tasks", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.bossAppId = ""; - message.titleId = ""; - message.titleRegion = ""; - message.name = ""; - message.tasks = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ListKnownBOSSAppsResponse = exports.ListKnownBOSSAppsRequest = exports.BOSSApp = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseBOSSApp() { + return { bossAppId: "", titleId: "", titleRegion: "", name: "", tasks: [] }; +} +exports.BOSSApp = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.bossAppId !== "") { + writer.uint32(10).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(18).string(message.titleId); + } + if (message.titleRegion !== "") { + writer.uint32(26).string(message.titleRegion); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + for (const v of message.tasks) { + writer.uint32(42).string(v); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBOSSApp(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string boss_app_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.titleId = reader.string(); - break; - case /* string title_region */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleRegion = reader.string(); - break; - case /* string name */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.name = reader.string(); - break; - case /* repeated string tasks */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.tasks.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string boss_app_id = 1; */ - if (message.bossAppId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 2; */ - if (message.titleId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string title_region = 3; */ - if (message.titleRegion !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleRegion); - /* string name = 4; */ - if (message.name !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.name); - /* repeated string tasks = 5; */ - for (let i = 0; i < message.tasks.length; i++) - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.tasks[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.BOSSApp - */ -exports.BOSSApp = new BOSSApp$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListKnownBOSSAppsRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListKnownBOSSAppsRequest", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + titleRegion: isSet(object.titleRegion) ? globalThis.String(object.titleRegion) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => globalThis.String(e)) : [], + }; + }, + toJSON(message) { + const obj = {}; + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.titleRegion !== "") { + obj.titleRegion = message.titleRegion; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.tasks?.length) { + obj.tasks = message.tasks; + } + return obj; + }, + create(base) { + return exports.BOSSApp.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseBOSSApp(); + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.titleRegion = object.titleRegion ?? ""; + message.name = object.name ?? ""; + message.tasks = object.tasks?.map((e) => e) || []; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, +}; +function createBaseListKnownBOSSAppsRequest() { + return {}; } -/** - * @generated MessageType for protobuf message boss.v2.ListKnownBOSSAppsRequest - */ -exports.ListKnownBOSSAppsRequest = new ListKnownBOSSAppsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListKnownBOSSAppsResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListKnownBOSSAppsResponse", [ - { no: 1, name: "apps", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.BOSSApp } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.apps = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ListKnownBOSSAppsRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.v2.BOSSApp apps */ 1: - message.apps.push(exports.BOSSApp.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.v2.BOSSApp apps = 1; */ - for (let i = 0; i < message.apps.length; i++) - exports.BOSSApp.internalBinaryWrite(message.apps[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.ListKnownBOSSAppsRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseListKnownBOSSAppsRequest(); + return message; + }, +}; +function createBaseListKnownBOSSAppsResponse() { + return { apps: [] }; +} +exports.ListKnownBOSSAppsResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.apps) { + exports.BOSSApp.encode(v, writer.uint32(10).fork()).join(); + } return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.apps.push(exports.BOSSApp.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { apps: globalThis.Array.isArray(object?.apps) ? object.apps.map((e) => exports.BOSSApp.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.apps?.length) { + obj.apps = message.apps.map((e) => exports.BOSSApp.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListKnownBOSSAppsResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListKnownBOSSAppsResponse(); + message.apps = object.apps?.map((e) => exports.BOSSApp.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.ListKnownBOSSAppsResponse - */ -exports.ListKnownBOSSAppsResponse = new ListKnownBOSSAppsResponse$Type(); diff --git a/javascript/boss/v2/list_known_boss_apps.ts b/javascript/boss/v2/list_known_boss_apps.ts new file mode 100644 index 0000000..823a0a8 --- /dev/null +++ b/javascript/boss/v2/list_known_boss_apps.ts @@ -0,0 +1,271 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_known_boss_apps.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface BOSSApp { + bossAppId: string; + titleId: string; + titleRegion: string; + name: string; + tasks: string[]; +} + +export interface ListKnownBOSSAppsRequest { +} + +export interface ListKnownBOSSAppsResponse { + apps: BOSSApp[]; +} + +function createBaseBOSSApp(): BOSSApp { + return { bossAppId: "", titleId: "", titleRegion: "", name: "", tasks: [] }; +} + +export const BOSSApp: MessageFns = { + encode(message: BOSSApp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bossAppId !== "") { + writer.uint32(10).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(18).string(message.titleId); + } + if (message.titleRegion !== "") { + writer.uint32(26).string(message.titleRegion); + } + if (message.name !== "") { + writer.uint32(34).string(message.name); + } + for (const v of message.tasks) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BOSSApp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBOSSApp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleRegion = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.name = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.tasks.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BOSSApp { + return { + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + titleRegion: isSet(object.titleRegion) ? globalThis.String(object.titleRegion) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: BOSSApp): unknown { + const obj: any = {}; + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.titleRegion !== "") { + obj.titleRegion = message.titleRegion; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.tasks?.length) { + obj.tasks = message.tasks; + } + return obj; + }, + + create(base?: DeepPartial): BOSSApp { + return BOSSApp.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BOSSApp { + const message = createBaseBOSSApp(); + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.titleRegion = object.titleRegion ?? ""; + message.name = object.name ?? ""; + message.tasks = object.tasks?.map((e) => e) || []; + return message; + }, +}; + +function createBaseListKnownBOSSAppsRequest(): ListKnownBOSSAppsRequest { + return {}; +} + +export const ListKnownBOSSAppsRequest: MessageFns = { + encode(_: ListKnownBOSSAppsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListKnownBOSSAppsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ListKnownBOSSAppsRequest { + return {}; + }, + + toJSON(_: ListKnownBOSSAppsRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ListKnownBOSSAppsRequest { + return ListKnownBOSSAppsRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ListKnownBOSSAppsRequest { + const message = createBaseListKnownBOSSAppsRequest(); + return message; + }, +}; + +function createBaseListKnownBOSSAppsResponse(): ListKnownBOSSAppsResponse { + return { apps: [] }; +} + +export const ListKnownBOSSAppsResponse: MessageFns = { + encode(message: ListKnownBOSSAppsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.apps) { + BOSSApp.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListKnownBOSSAppsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListKnownBOSSAppsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.apps.push(BOSSApp.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListKnownBOSSAppsResponse { + return { apps: globalThis.Array.isArray(object?.apps) ? object.apps.map((e: any) => BOSSApp.fromJSON(e)) : [] }; + }, + + toJSON(message: ListKnownBOSSAppsResponse): unknown { + const obj: any = {}; + if (message.apps?.length) { + obj.apps = message.apps.map((e) => BOSSApp.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListKnownBOSSAppsResponse { + return ListKnownBOSSAppsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListKnownBOSSAppsResponse { + const message = createBaseListKnownBOSSAppsResponse(); + message.apps = object.apps?.map((e) => BOSSApp.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/list_tasks.d.ts b/javascript/boss/v2/list_tasks.d.ts index 9b070e7..888b711 100644 --- a/javascript/boss/v2/list_tasks.d.ts +++ b/javascript/boss/v2/list_tasks.d.ts @@ -1,47 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_tasks.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Task } from "./task"; -/** - * @generated from protobuf message boss.v2.ListTasksRequest - */ +export declare const protobufPackage = "boss.v2"; export interface ListTasksRequest { } -/** - * @generated from protobuf message boss.v2.ListTasksResponse - */ export interface ListTasksResponse { - /** - * @generated from protobuf field: repeated boss.v2.Task tasks = 1; - */ tasks: Task[]; } -declare class ListTasksRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListTasksRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListTasksRequest): ListTasksRequest; - internalBinaryWrite(message: ListTasksRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const ListTasksRequest: MessageFns; +export declare const ListTasksResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.ListTasksRequest - */ -export declare const ListTasksRequest: ListTasksRequest$Type; -declare class ListTasksResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): ListTasksResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListTasksResponse): ListTasksResponse; - internalBinaryWrite(message: ListTasksResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.ListTasksResponse - */ -export declare const ListTasksResponse: ListTasksResponse$Type; export {}; diff --git a/javascript/boss/v2/list_tasks.js b/javascript/boss/v2/list_tasks.js index 02396e2..bf6ee95 100644 --- a/javascript/boss/v2/list_tasks.js +++ b/javascript/boss/v2/list_tasks.js @@ -1,90 +1,100 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_tasks.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_tasks.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.ListTasksResponse = exports.ListTasksRequest = void 0; +exports.ListTasksResponse = exports.ListTasksRequest = exports.protobufPackage = void 0; /* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/list_tasks.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +const wire_1 = require("@bufbuild/protobuf/wire"); const task_1 = require("./task"); -// @generated message type with reflection information, may provide speed optimized methods -class ListTasksRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListTasksRequest", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } +exports.protobufPackage = "boss.v2"; +function createBaseListTasksRequest() { + return {}; } -/** - * @generated MessageType for protobuf message boss.v2.ListTasksRequest - */ -exports.ListTasksRequest = new ListTasksRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ListTasksResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.ListTasksResponse", [ - { no: 1, name: "tasks", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => task_1.Task } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.tasks = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.ListTasksRequest = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated boss.v2.Task tasks */ 1: - message.tasks.push(task_1.Task.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated boss.v2.Task tasks = 1; */ - for (let i = 0; i < message.tasks.length; i++) - task_1.Task.internalBinaryWrite(message.tasks[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.ListTasksRequest.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseListTasksRequest(); + return message; + }, +}; +function createBaseListTasksResponse() { + return { tasks: [] }; } -/** - * @generated MessageType for protobuf message boss.v2.ListTasksResponse - */ -exports.ListTasksResponse = new ListTasksResponse$Type(); +exports.ListTasksResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.tasks) { + task_1.Task.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.tasks.push(task_1.Task.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(object) { + return { tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => task_1.Task.fromJSON(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.tasks?.length) { + obj.tasks = message.tasks.map((e) => task_1.Task.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.ListTasksResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseListTasksResponse(); + message.tasks = object.tasks?.map((e) => task_1.Task.fromPartial(e)) || []; + return message; + }, +}; diff --git a/javascript/boss/v2/list_tasks.ts b/javascript/boss/v2/list_tasks.ts new file mode 100644 index 0000000..3fcf536 --- /dev/null +++ b/javascript/boss/v2/list_tasks.ts @@ -0,0 +1,136 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/list_tasks.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Task } from "./task"; + +export const protobufPackage = "boss.v2"; + +export interface ListTasksRequest { +} + +export interface ListTasksResponse { + tasks: Task[]; +} + +function createBaseListTasksRequest(): ListTasksRequest { + return {}; +} + +export const ListTasksRequest: MessageFns = { + encode(_: ListTasksRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListTasksRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): ListTasksRequest { + return {}; + }, + + toJSON(_: ListTasksRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): ListTasksRequest { + return ListTasksRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): ListTasksRequest { + const message = createBaseListTasksRequest(); + return message; + }, +}; + +function createBaseListTasksResponse(): ListTasksResponse { + return { tasks: [] }; +} + +export const ListTasksResponse: MessageFns = { + encode(message: ListTasksResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tasks) { + Task.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListTasksResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTasksResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tasks.push(Task.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListTasksResponse { + return { tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e: any) => Task.fromJSON(e)) : [] }; + }, + + toJSON(message: ListTasksResponse): unknown { + const obj: any = {}; + if (message.tasks?.length) { + obj.tasks = message.tasks.map((e) => Task.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListTasksResponse { + return ListTasksResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListTasksResponse { + const message = createBaseListTasksResponse(); + message.tasks = object.tasks?.map((e) => Task.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/register_task.d.ts b/javascript/boss/v2/register_task.d.ts index 2d8f035..5bc6f75 100644 --- a/javascript/boss/v2/register_task.d.ts +++ b/javascript/boss/v2/register_task.d.ts @@ -1,67 +1,28 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/register_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Task } from "./task"; -/** - * @generated from protobuf message boss.v2.RegisterTaskRequest - */ +export declare const protobufPackage = "boss.v2"; export interface RegisterTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 3; - */ titleId: string; - /** - * @generated from protobuf field: string country = 4; - */ country: string; - /** - * @generated from protobuf field: string description = 5; - */ description: string; } -/** - * @generated from protobuf message boss.v2.RegisterTaskResponse - */ export interface RegisterTaskResponse { - /** - * @generated from protobuf field: boss.v2.Task task = 1; - */ - task?: Task; + task: Task | undefined; } -declare class RegisterTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterTaskRequest): RegisterTaskRequest; - internalBinaryWrite(message: RegisterTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const RegisterTaskRequest: MessageFns; +export declare const RegisterTaskResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.RegisterTaskRequest - */ -export declare const RegisterTaskRequest: RegisterTaskRequest$Type; -declare class RegisterTaskResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): RegisterTaskResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RegisterTaskResponse): RegisterTaskResponse; - internalBinaryWrite(message: RegisterTaskResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.RegisterTaskResponse - */ -export declare const RegisterTaskResponse: RegisterTaskResponse$Type; export {}; diff --git a/javascript/boss/v2/register_task.js b/javascript/boss/v2/register_task.js index a8e2422..db08fd2 100644 --- a/javascript/boss/v2/register_task.js +++ b/javascript/boss/v2/register_task.js @@ -1,138 +1,179 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/register_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/register_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.RegisterTaskResponse = exports.RegisterTaskRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.RegisterTaskResponse = exports.RegisterTaskRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const task_1 = require("./task"); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.RegisterTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "country", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - message.titleId = ""; - message.country = ""; - message.description = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss.v2"; +function createBaseRegisterTaskRequest() { + return { id: "", bossAppId: "", titleId: "", country: "", description: "" }; +} +exports.RegisterTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.country !== "") { + writer.uint32(34).string(message.country); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleId = reader.string(); - break; - case /* string country */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.country = reader.string(); - break; - case /* string description */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.description = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 3; */ - if (message.titleId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string country = 4; */ - if (message.country !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.country); - /* string description = 5; */ - if (message.description !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.description); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.RegisterTaskRequest - */ -exports.RegisterTaskRequest = new RegisterTaskRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RegisterTaskResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.RegisterTaskResponse", [ - { no: 1, name: "task", kind: "message", T: () => task_1.Task } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + create(base) { + return exports.RegisterTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.country = object.country ?? ""; + message.description = object.description ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseRegisterTaskResponse() { + return { task: undefined }; +} +exports.RegisterTaskResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.task !== undefined) { + task_1.Task.encode(message.task, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* boss.v2.Task task */ 1: - message.task = task_1.Task.internalBinaryRead(reader, reader.uint32(), options, message.task); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.task = task_1.Task.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* boss.v2.Task task = 1; */ - if (message.task) - task_1.Task.internalBinaryWrite(message.task, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { task: isSet(object.task) ? task_1.Task.fromJSON(object.task) : undefined }; + }, + toJSON(message) { + const obj = {}; + if (message.task !== undefined) { + obj.task = task_1.Task.toJSON(message.task); + } + return obj; + }, + create(base) { + return exports.RegisterTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseRegisterTaskResponse(); + message.task = (object.task !== undefined && object.task !== null) ? task_1.Task.fromPartial(object.task) : undefined; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.RegisterTaskResponse - */ -exports.RegisterTaskResponse = new RegisterTaskResponse$Type(); diff --git a/javascript/boss/v2/register_task.ts b/javascript/boss/v2/register_task.ts new file mode 100644 index 0000000..1c59666 --- /dev/null +++ b/javascript/boss/v2/register_task.ts @@ -0,0 +1,226 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/register_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { Task } from "./task"; + +export const protobufPackage = "boss.v2"; + +export interface RegisterTaskRequest { + id: string; + bossAppId: string; + titleId: string; + country: string; + description: string; +} + +export interface RegisterTaskResponse { + task: Task | undefined; +} + +function createBaseRegisterTaskRequest(): RegisterTaskRequest { + return { id: "", bossAppId: "", titleId: "", country: "", description: "" }; +} + +export const RegisterTaskRequest: MessageFns = { + encode(message: RegisterTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.country !== "") { + writer.uint32(34).string(message.country); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.country = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.description = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + country: isSet(object.country) ? globalThis.String(object.country) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + + toJSON(message: RegisterTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.country !== "") { + obj.country = message.country; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + + create(base?: DeepPartial): RegisterTaskRequest { + return RegisterTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterTaskRequest { + const message = createBaseRegisterTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.country = object.country ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseRegisterTaskResponse(): RegisterTaskResponse { + return { task: undefined }; +} + +export const RegisterTaskResponse: MessageFns = { + encode(message: RegisterTaskResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.task !== undefined) { + Task.encode(message.task, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RegisterTaskResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRegisterTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.task = Task.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RegisterTaskResponse { + return { task: isSet(object.task) ? Task.fromJSON(object.task) : undefined }; + }, + + toJSON(message: RegisterTaskResponse): unknown { + const obj: any = {}; + if (message.task !== undefined) { + obj.task = Task.toJSON(message.task); + } + return obj; + }, + + create(base?: DeepPartial): RegisterTaskResponse { + return RegisterTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RegisterTaskResponse { + const message = createBaseRegisterTaskResponse(); + message.task = (object.task !== undefined && object.task !== null) ? Task.fromPartial(object.task) : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/task.d.ts b/javascript/boss/v2/task.d.ts index ebeca99..1090009 100644 --- a/javascript/boss/v2/task.d.ts +++ b/javascript/boss/v2/task.d.ts @@ -1,67 +1,28 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.Task - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface Task { - /** - * @generated from protobuf field: bool deleted = 1; - */ deleted: boolean; - /** - * @generated from protobuf field: string id = 2; - */ id: string; - /** - * @generated from protobuf field: string in_game_id = 3; - */ inGameId: string; - /** - * @generated from protobuf field: string boss_app_id = 4; - */ bossAppId: string; - /** - * @generated from protobuf field: uint32 creator_pid = 5; - */ creatorPid: number; - /** - * @generated from protobuf field: string status = 6; - */ status: string; - /** - * @generated from protobuf field: string title_id = 7; - */ titleId: string; - /** - * @generated from protobuf field: string description = 8; - */ description: string; - /** - * @generated from protobuf field: uint64 created_timestamp = 9; - */ createdTimestamp: bigint; - /** - * @generated from protobuf field: uint64 updated_timestamp = 10; - */ updatedTimestamp: bigint; } -declare class Task$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Task; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Task): Task; - internalBinaryWrite(message: Task, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Task: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.Task - */ -export declare const Task: Task$Type; export {}; diff --git a/javascript/boss/v2/task.js b/javascript/boss/v2/task.js index f60bbaa..247591c 100644 --- a/javascript/boss/v2/task.js +++ b/javascript/boss/v2/task.js @@ -1,131 +1,219 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Task = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Task$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.Task", [ - { no: 1, name: "deleted", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "in_game_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "creator_pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 6, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "created_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 10, name: "updated_timestamp", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.deleted = false; - message.id = ""; - message.inGameId = ""; - message.bossAppId = ""; - message.creatorPid = 0; - message.status = ""; - message.titleId = ""; - message.description = ""; - message.createdTimestamp = 0n; - message.updatedTimestamp = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.Task = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseTask() { + return { + deleted: false, + id: "", + inGameId: "", + bossAppId: "", + creatorPid: 0, + status: "", + titleId: "", + description: "", + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} +exports.Task = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.inGameId !== "") { + writer.uint32(26).string(message.inGameId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + if (message.creatorPid !== 0) { + writer.uint32(40).uint32(message.creatorPid); + } + if (message.status !== "") { + writer.uint32(50).string(message.status); + } + if (message.titleId !== "") { + writer.uint32(58).string(message.titleId); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(72).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(80).uint64(message.updatedTimestamp); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTask(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool deleted */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.deleted = reader.bool(); - break; - case /* string id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.id = reader.string(); - break; - case /* string in_game_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.inGameId = reader.string(); - break; - case /* string boss_app_id */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.bossAppId = reader.string(); - break; - case /* uint32 creator_pid */ 5: + continue; + } + case 5: { + if (tag !== 40) { + break; + } message.creatorPid = reader.uint32(); - break; - case /* string status */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.status = reader.string(); - break; - case /* string title_id */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.titleId = reader.string(); - break; - case /* string description */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.description = reader.string(); - break; - case /* uint64 created_timestamp */ 9: - message.createdTimestamp = reader.uint64().toBigInt(); - break; - case /* uint64 updated_timestamp */ 10: - message.updatedTimestamp = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + message.createdTimestamp = reader.uint64(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + message.updatedTimestamp = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool deleted = 1; */ - if (message.deleted !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.deleted); - /* string id = 2; */ - if (message.id !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.id); - /* string in_game_id = 3; */ - if (message.inGameId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.inGameId); - /* string boss_app_id = 4; */ - if (message.bossAppId !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* uint32 creator_pid = 5; */ - if (message.creatorPid !== 0) - writer.tag(5, runtime_1.WireType.Varint).uint32(message.creatorPid); - /* string status = 6; */ - if (message.status !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.status); - /* string title_id = 7; */ - if (message.titleId !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string description = 8; */ - if (message.description !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.description); - /* uint64 created_timestamp = 9; */ - if (message.createdTimestamp !== 0n) - writer.tag(9, runtime_1.WireType.Varint).uint64(message.createdTimestamp); - /* uint64 updated_timestamp = 10; */ - if (message.updatedTimestamp !== 0n) - writer.tag(10, runtime_1.WireType.Varint).uint64(message.updatedTimestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + id: isSet(object.id) ? globalThis.String(object.id) : "", + inGameId: isSet(object.inGameId) ? globalThis.String(object.inGameId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + status: isSet(object.status) ? globalThis.String(object.status) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + toJSON(message) { + const obj = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.id !== "") { + obj.id = message.id; + } + if (message.inGameId !== "") { + obj.inGameId = message.inGameId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + create(base) { + return exports.Task.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseTask(); + message.deleted = object.deleted ?? false; + message.id = object.id ?? ""; + message.inGameId = object.inGameId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.status = object.status ?? ""; + message.titleId = object.titleId ?? ""; + message.description = object.description ?? ""; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.Task - */ -exports.Task = new Task$Type(); diff --git a/javascript/boss/v2/task.ts b/javascript/boss/v2/task.ts new file mode 100644 index 0000000..6f126f5 --- /dev/null +++ b/javascript/boss/v2/task.ts @@ -0,0 +1,265 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface Task { + deleted: boolean; + id: string; + inGameId: string; + bossAppId: string; + creatorPid: number; + status: string; + titleId: string; + description: string; + createdTimestamp: bigint; + updatedTimestamp: bigint; +} + +function createBaseTask(): Task { + return { + deleted: false, + id: "", + inGameId: "", + bossAppId: "", + creatorPid: 0, + status: "", + titleId: "", + description: "", + createdTimestamp: 0n, + updatedTimestamp: 0n, + }; +} + +export const Task: MessageFns = { + encode(message: Task, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deleted !== false) { + writer.uint32(8).bool(message.deleted); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.inGameId !== "") { + writer.uint32(26).string(message.inGameId); + } + if (message.bossAppId !== "") { + writer.uint32(34).string(message.bossAppId); + } + if (message.creatorPid !== 0) { + writer.uint32(40).uint32(message.creatorPid); + } + if (message.status !== "") { + writer.uint32(50).string(message.status); + } + if (message.titleId !== "") { + writer.uint32(58).string(message.titleId); + } + if (message.description !== "") { + writer.uint32(66).string(message.description); + } + if (message.createdTimestamp !== 0n) { + if (BigInt.asUintN(64, message.createdTimestamp) !== message.createdTimestamp) { + throw new globalThis.Error("value provided for field message.createdTimestamp of type uint64 too large"); + } + writer.uint32(72).uint64(message.createdTimestamp); + } + if (message.updatedTimestamp !== 0n) { + if (BigInt.asUintN(64, message.updatedTimestamp) !== message.updatedTimestamp) { + throw new globalThis.Error("value provided for field message.updatedTimestamp of type uint64 too large"); + } + writer.uint32(80).uint64(message.updatedTimestamp); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Task { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTask(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deleted = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.id = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.inGameId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.creatorPid = reader.uint32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.status = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.description = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.createdTimestamp = reader.uint64() as bigint; + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.updatedTimestamp = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Task { + return { + deleted: isSet(object.deleted) ? globalThis.Boolean(object.deleted) : false, + id: isSet(object.id) ? globalThis.String(object.id) : "", + inGameId: isSet(object.inGameId) ? globalThis.String(object.inGameId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + creatorPid: isSet(object.creatorPid) ? globalThis.Number(object.creatorPid) : 0, + status: isSet(object.status) ? globalThis.String(object.status) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + createdTimestamp: isSet(object.createdTimestamp) ? BigInt(object.createdTimestamp) : 0n, + updatedTimestamp: isSet(object.updatedTimestamp) ? BigInt(object.updatedTimestamp) : 0n, + }; + }, + + toJSON(message: Task): unknown { + const obj: any = {}; + if (message.deleted !== false) { + obj.deleted = message.deleted; + } + if (message.id !== "") { + obj.id = message.id; + } + if (message.inGameId !== "") { + obj.inGameId = message.inGameId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.creatorPid !== 0) { + obj.creatorPid = Math.round(message.creatorPid); + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.createdTimestamp !== 0n) { + obj.createdTimestamp = message.createdTimestamp.toString(); + } + if (message.updatedTimestamp !== 0n) { + obj.updatedTimestamp = message.updatedTimestamp.toString(); + } + return obj; + }, + + create(base?: DeepPartial): Task { + return Task.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Task { + const message = createBaseTask(); + message.deleted = object.deleted ?? false; + message.id = object.id ?? ""; + message.inGameId = object.inGameId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.creatorPid = object.creatorPid ?? 0; + message.status = object.status ?? ""; + message.titleId = object.titleId ?? ""; + message.description = object.description ?? ""; + message.createdTimestamp = object.createdTimestamp ?? 0n; + message.updatedTimestamp = object.updatedTimestamp ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/update_file_metadata.d.ts b/javascript/boss/v2/update_file_metadata.d.ts index 78abd5e..e0c8f16 100644 --- a/javascript/boss/v2/update_file_metadata.d.ts +++ b/javascript/boss/v2/update_file_metadata.d.ts @@ -1,113 +1,38 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/update_file_metadata.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.UpdateFileMetadataData - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface UpdateFileMetadataData { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 3; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 4; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 5; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 6; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 7; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 8; - */ attribute3: string; - /** - * @generated from protobuf field: string name = 9; - */ name: string; - /** - * @generated from protobuf field: string type = 10; - */ type: string; - /** - * @generated from protobuf field: repeated string notify_on_new = 11; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 12; - */ notifyLed: boolean; } -/** - * @generated from protobuf message boss.v2.UpdateFileMetadataRequest - */ export interface UpdateFileMetadataRequest { - /** - * @generated from protobuf field: uint64 data_id = 1; - */ dataId: bigint; - /** - * @generated from protobuf field: boss.v2.UpdateFileMetadataData update_data = 2; - */ - updateData?: UpdateFileMetadataData; + updateData: UpdateFileMetadataData | undefined; } -/** - * @generated from protobuf message boss.v2.UpdateFileMetadataResponse - */ export interface UpdateFileMetadataResponse { } -declare class UpdateFileMetadataData$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateFileMetadataData; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFileMetadataData): UpdateFileMetadataData; - internalBinaryWrite(message: UpdateFileMetadataData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateFileMetadataData: MessageFns; +export declare const UpdateFileMetadataRequest: MessageFns; +export declare const UpdateFileMetadataResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataData - */ -export declare const UpdateFileMetadataData: UpdateFileMetadataData$Type; -declare class UpdateFileMetadataRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateFileMetadataRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFileMetadataRequest): UpdateFileMetadataRequest; - internalBinaryWrite(message: UpdateFileMetadataRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataRequest - */ -export declare const UpdateFileMetadataRequest: UpdateFileMetadataRequest$Type; -declare class UpdateFileMetadataResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateFileMetadataResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateFileMetadataResponse): UpdateFileMetadataResponse; - internalBinaryWrite(message: UpdateFileMetadataResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataResponse - */ -export declare const UpdateFileMetadataResponse: UpdateFileMetadataResponse$Type; export {}; diff --git a/javascript/boss/v2/update_file_metadata.js b/javascript/boss/v2/update_file_metadata.js index 14f199c..bb453b0 100644 --- a/javascript/boss/v2/update_file_metadata.js +++ b/javascript/boss/v2/update_file_metadata.js @@ -1,226 +1,361 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/update_file_metadata.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/update_file_metadata.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateFileMetadataResponse = exports.UpdateFileMetadataRequest = exports.UpdateFileMetadataData = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateFileMetadataData$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateFileMetadataData", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.name = ""; - message.type = ""; - message.notifyOnNew = []; - message.notifyLed = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UpdateFileMetadataResponse = exports.UpdateFileMetadataRequest = exports.UpdateFileMetadataData = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseUpdateFileMetadataData() { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + }; +} +exports.UpdateFileMetadataData = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataData(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute3 = reader.string(); - break; - case /* string name */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.name = reader.string(); - break; - case /* string type */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.type = reader.string(); - break; - case /* repeated string notify_on_new */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.notifyLed = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 3; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 4; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 5; */ - if (message.password !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 6; */ - if (message.attribute1 !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 7; */ - if (message.attribute2 !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 8; */ - if (message.attribute3 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* string name = 9; */ - if (message.name !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 10; */ - if (message.type !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.type); - /* repeated string notify_on_new = 11; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 12; */ - if (message.notifyLed !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.notifyLed); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataData - */ -exports.UpdateFileMetadataData = new UpdateFileMetadataData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateFileMetadataRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateFileMetadataRequest", [ - { no: 1, name: "data_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "update_data", kind: "message", T: () => exports.UpdateFileMetadataData } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.dataId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + return obj; + }, + create(base) { + return exports.UpdateFileMetadataData.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateFileMetadataData(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUpdateFileMetadataRequest() { + return { dataId: 0n, updateData: undefined }; +} +exports.UpdateFileMetadataRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.updateData !== undefined) { + exports.UpdateFileMetadataData.encode(message.updateData, writer.uint32(18).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 data_id */ 1: - message.dataId = reader.uint64().toBigInt(); - break; - case /* boss.v2.UpdateFileMetadataData update_data */ 2: - message.updateData = exports.UpdateFileMetadataData.internalBinaryRead(reader, reader.uint32(), options, message.updateData); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.dataId = reader.uint64(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.updateData = exports.UpdateFileMetadataData.decode(reader, reader.uint32()); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 data_id = 1; */ - if (message.dataId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.dataId); - /* boss.v2.UpdateFileMetadataData update_data = 2; */ - if (message.updateData) - exports.UpdateFileMetadataData.internalBinaryWrite(message.updateData, writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataRequest - */ -exports.UpdateFileMetadataRequest = new UpdateFileMetadataRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateFileMetadataResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateFileMetadataResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + updateData: isSet(object.updateData) ? exports.UpdateFileMetadataData.fromJSON(object.updateData) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.updateData !== undefined) { + obj.updateData = exports.UpdateFileMetadataData.toJSON(message.updateData); + } + return obj; + }, + create(base) { + return exports.UpdateFileMetadataRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateFileMetadataRequest(); + message.dataId = object.dataId ?? 0n; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? exports.UpdateFileMetadataData.fromPartial(object.updateData) + : undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseUpdateFileMetadataResponse() { + return {}; +} +exports.UpdateFileMetadataResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.UpdateFileMetadataResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseUpdateFileMetadataResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.UpdateFileMetadataResponse - */ -exports.UpdateFileMetadataResponse = new UpdateFileMetadataResponse$Type(); diff --git a/javascript/boss/v2/update_file_metadata.ts b/javascript/boss/v2/update_file_metadata.ts new file mode 100644 index 0000000..7d42c02 --- /dev/null +++ b/javascript/boss/v2/update_file_metadata.ts @@ -0,0 +1,433 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/update_file_metadata.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface UpdateFileMetadataData { + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + name: string; + type: string; + notifyOnNew: string[]; + notifyLed: boolean; +} + +export interface UpdateFileMetadataRequest { + dataId: bigint; + updateData: UpdateFileMetadataData | undefined; +} + +export interface UpdateFileMetadataResponse { +} + +function createBaseUpdateFileMetadataData(): UpdateFileMetadataData { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + }; +} + +export const UpdateFileMetadataData: MessageFns = { + encode(message: UpdateFileMetadataData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v!); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateFileMetadataData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.password = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.name = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.type = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFileMetadataData { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + }; + }, + + toJSON(message: UpdateFileMetadataData): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + return obj; + }, + + create(base?: DeepPartial): UpdateFileMetadataData { + return UpdateFileMetadataData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateFileMetadataData { + const message = createBaseUpdateFileMetadataData(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + return message; + }, +}; + +function createBaseUpdateFileMetadataRequest(): UpdateFileMetadataRequest { + return { dataId: 0n, updateData: undefined }; +} + +export const UpdateFileMetadataRequest: MessageFns = { + encode(message: UpdateFileMetadataRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.dataId !== 0n) { + if (BigInt.asUintN(64, message.dataId) !== message.dataId) { + throw new globalThis.Error("value provided for field message.dataId of type uint64 too large"); + } + writer.uint32(8).uint64(message.dataId); + } + if (message.updateData !== undefined) { + UpdateFileMetadataData.encode(message.updateData, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateFileMetadataRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.dataId = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.updateData = UpdateFileMetadataData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateFileMetadataRequest { + return { + dataId: isSet(object.dataId) ? BigInt(object.dataId) : 0n, + updateData: isSet(object.updateData) ? UpdateFileMetadataData.fromJSON(object.updateData) : undefined, + }; + }, + + toJSON(message: UpdateFileMetadataRequest): unknown { + const obj: any = {}; + if (message.dataId !== 0n) { + obj.dataId = message.dataId.toString(); + } + if (message.updateData !== undefined) { + obj.updateData = UpdateFileMetadataData.toJSON(message.updateData); + } + return obj; + }, + + create(base?: DeepPartial): UpdateFileMetadataRequest { + return UpdateFileMetadataRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateFileMetadataRequest { + const message = createBaseUpdateFileMetadataRequest(); + message.dataId = object.dataId ?? 0n; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? UpdateFileMetadataData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; + +function createBaseUpdateFileMetadataResponse(): UpdateFileMetadataResponse { + return {}; +} + +export const UpdateFileMetadataResponse: MessageFns = { + encode(_: UpdateFileMetadataResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateFileMetadataResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateFileMetadataResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): UpdateFileMetadataResponse { + return {}; + }, + + toJSON(_: UpdateFileMetadataResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): UpdateFileMetadataResponse { + return UpdateFileMetadataResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): UpdateFileMetadataResponse { + const message = createBaseUpdateFileMetadataResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/update_task.d.ts b/javascript/boss/v2/update_task.d.ts index f33cc77..a534381 100644 --- a/javascript/boss/v2/update_task.d.ts +++ b/javascript/boss/v2/update_task.d.ts @@ -1,89 +1,32 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/update_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message boss.v2.UpdateTaskData - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "boss.v2"; export interface UpdateTaskData { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: string title_id = 3; - */ titleId: string; - /** - * @generated from protobuf field: string status = 4; - */ status: string; - /** - * @generated from protobuf field: string description = 5; - */ description: string; } -/** - * @generated from protobuf message boss.v2.UpdateTaskRequest - */ export interface UpdateTaskRequest { - /** - * @generated from protobuf field: string id = 1; - */ id: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: boss.v2.UpdateTaskData update_data = 3; - */ - updateData?: UpdateTaskData; + updateData: UpdateTaskData | undefined; } -/** - * @generated from protobuf message boss.v2.UpdateTaskResponse - */ export interface UpdateTaskResponse { } -declare class UpdateTaskData$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateTaskData; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTaskData): UpdateTaskData; - internalBinaryWrite(message: UpdateTaskData, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UpdateTaskData: MessageFns; +export declare const UpdateTaskRequest: MessageFns; +export declare const UpdateTaskResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskData - */ -export declare const UpdateTaskData: UpdateTaskData$Type; -declare class UpdateTaskRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateTaskRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTaskRequest): UpdateTaskRequest; - internalBinaryWrite(message: UpdateTaskRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskRequest - */ -export declare const UpdateTaskRequest: UpdateTaskRequest$Type; -declare class UpdateTaskResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UpdateTaskResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateTaskResponse): UpdateTaskResponse; - internalBinaryWrite(message: UpdateTaskResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskResponse - */ -export declare const UpdateTaskResponse: UpdateTaskResponse$Type; export {}; diff --git a/javascript/boss/v2/update_task.js b/javascript/boss/v2/update_task.js index 4945b7c..bbdaebf 100644 --- a/javascript/boss/v2/update_task.js +++ b/javascript/boss/v2/update_task.js @@ -1,178 +1,249 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/update_task.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/update_task.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UpdateTaskResponse = exports.UpdateTaskRequest = exports.UpdateTaskData = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateTaskData$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateTaskData", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "title_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "status", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - message.titleId = ""; - message.status = ""; - message.description = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.UpdateTaskResponse = exports.UpdateTaskRequest = exports.UpdateTaskData = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "boss.v2"; +function createBaseUpdateTaskData() { + return { id: "", bossAppId: "", titleId: "", status: "", description: "" }; +} +exports.UpdateTaskData = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.status !== "") { + writer.uint32(34).string(message.status); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskData(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* string title_id */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.titleId = reader.string(); - break; - case /* string status */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.status = reader.string(); - break; - case /* string description */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.description = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* string title_id = 3; */ - if (message.titleId !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.titleId); - /* string status = 4; */ - if (message.status !== "") - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.status); - /* string description = 5; */ - if (message.description !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.description); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskData - */ -exports.UpdateTaskData = new UpdateTaskData$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateTaskRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateTaskRequest", [ - { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "update_data", kind: "message", T: () => exports.UpdateTaskData } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = ""; - message.bossAppId = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + status: isSet(object.status) ? globalThis.String(object.status) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + create(base) { + return exports.UpdateTaskData.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateTaskData(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.status = object.status ?? ""; + message.description = object.description ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUpdateTaskRequest() { + return { id: "", bossAppId: "", updateData: undefined }; +} +exports.UpdateTaskRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.updateData !== undefined) { + exports.UpdateTaskData.encode(message.updateData, writer.uint32(26).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.id = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* boss.v2.UpdateTaskData update_data */ 3: - message.updateData = exports.UpdateTaskData.internalBinaryRead(reader, reader.uint32(), options, message.updateData); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + message.updateData = exports.UpdateTaskData.decode(reader, reader.uint32()); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string id = 1; */ - if (message.id !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.id); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* boss.v2.UpdateTaskData update_data = 3; */ - if (message.updateData) - exports.UpdateTaskData.internalBinaryWrite(message.updateData, writer.tag(3, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskRequest - */ -exports.UpdateTaskRequest = new UpdateTaskRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UpdateTaskResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UpdateTaskResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + updateData: isSet(object.updateData) ? exports.UpdateTaskData.fromJSON(object.updateData) : undefined, + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.updateData !== undefined) { + obj.updateData = exports.UpdateTaskData.toJSON(message.updateData); + } + return obj; + }, + create(base) { + return exports.UpdateTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUpdateTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? exports.UpdateTaskData.fromPartial(object.updateData) + : undefined; return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseUpdateTaskResponse() { + return {}; +} +exports.UpdateTaskResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.UpdateTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseUpdateTaskResponse(); + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.UpdateTaskResponse - */ -exports.UpdateTaskResponse = new UpdateTaskResponse$Type(); diff --git a/javascript/boss/v2/update_task.ts b/javascript/boss/v2/update_task.ts new file mode 100644 index 0000000..e8fef3d --- /dev/null +++ b/javascript/boss/v2/update_task.ts @@ -0,0 +1,309 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/update_task.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "boss.v2"; + +export interface UpdateTaskData { + id: string; + bossAppId: string; + titleId: string; + status: string; + description: string; +} + +export interface UpdateTaskRequest { + id: string; + bossAppId: string; + updateData: UpdateTaskData | undefined; +} + +export interface UpdateTaskResponse { +} + +function createBaseUpdateTaskData(): UpdateTaskData { + return { id: "", bossAppId: "", titleId: "", status: "", description: "" }; +} + +export const UpdateTaskData: MessageFns = { + encode(message: UpdateTaskData, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.titleId !== "") { + writer.uint32(26).string(message.titleId); + } + if (message.status !== "") { + writer.uint32(34).string(message.status); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateTaskData { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskData(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.titleId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.status = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.description = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateTaskData { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + titleId: isSet(object.titleId) ? globalThis.String(object.titleId) : "", + status: isSet(object.status) ? globalThis.String(object.status) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + }; + }, + + toJSON(message: UpdateTaskData): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.titleId !== "") { + obj.titleId = message.titleId; + } + if (message.status !== "") { + obj.status = message.status; + } + if (message.description !== "") { + obj.description = message.description; + } + return obj; + }, + + create(base?: DeepPartial): UpdateTaskData { + return UpdateTaskData.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateTaskData { + const message = createBaseUpdateTaskData(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.titleId = object.titleId ?? ""; + message.status = object.status ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +function createBaseUpdateTaskRequest(): UpdateTaskRequest { + return { id: "", bossAppId: "", updateData: undefined }; +} + +export const UpdateTaskRequest: MessageFns = { + encode(message: UpdateTaskRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + if (message.updateData !== undefined) { + UpdateTaskData.encode(message.updateData, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateTaskRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.updateData = UpdateTaskData.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateTaskRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + updateData: isSet(object.updateData) ? UpdateTaskData.fromJSON(object.updateData) : undefined, + }; + }, + + toJSON(message: UpdateTaskRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.updateData !== undefined) { + obj.updateData = UpdateTaskData.toJSON(message.updateData); + } + return obj; + }, + + create(base?: DeepPartial): UpdateTaskRequest { + return UpdateTaskRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateTaskRequest { + const message = createBaseUpdateTaskRequest(); + message.id = object.id ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.updateData = (object.updateData !== undefined && object.updateData !== null) + ? UpdateTaskData.fromPartial(object.updateData) + : undefined; + return message; + }, +}; + +function createBaseUpdateTaskResponse(): UpdateTaskResponse { + return {}; +} + +export const UpdateTaskResponse: MessageFns = { + encode(_: UpdateTaskResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateTaskResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateTaskResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): UpdateTaskResponse { + return {}; + }, + + toJSON(_: UpdateTaskResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): UpdateTaskResponse { + return UpdateTaskResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): UpdateTaskResponse { + const message = createBaseUpdateTaskResponse(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/boss/v2/upload_file.d.ts b/javascript/boss/v2/upload_file.d.ts index 2947365..17ad236 100644 --- a/javascript/boss/v2/upload_file.d.ts +++ b/javascript/boss/v2/upload_file.d.ts @@ -1,103 +1,37 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/upload_file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { File } from "./file"; -/** - * @generated from protobuf message boss.v2.UploadFileRequest - */ +export declare const protobufPackage = "boss.v2"; export interface UploadFileRequest { - /** - * @generated from protobuf field: string task_id = 1; - */ taskId: string; - /** - * @generated from protobuf field: string boss_app_id = 2; - */ bossAppId: string; - /** - * @generated from protobuf field: repeated string supported_countries = 3; - */ supportedCountries: string[]; - /** - * @generated from protobuf field: repeated string supported_languages = 4; - */ supportedLanguages: string[]; - /** - * @generated from protobuf field: string password = 5; - */ password: string; - /** - * @generated from protobuf field: string attribute1 = 6; - */ attribute1: string; - /** - * @generated from protobuf field: string attribute2 = 7; - */ attribute2: string; - /** - * @generated from protobuf field: string attribute3 = 8; - */ attribute3: string; - /** - * @generated from protobuf field: string name = 9; - */ name: string; - /** - * @generated from protobuf field: string type = 10; - */ type: string; - /** - * @generated from protobuf field: repeated string notify_on_new = 11; - */ notifyOnNew: string[]; - /** - * @generated from protobuf field: bool notify_led = 12; - */ notifyLed: boolean; - /** - * @generated from protobuf field: bytes data = 13; - */ - data: Uint8Array; - /** - * @generated from protobuf field: bool name_equals_data_id = 14; - */ + data: Buffer; nameEqualsDataId: boolean; } -/** - * @generated from protobuf message boss.v2.UploadFileResponse - */ export interface UploadFileResponse { - /** - * @generated from protobuf field: boss.v2.File file = 1; - */ - file?: File; + file: File | undefined; } -declare class UploadFileRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UploadFileRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileRequest): UploadFileRequest; - internalBinaryWrite(message: UploadFileRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const UploadFileRequest: MessageFns; +export declare const UploadFileResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message boss.v2.UploadFileRequest - */ -export declare const UploadFileRequest: UploadFileRequest$Type; -declare class UploadFileResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): UploadFileResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UploadFileResponse): UploadFileResponse; - internalBinaryWrite(message: UploadFileResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message boss.v2.UploadFileResponse - */ -export declare const UploadFileResponse: UploadFileResponse$Type; export {}; diff --git a/javascript/boss/v2/upload_file.js b/javascript/boss/v2/upload_file.js index 93db8b0..4903e28 100644 --- a/javascript/boss/v2/upload_file.js +++ b/javascript/boss/v2/upload_file.js @@ -1,210 +1,341 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "boss/v2/upload_file.proto" (package "boss.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/upload_file.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.UploadFileResponse = exports.UploadFileRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.UploadFileResponse = exports.UploadFileRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const file_1 = require("./file"); -// @generated message type with reflection information, may provide speed optimized methods -class UploadFileRequest$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UploadFileRequest", [ - { no: 1, name: "task_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "boss_app_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "supported_countries", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "supported_languages", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "password", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 6, name: "attribute1", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 7, name: "attribute2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "attribute3", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 9, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 10, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 11, name: "notify_on_new", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, - { no: 12, name: "notify_led", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 13, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, - { no: 14, name: "name_equals_data_id", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.taskId = ""; - message.bossAppId = ""; - message.supportedCountries = []; - message.supportedLanguages = []; - message.password = ""; - message.attribute1 = ""; - message.attribute2 = ""; - message.attribute3 = ""; - message.name = ""; - message.type = ""; - message.notifyOnNew = []; - message.notifyLed = false; - message.data = new Uint8Array(0); - message.nameEqualsDataId = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "boss.v2"; +function createBaseUploadFileRequest() { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + data: Buffer.alloc(0), + nameEqualsDataId: false, + }; +} +exports.UploadFileRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + if (message.data.length !== 0) { + writer.uint32(106).bytes(message.data); + } + if (message.nameEqualsDataId !== false) { + writer.uint32(112).bool(message.nameEqualsDataId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string task_id */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } message.taskId = reader.string(); - break; - case /* string boss_app_id */ 2: + continue; + } + case 2: { + if (tag !== 18) { + break; + } message.bossAppId = reader.string(); - break; - case /* repeated string supported_countries */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.supportedCountries.push(reader.string()); - break; - case /* repeated string supported_languages */ 4: + continue; + } + case 4: { + if (tag !== 34) { + break; + } message.supportedLanguages.push(reader.string()); - break; - case /* string password */ 5: + continue; + } + case 5: { + if (tag !== 42) { + break; + } message.password = reader.string(); - break; - case /* string attribute1 */ 6: + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.attribute1 = reader.string(); - break; - case /* string attribute2 */ 7: + continue; + } + case 7: { + if (tag !== 58) { + break; + } message.attribute2 = reader.string(); - break; - case /* string attribute3 */ 8: + continue; + } + case 8: { + if (tag !== 66) { + break; + } message.attribute3 = reader.string(); - break; - case /* string name */ 9: + continue; + } + case 9: { + if (tag !== 74) { + break; + } message.name = reader.string(); - break; - case /* string type */ 10: + continue; + } + case 10: { + if (tag !== 82) { + break; + } message.type = reader.string(); - break; - case /* repeated string notify_on_new */ 11: + continue; + } + case 11: { + if (tag !== 90) { + break; + } message.notifyOnNew.push(reader.string()); - break; - case /* bool notify_led */ 12: + continue; + } + case 12: { + if (tag !== 96) { + break; + } message.notifyLed = reader.bool(); - break; - case /* bytes data */ 13: - message.data = reader.bytes(); - break; - case /* bool name_equals_data_id */ 14: + continue; + } + case 13: { + if (tag !== 106) { + break; + } + message.data = Buffer.from(reader.bytes()); + continue; + } + case 14: { + if (tag !== 112) { + break; + } message.nameEqualsDataId = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* string task_id = 1; */ - if (message.taskId !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.taskId); - /* string boss_app_id = 2; */ - if (message.bossAppId !== "") - writer.tag(2, runtime_1.WireType.LengthDelimited).string(message.bossAppId); - /* repeated string supported_countries = 3; */ - for (let i = 0; i < message.supportedCountries.length; i++) - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.supportedCountries[i]); - /* repeated string supported_languages = 4; */ - for (let i = 0; i < message.supportedLanguages.length; i++) - writer.tag(4, runtime_1.WireType.LengthDelimited).string(message.supportedLanguages[i]); - /* string password = 5; */ - if (message.password !== "") - writer.tag(5, runtime_1.WireType.LengthDelimited).string(message.password); - /* string attribute1 = 6; */ - if (message.attribute1 !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.attribute1); - /* string attribute2 = 7; */ - if (message.attribute2 !== "") - writer.tag(7, runtime_1.WireType.LengthDelimited).string(message.attribute2); - /* string attribute3 = 8; */ - if (message.attribute3 !== "") - writer.tag(8, runtime_1.WireType.LengthDelimited).string(message.attribute3); - /* string name = 9; */ - if (message.name !== "") - writer.tag(9, runtime_1.WireType.LengthDelimited).string(message.name); - /* string type = 10; */ - if (message.type !== "") - writer.tag(10, runtime_1.WireType.LengthDelimited).string(message.type); - /* repeated string notify_on_new = 11; */ - for (let i = 0; i < message.notifyOnNew.length; i++) - writer.tag(11, runtime_1.WireType.LengthDelimited).string(message.notifyOnNew[i]); - /* bool notify_led = 12; */ - if (message.notifyLed !== false) - writer.tag(12, runtime_1.WireType.Varint).bool(message.notifyLed); - /* bytes data = 13; */ - if (message.data.length) - writer.tag(13, runtime_1.WireType.LengthDelimited).bytes(message.data); - /* bool name_equals_data_id = 14; */ - if (message.nameEqualsDataId !== false) - writer.tag(14, runtime_1.WireType.Varint).bool(message.nameEqualsDataId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message boss.v2.UploadFileRequest - */ -exports.UploadFileRequest = new UploadFileRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class UploadFileResponse$Type extends runtime_4.MessageType { - constructor() { - super("boss.v2.UploadFileResponse", [ - { no: 1, name: "file", kind: "message", T: () => file_1.File } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + data: isSet(object.data) ? Buffer.from(bytesFromBase64(object.data)) : Buffer.alloc(0), + nameEqualsDataId: isSet(object.nameEqualsDataId) ? globalThis.Boolean(object.nameEqualsDataId) : false, + }; + }, + toJSON(message) { + const obj = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + if (message.nameEqualsDataId !== false) { + obj.nameEqualsDataId = message.nameEqualsDataId; + } + return obj; + }, + create(base) { + return exports.UploadFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUploadFileRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.data = object.data ?? Buffer.alloc(0); + message.nameEqualsDataId = object.nameEqualsDataId ?? false; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseUploadFileResponse() { + return { file: undefined }; +} +exports.UploadFileResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.file !== undefined) { + file_1.File.encode(message.file, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* boss.v2.File file */ 1: - message.file = file_1.File.internalBinaryRead(reader, reader.uint32(), options, message.file); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.file = file_1.File.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* boss.v2.File file = 1; */ - if (message.file) - file_1.File.internalBinaryWrite(message.file, writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { file: isSet(object.file) ? file_1.File.fromJSON(object.file) : undefined }; + }, + toJSON(message) { + const obj = {}; + if (message.file !== undefined) { + obj.file = file_1.File.toJSON(message.file); + } + return obj; + }, + create(base) { + return exports.UploadFileResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseUploadFileResponse(); + message.file = (object.file !== undefined && object.file !== null) ? file_1.File.fromPartial(object.file) : undefined; + return message; + }, +}; +function bytesFromBase64(b64) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} +function base64FromBytes(arr) { + return globalThis.Buffer.from(arr).toString("base64"); +} +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message boss.v2.UploadFileResponse - */ -exports.UploadFileResponse = new UploadFileResponse$Type(); diff --git a/javascript/boss/v2/upload_file.ts b/javascript/boss/v2/upload_file.ts new file mode 100644 index 0000000..02ac577 --- /dev/null +++ b/javascript/boss/v2/upload_file.ts @@ -0,0 +1,408 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: boss/v2/upload_file.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { File } from "./file"; + +export const protobufPackage = "boss.v2"; + +export interface UploadFileRequest { + taskId: string; + bossAppId: string; + supportedCountries: string[]; + supportedLanguages: string[]; + password: string; + attribute1: string; + attribute2: string; + attribute3: string; + name: string; + type: string; + notifyOnNew: string[]; + notifyLed: boolean; + data: Buffer; + nameEqualsDataId: boolean; +} + +export interface UploadFileResponse { + file: File | undefined; +} + +function createBaseUploadFileRequest(): UploadFileRequest { + return { + taskId: "", + bossAppId: "", + supportedCountries: [], + supportedLanguages: [], + password: "", + attribute1: "", + attribute2: "", + attribute3: "", + name: "", + type: "", + notifyOnNew: [], + notifyLed: false, + data: Buffer.alloc(0), + nameEqualsDataId: false, + }; +} + +export const UploadFileRequest: MessageFns = { + encode(message: UploadFileRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.taskId !== "") { + writer.uint32(10).string(message.taskId); + } + if (message.bossAppId !== "") { + writer.uint32(18).string(message.bossAppId); + } + for (const v of message.supportedCountries) { + writer.uint32(26).string(v!); + } + for (const v of message.supportedLanguages) { + writer.uint32(34).string(v!); + } + if (message.password !== "") { + writer.uint32(42).string(message.password); + } + if (message.attribute1 !== "") { + writer.uint32(50).string(message.attribute1); + } + if (message.attribute2 !== "") { + writer.uint32(58).string(message.attribute2); + } + if (message.attribute3 !== "") { + writer.uint32(66).string(message.attribute3); + } + if (message.name !== "") { + writer.uint32(74).string(message.name); + } + if (message.type !== "") { + writer.uint32(82).string(message.type); + } + for (const v of message.notifyOnNew) { + writer.uint32(90).string(v!); + } + if (message.notifyLed !== false) { + writer.uint32(96).bool(message.notifyLed); + } + if (message.data.length !== 0) { + writer.uint32(106).bytes(message.data); + } + if (message.nameEqualsDataId !== false) { + writer.uint32(112).bool(message.nameEqualsDataId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UploadFileRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.taskId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bossAppId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.supportedCountries.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.supportedLanguages.push(reader.string()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.password = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.attribute1 = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.attribute2 = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.attribute3 = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.name = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.type = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notifyOnNew.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.notifyLed = reader.bool(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.data = Buffer.from(reader.bytes()); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.nameEqualsDataId = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadFileRequest { + return { + taskId: isSet(object.taskId) ? globalThis.String(object.taskId) : "", + bossAppId: isSet(object.bossAppId) ? globalThis.String(object.bossAppId) : "", + supportedCountries: globalThis.Array.isArray(object?.supportedCountries) + ? object.supportedCountries.map((e: any) => globalThis.String(e)) + : [], + supportedLanguages: globalThis.Array.isArray(object?.supportedLanguages) + ? object.supportedLanguages.map((e: any) => globalThis.String(e)) + : [], + password: isSet(object.password) ? globalThis.String(object.password) : "", + attribute1: isSet(object.attribute1) ? globalThis.String(object.attribute1) : "", + attribute2: isSet(object.attribute2) ? globalThis.String(object.attribute2) : "", + attribute3: isSet(object.attribute3) ? globalThis.String(object.attribute3) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + notifyOnNew: globalThis.Array.isArray(object?.notifyOnNew) + ? object.notifyOnNew.map((e: any) => globalThis.String(e)) + : [], + notifyLed: isSet(object.notifyLed) ? globalThis.Boolean(object.notifyLed) : false, + data: isSet(object.data) ? Buffer.from(bytesFromBase64(object.data)) : Buffer.alloc(0), + nameEqualsDataId: isSet(object.nameEqualsDataId) ? globalThis.Boolean(object.nameEqualsDataId) : false, + }; + }, + + toJSON(message: UploadFileRequest): unknown { + const obj: any = {}; + if (message.taskId !== "") { + obj.taskId = message.taskId; + } + if (message.bossAppId !== "") { + obj.bossAppId = message.bossAppId; + } + if (message.supportedCountries?.length) { + obj.supportedCountries = message.supportedCountries; + } + if (message.supportedLanguages?.length) { + obj.supportedLanguages = message.supportedLanguages; + } + if (message.password !== "") { + obj.password = message.password; + } + if (message.attribute1 !== "") { + obj.attribute1 = message.attribute1; + } + if (message.attribute2 !== "") { + obj.attribute2 = message.attribute2; + } + if (message.attribute3 !== "") { + obj.attribute3 = message.attribute3; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.notifyOnNew?.length) { + obj.notifyOnNew = message.notifyOnNew; + } + if (message.notifyLed !== false) { + obj.notifyLed = message.notifyLed; + } + if (message.data.length !== 0) { + obj.data = base64FromBytes(message.data); + } + if (message.nameEqualsDataId !== false) { + obj.nameEqualsDataId = message.nameEqualsDataId; + } + return obj; + }, + + create(base?: DeepPartial): UploadFileRequest { + return UploadFileRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UploadFileRequest { + const message = createBaseUploadFileRequest(); + message.taskId = object.taskId ?? ""; + message.bossAppId = object.bossAppId ?? ""; + message.supportedCountries = object.supportedCountries?.map((e) => e) || []; + message.supportedLanguages = object.supportedLanguages?.map((e) => e) || []; + message.password = object.password ?? ""; + message.attribute1 = object.attribute1 ?? ""; + message.attribute2 = object.attribute2 ?? ""; + message.attribute3 = object.attribute3 ?? ""; + message.name = object.name ?? ""; + message.type = object.type ?? ""; + message.notifyOnNew = object.notifyOnNew?.map((e) => e) || []; + message.notifyLed = object.notifyLed ?? false; + message.data = object.data ?? Buffer.alloc(0); + message.nameEqualsDataId = object.nameEqualsDataId ?? false; + return message; + }, +}; + +function createBaseUploadFileResponse(): UploadFileResponse { + return { file: undefined }; +} + +export const UploadFileResponse: MessageFns = { + encode(message: UploadFileResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.file !== undefined) { + File.encode(message.file, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UploadFileResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadFileResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.file = File.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UploadFileResponse { + return { file: isSet(object.file) ? File.fromJSON(object.file) : undefined }; + }, + + toJSON(message: UploadFileResponse): unknown { + const obj: any = {}; + if (message.file !== undefined) { + obj.file = File.toJSON(message.file); + } + return obj; + }, + + create(base?: DeepPartial): UploadFileResponse { + return UploadFileResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UploadFileResponse { + const message = createBaseUploadFileResponse(); + message.file = (object.file !== undefined && object.file !== null) ? File.fromPartial(object.file) : undefined; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/accept_friend_request_rpc.d.ts b/javascript/friends/accept_friend_request_rpc.d.ts index 08e0b95..90e68a7 100644 --- a/javascript/friends/accept_friend_request_rpc.d.ts +++ b/javascript/friends/accept_friend_request_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/accept_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.AcceptFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface AcceptFriendRequestRequest { - /** - * @generated from protobuf field: uint64 friend_request_id = 1; - */ friendRequestId: bigint; } -/** - * @generated from protobuf message friends.AcceptFriendRequestResponse - */ export interface AcceptFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class AcceptFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AcceptFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AcceptFriendRequestRequest): AcceptFriendRequestRequest; - internalBinaryWrite(message: AcceptFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const AcceptFriendRequestRequest: MessageFns; +export declare const AcceptFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.AcceptFriendRequestRequest - */ -export declare const AcceptFriendRequestRequest: AcceptFriendRequestRequest$Type; -declare class AcceptFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AcceptFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AcceptFriendRequestResponse): AcceptFriendRequestResponse; - internalBinaryWrite(message: AcceptFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.AcceptFriendRequestResponse - */ -export declare const AcceptFriendRequestResponse: AcceptFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/accept_friend_request_rpc.js b/javascript/friends/accept_friend_request_rpc.js index fdeed56..523e8d8 100644 --- a/javascript/friends/accept_friend_request_rpc.js +++ b/javascript/friends/accept_friend_request_rpc.js @@ -1,106 +1,119 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/accept_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/accept_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.AcceptFriendRequestResponse = exports.AcceptFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class AcceptFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.AcceptFriendRequestRequest", [ - { no: 1, name: "friend_request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequestId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.AcceptFriendRequestResponse = exports.AcceptFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseAcceptFriendRequestRequest() { + return { friendRequestId: 0n }; +} +exports.AcceptFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 friend_request_id */ 1: - message.friendRequestId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.friendRequestId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 friend_request_id = 1; */ - if (message.friendRequestId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.friendRequestId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.AcceptFriendRequestRequest - */ -exports.AcceptFriendRequestRequest = new AcceptFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AcceptFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.AcceptFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + create(base) { + return exports.AcceptFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseAcceptFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseAcceptFriendRequestResponse() { + return { success: false }; +} +exports.AcceptFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.AcceptFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseAcceptFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.AcceptFriendRequestResponse - */ -exports.AcceptFriendRequestResponse = new AcceptFriendRequestResponse$Type(); diff --git a/javascript/friends/accept_friend_request_rpc.ts b/javascript/friends/accept_friend_request_rpc.ts new file mode 100644 index 0000000..794de7c --- /dev/null +++ b/javascript/friends/accept_friend_request_rpc.ts @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/accept_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface AcceptFriendRequestRequest { + friendRequestId: bigint; +} + +export interface AcceptFriendRequestResponse { + success: boolean; +} + +function createBaseAcceptFriendRequestRequest(): AcceptFriendRequestRequest { + return { friendRequestId: 0n }; +} + +export const AcceptFriendRequestRequest: MessageFns = { + encode(message: AcceptFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AcceptFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.friendRequestId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptFriendRequestRequest { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + + toJSON(message: AcceptFriendRequestRequest): unknown { + const obj: any = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): AcceptFriendRequestRequest { + return AcceptFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AcceptFriendRequestRequest { + const message = createBaseAcceptFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; + return message; + }, +}; + +function createBaseAcceptFriendRequestResponse(): AcceptFriendRequestResponse { + return { success: false }; +} + +export const AcceptFriendRequestResponse: MessageFns = { + encode(message: AcceptFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AcceptFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: AcceptFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): AcceptFriendRequestResponse { + return AcceptFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AcceptFriendRequestResponse { + const message = createBaseAcceptFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/deny_friend_request_rpc.d.ts b/javascript/friends/deny_friend_request_rpc.d.ts index 938f6b2..a452d6c 100644 --- a/javascript/friends/deny_friend_request_rpc.d.ts +++ b/javascript/friends/deny_friend_request_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/deny_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.DenyFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface DenyFriendRequestRequest { - /** - * @generated from protobuf field: uint64 friend_request_id = 1; - */ friendRequestId: bigint; } -/** - * @generated from protobuf message friends.DenyFriendRequestResponse - */ export interface DenyFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class DenyFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DenyFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DenyFriendRequestRequest): DenyFriendRequestRequest; - internalBinaryWrite(message: DenyFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DenyFriendRequestRequest: MessageFns; +export declare const DenyFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.DenyFriendRequestRequest - */ -export declare const DenyFriendRequestRequest: DenyFriendRequestRequest$Type; -declare class DenyFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DenyFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DenyFriendRequestResponse): DenyFriendRequestResponse; - internalBinaryWrite(message: DenyFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.DenyFriendRequestResponse - */ -export declare const DenyFriendRequestResponse: DenyFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/deny_friend_request_rpc.js b/javascript/friends/deny_friend_request_rpc.js index 5323e57..cbf6aa8 100644 --- a/javascript/friends/deny_friend_request_rpc.js +++ b/javascript/friends/deny_friend_request_rpc.js @@ -1,106 +1,119 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/deny_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/deny_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DenyFriendRequestResponse = exports.DenyFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DenyFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.DenyFriendRequestRequest", [ - { no: 1, name: "friend_request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequestId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DenyFriendRequestResponse = exports.DenyFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseDenyFriendRequestRequest() { + return { friendRequestId: 0n }; +} +exports.DenyFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 friend_request_id */ 1: - message.friendRequestId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.friendRequestId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 friend_request_id = 1; */ - if (message.friendRequestId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.friendRequestId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.DenyFriendRequestRequest - */ -exports.DenyFriendRequestRequest = new DenyFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DenyFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.DenyFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + create(base) { + return exports.DenyFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDenyFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseDenyFriendRequestResponse() { + return { success: false }; +} +exports.DenyFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.DenyFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDenyFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.DenyFriendRequestResponse - */ -exports.DenyFriendRequestResponse = new DenyFriendRequestResponse$Type(); diff --git a/javascript/friends/deny_friend_request_rpc.ts b/javascript/friends/deny_friend_request_rpc.ts new file mode 100644 index 0000000..836465d --- /dev/null +++ b/javascript/friends/deny_friend_request_rpc.ts @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/deny_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface DenyFriendRequestRequest { + friendRequestId: bigint; +} + +export interface DenyFriendRequestResponse { + success: boolean; +} + +function createBaseDenyFriendRequestRequest(): DenyFriendRequestRequest { + return { friendRequestId: 0n }; +} + +export const DenyFriendRequestRequest: MessageFns = { + encode(message: DenyFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DenyFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.friendRequestId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DenyFriendRequestRequest { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + + toJSON(message: DenyFriendRequestRequest): unknown { + const obj: any = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): DenyFriendRequestRequest { + return DenyFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DenyFriendRequestRequest { + const message = createBaseDenyFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; + return message; + }, +}; + +function createBaseDenyFriendRequestResponse(): DenyFriendRequestResponse { + return { success: false }; +} + +export const DenyFriendRequestResponse: MessageFns = { + encode(message: DenyFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DenyFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DenyFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: DenyFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): DenyFriendRequestResponse { + return DenyFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DenyFriendRequestResponse { + const message = createBaseDenyFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/friend_request.d.ts b/javascript/friends/friend_request.d.ts index e133f36..807ae48 100644 --- a/javascript/friends/friend_request.d.ts +++ b/javascript/friends/friend_request.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friend_request.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.FriendRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface FriendRequest { - /** - * @generated from protobuf field: uint64 id = 1; - */ id: bigint; - /** - * @generated from protobuf field: uint32 sender = 2; - */ sender: number; - /** - * @generated from protobuf field: uint32 recipient = 3; - */ recipient: number; - /** - * @generated from protobuf field: uint64 sent = 4; - */ sent: bigint; - /** - * @generated from protobuf field: uint64 expires = 5; - */ expires: bigint; - /** - * @generated from protobuf field: string message = 6; - */ message: string; } -declare class FriendRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FriendRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FriendRequest): FriendRequest; - internalBinaryWrite(message: FriendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const FriendRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.FriendRequest - */ -export declare const FriendRequest: FriendRequest$Type; export {}; diff --git a/javascript/friends/friend_request.js b/javascript/friends/friend_request.js index b3405d8..6af5707 100644 --- a/javascript/friends/friend_request.js +++ b/javascript/friends/friend_request.js @@ -1,99 +1,151 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friend_request.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/friend_request.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.FriendRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class FriendRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.FriendRequest", [ - { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "sender", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "recipient", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "expires", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = 0n; - message.sender = 0; - message.recipient = 0; - message.sent = 0n; - message.expires = 0n; - message.message = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.FriendRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseFriendRequest() { + return { id: 0n, sender: 0, recipient: 0, sent: 0n, expires: 0n, message: "" }; +} +exports.FriendRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== 0n) { + if (BigInt.asUintN(64, message.id) !== message.id) { + throw new globalThis.Error("value provided for field message.id of type uint64 too large"); + } + writer.uint32(8).uint64(message.id); + } + if (message.sender !== 0) { + writer.uint32(16).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(24).uint32(message.recipient); + } + if (message.sent !== 0n) { + if (BigInt.asUintN(64, message.sent) !== message.sent) { + throw new globalThis.Error("value provided for field message.sent of type uint64 too large"); + } + writer.uint32(32).uint64(message.sent); + } + if (message.expires !== 0n) { + if (BigInt.asUintN(64, message.expires) !== message.expires) { + throw new globalThis.Error("value provided for field message.expires of type uint64 too large"); + } + writer.uint32(40).uint64(message.expires); + } + if (message.message !== "") { + writer.uint32(50).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 id */ 1: - message.id = reader.uint64().toBigInt(); - break; - case /* uint32 sender */ 2: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.id = reader.uint64(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.sender = reader.uint32(); - break; - case /* uint32 recipient */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.recipient = reader.uint32(); - break; - case /* uint64 sent */ 4: - message.sent = reader.uint64().toBigInt(); - break; - case /* uint64 expires */ 5: - message.expires = reader.uint64().toBigInt(); - break; - case /* string message */ 6: + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.sent = reader.uint64(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.expires = reader.uint64(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 id = 1; */ - if (message.id !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.id); - /* uint32 sender = 2; */ - if (message.sender !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.sender); - /* uint32 recipient = 3; */ - if (message.recipient !== 0) - writer.tag(3, runtime_1.WireType.Varint).uint32(message.recipient); - /* uint64 sent = 4; */ - if (message.sent !== 0n) - writer.tag(4, runtime_1.WireType.Varint).uint64(message.sent); - /* uint64 expires = 5; */ - if (message.expires !== 0n) - writer.tag(5, runtime_1.WireType.Varint).uint64(message.expires); - /* string message = 6; */ - if (message.message !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + id: isSet(object.id) ? BigInt(object.id) : 0n, + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + sent: isSet(object.sent) ? BigInt(object.sent) : 0n, + expires: isSet(object.expires) ? BigInt(object.expires) : 0n, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== 0n) { + obj.id = message.id.toString(); + } + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.sent !== 0n) { + obj.sent = message.sent.toString(); + } + if (message.expires !== 0n) { + obj.expires = message.expires.toString(); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.FriendRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseFriendRequest(); + message.id = object.id ?? 0n; + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.sent = object.sent ?? 0n; + message.expires = object.expires ?? 0n; + message.message = object.message ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.FriendRequest - */ -exports.FriendRequest = new FriendRequest$Type(); diff --git a/javascript/friends/friend_request.ts b/javascript/friends/friend_request.ts new file mode 100644 index 0000000..e06b2ec --- /dev/null +++ b/javascript/friends/friend_request.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/friend_request.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface FriendRequest { + id: bigint; + sender: number; + recipient: number; + sent: bigint; + expires: bigint; + message: string; +} + +function createBaseFriendRequest(): FriendRequest { + return { id: 0n, sender: 0, recipient: 0, sent: 0n, expires: 0n, message: "" }; +} + +export const FriendRequest: MessageFns = { + encode(message: FriendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== 0n) { + if (BigInt.asUintN(64, message.id) !== message.id) { + throw new globalThis.Error("value provided for field message.id of type uint64 too large"); + } + writer.uint32(8).uint64(message.id); + } + if (message.sender !== 0) { + writer.uint32(16).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(24).uint32(message.recipient); + } + if (message.sent !== 0n) { + if (BigInt.asUintN(64, message.sent) !== message.sent) { + throw new globalThis.Error("value provided for field message.sent of type uint64 too large"); + } + writer.uint32(32).uint64(message.sent); + } + if (message.expires !== 0n) { + if (BigInt.asUintN(64, message.expires) !== message.expires) { + throw new globalThis.Error("value provided for field message.expires of type uint64 too large"); + } + writer.uint32(40).uint64(message.expires); + } + if (message.message !== "") { + writer.uint32(50).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FriendRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.id = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.sender = reader.uint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.recipient = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.sent = reader.uint64() as bigint; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.expires = reader.uint64() as bigint; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FriendRequest { + return { + id: isSet(object.id) ? BigInt(object.id) : 0n, + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + sent: isSet(object.sent) ? BigInt(object.sent) : 0n, + expires: isSet(object.expires) ? BigInt(object.expires) : 0n, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + + toJSON(message: FriendRequest): unknown { + const obj: any = {}; + if (message.id !== 0n) { + obj.id = message.id.toString(); + } + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.sent !== 0n) { + obj.sent = message.sent.toString(); + } + if (message.expires !== 0n) { + obj.expires = message.expires.toString(); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): FriendRequest { + return FriendRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FriendRequest { + const message = createBaseFriendRequest(); + message.id = object.id ?? 0n; + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.sent = object.sent ?? 0n; + message.expires = object.expires ?? 0n; + message.message = object.message ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/friends_service.client.d.ts b/javascript/friends/friends_service.client.d.ts deleted file mode 100644 index ce8c466..0000000 --- a/javascript/friends/friends_service.client.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friends_service.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { DenyFriendRequestResponse } from "./deny_friend_request_rpc"; -import type { DenyFriendRequestRequest } from "./deny_friend_request_rpc"; -import type { AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; -import type { AcceptFriendRequestRequest } from "./accept_friend_request_rpc"; -import type { GetUserFriendRequestsIncomingResponse } from "./get_user_friend_requests_incoming_rpc"; -import type { GetUserFriendRequestsIncomingRequest } from "./get_user_friend_requests_incoming_rpc"; -import type { SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; -import type { SendUserFriendRequestRequest } from "./send_user_friend_request_rpc"; -import type { GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; -import type { GetUserFriendPIDsRequest } from "./get_user_friend_pids_rpc"; -import type { Empty } from "../google/protobuf/empty"; -import type { SendUserNotificationWiiURequest } from "./send_user_notification_wiiu_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service friends.Friends - */ -export interface IFriendsClient { - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.SendUserNotificationWiiURequest) returns (google.protobuf.Empty); - */ - sendUserNotificationWiiU(input: SendUserNotificationWiiURequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.GetUserFriendPIDsRequest) returns (friends.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input: GetUserFriendPIDsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.SendUserFriendRequestRequest) returns (friends.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input: SendUserFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.GetUserFriendRequestsIncomingRequest) returns (friends.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input: GetUserFriendRequestsIncomingRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.AcceptFriendRequestRequest) returns (friends.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input: AcceptFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.DenyFriendRequestRequest) returns (friends.DenyFriendRequestResponse); - */ - denyFriendRequest(input: DenyFriendRequestRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service friends.Friends - */ -export declare class FriendsClient implements IFriendsClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.SendUserNotificationWiiURequest) returns (google.protobuf.Empty); - */ - sendUserNotificationWiiU(input: SendUserNotificationWiiURequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.GetUserFriendPIDsRequest) returns (friends.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input: GetUserFriendPIDsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.SendUserFriendRequestRequest) returns (friends.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input: SendUserFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.GetUserFriendRequestsIncomingRequest) returns (friends.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input: GetUserFriendRequestsIncomingRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.AcceptFriendRequestRequest) returns (friends.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input: AcceptFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.DenyFriendRequestRequest) returns (friends.DenyFriendRequestResponse); - */ - denyFriendRequest(input: DenyFriendRequestRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/friends/friends_service.client.js b/javascript/friends/friends_service.client.js deleted file mode 100644 index 9196827..0000000 --- a/javascript/friends/friends_service.client.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friends_service.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FriendsClient = void 0; -const friends_service_1 = require("./friends_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service friends.Friends - */ -class FriendsClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = friends_service_1.Friends.typeName; - this.methods = friends_service_1.Friends.methods; - this.options = friends_service_1.Friends.options; - } - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.SendUserNotificationWiiURequest) returns (google.protobuf.Empty); - */ - sendUserNotificationWiiU(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.GetUserFriendPIDsRequest) returns (friends.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.SendUserFriendRequestRequest) returns (friends.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.GetUserFriendRequestsIncomingRequest) returns (friends.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.AcceptFriendRequestRequest) returns (friends.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.DenyFriendRequestRequest) returns (friends.DenyFriendRequestResponse); - */ - denyFriendRequest(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.FriendsClient = FriendsClient; diff --git a/javascript/friends/friends_service.d.ts b/javascript/friends/friends_service.d.ts index 1113cfd..5730256 100644 --- a/javascript/friends/friends_service.d.ts +++ b/javascript/friends/friends_service.d.ts @@ -1,9 +1,85 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friends_service.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service friends.Friends - */ -export declare const Friends: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { AcceptFriendRequestRequest, AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; +import { DenyFriendRequestRequest, DenyFriendRequestResponse } from "./deny_friend_request_rpc"; +import { GetUserFriendPIDsRequest, GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; +import { GetUserFriendRequestsIncomingRequest, GetUserFriendRequestsIncomingResponse } from "./get_user_friend_requests_incoming_rpc"; +import { SendUserFriendRequestRequest, SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; +import { SendUserNotificationWiiURequest } from "./send_user_notification_wiiu_rpc"; +export declare const protobufPackage = "friends"; +export type FriendsDefinition = typeof FriendsDefinition; +export declare const FriendsDefinition: { + readonly name: "Friends"; + readonly fullName: "friends.Friends"; + readonly methods: { + readonly sendUserNotificationWiiU: { + readonly name: "SendUserNotificationWiiU"; + readonly requestType: import("./send_user_notification_wiiu_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("../google/protobuf/empty").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserFriendPIDs: { + readonly name: "GetUserFriendPIDs"; + readonly requestType: import("./get_user_friend_pids_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_friend_pids_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly sendUserFriendRequest: { + readonly name: "SendUserFriendRequest"; + readonly requestType: import("./send_user_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./send_user_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserFriendRequestsIncoming: { + readonly name: "GetUserFriendRequestsIncoming"; + readonly requestType: import("./get_user_friend_requests_incoming_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_friend_requests_incoming_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly acceptFriendRequest: { + readonly name: "AcceptFriendRequest"; + readonly requestType: import("./accept_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./accept_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly denyFriendRequest: { + readonly name: "DenyFriendRequest"; + readonly requestType: import("./deny_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./deny_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface FriendsServiceImplementation { + sendUserNotificationWiiU(request: SendUserNotificationWiiURequest, context: CallContext & CallContextExt): Promise>; + getUserFriendPIDs(request: GetUserFriendPIDsRequest, context: CallContext & CallContextExt): Promise>; + sendUserFriendRequest(request: SendUserFriendRequestRequest, context: CallContext & CallContextExt): Promise>; + getUserFriendRequestsIncoming(request: GetUserFriendRequestsIncomingRequest, context: CallContext & CallContextExt): Promise>; + acceptFriendRequest(request: AcceptFriendRequestRequest, context: CallContext & CallContextExt): Promise>; + denyFriendRequest(request: DenyFriendRequestRequest, context: CallContext & CallContextExt): Promise>; +} +export interface FriendsClient { + sendUserNotificationWiiU(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserFriendPIDs(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + sendUserFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserFriendRequestsIncoming(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + acceptFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + denyFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/friends/friends_service.js b/javascript/friends/friends_service.js index 12b4dbb..8095623 100644 --- a/javascript/friends/friends_service.js +++ b/javascript/friends/friends_service.js @@ -1,37 +1,70 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friends_service.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/friends_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Friends = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/friends_service.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -const deny_friend_request_rpc_1 = require("./deny_friend_request_rpc"); -const deny_friend_request_rpc_2 = require("./deny_friend_request_rpc"); +exports.FriendsDefinition = exports.protobufPackage = void 0; +const empty_1 = require("../google/protobuf/empty"); const accept_friend_request_rpc_1 = require("./accept_friend_request_rpc"); -const accept_friend_request_rpc_2 = require("./accept_friend_request_rpc"); +const deny_friend_request_rpc_1 = require("./deny_friend_request_rpc"); +const get_user_friend_pids_rpc_1 = require("./get_user_friend_pids_rpc"); const get_user_friend_requests_incoming_rpc_1 = require("./get_user_friend_requests_incoming_rpc"); -const get_user_friend_requests_incoming_rpc_2 = require("./get_user_friend_requests_incoming_rpc"); const send_user_friend_request_rpc_1 = require("./send_user_friend_request_rpc"); -const send_user_friend_request_rpc_2 = require("./send_user_friend_request_rpc"); -const get_user_friend_pids_rpc_1 = require("./get_user_friend_pids_rpc"); -const get_user_friend_pids_rpc_2 = require("./get_user_friend_pids_rpc"); -const empty_1 = require("../google/protobuf/empty"); const send_user_notification_wiiu_rpc_1 = require("./send_user_notification_wiiu_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service friends.Friends - */ -exports.Friends = new runtime_rpc_1.ServiceType("friends.Friends", [ - { name: "SendUserNotificationWiiU", options: {}, I: send_user_notification_wiiu_rpc_1.SendUserNotificationWiiURequest, O: empty_1.Empty }, - { name: "GetUserFriendPIDs", options: {}, I: get_user_friend_pids_rpc_2.GetUserFriendPIDsRequest, O: get_user_friend_pids_rpc_1.GetUserFriendPIDsResponse }, - { name: "SendUserFriendRequest", options: {}, I: send_user_friend_request_rpc_2.SendUserFriendRequestRequest, O: send_user_friend_request_rpc_1.SendUserFriendRequestResponse }, - { name: "GetUserFriendRequestsIncoming", options: {}, I: get_user_friend_requests_incoming_rpc_2.GetUserFriendRequestsIncomingRequest, O: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingResponse }, - { name: "AcceptFriendRequest", options: {}, I: accept_friend_request_rpc_2.AcceptFriendRequestRequest, O: accept_friend_request_rpc_1.AcceptFriendRequestResponse }, - { name: "DenyFriendRequest", options: {}, I: deny_friend_request_rpc_2.DenyFriendRequestRequest, O: deny_friend_request_rpc_1.DenyFriendRequestResponse } -]); +exports.protobufPackage = "friends"; +exports.FriendsDefinition = { + name: "Friends", + fullName: "friends.Friends", + methods: { + sendUserNotificationWiiU: { + name: "SendUserNotificationWiiU", + requestType: send_user_notification_wiiu_rpc_1.SendUserNotificationWiiURequest, + requestStream: false, + responseType: empty_1.Empty, + responseStream: false, + options: {}, + }, + getUserFriendPIDs: { + name: "GetUserFriendPIDs", + requestType: get_user_friend_pids_rpc_1.GetUserFriendPIDsRequest, + requestStream: false, + responseType: get_user_friend_pids_rpc_1.GetUserFriendPIDsResponse, + responseStream: false, + options: {}, + }, + sendUserFriendRequest: { + name: "SendUserFriendRequest", + requestType: send_user_friend_request_rpc_1.SendUserFriendRequestRequest, + requestStream: false, + responseType: send_user_friend_request_rpc_1.SendUserFriendRequestResponse, + responseStream: false, + options: {}, + }, + getUserFriendRequestsIncoming: { + name: "GetUserFriendRequestsIncoming", + requestType: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingRequest, + requestStream: false, + responseType: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingResponse, + responseStream: false, + options: {}, + }, + acceptFriendRequest: { + name: "AcceptFriendRequest", + requestType: accept_friend_request_rpc_1.AcceptFriendRequestRequest, + requestStream: false, + responseType: accept_friend_request_rpc_1.AcceptFriendRequestResponse, + responseStream: false, + options: {}, + }, + denyFriendRequest: { + name: "DenyFriendRequest", + requestType: deny_friend_request_rpc_1.DenyFriendRequestRequest, + requestStream: false, + responseType: deny_friend_request_rpc_1.DenyFriendRequestResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/friends/friends_service.ts b/javascript/friends/friends_service.ts new file mode 100644 index 0000000..34859a6 --- /dev/null +++ b/javascript/friends/friends_service.ts @@ -0,0 +1,138 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/friends_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { Empty } from "../google/protobuf/empty"; +import { AcceptFriendRequestRequest, AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; +import { DenyFriendRequestRequest, DenyFriendRequestResponse } from "./deny_friend_request_rpc"; +import { GetUserFriendPIDsRequest, GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; +import { + GetUserFriendRequestsIncomingRequest, + GetUserFriendRequestsIncomingResponse, +} from "./get_user_friend_requests_incoming_rpc"; +import { SendUserFriendRequestRequest, SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; +import { SendUserNotificationWiiURequest } from "./send_user_notification_wiiu_rpc"; + +export const protobufPackage = "friends"; + +export type FriendsDefinition = typeof FriendsDefinition; +export const FriendsDefinition = { + name: "Friends", + fullName: "friends.Friends", + methods: { + sendUserNotificationWiiU: { + name: "SendUserNotificationWiiU", + requestType: SendUserNotificationWiiURequest, + requestStream: false, + responseType: Empty, + responseStream: false, + options: {}, + }, + getUserFriendPIDs: { + name: "GetUserFriendPIDs", + requestType: GetUserFriendPIDsRequest, + requestStream: false, + responseType: GetUserFriendPIDsResponse, + responseStream: false, + options: {}, + }, + sendUserFriendRequest: { + name: "SendUserFriendRequest", + requestType: SendUserFriendRequestRequest, + requestStream: false, + responseType: SendUserFriendRequestResponse, + responseStream: false, + options: {}, + }, + getUserFriendRequestsIncoming: { + name: "GetUserFriendRequestsIncoming", + requestType: GetUserFriendRequestsIncomingRequest, + requestStream: false, + responseType: GetUserFriendRequestsIncomingResponse, + responseStream: false, + options: {}, + }, + acceptFriendRequest: { + name: "AcceptFriendRequest", + requestType: AcceptFriendRequestRequest, + requestStream: false, + responseType: AcceptFriendRequestResponse, + responseStream: false, + options: {}, + }, + denyFriendRequest: { + name: "DenyFriendRequest", + requestType: DenyFriendRequestRequest, + requestStream: false, + responseType: DenyFriendRequestResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface FriendsServiceImplementation { + sendUserNotificationWiiU( + request: SendUserNotificationWiiURequest, + context: CallContext & CallContextExt, + ): Promise>; + getUserFriendPIDs( + request: GetUserFriendPIDsRequest, + context: CallContext & CallContextExt, + ): Promise>; + sendUserFriendRequest( + request: SendUserFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; + getUserFriendRequestsIncoming( + request: GetUserFriendRequestsIncomingRequest, + context: CallContext & CallContextExt, + ): Promise>; + acceptFriendRequest( + request: AcceptFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; + denyFriendRequest( + request: DenyFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface FriendsClient { + sendUserNotificationWiiU( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getUserFriendPIDs( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + sendUserFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getUserFriendRequestsIncoming( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + acceptFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + denyFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/friends/get_user_friend_pids_rpc.d.ts b/javascript/friends/get_user_friend_pids_rpc.d.ts index d0cb623..98c1410 100644 --- a/javascript/friends/get_user_friend_pids_rpc.d.ts +++ b/javascript/friends/get_user_friend_pids_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/get_user_friend_pids_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.GetUserFriendPIDsRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface GetUserFriendPIDsRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message friends.GetUserFriendPIDsResponse - */ export interface GetUserFriendPIDsResponse { - /** - * @generated from protobuf field: repeated uint32 pids = 1; - */ pids: number[]; } -declare class GetUserFriendPIDsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendPIDsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendPIDsRequest): GetUserFriendPIDsRequest; - internalBinaryWrite(message: GetUserFriendPIDsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserFriendPIDsRequest: MessageFns; +export declare const GetUserFriendPIDsResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.GetUserFriendPIDsRequest - */ -export declare const GetUserFriendPIDsRequest: GetUserFriendPIDsRequest$Type; -declare class GetUserFriendPIDsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendPIDsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendPIDsResponse): GetUserFriendPIDsResponse; - internalBinaryWrite(message: GetUserFriendPIDsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.GetUserFriendPIDsResponse - */ -export declare const GetUserFriendPIDsResponse: GetUserFriendPIDsResponse$Type; export {}; diff --git a/javascript/friends/get_user_friend_pids_rpc.js b/javascript/friends/get_user_friend_pids_rpc.js index 01cd504..39ae5de 100644 --- a/javascript/friends/get_user_friend_pids_rpc.js +++ b/javascript/friends/get_user_friend_pids_rpc.js @@ -1,114 +1,125 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/get_user_friend_pids_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/get_user_friend_pids_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserFriendPIDsResponse = exports.GetUserFriendPIDsRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendPIDsRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.GetUserFriendPIDsRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.GetUserFriendPIDsResponse = exports.GetUserFriendPIDsRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseGetUserFriendPIDsRequest() { + return { pid: 0 }; +} +exports.GetUserFriendPIDsRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.GetUserFriendPIDsRequest - */ -exports.GetUserFriendPIDsRequest = new GetUserFriendPIDsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendPIDsResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.GetUserFriendPIDsResponse", [ - { no: 1, name: "pids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pids = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserFriendPIDsRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendPIDsRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserFriendPIDsResponse() { + return { pids: [] }; +} +exports.GetUserFriendPIDsResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + writer.uint32(10).fork(); + for (const v of message.pids) { + writer.uint32(v); + } + writer.join(); + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated uint32 pids */ 1: - if (wireType === runtime_1.WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.pids.push(reader.uint32()); - else + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { message.pids.push(reader.uint32()); + continue; + } + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.pids.push(reader.uint32()); + } + continue; + } break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated uint32 pids = 1; */ - if (message.pids.length) { - writer.tag(1, runtime_1.WireType.LengthDelimited).fork(); - for (let i = 0; i < message.pids.length; i++) - writer.uint32(message.pids[i]); - writer.join(); + }, + fromJSON(object) { + return { pids: globalThis.Array.isArray(object?.pids) ? object.pids.map((e) => globalThis.Number(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.pids?.length) { + obj.pids = message.pids.map((e) => Math.round(e)); } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + return obj; + }, + create(base) { + return exports.GetUserFriendPIDsResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendPIDsResponse(); + message.pids = object.pids?.map((e) => e) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.GetUserFriendPIDsResponse - */ -exports.GetUserFriendPIDsResponse = new GetUserFriendPIDsResponse$Type(); diff --git a/javascript/friends/get_user_friend_pids_rpc.ts b/javascript/friends/get_user_friend_pids_rpc.ts new file mode 100644 index 0000000..553b38b --- /dev/null +++ b/javascript/friends/get_user_friend_pids_rpc.ts @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/get_user_friend_pids_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface GetUserFriendPIDsRequest { + pid: number; +} + +export interface GetUserFriendPIDsResponse { + pids: number[]; +} + +function createBaseGetUserFriendPIDsRequest(): GetUserFriendPIDsRequest { + return { pid: 0 }; +} + +export const GetUserFriendPIDsRequest: MessageFns = { + encode(message: GetUserFriendPIDsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendPIDsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendPIDsRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserFriendPIDsRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendPIDsRequest { + return GetUserFriendPIDsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendPIDsRequest { + const message = createBaseGetUserFriendPIDsRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserFriendPIDsResponse(): GetUserFriendPIDsResponse { + return { pids: [] }; +} + +export const GetUserFriendPIDsResponse: MessageFns = { + encode(message: GetUserFriendPIDsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.pids) { + writer.uint32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendPIDsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.pids.push(reader.uint32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.pids.push(reader.uint32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendPIDsResponse { + return { pids: globalThis.Array.isArray(object?.pids) ? object.pids.map((e: any) => globalThis.Number(e)) : [] }; + }, + + toJSON(message: GetUserFriendPIDsResponse): unknown { + const obj: any = {}; + if (message.pids?.length) { + obj.pids = message.pids.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendPIDsResponse { + return GetUserFriendPIDsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendPIDsResponse { + const message = createBaseGetUserFriendPIDsResponse(); + message.pids = object.pids?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/get_user_friend_requests_incoming_rpc.d.ts b/javascript/friends/get_user_friend_requests_incoming_rpc.d.ts index a56ade1..5d2510b 100644 --- a/javascript/friends/get_user_friend_requests_incoming_rpc.d.ts +++ b/javascript/friends/get_user_friend_requests_incoming_rpc.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/get_user_friend_requests_incoming_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { FriendRequest } from "./friend_request"; -/** - * @generated from protobuf message friends.GetUserFriendRequestsIncomingRequest - */ +export declare const protobufPackage = "friends"; export interface GetUserFriendRequestsIncomingRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message friends.GetUserFriendRequestsIncomingResponse - */ export interface GetUserFriendRequestsIncomingResponse { - /** - * @generated from protobuf field: repeated friends.FriendRequest friend_requests = 1; - */ friendRequests: FriendRequest[]; } -declare class GetUserFriendRequestsIncomingRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendRequestsIncomingRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendRequestsIncomingRequest): GetUserFriendRequestsIncomingRequest; - internalBinaryWrite(message: GetUserFriendRequestsIncomingRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserFriendRequestsIncomingRequest: MessageFns; +export declare const GetUserFriendRequestsIncomingResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.GetUserFriendRequestsIncomingRequest - */ -export declare const GetUserFriendRequestsIncomingRequest: GetUserFriendRequestsIncomingRequest$Type; -declare class GetUserFriendRequestsIncomingResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendRequestsIncomingResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendRequestsIncomingResponse): GetUserFriendRequestsIncomingResponse; - internalBinaryWrite(message: GetUserFriendRequestsIncomingResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.GetUserFriendRequestsIncomingResponse - */ -export declare const GetUserFriendRequestsIncomingResponse: GetUserFriendRequestsIncomingResponse$Type; export {}; diff --git a/javascript/friends/get_user_friend_requests_incoming_rpc.js b/javascript/friends/get_user_friend_requests_incoming_rpc.js index 7a70cb9..610cecb 100644 --- a/javascript/friends/get_user_friend_requests_incoming_rpc.js +++ b/javascript/friends/get_user_friend_requests_incoming_rpc.js @@ -1,107 +1,121 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/get_user_friend_requests_incoming_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/get_user_friend_requests_incoming_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserFriendRequestsIncomingResponse = exports.GetUserFriendRequestsIncomingRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.GetUserFriendRequestsIncomingResponse = exports.GetUserFriendRequestsIncomingRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const friend_request_1 = require("./friend_request"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendRequestsIncomingRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.GetUserFriendRequestsIncomingRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "friends"; +function createBaseGetUserFriendRequestsIncomingRequest() { + return { pid: 0 }; +} +exports.GetUserFriendRequestsIncomingRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.GetUserFriendRequestsIncomingRequest - */ -exports.GetUserFriendRequestsIncomingRequest = new GetUserFriendRequestsIncomingRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendRequestsIncomingResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.GetUserFriendRequestsIncomingResponse", [ - { no: 1, name: "friend_requests", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => friend_request_1.FriendRequest } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequests = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserFriendRequestsIncomingRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendRequestsIncomingRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserFriendRequestsIncomingResponse() { + return { friendRequests: [] }; +} +exports.GetUserFriendRequestsIncomingResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.friendRequests) { + friend_request_1.FriendRequest.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated friends.FriendRequest friend_requests */ 1: - message.friendRequests.push(friend_request_1.FriendRequest.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.friendRequests.push(friend_request_1.FriendRequest.decode(reader, reader.uint32())); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated friends.FriendRequest friend_requests = 1; */ - for (let i = 0; i < message.friendRequests.length; i++) - friend_request_1.FriendRequest.internalBinaryWrite(message.friendRequests[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + friendRequests: globalThis.Array.isArray(object?.friendRequests) + ? object.friendRequests.map((e) => friend_request_1.FriendRequest.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequests?.length) { + obj.friendRequests = message.friendRequests.map((e) => friend_request_1.FriendRequest.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.GetUserFriendRequestsIncomingResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendRequestsIncomingResponse(); + message.friendRequests = object.friendRequests?.map((e) => friend_request_1.FriendRequest.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.GetUserFriendRequestsIncomingResponse - */ -exports.GetUserFriendRequestsIncomingResponse = new GetUserFriendRequestsIncomingResponse$Type(); diff --git a/javascript/friends/get_user_friend_requests_incoming_rpc.ts b/javascript/friends/get_user_friend_requests_incoming_rpc.ts new file mode 100644 index 0000000..865dbd8 --- /dev/null +++ b/javascript/friends/get_user_friend_requests_incoming_rpc.ts @@ -0,0 +1,160 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/get_user_friend_requests_incoming_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { FriendRequest } from "./friend_request"; + +export const protobufPackage = "friends"; + +export interface GetUserFriendRequestsIncomingRequest { + pid: number; +} + +export interface GetUserFriendRequestsIncomingResponse { + friendRequests: FriendRequest[]; +} + +function createBaseGetUserFriendRequestsIncomingRequest(): GetUserFriendRequestsIncomingRequest { + return { pid: 0 }; +} + +export const GetUserFriendRequestsIncomingRequest: MessageFns = { + encode(message: GetUserFriendRequestsIncomingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendRequestsIncomingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendRequestsIncomingRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserFriendRequestsIncomingRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendRequestsIncomingRequest { + return GetUserFriendRequestsIncomingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendRequestsIncomingRequest { + const message = createBaseGetUserFriendRequestsIncomingRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserFriendRequestsIncomingResponse(): GetUserFriendRequestsIncomingResponse { + return { friendRequests: [] }; +} + +export const GetUserFriendRequestsIncomingResponse: MessageFns = { + encode(message: GetUserFriendRequestsIncomingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.friendRequests) { + FriendRequest.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendRequestsIncomingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.friendRequests.push(FriendRequest.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendRequestsIncomingResponse { + return { + friendRequests: globalThis.Array.isArray(object?.friendRequests) + ? object.friendRequests.map((e: any) => FriendRequest.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GetUserFriendRequestsIncomingResponse): unknown { + const obj: any = {}; + if (message.friendRequests?.length) { + obj.friendRequests = message.friendRequests.map((e) => FriendRequest.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendRequestsIncomingResponse { + return GetUserFriendRequestsIncomingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendRequestsIncomingResponse { + const message = createBaseGetUserFriendRequestsIncomingResponse(); + message.friendRequests = object.friendRequests?.map((e) => FriendRequest.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/send_user_friend_request_rpc.d.ts b/javascript/friends/send_user_friend_request_rpc.d.ts index b9c2db1..b724049 100644 --- a/javascript/friends/send_user_friend_request_rpc.d.ts +++ b/javascript/friends/send_user_friend_request_rpc.d.ts @@ -1,58 +1,25 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/send_user_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.SendUserFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface SendUserFriendRequestRequest { - /** - * @generated from protobuf field: uint32 sender = 1; - */ sender: number; - /** - * @generated from protobuf field: uint32 recipient = 2; - */ recipient: number; - /** - * @generated from protobuf field: string message = 3; - */ message: string; } -/** - * @generated from protobuf message friends.SendUserFriendRequestResponse - */ export interface SendUserFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class SendUserFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserFriendRequestRequest): SendUserFriendRequestRequest; - internalBinaryWrite(message: SendUserFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SendUserFriendRequestRequest: MessageFns; +export declare const SendUserFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.SendUserFriendRequestRequest - */ -export declare const SendUserFriendRequestRequest: SendUserFriendRequestRequest$Type; -declare class SendUserFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserFriendRequestResponse): SendUserFriendRequestResponse; - internalBinaryWrite(message: SendUserFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.SendUserFriendRequestResponse - */ -export declare const SendUserFriendRequestResponse: SendUserFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/send_user_friend_request_rpc.js b/javascript/friends/send_user_friend_request_rpc.js index 7a4b60a..21adef9 100644 --- a/javascript/friends/send_user_friend_request_rpc.js +++ b/javascript/friends/send_user_friend_request_rpc.js @@ -1,122 +1,148 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/send_user_friend_request_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/send_user_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SendUserFriendRequestResponse = exports.SendUserFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.SendUserFriendRequestRequest", [ - { no: 1, name: "sender", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "recipient", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.sender = 0; - message.recipient = 0; - message.message = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SendUserFriendRequestResponse = exports.SendUserFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseSendUserFriendRequestRequest() { + return { sender: 0, recipient: 0, message: "" }; +} +exports.SendUserFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sender !== 0) { + writer.uint32(8).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(16).uint32(message.recipient); + } + if (message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 sender */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.sender = reader.uint32(); - break; - case /* uint32 recipient */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.recipient = reader.uint32(); - break; - case /* string message */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 sender = 1; */ - if (message.sender !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.sender); - /* uint32 recipient = 2; */ - if (message.recipient !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.recipient); - /* string message = 3; */ - if (message.message !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.SendUserFriendRequestRequest - */ -exports.SendUserFriendRequestRequest = new SendUserFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.SendUserFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.SendUserFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserFriendRequestRequest(); + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.message = object.message ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseSendUserFriendRequestResponse() { + return { success: false }; +} +exports.SendUserFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.SendUserFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.SendUserFriendRequestResponse - */ -exports.SendUserFriendRequestResponse = new SendUserFriendRequestResponse$Type(); diff --git a/javascript/friends/send_user_friend_request_rpc.ts b/javascript/friends/send_user_friend_request_rpc.ts new file mode 100644 index 0000000..99b7a7a --- /dev/null +++ b/javascript/friends/send_user_friend_request_rpc.ts @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/send_user_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface SendUserFriendRequestRequest { + sender: number; + recipient: number; + message: string; +} + +export interface SendUserFriendRequestResponse { + success: boolean; +} + +function createBaseSendUserFriendRequestRequest(): SendUserFriendRequestRequest { + return { sender: 0, recipient: 0, message: "" }; +} + +export const SendUserFriendRequestRequest: MessageFns = { + encode(message: SendUserFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sender !== 0) { + writer.uint32(8).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(16).uint32(message.recipient); + } + if (message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.sender = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.recipient = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserFriendRequestRequest { + return { + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + + toJSON(message: SendUserFriendRequestRequest): unknown { + const obj: any = {}; + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): SendUserFriendRequestRequest { + return SendUserFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserFriendRequestRequest { + const message = createBaseSendUserFriendRequestRequest(); + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseSendUserFriendRequestResponse(): SendUserFriendRequestResponse { + return { success: false }; +} + +export const SendUserFriendRequestResponse: MessageFns = { + encode(message: SendUserFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: SendUserFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): SendUserFriendRequestResponse { + return SendUserFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserFriendRequestResponse { + const message = createBaseSendUserFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/send_user_notification_wiiu_rpc.d.ts b/javascript/friends/send_user_notification_wiiu_rpc.d.ts index de74894..fda56e0 100644 --- a/javascript/friends/send_user_notification_wiiu_rpc.d.ts +++ b/javascript/friends/send_user_notification_wiiu_rpc.d.ts @@ -1,35 +1,20 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/send_user_notification_wiiu_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.SendUserNotificationWiiURequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends"; export interface SendUserNotificationWiiURequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: bytes notification_data = 2; - */ - notificationData: Uint8Array; + notificationData: Buffer; } -declare class SendUserNotificationWiiURequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserNotificationWiiURequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserNotificationWiiURequest): SendUserNotificationWiiURequest; - internalBinaryWrite(message: SendUserNotificationWiiURequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SendUserNotificationWiiURequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.SendUserNotificationWiiURequest - */ -export declare const SendUserNotificationWiiURequest: SendUserNotificationWiiURequest$Type; export {}; diff --git a/javascript/friends/send_user_notification_wiiu_rpc.js b/javascript/friends/send_user_notification_wiiu_rpc.js index d9245d6..18d01a3 100644 --- a/javascript/friends/send_user_notification_wiiu_rpc.js +++ b/javascript/friends/send_user_notification_wiiu_rpc.js @@ -1,67 +1,90 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/send_user_notification_wiiu_rpc.proto" (package "friends", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/send_user_notification_wiiu_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SendUserNotificationWiiURequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserNotificationWiiURequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.SendUserNotificationWiiURequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "notification_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - message.notificationData = new Uint8Array(0); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SendUserNotificationWiiURequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends"; +function createBaseSendUserNotificationWiiURequest() { + return { pid: 0, notificationData: Buffer.alloc(0) }; +} +exports.SendUserNotificationWiiURequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.notificationData.length !== 0) { + writer.uint32(18).bytes(message.notificationData); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiURequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* bytes notification_data */ 2: - message.notificationData = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.notificationData = Buffer.from(reader.bytes()); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* bytes notification_data = 2; */ - if (message.notificationData.length) - writer.tag(2, runtime_1.WireType.LengthDelimited).bytes(message.notificationData); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + notificationData: isSet(object.notificationData) + ? Buffer.from(bytesFromBase64(object.notificationData)) + : Buffer.alloc(0), + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.notificationData.length !== 0) { + obj.notificationData = base64FromBytes(message.notificationData); + } + return obj; + }, + create(base) { + return exports.SendUserNotificationWiiURequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserNotificationWiiURequest(); + message.pid = object.pid ?? 0; + message.notificationData = object.notificationData ?? Buffer.alloc(0); + return message; + }, +}; +function bytesFromBase64(b64) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} +function base64FromBytes(arr) { + return globalThis.Buffer.from(arr).toString("base64"); +} +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.SendUserNotificationWiiURequest - */ -exports.SendUserNotificationWiiURequest = new SendUserNotificationWiiURequest$Type(); diff --git a/javascript/friends/send_user_notification_wiiu_rpc.ts b/javascript/friends/send_user_notification_wiiu_rpc.ts new file mode 100644 index 0000000..e38d044 --- /dev/null +++ b/javascript/friends/send_user_notification_wiiu_rpc.ts @@ -0,0 +1,122 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/send_user_notification_wiiu_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends"; + +export interface SendUserNotificationWiiURequest { + pid: number; + notificationData: Buffer; +} + +function createBaseSendUserNotificationWiiURequest(): SendUserNotificationWiiURequest { + return { pid: 0, notificationData: Buffer.alloc(0) }; +} + +export const SendUserNotificationWiiURequest: MessageFns = { + encode(message: SendUserNotificationWiiURequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.notificationData.length !== 0) { + writer.uint32(18).bytes(message.notificationData); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserNotificationWiiURequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiURequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.notificationData = Buffer.from(reader.bytes()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserNotificationWiiURequest { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + notificationData: isSet(object.notificationData) + ? Buffer.from(bytesFromBase64(object.notificationData)) + : Buffer.alloc(0), + }; + }, + + toJSON(message: SendUserNotificationWiiURequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.notificationData.length !== 0) { + obj.notificationData = base64FromBytes(message.notificationData); + } + return obj; + }, + + create(base?: DeepPartial): SendUserNotificationWiiURequest { + return SendUserNotificationWiiURequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserNotificationWiiURequest { + const message = createBaseSendUserNotificationWiiURequest(); + message.pid = object.pid ?? 0; + message.notificationData = object.notificationData ?? Buffer.alloc(0); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/accept_friend_request_rpc.d.ts b/javascript/friends/v2/accept_friend_request_rpc.d.ts index b40c187..565fa46 100644 --- a/javascript/friends/v2/accept_friend_request_rpc.d.ts +++ b/javascript/friends/v2/accept_friend_request_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/accept_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.AcceptFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface AcceptFriendRequestRequest { - /** - * @generated from protobuf field: uint64 friend_request_id = 1; - */ friendRequestId: bigint; } -/** - * @generated from protobuf message friends.v2.AcceptFriendRequestResponse - */ export interface AcceptFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class AcceptFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AcceptFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AcceptFriendRequestRequest): AcceptFriendRequestRequest; - internalBinaryWrite(message: AcceptFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const AcceptFriendRequestRequest: MessageFns; +export declare const AcceptFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.AcceptFriendRequestRequest - */ -export declare const AcceptFriendRequestRequest: AcceptFriendRequestRequest$Type; -declare class AcceptFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): AcceptFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AcceptFriendRequestResponse): AcceptFriendRequestResponse; - internalBinaryWrite(message: AcceptFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.AcceptFriendRequestResponse - */ -export declare const AcceptFriendRequestResponse: AcceptFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/v2/accept_friend_request_rpc.js b/javascript/friends/v2/accept_friend_request_rpc.js index 1a12183..4cf9484 100644 --- a/javascript/friends/v2/accept_friend_request_rpc.js +++ b/javascript/friends/v2/accept_friend_request_rpc.js @@ -1,106 +1,119 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/accept_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/accept_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.AcceptFriendRequestResponse = exports.AcceptFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class AcceptFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.AcceptFriendRequestRequest", [ - { no: 1, name: "friend_request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequestId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.AcceptFriendRequestResponse = exports.AcceptFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseAcceptFriendRequestRequest() { + return { friendRequestId: 0n }; +} +exports.AcceptFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 friend_request_id */ 1: - message.friendRequestId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.friendRequestId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 friend_request_id = 1; */ - if (message.friendRequestId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.friendRequestId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.AcceptFriendRequestRequest - */ -exports.AcceptFriendRequestRequest = new AcceptFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class AcceptFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.AcceptFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + create(base) { + return exports.AcceptFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseAcceptFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseAcceptFriendRequestResponse() { + return { success: false }; +} +exports.AcceptFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.AcceptFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseAcceptFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.AcceptFriendRequestResponse - */ -exports.AcceptFriendRequestResponse = new AcceptFriendRequestResponse$Type(); diff --git a/javascript/friends/v2/accept_friend_request_rpc.ts b/javascript/friends/v2/accept_friend_request_rpc.ts new file mode 100644 index 0000000..291f37d --- /dev/null +++ b/javascript/friends/v2/accept_friend_request_rpc.ts @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/accept_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface AcceptFriendRequestRequest { + friendRequestId: bigint; +} + +export interface AcceptFriendRequestResponse { + success: boolean; +} + +function createBaseAcceptFriendRequestRequest(): AcceptFriendRequestRequest { + return { friendRequestId: 0n }; +} + +export const AcceptFriendRequestRequest: MessageFns = { + encode(message: AcceptFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AcceptFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.friendRequestId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptFriendRequestRequest { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + + toJSON(message: AcceptFriendRequestRequest): unknown { + const obj: any = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): AcceptFriendRequestRequest { + return AcceptFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AcceptFriendRequestRequest { + const message = createBaseAcceptFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; + return message; + }, +}; + +function createBaseAcceptFriendRequestResponse(): AcceptFriendRequestResponse { + return { success: false }; +} + +export const AcceptFriendRequestResponse: MessageFns = { + encode(message: AcceptFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AcceptFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAcceptFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AcceptFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: AcceptFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): AcceptFriendRequestResponse { + return AcceptFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AcceptFriendRequestResponse { + const message = createBaseAcceptFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/deny_friend_request_rpc.d.ts b/javascript/friends/v2/deny_friend_request_rpc.d.ts index de5aa4e..d5d6968 100644 --- a/javascript/friends/v2/deny_friend_request_rpc.d.ts +++ b/javascript/friends/v2/deny_friend_request_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/deny_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.DenyFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface DenyFriendRequestRequest { - /** - * @generated from protobuf field: uint64 friend_request_id = 1; - */ friendRequestId: bigint; } -/** - * @generated from protobuf message friends.v2.DenyFriendRequestResponse - */ export interface DenyFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class DenyFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DenyFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DenyFriendRequestRequest): DenyFriendRequestRequest; - internalBinaryWrite(message: DenyFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const DenyFriendRequestRequest: MessageFns; +export declare const DenyFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.DenyFriendRequestRequest - */ -export declare const DenyFriendRequestRequest: DenyFriendRequestRequest$Type; -declare class DenyFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): DenyFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DenyFriendRequestResponse): DenyFriendRequestResponse; - internalBinaryWrite(message: DenyFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.DenyFriendRequestResponse - */ -export declare const DenyFriendRequestResponse: DenyFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/v2/deny_friend_request_rpc.js b/javascript/friends/v2/deny_friend_request_rpc.js index 4d9bfda..e329dcf 100644 --- a/javascript/friends/v2/deny_friend_request_rpc.js +++ b/javascript/friends/v2/deny_friend_request_rpc.js @@ -1,106 +1,119 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/deny_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/deny_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.DenyFriendRequestResponse = exports.DenyFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class DenyFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.DenyFriendRequestRequest", [ - { no: 1, name: "friend_request_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequestId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.DenyFriendRequestResponse = exports.DenyFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseDenyFriendRequestRequest() { + return { friendRequestId: 0n }; +} +exports.DenyFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 friend_request_id */ 1: - message.friendRequestId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.friendRequestId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 friend_request_id = 1; */ - if (message.friendRequestId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.friendRequestId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.DenyFriendRequestRequest - */ -exports.DenyFriendRequestRequest = new DenyFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class DenyFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.DenyFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + create(base) { + return exports.DenyFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDenyFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseDenyFriendRequestResponse() { + return { success: false }; +} +exports.DenyFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.DenyFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseDenyFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.DenyFriendRequestResponse - */ -exports.DenyFriendRequestResponse = new DenyFriendRequestResponse$Type(); diff --git a/javascript/friends/v2/deny_friend_request_rpc.ts b/javascript/friends/v2/deny_friend_request_rpc.ts new file mode 100644 index 0000000..800ef39 --- /dev/null +++ b/javascript/friends/v2/deny_friend_request_rpc.ts @@ -0,0 +1,158 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/deny_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface DenyFriendRequestRequest { + friendRequestId: bigint; +} + +export interface DenyFriendRequestResponse { + success: boolean; +} + +function createBaseDenyFriendRequestRequest(): DenyFriendRequestRequest { + return { friendRequestId: 0n }; +} + +export const DenyFriendRequestRequest: MessageFns = { + encode(message: DenyFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.friendRequestId !== 0n) { + if (BigInt.asUintN(64, message.friendRequestId) !== message.friendRequestId) { + throw new globalThis.Error("value provided for field message.friendRequestId of type uint64 too large"); + } + writer.uint32(8).uint64(message.friendRequestId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DenyFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.friendRequestId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DenyFriendRequestRequest { + return { friendRequestId: isSet(object.friendRequestId) ? BigInt(object.friendRequestId) : 0n }; + }, + + toJSON(message: DenyFriendRequestRequest): unknown { + const obj: any = {}; + if (message.friendRequestId !== 0n) { + obj.friendRequestId = message.friendRequestId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): DenyFriendRequestRequest { + return DenyFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DenyFriendRequestRequest { + const message = createBaseDenyFriendRequestRequest(); + message.friendRequestId = object.friendRequestId ?? 0n; + return message; + }, +}; + +function createBaseDenyFriendRequestResponse(): DenyFriendRequestResponse { + return { success: false }; +} + +export const DenyFriendRequestResponse: MessageFns = { + encode(message: DenyFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DenyFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDenyFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DenyFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: DenyFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): DenyFriendRequestResponse { + return DenyFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DenyFriendRequestResponse { + const message = createBaseDenyFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/friend_request.d.ts b/javascript/friends/v2/friend_request.d.ts index 5440a2f..02a0eed 100644 --- a/javascript/friends/v2/friend_request.d.ts +++ b/javascript/friends/v2/friend_request.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friend_request.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.FriendRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface FriendRequest { - /** - * @generated from protobuf field: uint64 id = 1; - */ id: bigint; - /** - * @generated from protobuf field: uint32 sender = 2; - */ sender: number; - /** - * @generated from protobuf field: uint32 recipient = 3; - */ recipient: number; - /** - * @generated from protobuf field: uint64 sent = 4; - */ sent: bigint; - /** - * @generated from protobuf field: uint64 expires = 5; - */ expires: bigint; - /** - * @generated from protobuf field: string message = 6; - */ message: string; } -declare class FriendRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): FriendRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FriendRequest): FriendRequest; - internalBinaryWrite(message: FriendRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const FriendRequest: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.FriendRequest - */ -export declare const FriendRequest: FriendRequest$Type; export {}; diff --git a/javascript/friends/v2/friend_request.js b/javascript/friends/v2/friend_request.js index 4335ae4..63cb8e9 100644 --- a/javascript/friends/v2/friend_request.js +++ b/javascript/friends/v2/friend_request.js @@ -1,99 +1,151 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friend_request.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/friend_request.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.FriendRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class FriendRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.FriendRequest", [ - { no: 1, name: "id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 2, name: "sender", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "recipient", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 4, name: "sent", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 5, name: "expires", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ }, - { no: 6, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.id = 0n; - message.sender = 0; - message.recipient = 0; - message.sent = 0n; - message.expires = 0n; - message.message = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.FriendRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseFriendRequest() { + return { id: 0n, sender: 0, recipient: 0, sent: 0n, expires: 0n, message: "" }; +} +exports.FriendRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.id !== 0n) { + if (BigInt.asUintN(64, message.id) !== message.id) { + throw new globalThis.Error("value provided for field message.id of type uint64 too large"); + } + writer.uint32(8).uint64(message.id); + } + if (message.sender !== 0) { + writer.uint32(16).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(24).uint32(message.recipient); + } + if (message.sent !== 0n) { + if (BigInt.asUintN(64, message.sent) !== message.sent) { + throw new globalThis.Error("value provided for field message.sent of type uint64 too large"); + } + writer.uint32(32).uint64(message.sent); + } + if (message.expires !== 0n) { + if (BigInt.asUintN(64, message.expires) !== message.expires) { + throw new globalThis.Error("value provided for field message.expires of type uint64 too large"); + } + writer.uint32(40).uint64(message.expires); + } + if (message.message !== "") { + writer.uint32(50).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 id */ 1: - message.id = reader.uint64().toBigInt(); - break; - case /* uint32 sender */ 2: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.id = reader.uint64(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.sender = reader.uint32(); - break; - case /* uint32 recipient */ 3: + continue; + } + case 3: { + if (tag !== 24) { + break; + } message.recipient = reader.uint32(); - break; - case /* uint64 sent */ 4: - message.sent = reader.uint64().toBigInt(); - break; - case /* uint64 expires */ 5: - message.expires = reader.uint64().toBigInt(); - break; - case /* string message */ 6: + continue; + } + case 4: { + if (tag !== 32) { + break; + } + message.sent = reader.uint64(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + message.expires = reader.uint64(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 id = 1; */ - if (message.id !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.id); - /* uint32 sender = 2; */ - if (message.sender !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.sender); - /* uint32 recipient = 3; */ - if (message.recipient !== 0) - writer.tag(3, runtime_1.WireType.Varint).uint32(message.recipient); - /* uint64 sent = 4; */ - if (message.sent !== 0n) - writer.tag(4, runtime_1.WireType.Varint).uint64(message.sent); - /* uint64 expires = 5; */ - if (message.expires !== 0n) - writer.tag(5, runtime_1.WireType.Varint).uint64(message.expires); - /* string message = 6; */ - if (message.message !== "") - writer.tag(6, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + id: isSet(object.id) ? BigInt(object.id) : 0n, + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + sent: isSet(object.sent) ? BigInt(object.sent) : 0n, + expires: isSet(object.expires) ? BigInt(object.expires) : 0n, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.id !== 0n) { + obj.id = message.id.toString(); + } + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.sent !== 0n) { + obj.sent = message.sent.toString(); + } + if (message.expires !== 0n) { + obj.expires = message.expires.toString(); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.FriendRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseFriendRequest(); + message.id = object.id ?? 0n; + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.sent = object.sent ?? 0n; + message.expires = object.expires ?? 0n; + message.message = object.message ?? ""; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.FriendRequest - */ -exports.FriendRequest = new FriendRequest$Type(); diff --git a/javascript/friends/v2/friend_request.ts b/javascript/friends/v2/friend_request.ts new file mode 100644 index 0000000..0a4d349 --- /dev/null +++ b/javascript/friends/v2/friend_request.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/friend_request.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface FriendRequest { + id: bigint; + sender: number; + recipient: number; + sent: bigint; + expires: bigint; + message: string; +} + +function createBaseFriendRequest(): FriendRequest { + return { id: 0n, sender: 0, recipient: 0, sent: 0n, expires: 0n, message: "" }; +} + +export const FriendRequest: MessageFns = { + encode(message: FriendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== 0n) { + if (BigInt.asUintN(64, message.id) !== message.id) { + throw new globalThis.Error("value provided for field message.id of type uint64 too large"); + } + writer.uint32(8).uint64(message.id); + } + if (message.sender !== 0) { + writer.uint32(16).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(24).uint32(message.recipient); + } + if (message.sent !== 0n) { + if (BigInt.asUintN(64, message.sent) !== message.sent) { + throw new globalThis.Error("value provided for field message.sent of type uint64 too large"); + } + writer.uint32(32).uint64(message.sent); + } + if (message.expires !== 0n) { + if (BigInt.asUintN(64, message.expires) !== message.expires) { + throw new globalThis.Error("value provided for field message.expires of type uint64 too large"); + } + writer.uint32(40).uint64(message.expires); + } + if (message.message !== "") { + writer.uint32(50).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FriendRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFriendRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.id = reader.uint64() as bigint; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.sender = reader.uint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.recipient = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.sent = reader.uint64() as bigint; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.expires = reader.uint64() as bigint; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FriendRequest { + return { + id: isSet(object.id) ? BigInt(object.id) : 0n, + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + sent: isSet(object.sent) ? BigInt(object.sent) : 0n, + expires: isSet(object.expires) ? BigInt(object.expires) : 0n, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + + toJSON(message: FriendRequest): unknown { + const obj: any = {}; + if (message.id !== 0n) { + obj.id = message.id.toString(); + } + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.sent !== 0n) { + obj.sent = message.sent.toString(); + } + if (message.expires !== 0n) { + obj.expires = message.expires.toString(); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): FriendRequest { + return FriendRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FriendRequest { + const message = createBaseFriendRequest(); + message.id = object.id ?? 0n; + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.sent = object.sent ?? 0n; + message.expires = object.expires ?? 0n; + message.message = object.message ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/friends_service.client.d.ts b/javascript/friends/v2/friends_service.client.d.ts deleted file mode 100644 index 9a68f0c..0000000 --- a/javascript/friends/v2/friends_service.client.d.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friends_service.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { DenyFriendRequestResponse } from "./deny_friend_request_rpc"; -import type { DenyFriendRequestRequest } from "./deny_friend_request_rpc"; -import type { AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; -import type { AcceptFriendRequestRequest } from "./accept_friend_request_rpc"; -import type { GetUserFriendRequestsIncomingResponse } from "./get_user_friend_requests_incoming_rpc"; -import type { GetUserFriendRequestsIncomingRequest } from "./get_user_friend_requests_incoming_rpc"; -import type { SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; -import type { SendUserFriendRequestRequest } from "./send_user_friend_request_rpc"; -import type { GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; -import type { GetUserFriendPIDsRequest } from "./get_user_friend_pids_rpc"; -import type { SendUserNotificationWiiUResponse } from "./send_user_notification_wiiu_rpc"; -import type { SendUserNotificationWiiURequest } from "./send_user_notification_wiiu_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service friends.v2.FriendsService - */ -export interface IFriendsServiceClient { - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.v2.SendUserNotificationWiiURequest) returns (friends.v2.SendUserNotificationWiiUResponse); - */ - sendUserNotificationWiiU(input: SendUserNotificationWiiURequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.v2.GetUserFriendPIDsRequest) returns (friends.v2.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input: GetUserFriendPIDsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.v2.SendUserFriendRequestRequest) returns (friends.v2.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input: SendUserFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.v2.GetUserFriendRequestsIncomingRequest) returns (friends.v2.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input: GetUserFriendRequestsIncomingRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.v2.AcceptFriendRequestRequest) returns (friends.v2.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input: AcceptFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.v2.DenyFriendRequestRequest) returns (friends.v2.DenyFriendRequestResponse); - */ - denyFriendRequest(input: DenyFriendRequestRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service friends.v2.FriendsService - */ -export declare class FriendsServiceClient implements IFriendsServiceClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.v2.SendUserNotificationWiiURequest) returns (friends.v2.SendUserNotificationWiiUResponse); - */ - sendUserNotificationWiiU(input: SendUserNotificationWiiURequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.v2.GetUserFriendPIDsRequest) returns (friends.v2.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input: GetUserFriendPIDsRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.v2.SendUserFriendRequestRequest) returns (friends.v2.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input: SendUserFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.v2.GetUserFriendRequestsIncomingRequest) returns (friends.v2.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input: GetUserFriendRequestsIncomingRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.v2.AcceptFriendRequestRequest) returns (friends.v2.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input: AcceptFriendRequestRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.v2.DenyFriendRequestRequest) returns (friends.v2.DenyFriendRequestResponse); - */ - denyFriendRequest(input: DenyFriendRequestRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/friends/v2/friends_service.client.js b/javascript/friends/v2/friends_service.client.js deleted file mode 100644 index 76116ba..0000000 --- a/javascript/friends/v2/friends_service.client.js +++ /dev/null @@ -1,64 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friends_service.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.FriendsServiceClient = void 0; -const friends_service_1 = require("./friends_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service friends.v2.FriendsService - */ -class FriendsServiceClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = friends_service_1.FriendsService.typeName; - this.methods = friends_service_1.FriendsService.methods; - this.options = friends_service_1.FriendsService.options; - } - /** - * @generated from protobuf rpc: SendUserNotificationWiiU(friends.v2.SendUserNotificationWiiURequest) returns (friends.v2.SendUserNotificationWiiUResponse); - */ - sendUserNotificationWiiU(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserFriendPIDs(friends.v2.GetUserFriendPIDsRequest) returns (friends.v2.GetUserFriendPIDsResponse); - */ - getUserFriendPIDs(input, options) { - const method = this.methods[1], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: SendUserFriendRequest(friends.v2.SendUserFriendRequestRequest) returns (friends.v2.SendUserFriendRequestResponse); - */ - sendUserFriendRequest(input, options) { - const method = this.methods[2], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: GetUserFriendRequestsIncoming(friends.v2.GetUserFriendRequestsIncomingRequest) returns (friends.v2.GetUserFriendRequestsIncomingResponse); - */ - getUserFriendRequestsIncoming(input, options) { - const method = this.methods[3], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: AcceptFriendRequest(friends.v2.AcceptFriendRequestRequest) returns (friends.v2.AcceptFriendRequestResponse); - */ - acceptFriendRequest(input, options) { - const method = this.methods[4], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: DenyFriendRequest(friends.v2.DenyFriendRequestRequest) returns (friends.v2.DenyFriendRequestResponse); - */ - denyFriendRequest(input, options) { - const method = this.methods[5], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.FriendsServiceClient = FriendsServiceClient; diff --git a/javascript/friends/v2/friends_service.d.ts b/javascript/friends/v2/friends_service.d.ts index 1a24473..d0fb0e5 100644 --- a/javascript/friends/v2/friends_service.d.ts +++ b/javascript/friends/v2/friends_service.d.ts @@ -1,9 +1,84 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friends_service.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service friends.v2.FriendsService - */ -export declare const FriendsService: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { AcceptFriendRequestRequest, AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; +import { DenyFriendRequestRequest, DenyFriendRequestResponse } from "./deny_friend_request_rpc"; +import { GetUserFriendPIDsRequest, GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; +import { GetUserFriendRequestsIncomingRequest, GetUserFriendRequestsIncomingResponse } from "./get_user_friend_requests_incoming_rpc"; +import { SendUserFriendRequestRequest, SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; +import { SendUserNotificationWiiURequest, SendUserNotificationWiiUResponse } from "./send_user_notification_wiiu_rpc"; +export declare const protobufPackage = "friends.v2"; +export type FriendsServiceDefinition = typeof FriendsServiceDefinition; +export declare const FriendsServiceDefinition: { + readonly name: "FriendsService"; + readonly fullName: "friends.v2.FriendsService"; + readonly methods: { + readonly sendUserNotificationWiiU: { + readonly name: "SendUserNotificationWiiU"; + readonly requestType: import("./send_user_notification_wiiu_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./send_user_notification_wiiu_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserFriendPIDs: { + readonly name: "GetUserFriendPIDs"; + readonly requestType: import("./get_user_friend_pids_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_friend_pids_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly sendUserFriendRequest: { + readonly name: "SendUserFriendRequest"; + readonly requestType: import("./send_user_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./send_user_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly getUserFriendRequestsIncoming: { + readonly name: "GetUserFriendRequestsIncoming"; + readonly requestType: import("./get_user_friend_requests_incoming_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./get_user_friend_requests_incoming_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly acceptFriendRequest: { + readonly name: "AcceptFriendRequest"; + readonly requestType: import("./accept_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./accept_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + readonly denyFriendRequest: { + readonly name: "DenyFriendRequest"; + readonly requestType: import("./deny_friend_request_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./deny_friend_request_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface FriendsServiceImplementation { + sendUserNotificationWiiU(request: SendUserNotificationWiiURequest, context: CallContext & CallContextExt): Promise>; + getUserFriendPIDs(request: GetUserFriendPIDsRequest, context: CallContext & CallContextExt): Promise>; + sendUserFriendRequest(request: SendUserFriendRequestRequest, context: CallContext & CallContextExt): Promise>; + getUserFriendRequestsIncoming(request: GetUserFriendRequestsIncomingRequest, context: CallContext & CallContextExt): Promise>; + acceptFriendRequest(request: AcceptFriendRequestRequest, context: CallContext & CallContextExt): Promise>; + denyFriendRequest(request: DenyFriendRequestRequest, context: CallContext & CallContextExt): Promise>; +} +export interface FriendsServiceClient { + sendUserNotificationWiiU(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserFriendPIDs(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + sendUserFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + getUserFriendRequestsIncoming(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + acceptFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + denyFriendRequest(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/friends/v2/friends_service.js b/javascript/friends/v2/friends_service.js index 076ab33..d65bb89 100644 --- a/javascript/friends/v2/friends_service.js +++ b/javascript/friends/v2/friends_service.js @@ -1,37 +1,69 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friends_service.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/friends_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.FriendsService = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/friends_service.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -const deny_friend_request_rpc_1 = require("./deny_friend_request_rpc"); -const deny_friend_request_rpc_2 = require("./deny_friend_request_rpc"); +exports.FriendsServiceDefinition = exports.protobufPackage = void 0; const accept_friend_request_rpc_1 = require("./accept_friend_request_rpc"); -const accept_friend_request_rpc_2 = require("./accept_friend_request_rpc"); +const deny_friend_request_rpc_1 = require("./deny_friend_request_rpc"); +const get_user_friend_pids_rpc_1 = require("./get_user_friend_pids_rpc"); const get_user_friend_requests_incoming_rpc_1 = require("./get_user_friend_requests_incoming_rpc"); -const get_user_friend_requests_incoming_rpc_2 = require("./get_user_friend_requests_incoming_rpc"); const send_user_friend_request_rpc_1 = require("./send_user_friend_request_rpc"); -const send_user_friend_request_rpc_2 = require("./send_user_friend_request_rpc"); -const get_user_friend_pids_rpc_1 = require("./get_user_friend_pids_rpc"); -const get_user_friend_pids_rpc_2 = require("./get_user_friend_pids_rpc"); const send_user_notification_wiiu_rpc_1 = require("./send_user_notification_wiiu_rpc"); -const send_user_notification_wiiu_rpc_2 = require("./send_user_notification_wiiu_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service friends.v2.FriendsService - */ -exports.FriendsService = new runtime_rpc_1.ServiceType("friends.v2.FriendsService", [ - { name: "SendUserNotificationWiiU", options: {}, I: send_user_notification_wiiu_rpc_2.SendUserNotificationWiiURequest, O: send_user_notification_wiiu_rpc_1.SendUserNotificationWiiUResponse }, - { name: "GetUserFriendPIDs", options: {}, I: get_user_friend_pids_rpc_2.GetUserFriendPIDsRequest, O: get_user_friend_pids_rpc_1.GetUserFriendPIDsResponse }, - { name: "SendUserFriendRequest", options: {}, I: send_user_friend_request_rpc_2.SendUserFriendRequestRequest, O: send_user_friend_request_rpc_1.SendUserFriendRequestResponse }, - { name: "GetUserFriendRequestsIncoming", options: {}, I: get_user_friend_requests_incoming_rpc_2.GetUserFriendRequestsIncomingRequest, O: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingResponse }, - { name: "AcceptFriendRequest", options: {}, I: accept_friend_request_rpc_2.AcceptFriendRequestRequest, O: accept_friend_request_rpc_1.AcceptFriendRequestResponse }, - { name: "DenyFriendRequest", options: {}, I: deny_friend_request_rpc_2.DenyFriendRequestRequest, O: deny_friend_request_rpc_1.DenyFriendRequestResponse } -]); +exports.protobufPackage = "friends.v2"; +exports.FriendsServiceDefinition = { + name: "FriendsService", + fullName: "friends.v2.FriendsService", + methods: { + sendUserNotificationWiiU: { + name: "SendUserNotificationWiiU", + requestType: send_user_notification_wiiu_rpc_1.SendUserNotificationWiiURequest, + requestStream: false, + responseType: send_user_notification_wiiu_rpc_1.SendUserNotificationWiiUResponse, + responseStream: false, + options: {}, + }, + getUserFriendPIDs: { + name: "GetUserFriendPIDs", + requestType: get_user_friend_pids_rpc_1.GetUserFriendPIDsRequest, + requestStream: false, + responseType: get_user_friend_pids_rpc_1.GetUserFriendPIDsResponse, + responseStream: false, + options: {}, + }, + sendUserFriendRequest: { + name: "SendUserFriendRequest", + requestType: send_user_friend_request_rpc_1.SendUserFriendRequestRequest, + requestStream: false, + responseType: send_user_friend_request_rpc_1.SendUserFriendRequestResponse, + responseStream: false, + options: {}, + }, + getUserFriendRequestsIncoming: { + name: "GetUserFriendRequestsIncoming", + requestType: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingRequest, + requestStream: false, + responseType: get_user_friend_requests_incoming_rpc_1.GetUserFriendRequestsIncomingResponse, + responseStream: false, + options: {}, + }, + acceptFriendRequest: { + name: "AcceptFriendRequest", + requestType: accept_friend_request_rpc_1.AcceptFriendRequestRequest, + requestStream: false, + responseType: accept_friend_request_rpc_1.AcceptFriendRequestResponse, + responseStream: false, + options: {}, + }, + denyFriendRequest: { + name: "DenyFriendRequest", + requestType: deny_friend_request_rpc_1.DenyFriendRequestRequest, + requestStream: false, + responseType: deny_friend_request_rpc_1.DenyFriendRequestResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/friends/v2/friends_service.ts b/javascript/friends/v2/friends_service.ts new file mode 100644 index 0000000..e36ce39 --- /dev/null +++ b/javascript/friends/v2/friends_service.ts @@ -0,0 +1,137 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/friends_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { AcceptFriendRequestRequest, AcceptFriendRequestResponse } from "./accept_friend_request_rpc"; +import { DenyFriendRequestRequest, DenyFriendRequestResponse } from "./deny_friend_request_rpc"; +import { GetUserFriendPIDsRequest, GetUserFriendPIDsResponse } from "./get_user_friend_pids_rpc"; +import { + GetUserFriendRequestsIncomingRequest, + GetUserFriendRequestsIncomingResponse, +} from "./get_user_friend_requests_incoming_rpc"; +import { SendUserFriendRequestRequest, SendUserFriendRequestResponse } from "./send_user_friend_request_rpc"; +import { SendUserNotificationWiiURequest, SendUserNotificationWiiUResponse } from "./send_user_notification_wiiu_rpc"; + +export const protobufPackage = "friends.v2"; + +export type FriendsServiceDefinition = typeof FriendsServiceDefinition; +export const FriendsServiceDefinition = { + name: "FriendsService", + fullName: "friends.v2.FriendsService", + methods: { + sendUserNotificationWiiU: { + name: "SendUserNotificationWiiU", + requestType: SendUserNotificationWiiURequest, + requestStream: false, + responseType: SendUserNotificationWiiUResponse, + responseStream: false, + options: {}, + }, + getUserFriendPIDs: { + name: "GetUserFriendPIDs", + requestType: GetUserFriendPIDsRequest, + requestStream: false, + responseType: GetUserFriendPIDsResponse, + responseStream: false, + options: {}, + }, + sendUserFriendRequest: { + name: "SendUserFriendRequest", + requestType: SendUserFriendRequestRequest, + requestStream: false, + responseType: SendUserFriendRequestResponse, + responseStream: false, + options: {}, + }, + getUserFriendRequestsIncoming: { + name: "GetUserFriendRequestsIncoming", + requestType: GetUserFriendRequestsIncomingRequest, + requestStream: false, + responseType: GetUserFriendRequestsIncomingResponse, + responseStream: false, + options: {}, + }, + acceptFriendRequest: { + name: "AcceptFriendRequest", + requestType: AcceptFriendRequestRequest, + requestStream: false, + responseType: AcceptFriendRequestResponse, + responseStream: false, + options: {}, + }, + denyFriendRequest: { + name: "DenyFriendRequest", + requestType: DenyFriendRequestRequest, + requestStream: false, + responseType: DenyFriendRequestResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface FriendsServiceImplementation { + sendUserNotificationWiiU( + request: SendUserNotificationWiiURequest, + context: CallContext & CallContextExt, + ): Promise>; + getUserFriendPIDs( + request: GetUserFriendPIDsRequest, + context: CallContext & CallContextExt, + ): Promise>; + sendUserFriendRequest( + request: SendUserFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; + getUserFriendRequestsIncoming( + request: GetUserFriendRequestsIncomingRequest, + context: CallContext & CallContextExt, + ): Promise>; + acceptFriendRequest( + request: AcceptFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; + denyFriendRequest( + request: DenyFriendRequestRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface FriendsServiceClient { + sendUserNotificationWiiU( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getUserFriendPIDs( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + sendUserFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + getUserFriendRequestsIncoming( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + acceptFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + denyFriendRequest( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/friends/v2/get_user_friend_pids_rpc.d.ts b/javascript/friends/v2/get_user_friend_pids_rpc.d.ts index 494db77..5b263e0 100644 --- a/javascript/friends/v2/get_user_friend_pids_rpc.d.ts +++ b/javascript/friends/v2/get_user_friend_pids_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/get_user_friend_pids_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.GetUserFriendPIDsRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface GetUserFriendPIDsRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message friends.v2.GetUserFriendPIDsResponse - */ export interface GetUserFriendPIDsResponse { - /** - * @generated from protobuf field: repeated uint32 pids = 1; - */ pids: number[]; } -declare class GetUserFriendPIDsRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendPIDsRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendPIDsRequest): GetUserFriendPIDsRequest; - internalBinaryWrite(message: GetUserFriendPIDsRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserFriendPIDsRequest: MessageFns; +export declare const GetUserFriendPIDsResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendPIDsRequest - */ -export declare const GetUserFriendPIDsRequest: GetUserFriendPIDsRequest$Type; -declare class GetUserFriendPIDsResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendPIDsResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendPIDsResponse): GetUserFriendPIDsResponse; - internalBinaryWrite(message: GetUserFriendPIDsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendPIDsResponse - */ -export declare const GetUserFriendPIDsResponse: GetUserFriendPIDsResponse$Type; export {}; diff --git a/javascript/friends/v2/get_user_friend_pids_rpc.js b/javascript/friends/v2/get_user_friend_pids_rpc.js index f323e20..7a012d5 100644 --- a/javascript/friends/v2/get_user_friend_pids_rpc.js +++ b/javascript/friends/v2/get_user_friend_pids_rpc.js @@ -1,114 +1,125 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/get_user_friend_pids_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/get_user_friend_pids_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserFriendPIDsResponse = exports.GetUserFriendPIDsRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendPIDsRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.GetUserFriendPIDsRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.GetUserFriendPIDsResponse = exports.GetUserFriendPIDsRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseGetUserFriendPIDsRequest() { + return { pid: 0 }; +} +exports.GetUserFriendPIDsRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendPIDsRequest - */ -exports.GetUserFriendPIDsRequest = new GetUserFriendPIDsRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendPIDsResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.GetUserFriendPIDsResponse", [ - { no: 1, name: "pids", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pids = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserFriendPIDsRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendPIDsRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserFriendPIDsResponse() { + return { pids: [] }; +} +exports.GetUserFriendPIDsResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + writer.uint32(10).fork(); + for (const v of message.pids) { + writer.uint32(v); + } + writer.join(); + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated uint32 pids */ 1: - if (wireType === runtime_1.WireType.LengthDelimited) - for (let e = reader.int32() + reader.pos; reader.pos < e;) - message.pids.push(reader.uint32()); - else + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { message.pids.push(reader.uint32()); + continue; + } + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.pids.push(reader.uint32()); + } + continue; + } break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated uint32 pids = 1; */ - if (message.pids.length) { - writer.tag(1, runtime_1.WireType.LengthDelimited).fork(); - for (let i = 0; i < message.pids.length; i++) - writer.uint32(message.pids[i]); - writer.join(); + }, + fromJSON(object) { + return { pids: globalThis.Array.isArray(object?.pids) ? object.pids.map((e) => globalThis.Number(e)) : [] }; + }, + toJSON(message) { + const obj = {}; + if (message.pids?.length) { + obj.pids = message.pids.map((e) => Math.round(e)); } - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + return obj; + }, + create(base) { + return exports.GetUserFriendPIDsResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendPIDsResponse(); + message.pids = object.pids?.map((e) => e) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendPIDsResponse - */ -exports.GetUserFriendPIDsResponse = new GetUserFriendPIDsResponse$Type(); diff --git a/javascript/friends/v2/get_user_friend_pids_rpc.ts b/javascript/friends/v2/get_user_friend_pids_rpc.ts new file mode 100644 index 0000000..0670e9e --- /dev/null +++ b/javascript/friends/v2/get_user_friend_pids_rpc.ts @@ -0,0 +1,167 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/get_user_friend_pids_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface GetUserFriendPIDsRequest { + pid: number; +} + +export interface GetUserFriendPIDsResponse { + pids: number[]; +} + +function createBaseGetUserFriendPIDsRequest(): GetUserFriendPIDsRequest { + return { pid: 0 }; +} + +export const GetUserFriendPIDsRequest: MessageFns = { + encode(message: GetUserFriendPIDsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendPIDsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendPIDsRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserFriendPIDsRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendPIDsRequest { + return GetUserFriendPIDsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendPIDsRequest { + const message = createBaseGetUserFriendPIDsRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserFriendPIDsResponse(): GetUserFriendPIDsResponse { + return { pids: [] }; +} + +export const GetUserFriendPIDsResponse: MessageFns = { + encode(message: GetUserFriendPIDsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.pids) { + writer.uint32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendPIDsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendPIDsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.pids.push(reader.uint32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.pids.push(reader.uint32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendPIDsResponse { + return { pids: globalThis.Array.isArray(object?.pids) ? object.pids.map((e: any) => globalThis.Number(e)) : [] }; + }, + + toJSON(message: GetUserFriendPIDsResponse): unknown { + const obj: any = {}; + if (message.pids?.length) { + obj.pids = message.pids.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendPIDsResponse { + return GetUserFriendPIDsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendPIDsResponse { + const message = createBaseGetUserFriendPIDsResponse(); + message.pids = object.pids?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/get_user_friend_requests_incoming_rpc.d.ts b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.d.ts index 18337c8..c545f4d 100644 --- a/javascript/friends/v2/get_user_friend_requests_incoming_rpc.d.ts +++ b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.d.ts @@ -1,51 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/get_user_friend_requests_incoming_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { FriendRequest } from "./friend_request"; -/** - * @generated from protobuf message friends.v2.GetUserFriendRequestsIncomingRequest - */ +export declare const protobufPackage = "friends.v2"; export interface GetUserFriendRequestsIncomingRequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; } -/** - * @generated from protobuf message friends.v2.GetUserFriendRequestsIncomingResponse - */ export interface GetUserFriendRequestsIncomingResponse { - /** - * @generated from protobuf field: repeated friends.v2.FriendRequest friend_requests = 1; - */ friendRequests: FriendRequest[]; } -declare class GetUserFriendRequestsIncomingRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendRequestsIncomingRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendRequestsIncomingRequest): GetUserFriendRequestsIncomingRequest; - internalBinaryWrite(message: GetUserFriendRequestsIncomingRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const GetUserFriendRequestsIncomingRequest: MessageFns; +export declare const GetUserFriendRequestsIncomingResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendRequestsIncomingRequest - */ -export declare const GetUserFriendRequestsIncomingRequest: GetUserFriendRequestsIncomingRequest$Type; -declare class GetUserFriendRequestsIncomingResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): GetUserFriendRequestsIncomingResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserFriendRequestsIncomingResponse): GetUserFriendRequestsIncomingResponse; - internalBinaryWrite(message: GetUserFriendRequestsIncomingResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendRequestsIncomingResponse - */ -export declare const GetUserFriendRequestsIncomingResponse: GetUserFriendRequestsIncomingResponse$Type; export {}; diff --git a/javascript/friends/v2/get_user_friend_requests_incoming_rpc.js b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.js index 24ab77b..2fe5ba5 100644 --- a/javascript/friends/v2/get_user_friend_requests_incoming_rpc.js +++ b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.js @@ -1,107 +1,121 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/get_user_friend_requests_incoming_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/get_user_friend_requests_incoming_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.GetUserFriendRequestsIncomingResponse = exports.GetUserFriendRequestsIncomingRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); +exports.GetUserFriendRequestsIncomingResponse = exports.GetUserFriendRequestsIncomingRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); const friend_request_1 = require("./friend_request"); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendRequestsIncomingRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.GetUserFriendRequestsIncomingRequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.protobufPackage = "friends.v2"; +function createBaseGetUserFriendRequestsIncomingRequest() { + return { pid: 0 }; +} +exports.GetUserFriendRequestsIncomingRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendRequestsIncomingRequest - */ -exports.GetUserFriendRequestsIncomingRequest = new GetUserFriendRequestsIncomingRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetUserFriendRequestsIncomingResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.GetUserFriendRequestsIncomingResponse", [ - { no: 1, name: "friend_requests", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => friend_request_1.FriendRequest } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.friendRequests = []; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + create(base) { + return exports.GetUserFriendRequestsIncomingRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendRequestsIncomingRequest(); + message.pid = object.pid ?? 0; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseGetUserFriendRequestsIncomingResponse() { + return { friendRequests: [] }; +} +exports.GetUserFriendRequestsIncomingResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + for (const v of message.friendRequests) { + friend_request_1.FriendRequest.encode(v, writer.uint32(10).fork()).join(); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* repeated friends.v2.FriendRequest friend_requests */ 1: - message.friendRequests.push(friend_request_1.FriendRequest.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + message.friendRequests.push(friend_request_1.FriendRequest.decode(reader, reader.uint32())); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* repeated friends.v2.FriendRequest friend_requests = 1; */ - for (let i = 0; i < message.friendRequests.length; i++) - friend_request_1.FriendRequest.internalBinaryWrite(message.friendRequests[i], writer.tag(1, runtime_1.WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { + friendRequests: globalThis.Array.isArray(object?.friendRequests) + ? object.friendRequests.map((e) => friend_request_1.FriendRequest.fromJSON(e)) + : [], + }; + }, + toJSON(message) { + const obj = {}; + if (message.friendRequests?.length) { + obj.friendRequests = message.friendRequests.map((e) => friend_request_1.FriendRequest.toJSON(e)); + } + return obj; + }, + create(base) { + return exports.GetUserFriendRequestsIncomingResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseGetUserFriendRequestsIncomingResponse(); + message.friendRequests = object.friendRequests?.map((e) => friend_request_1.FriendRequest.fromPartial(e)) || []; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.GetUserFriendRequestsIncomingResponse - */ -exports.GetUserFriendRequestsIncomingResponse = new GetUserFriendRequestsIncomingResponse$Type(); diff --git a/javascript/friends/v2/get_user_friend_requests_incoming_rpc.ts b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.ts new file mode 100644 index 0000000..0a7af5c --- /dev/null +++ b/javascript/friends/v2/get_user_friend_requests_incoming_rpc.ts @@ -0,0 +1,160 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/get_user_friend_requests_incoming_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import { FriendRequest } from "./friend_request"; + +export const protobufPackage = "friends.v2"; + +export interface GetUserFriendRequestsIncomingRequest { + pid: number; +} + +export interface GetUserFriendRequestsIncomingResponse { + friendRequests: FriendRequest[]; +} + +function createBaseGetUserFriendRequestsIncomingRequest(): GetUserFriendRequestsIncomingRequest { + return { pid: 0 }; +} + +export const GetUserFriendRequestsIncomingRequest: MessageFns = { + encode(message: GetUserFriendRequestsIncomingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendRequestsIncomingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendRequestsIncomingRequest { + return { pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0 }; + }, + + toJSON(message: GetUserFriendRequestsIncomingRequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendRequestsIncomingRequest { + return GetUserFriendRequestsIncomingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendRequestsIncomingRequest { + const message = createBaseGetUserFriendRequestsIncomingRequest(); + message.pid = object.pid ?? 0; + return message; + }, +}; + +function createBaseGetUserFriendRequestsIncomingResponse(): GetUserFriendRequestsIncomingResponse { + return { friendRequests: [] }; +} + +export const GetUserFriendRequestsIncomingResponse: MessageFns = { + encode(message: GetUserFriendRequestsIncomingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.friendRequests) { + FriendRequest.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetUserFriendRequestsIncomingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserFriendRequestsIncomingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.friendRequests.push(FriendRequest.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetUserFriendRequestsIncomingResponse { + return { + friendRequests: globalThis.Array.isArray(object?.friendRequests) + ? object.friendRequests.map((e: any) => FriendRequest.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GetUserFriendRequestsIncomingResponse): unknown { + const obj: any = {}; + if (message.friendRequests?.length) { + obj.friendRequests = message.friendRequests.map((e) => FriendRequest.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): GetUserFriendRequestsIncomingResponse { + return GetUserFriendRequestsIncomingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetUserFriendRequestsIncomingResponse { + const message = createBaseGetUserFriendRequestsIncomingResponse(); + message.friendRequests = object.friendRequests?.map((e) => FriendRequest.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/send_user_friend_request_rpc.d.ts b/javascript/friends/v2/send_user_friend_request_rpc.d.ts index 7952116..442cf74 100644 --- a/javascript/friends/v2/send_user_friend_request_rpc.d.ts +++ b/javascript/friends/v2/send_user_friend_request_rpc.d.ts @@ -1,58 +1,25 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/send_user_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.SendUserFriendRequestRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface SendUserFriendRequestRequest { - /** - * @generated from protobuf field: uint32 sender = 1; - */ sender: number; - /** - * @generated from protobuf field: uint32 recipient = 2; - */ recipient: number; - /** - * @generated from protobuf field: string message = 3; - */ message: string; } -/** - * @generated from protobuf message friends.v2.SendUserFriendRequestResponse - */ export interface SendUserFriendRequestResponse { - /** - * @generated from protobuf field: bool success = 1; - */ success: boolean; } -declare class SendUserFriendRequestRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserFriendRequestRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserFriendRequestRequest): SendUserFriendRequestRequest; - internalBinaryWrite(message: SendUserFriendRequestRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SendUserFriendRequestRequest: MessageFns; +export declare const SendUserFriendRequestResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.SendUserFriendRequestRequest - */ -export declare const SendUserFriendRequestRequest: SendUserFriendRequestRequest$Type; -declare class SendUserFriendRequestResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserFriendRequestResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserFriendRequestResponse): SendUserFriendRequestResponse; - internalBinaryWrite(message: SendUserFriendRequestResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.SendUserFriendRequestResponse - */ -export declare const SendUserFriendRequestResponse: SendUserFriendRequestResponse$Type; export {}; diff --git a/javascript/friends/v2/send_user_friend_request_rpc.js b/javascript/friends/v2/send_user_friend_request_rpc.js index 427f67f..01d3b50 100644 --- a/javascript/friends/v2/send_user_friend_request_rpc.js +++ b/javascript/friends/v2/send_user_friend_request_rpc.js @@ -1,122 +1,148 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/send_user_friend_request_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/send_user_friend_request_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SendUserFriendRequestResponse = exports.SendUserFriendRequestRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserFriendRequestRequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.SendUserFriendRequestRequest", [ - { no: 1, name: "sender", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "recipient", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 3, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.sender = 0; - message.recipient = 0; - message.message = ""; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SendUserFriendRequestResponse = exports.SendUserFriendRequestRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseSendUserFriendRequestRequest() { + return { sender: 0, recipient: 0, message: "" }; +} +exports.SendUserFriendRequestRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.sender !== 0) { + writer.uint32(8).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(16).uint32(message.recipient); + } + if (message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 sender */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.sender = reader.uint32(); - break; - case /* uint32 recipient */ 2: + continue; + } + case 2: { + if (tag !== 16) { + break; + } message.recipient = reader.uint32(); - break; - case /* string message */ 3: + continue; + } + case 3: { + if (tag !== 26) { + break; + } message.message = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 sender = 1; */ - if (message.sender !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.sender); - /* uint32 recipient = 2; */ - if (message.recipient !== 0) - writer.tag(2, runtime_1.WireType.Varint).uint32(message.recipient); - /* string message = 3; */ - if (message.message !== "") - writer.tag(3, runtime_1.WireType.LengthDelimited).string(message.message); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.SendUserFriendRequestRequest - */ -exports.SendUserFriendRequestRequest = new SendUserFriendRequestRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserFriendRequestResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.SendUserFriendRequestResponse", [ - { no: 1, name: "success", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.success = false; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + toJSON(message) { + const obj = {}; + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + create(base) { + return exports.SendUserFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserFriendRequestRequest(); + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.message = object.message ?? ""; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseSendUserFriendRequestResponse() { + return { success: false }; +} +exports.SendUserFriendRequestResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool success */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.success = reader.bool(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* bool success = 1; */ - if (message.success !== false) - writer.tag(1, runtime_1.WireType.Varint).bool(message.success); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + toJSON(message) { + const obj = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + create(base) { + return exports.SendUserFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.SendUserFriendRequestResponse - */ -exports.SendUserFriendRequestResponse = new SendUserFriendRequestResponse$Type(); diff --git a/javascript/friends/v2/send_user_friend_request_rpc.ts b/javascript/friends/v2/send_user_friend_request_rpc.ts new file mode 100644 index 0000000..dc29ac9 --- /dev/null +++ b/javascript/friends/v2/send_user_friend_request_rpc.ts @@ -0,0 +1,191 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/send_user_friend_request_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface SendUserFriendRequestRequest { + sender: number; + recipient: number; + message: string; +} + +export interface SendUserFriendRequestResponse { + success: boolean; +} + +function createBaseSendUserFriendRequestRequest(): SendUserFriendRequestRequest { + return { sender: 0, recipient: 0, message: "" }; +} + +export const SendUserFriendRequestRequest: MessageFns = { + encode(message: SendUserFriendRequestRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.sender !== 0) { + writer.uint32(8).uint32(message.sender); + } + if (message.recipient !== 0) { + writer.uint32(16).uint32(message.recipient); + } + if (message.message !== "") { + writer.uint32(26).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserFriendRequestRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.sender = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.recipient = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserFriendRequestRequest { + return { + sender: isSet(object.sender) ? globalThis.Number(object.sender) : 0, + recipient: isSet(object.recipient) ? globalThis.Number(object.recipient) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + + toJSON(message: SendUserFriendRequestRequest): unknown { + const obj: any = {}; + if (message.sender !== 0) { + obj.sender = Math.round(message.sender); + } + if (message.recipient !== 0) { + obj.recipient = Math.round(message.recipient); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): SendUserFriendRequestRequest { + return SendUserFriendRequestRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserFriendRequestRequest { + const message = createBaseSendUserFriendRequestRequest(); + message.sender = object.sender ?? 0; + message.recipient = object.recipient ?? 0; + message.message = object.message ?? ""; + return message; + }, +}; + +function createBaseSendUserFriendRequestResponse(): SendUserFriendRequestResponse { + return { success: false }; +} + +export const SendUserFriendRequestResponse: MessageFns = { + encode(message: SendUserFriendRequestResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.success !== false) { + writer.uint32(8).bool(message.success); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserFriendRequestResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserFriendRequestResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.success = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserFriendRequestResponse { + return { success: isSet(object.success) ? globalThis.Boolean(object.success) : false }; + }, + + toJSON(message: SendUserFriendRequestResponse): unknown { + const obj: any = {}; + if (message.success !== false) { + obj.success = message.success; + } + return obj; + }, + + create(base?: DeepPartial): SendUserFriendRequestResponse { + return SendUserFriendRequestResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserFriendRequestResponse { + const message = createBaseSendUserFriendRequestResponse(); + message.success = object.success ?? false; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/friends/v2/send_user_notification_wiiu_rpc.d.ts b/javascript/friends/v2/send_user_notification_wiiu_rpc.d.ts index 729728a..94dfb8c 100644 --- a/javascript/friends/v2/send_user_notification_wiiu_rpc.d.ts +++ b/javascript/friends/v2/send_user_notification_wiiu_rpc.d.ts @@ -1,50 +1,23 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/send_user_notification_wiiu_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message friends.v2.SendUserNotificationWiiURequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "friends.v2"; export interface SendUserNotificationWiiURequest { - /** - * @generated from protobuf field: uint32 pid = 1; - */ pid: number; - /** - * @generated from protobuf field: bytes notification_data = 2; - */ - notificationData: Uint8Array; + notificationData: Buffer; } -/** - * @generated from protobuf message friends.v2.SendUserNotificationWiiUResponse - */ export interface SendUserNotificationWiiUResponse { } -declare class SendUserNotificationWiiURequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserNotificationWiiURequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserNotificationWiiURequest): SendUserNotificationWiiURequest; - internalBinaryWrite(message: SendUserNotificationWiiURequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SendUserNotificationWiiURequest: MessageFns; +export declare const SendUserNotificationWiiUResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message friends.v2.SendUserNotificationWiiURequest - */ -export declare const SendUserNotificationWiiURequest: SendUserNotificationWiiURequest$Type; -declare class SendUserNotificationWiiUResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SendUserNotificationWiiUResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SendUserNotificationWiiUResponse): SendUserNotificationWiiUResponse; - internalBinaryWrite(message: SendUserNotificationWiiUResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message friends.v2.SendUserNotificationWiiUResponse - */ -export declare const SendUserNotificationWiiUResponse: SendUserNotificationWiiUResponse$Type; export {}; diff --git a/javascript/friends/v2/send_user_notification_wiiu_rpc.js b/javascript/friends/v2/send_user_notification_wiiu_rpc.js index 54b2cc3..1166f13 100644 --- a/javascript/friends/v2/send_user_notification_wiiu_rpc.js +++ b/javascript/friends/v2/send_user_notification_wiiu_rpc.js @@ -1,92 +1,127 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "friends/v2/send_user_notification_wiiu_rpc.proto" (package "friends.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/send_user_notification_wiiu_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SendUserNotificationWiiUResponse = exports.SendUserNotificationWiiURequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserNotificationWiiURequest$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.SendUserNotificationWiiURequest", [ - { no: 1, name: "pid", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, - { no: 2, name: "notification_data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.pid = 0; - message.notificationData = new Uint8Array(0); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SendUserNotificationWiiUResponse = exports.SendUserNotificationWiiURequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "friends.v2"; +function createBaseSendUserNotificationWiiURequest() { + return { pid: 0, notificationData: Buffer.alloc(0) }; +} +exports.SendUserNotificationWiiURequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.notificationData.length !== 0) { + writer.uint32(18).bytes(message.notificationData); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiURequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint32 pid */ 1: + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } message.pid = reader.uint32(); - break; - case /* bytes notification_data */ 2: - message.notificationData = reader.bytes(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + message.notificationData = Buffer.from(reader.bytes()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint32 pid = 1; */ - if (message.pid !== 0) - writer.tag(1, runtime_1.WireType.Varint).uint32(message.pid); - /* bytes notification_data = 2; */ - if (message.notificationData.length) - writer.tag(2, runtime_1.WireType.LengthDelimited).bytes(message.notificationData); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message friends.v2.SendUserNotificationWiiURequest - */ -exports.SendUserNotificationWiiURequest = new SendUserNotificationWiiURequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SendUserNotificationWiiUResponse$Type extends runtime_4.MessageType { - constructor() { - super("friends.v2.SendUserNotificationWiiUResponse", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + notificationData: isSet(object.notificationData) + ? Buffer.from(bytesFromBase64(object.notificationData)) + : Buffer.alloc(0), + }; + }, + toJSON(message) { + const obj = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.notificationData.length !== 0) { + obj.notificationData = base64FromBytes(message.notificationData); + } + return obj; + }, + create(base) { + return exports.SendUserNotificationWiiURequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSendUserNotificationWiiURequest(); + message.pid = object.pid ?? 0; + message.notificationData = object.notificationData ?? Buffer.alloc(0); return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + }, +}; +function createBaseSendUserNotificationWiiUResponse() { + return {}; +} +exports.SendUserNotificationWiiUResponse = { + encode(_, writer = new wire_1.BinaryWriter()) { return writer; - } + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiUResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.SendUserNotificationWiiUResponse.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseSendUserNotificationWiiUResponse(); + return message; + }, +}; +function bytesFromBase64(b64) { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} +function base64FromBytes(arr) { + return globalThis.Buffer.from(arr).toString("base64"); +} +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message friends.v2.SendUserNotificationWiiUResponse - */ -exports.SendUserNotificationWiiUResponse = new SendUserNotificationWiiUResponse$Type(); diff --git a/javascript/friends/v2/send_user_notification_wiiu_rpc.ts b/javascript/friends/v2/send_user_notification_wiiu_rpc.ts new file mode 100644 index 0000000..eaad1a9 --- /dev/null +++ b/javascript/friends/v2/send_user_notification_wiiu_rpc.ts @@ -0,0 +1,168 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: friends/v2/send_user_notification_wiiu_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "friends.v2"; + +export interface SendUserNotificationWiiURequest { + pid: number; + notificationData: Buffer; +} + +export interface SendUserNotificationWiiUResponse { +} + +function createBaseSendUserNotificationWiiURequest(): SendUserNotificationWiiURequest { + return { pid: 0, notificationData: Buffer.alloc(0) }; +} + +export const SendUserNotificationWiiURequest: MessageFns = { + encode(message: SendUserNotificationWiiURequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pid !== 0) { + writer.uint32(8).uint32(message.pid); + } + if (message.notificationData.length !== 0) { + writer.uint32(18).bytes(message.notificationData); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserNotificationWiiURequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiURequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pid = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.notificationData = Buffer.from(reader.bytes()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SendUserNotificationWiiURequest { + return { + pid: isSet(object.pid) ? globalThis.Number(object.pid) : 0, + notificationData: isSet(object.notificationData) + ? Buffer.from(bytesFromBase64(object.notificationData)) + : Buffer.alloc(0), + }; + }, + + toJSON(message: SendUserNotificationWiiURequest): unknown { + const obj: any = {}; + if (message.pid !== 0) { + obj.pid = Math.round(message.pid); + } + if (message.notificationData.length !== 0) { + obj.notificationData = base64FromBytes(message.notificationData); + } + return obj; + }, + + create(base?: DeepPartial): SendUserNotificationWiiURequest { + return SendUserNotificationWiiURequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SendUserNotificationWiiURequest { + const message = createBaseSendUserNotificationWiiURequest(); + message.pid = object.pid ?? 0; + message.notificationData = object.notificationData ?? Buffer.alloc(0); + return message; + }, +}; + +function createBaseSendUserNotificationWiiUResponse(): SendUserNotificationWiiUResponse { + return {}; +} + +export const SendUserNotificationWiiUResponse: MessageFns = { + encode(_: SendUserNotificationWiiUResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SendUserNotificationWiiUResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSendUserNotificationWiiUResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): SendUserNotificationWiiUResponse { + return {}; + }, + + toJSON(_: SendUserNotificationWiiUResponse): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): SendUserNotificationWiiUResponse { + return SendUserNotificationWiiUResponse.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): SendUserNotificationWiiUResponse { + const message = createBaseSendUserNotificationWiiUResponse(); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/google/protobuf/empty.d.ts b/javascript/google/protobuf/empty.d.ts index dc3bec2..f9952a1 100644 --- a/javascript/google/protobuf/empty.d.ts +++ b/javascript/google/protobuf/empty.d.ts @@ -1,45 +1,5 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "google/protobuf/empty.proto" (package "google.protobuf", syntax proto3) -// tslint:disable -// @ts-nocheck -// -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "google.protobuf"; /** * 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 @@ -48,20 +8,20 @@ import { MessageType } from "@protobuf-ts/runtime"; * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } - * - * - * @generated from protobuf message google.protobuf.Empty */ export interface Empty { } -declare class Empty$Type extends MessageType { - constructor(); - create(value?: PartialMessage): Empty; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty; - internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const Empty: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message google.protobuf.Empty - */ -export declare const Empty: Empty$Type; export {}; diff --git a/javascript/google/protobuf/empty.js b/javascript/google/protobuf/empty.js index 11f4e3c..8ac4012 100644 --- a/javascript/google/protobuf/empty.js +++ b/javascript/google/protobuf/empty.js @@ -1,67 +1,48 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "google/protobuf/empty.proto" (package "google.protobuf", syntax proto3) -// tslint:disable -// @ts-nocheck -// -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: google/protobuf/empty.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Empty = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class Empty$Type extends runtime_3.MessageType { - constructor() { - super("google.protobuf.Empty", []); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - if (value !== undefined) - runtime_2.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - return target ?? this.create(); - } - internalBinaryWrite(message, writer, options) { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_1.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } +exports.Empty = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "google.protobuf"; +function createBaseEmpty() { + return {}; } -/** - * @generated MessageType for protobuf message google.protobuf.Empty - */ -exports.Empty = new Empty$Type(); +exports.Empty = { + encode(_, writer = new wire_1.BinaryWriter()) { + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + fromJSON(_) { + return {}; + }, + toJSON(_) { + const obj = {}; + return obj; + }, + create(base) { + return exports.Empty.fromPartial(base ?? {}); + }, + fromPartial(_) { + const message = createBaseEmpty(); + return message; + }, +}; diff --git a/javascript/google/protobuf/empty.ts b/javascript/google/protobuf/empty.ts new file mode 100644 index 0000000..ccac7ec --- /dev/null +++ b/javascript/google/protobuf/empty.ts @@ -0,0 +1,82 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: google/protobuf/empty.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "google.protobuf"; + +/** + * 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 + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + */ +export interface Empty { +} + +function createBaseEmpty(): Empty { + return {}; +} + +export const Empty: MessageFns = { + encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Empty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): Empty { + return {}; + }, + + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): Empty { + return Empty.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): Empty { + const message = createBaseEmpty(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/miiverse/miiverse_service.client.d.ts b/javascript/miiverse/miiverse_service.client.d.ts deleted file mode 100644 index 078b3da..0000000 --- a/javascript/miiverse/miiverse_service.client.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/miiverse_service.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { SMMRequestPostIDResponse } from "./smm_request_post_id_rpc"; -import type { SMMRequestPostIDRequest } from "./smm_request_post_id_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service miiverse.Miiverse - */ -export interface IMiiverseClient { - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.SMMRequestPostIDRequest) returns (miiverse.SMMRequestPostIDResponse); - */ - sMMRequestPostId(input: SMMRequestPostIDRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service miiverse.Miiverse - */ -export declare class MiiverseClient implements IMiiverseClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.SMMRequestPostIDRequest) returns (miiverse.SMMRequestPostIDResponse); - */ - sMMRequestPostId(input: SMMRequestPostIDRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/miiverse/miiverse_service.client.js b/javascript/miiverse/miiverse_service.client.js deleted file mode 100644 index 940cdf9..0000000 --- a/javascript/miiverse/miiverse_service.client.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/miiverse_service.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MiiverseClient = void 0; -const miiverse_service_1 = require("./miiverse_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service miiverse.Miiverse - */ -class MiiverseClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = miiverse_service_1.Miiverse.typeName; - this.methods = miiverse_service_1.Miiverse.methods; - this.options = miiverse_service_1.Miiverse.options; - } - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.SMMRequestPostIDRequest) returns (miiverse.SMMRequestPostIDResponse); - */ - sMMRequestPostId(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.MiiverseClient = MiiverseClient; diff --git a/javascript/miiverse/miiverse_service.d.ts b/javascript/miiverse/miiverse_service.d.ts index d875ecb..f7aa446 100644 --- a/javascript/miiverse/miiverse_service.d.ts +++ b/javascript/miiverse/miiverse_service.d.ts @@ -1,9 +1,32 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/miiverse_service.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service miiverse.Miiverse - */ -export declare const Miiverse: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { SMMRequestPostIDRequest, SMMRequestPostIDResponse } from "./smm_request_post_id_rpc"; +export declare const protobufPackage = "miiverse"; +export type MiiverseDefinition = typeof MiiverseDefinition; +export declare const MiiverseDefinition: { + readonly name: "Miiverse"; + readonly fullName: "miiverse.Miiverse"; + readonly methods: { + /** Used by Super Mario Maker */ + readonly sMMRequestPostId: { + readonly name: "SMMRequestPostId"; + readonly requestType: import("./smm_request_post_id_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./smm_request_post_id_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface MiiverseServiceImplementation { + /** Used by Super Mario Maker */ + sMMRequestPostId(request: SMMRequestPostIDRequest, context: CallContext & CallContextExt): Promise>; +} +export interface MiiverseClient { + /** Used by Super Mario Maker */ + sMMRequestPostId(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/miiverse/miiverse_service.js b/javascript/miiverse/miiverse_service.js index a7ea38a..884e836 100644 --- a/javascript/miiverse/miiverse_service.js +++ b/javascript/miiverse/miiverse_service.js @@ -1,22 +1,25 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/miiverse_service.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/miiverse_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.Miiverse = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/miiverse_service.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck +exports.MiiverseDefinition = exports.protobufPackage = void 0; const smm_request_post_id_rpc_1 = require("./smm_request_post_id_rpc"); -const smm_request_post_id_rpc_2 = require("./smm_request_post_id_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service miiverse.Miiverse - */ -exports.Miiverse = new runtime_rpc_1.ServiceType("miiverse.Miiverse", [ - { name: "SMMRequestPostId", options: {}, I: smm_request_post_id_rpc_2.SMMRequestPostIDRequest, O: smm_request_post_id_rpc_1.SMMRequestPostIDResponse } -]); +exports.protobufPackage = "miiverse"; +exports.MiiverseDefinition = { + name: "Miiverse", + fullName: "miiverse.Miiverse", + methods: { + /** Used by Super Mario Maker */ + sMMRequestPostId: { + name: "SMMRequestPostId", + requestType: smm_request_post_id_rpc_1.SMMRequestPostIDRequest, + requestStream: false, + responseType: smm_request_post_id_rpc_1.SMMRequestPostIDResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/miiverse/miiverse_service.ts b/javascript/miiverse/miiverse_service.ts new file mode 100644 index 0000000..0f9fcb9 --- /dev/null +++ b/javascript/miiverse/miiverse_service.ts @@ -0,0 +1,52 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/miiverse_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { SMMRequestPostIDRequest, SMMRequestPostIDResponse } from "./smm_request_post_id_rpc"; + +export const protobufPackage = "miiverse"; + +export type MiiverseDefinition = typeof MiiverseDefinition; +export const MiiverseDefinition = { + name: "Miiverse", + fullName: "miiverse.Miiverse", + methods: { + /** Used by Super Mario Maker */ + sMMRequestPostId: { + name: "SMMRequestPostId", + requestType: SMMRequestPostIDRequest, + requestStream: false, + responseType: SMMRequestPostIDResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface MiiverseServiceImplementation { + /** Used by Super Mario Maker */ + sMMRequestPostId( + request: SMMRequestPostIDRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface MiiverseClient { + /** Used by Super Mario Maker */ + sMMRequestPostId( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/miiverse/smm_request_post_id_rpc.d.ts b/javascript/miiverse/smm_request_post_id_rpc.d.ts index aefba93..727a721 100644 --- a/javascript/miiverse/smm_request_post_id_rpc.d.ts +++ b/javascript/miiverse/smm_request_post_id_rpc.d.ts @@ -1,50 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/smm_request_post_id_rpc.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message miiverse.SMMRequestPostIDRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "miiverse"; export interface SMMRequestPostIDRequest { - /** - * @generated from protobuf field: uint64 course_id = 1; - */ + /** TODO - Other course/user data? */ courseId: bigint; } -/** - * @generated from protobuf message miiverse.SMMRequestPostIDResponse - */ export interface SMMRequestPostIDResponse { - /** - * @generated from protobuf field: uint64 post_id = 1; - */ postId: bigint; } -declare class SMMRequestPostIDRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SMMRequestPostIDRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SMMRequestPostIDRequest): SMMRequestPostIDRequest; - internalBinaryWrite(message: SMMRequestPostIDRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SMMRequestPostIDRequest: MessageFns; +export declare const SMMRequestPostIDResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message miiverse.SMMRequestPostIDRequest - */ -export declare const SMMRequestPostIDRequest: SMMRequestPostIDRequest$Type; -declare class SMMRequestPostIDResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SMMRequestPostIDResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SMMRequestPostIDResponse): SMMRequestPostIDResponse; - internalBinaryWrite(message: SMMRequestPostIDResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message miiverse.SMMRequestPostIDResponse - */ -export declare const SMMRequestPostIDResponse: SMMRequestPostIDResponse$Type; export {}; diff --git a/javascript/miiverse/smm_request_post_id_rpc.js b/javascript/miiverse/smm_request_post_id_rpc.js index c1c529c..ac87ccc 100644 --- a/javascript/miiverse/smm_request_post_id_rpc.js +++ b/javascript/miiverse/smm_request_post_id_rpc.js @@ -1,106 +1,122 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/smm_request_post_id_rpc.proto" (package "miiverse", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/smm_request_post_id_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SMMRequestPostIDResponse = exports.SMMRequestPostIDRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SMMRequestPostIDRequest$Type extends runtime_4.MessageType { - constructor() { - super("miiverse.SMMRequestPostIDRequest", [ - { no: 1, name: "course_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.courseId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SMMRequestPostIDResponse = exports.SMMRequestPostIDRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "miiverse"; +function createBaseSMMRequestPostIDRequest() { + return { courseId: 0n }; +} +exports.SMMRequestPostIDRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.courseId !== 0n) { + if (BigInt.asUintN(64, message.courseId) !== message.courseId) { + throw new globalThis.Error("value provided for field message.courseId of type uint64 too large"); + } + writer.uint32(8).uint64(message.courseId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIDRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 course_id */ 1: - message.courseId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.courseId = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 course_id = 1; */ - if (message.courseId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.courseId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message miiverse.SMMRequestPostIDRequest - */ -exports.SMMRequestPostIDRequest = new SMMRequestPostIDRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SMMRequestPostIDResponse$Type extends runtime_4.MessageType { - constructor() { - super("miiverse.SMMRequestPostIDResponse", [ - { no: 1, name: "post_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.postId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { courseId: isSet(object.courseId) ? BigInt(object.courseId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.courseId !== 0n) { + obj.courseId = message.courseId.toString(); + } + return obj; + }, + create(base) { + return exports.SMMRequestPostIDRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSMMRequestPostIDRequest(); + message.courseId = object.courseId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseSMMRequestPostIDResponse() { + return { postId: 0n }; +} +exports.SMMRequestPostIDResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.postId !== 0n) { + if (BigInt.asUintN(64, message.postId) !== message.postId) { + throw new globalThis.Error("value provided for field message.postId of type uint64 too large"); + } + writer.uint32(8).uint64(message.postId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIDResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 post_id */ 1: - message.postId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.postId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 post_id = 1; */ - if (message.postId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.postId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { postId: isSet(object.postId) ? BigInt(object.postId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.postId !== 0n) { + obj.postId = message.postId.toString(); + } + return obj; + }, + create(base) { + return exports.SMMRequestPostIDResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSMMRequestPostIDResponse(); + message.postId = object.postId ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message miiverse.SMMRequestPostIDResponse - */ -exports.SMMRequestPostIDResponse = new SMMRequestPostIDResponse$Type(); diff --git a/javascript/miiverse/smm_request_post_id_rpc.ts b/javascript/miiverse/smm_request_post_id_rpc.ts new file mode 100644 index 0000000..46836dc --- /dev/null +++ b/javascript/miiverse/smm_request_post_id_rpc.ts @@ -0,0 +1,162 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/smm_request_post_id_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "miiverse"; + +export interface SMMRequestPostIDRequest { + /** TODO - Other course/user data? */ + courseId: bigint; +} + +export interface SMMRequestPostIDResponse { + postId: bigint; +} + +function createBaseSMMRequestPostIDRequest(): SMMRequestPostIDRequest { + return { courseId: 0n }; +} + +export const SMMRequestPostIDRequest: MessageFns = { + encode(message: SMMRequestPostIDRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.courseId !== 0n) { + if (BigInt.asUintN(64, message.courseId) !== message.courseId) { + throw new globalThis.Error("value provided for field message.courseId of type uint64 too large"); + } + writer.uint32(8).uint64(message.courseId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SMMRequestPostIDRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.courseId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SMMRequestPostIDRequest { + return { courseId: isSet(object.courseId) ? BigInt(object.courseId) : 0n }; + }, + + toJSON(message: SMMRequestPostIDRequest): unknown { + const obj: any = {}; + if (message.courseId !== 0n) { + obj.courseId = message.courseId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SMMRequestPostIDRequest { + return SMMRequestPostIDRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SMMRequestPostIDRequest { + const message = createBaseSMMRequestPostIDRequest(); + message.courseId = object.courseId ?? 0n; + return message; + }, +}; + +function createBaseSMMRequestPostIDResponse(): SMMRequestPostIDResponse { + return { postId: 0n }; +} + +export const SMMRequestPostIDResponse: MessageFns = { + encode(message: SMMRequestPostIDResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.postId !== 0n) { + if (BigInt.asUintN(64, message.postId) !== message.postId) { + throw new globalThis.Error("value provided for field message.postId of type uint64 too large"); + } + writer.uint32(8).uint64(message.postId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SMMRequestPostIDResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.postId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SMMRequestPostIDResponse { + return { postId: isSet(object.postId) ? BigInt(object.postId) : 0n }; + }, + + toJSON(message: SMMRequestPostIDResponse): unknown { + const obj: any = {}; + if (message.postId !== 0n) { + obj.postId = message.postId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SMMRequestPostIDResponse { + return SMMRequestPostIDResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SMMRequestPostIDResponse { + const message = createBaseSMMRequestPostIDResponse(); + message.postId = object.postId ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/miiverse/v2/miiverse_service.client.d.ts b/javascript/miiverse/v2/miiverse_service.client.d.ts deleted file mode 100644 index 17a71f6..0000000 --- a/javascript/miiverse/v2/miiverse_service.client.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/miiverse_service.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; -import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; -import type { SMMRequestPostIdResponse } from "./smm_request_post_id_rpc"; -import type { SMMRequestPostIdRequest } from "./smm_request_post_id_rpc"; -import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; -import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; -/** - * @generated from protobuf service miiverse.v2.MiiverseService - */ -export interface IMiiverseServiceClient { - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.v2.SMMRequestPostIdRequest) returns (miiverse.v2.SMMRequestPostIdResponse); - */ - sMMRequestPostId(input: SMMRequestPostIdRequest, options?: RpcOptions): UnaryCall; -} -/** - * @generated from protobuf service miiverse.v2.MiiverseService - */ -export declare class MiiverseServiceClient implements IMiiverseServiceClient, ServiceInfo { - private readonly _transport; - typeName: any; - methods: any; - options: any; - constructor(_transport: RpcTransport); - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.v2.SMMRequestPostIdRequest) returns (miiverse.v2.SMMRequestPostIdResponse); - */ - sMMRequestPostId(input: SMMRequestPostIdRequest, options?: RpcOptions): UnaryCall; -} diff --git a/javascript/miiverse/v2/miiverse_service.client.js b/javascript/miiverse/v2/miiverse_service.client.js deleted file mode 100644 index 2ddb593..0000000 --- a/javascript/miiverse/v2/miiverse_service.client.js +++ /dev/null @@ -1,31 +0,0 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/miiverse_service.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.MiiverseServiceClient = void 0; -const miiverse_service_1 = require("./miiverse_service"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated from protobuf service miiverse.v2.MiiverseService - */ -class MiiverseServiceClient { - constructor(_transport) { - this._transport = _transport; - this.typeName = miiverse_service_1.MiiverseService.typeName; - this.methods = miiverse_service_1.MiiverseService.methods; - this.options = miiverse_service_1.MiiverseService.options; - } - /** - * Used by Super Mario Maker - * - * @generated from protobuf rpc: SMMRequestPostId(miiverse.v2.SMMRequestPostIdRequest) returns (miiverse.v2.SMMRequestPostIdResponse); - */ - sMMRequestPostId(input, options) { - const method = this.methods[0], opt = this._transport.mergeOptions(options); - return runtime_rpc_1.stackIntercept("unary", this._transport, method, opt, input); - } -} -exports.MiiverseServiceClient = MiiverseServiceClient; diff --git a/javascript/miiverse/v2/miiverse_service.d.ts b/javascript/miiverse/v2/miiverse_service.d.ts index f5eb217..82e0699 100644 --- a/javascript/miiverse/v2/miiverse_service.d.ts +++ b/javascript/miiverse/v2/miiverse_service.d.ts @@ -1,9 +1,32 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/miiverse_service.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -/** - * @generated ServiceType for protobuf service miiverse.v2.MiiverseService - */ -export declare const MiiverseService: any; +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { SMMRequestPostIdRequest, SMMRequestPostIdResponse } from "./smm_request_post_id_rpc"; +export declare const protobufPackage = "miiverse.v2"; +export type MiiverseServiceDefinition = typeof MiiverseServiceDefinition; +export declare const MiiverseServiceDefinition: { + readonly name: "MiiverseService"; + readonly fullName: "miiverse.v2.MiiverseService"; + readonly methods: { + /** Used by Super Mario Maker */ + readonly sMMRequestPostId: { + readonly name: "SMMRequestPostId"; + readonly requestType: import("./smm_request_post_id_rpc").MessageFns; + readonly requestStream: false; + readonly responseType: import("./smm_request_post_id_rpc").MessageFns; + readonly responseStream: false; + readonly options: {}; + }; + }; +}; +export interface MiiverseServiceImplementation { + /** Used by Super Mario Maker */ + sMMRequestPostId(request: SMMRequestPostIdRequest, context: CallContext & CallContextExt): Promise>; +} +export interface MiiverseServiceClient { + /** Used by Super Mario Maker */ + sMMRequestPostId(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export {}; diff --git a/javascript/miiverse/v2/miiverse_service.js b/javascript/miiverse/v2/miiverse_service.js index 2d10330..b771560 100644 --- a/javascript/miiverse/v2/miiverse_service.js +++ b/javascript/miiverse/v2/miiverse_service.js @@ -1,22 +1,25 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/miiverse_service.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/v2/miiverse_service.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.MiiverseService = void 0; -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/miiverse_service.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck +exports.MiiverseServiceDefinition = exports.protobufPackage = void 0; const smm_request_post_id_rpc_1 = require("./smm_request_post_id_rpc"); -const smm_request_post_id_rpc_2 = require("./smm_request_post_id_rpc"); -const runtime_rpc_1 = require("@protobuf-ts/runtime-rpc"); -/** - * @generated ServiceType for protobuf service miiverse.v2.MiiverseService - */ -exports.MiiverseService = new runtime_rpc_1.ServiceType("miiverse.v2.MiiverseService", [ - { name: "SMMRequestPostId", options: {}, I: smm_request_post_id_rpc_2.SMMRequestPostIdRequest, O: smm_request_post_id_rpc_1.SMMRequestPostIdResponse } -]); +exports.protobufPackage = "miiverse.v2"; +exports.MiiverseServiceDefinition = { + name: "MiiverseService", + fullName: "miiverse.v2.MiiverseService", + methods: { + /** Used by Super Mario Maker */ + sMMRequestPostId: { + name: "SMMRequestPostId", + requestType: smm_request_post_id_rpc_1.SMMRequestPostIdRequest, + requestStream: false, + responseType: smm_request_post_id_rpc_1.SMMRequestPostIdResponse, + responseStream: false, + options: {}, + }, + }, +}; diff --git a/javascript/miiverse/v2/miiverse_service.ts b/javascript/miiverse/v2/miiverse_service.ts new file mode 100644 index 0000000..8ab15f7 --- /dev/null +++ b/javascript/miiverse/v2/miiverse_service.ts @@ -0,0 +1,52 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/v2/miiverse_service.proto + +/* eslint-disable */ +import { type CallContext, type CallOptions } from "nice-grpc-common"; +import { SMMRequestPostIdRequest, SMMRequestPostIdResponse } from "./smm_request_post_id_rpc"; + +export const protobufPackage = "miiverse.v2"; + +export type MiiverseServiceDefinition = typeof MiiverseServiceDefinition; +export const MiiverseServiceDefinition = { + name: "MiiverseService", + fullName: "miiverse.v2.MiiverseService", + methods: { + /** Used by Super Mario Maker */ + sMMRequestPostId: { + name: "SMMRequestPostId", + requestType: SMMRequestPostIdRequest, + requestStream: false, + responseType: SMMRequestPostIdResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +export interface MiiverseServiceImplementation { + /** Used by Super Mario Maker */ + sMMRequestPostId( + request: SMMRequestPostIdRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface MiiverseServiceClient { + /** Used by Super Mario Maker */ + sMMRequestPostId( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/javascript/miiverse/v2/smm_request_post_id_rpc.d.ts b/javascript/miiverse/v2/smm_request_post_id_rpc.d.ts index c0fa284..8758d2e 100644 --- a/javascript/miiverse/v2/smm_request_post_id_rpc.d.ts +++ b/javascript/miiverse/v2/smm_request_post_id_rpc.d.ts @@ -1,50 +1,24 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/smm_request_post_id_rpc.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck -import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; -import type { IBinaryWriter } from "@protobuf-ts/runtime"; -import type { BinaryReadOptions } from "@protobuf-ts/runtime"; -import type { IBinaryReader } from "@protobuf-ts/runtime"; -import type { PartialMessage } from "@protobuf-ts/runtime"; -import { MessageType } from "@protobuf-ts/runtime"; -/** - * @generated from protobuf message miiverse.v2.SMMRequestPostIdRequest - */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +export declare const protobufPackage = "miiverse.v2"; export interface SMMRequestPostIdRequest { - /** - * @generated from protobuf field: uint64 course_id = 1; - */ + /** TODO - Other course/user data? */ courseId: bigint; } -/** - * @generated from protobuf message miiverse.v2.SMMRequestPostIdResponse - */ export interface SMMRequestPostIdResponse { - /** - * @generated from protobuf field: uint64 post_id = 1; - */ postId: bigint; } -declare class SMMRequestPostIdRequest$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SMMRequestPostIdRequest; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SMMRequestPostIdRequest): SMMRequestPostIdRequest; - internalBinaryWrite(message: SMMRequestPostIdRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; +export declare const SMMRequestPostIdRequest: MessageFns; +export declare const SMMRequestPostIdResponse: MessageFns; +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; +export type DeepPartial = T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { + [K in keyof T]?: DeepPartial; +} : Partial; +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; } -/** - * @generated MessageType for protobuf message miiverse.v2.SMMRequestPostIdRequest - */ -export declare const SMMRequestPostIdRequest: SMMRequestPostIdRequest$Type; -declare class SMMRequestPostIdResponse$Type extends MessageType { - constructor(); - create(value?: PartialMessage): SMMRequestPostIdResponse; - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SMMRequestPostIdResponse): SMMRequestPostIdResponse; - internalBinaryWrite(message: SMMRequestPostIdResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter; -} -/** - * @generated MessageType for protobuf message miiverse.v2.SMMRequestPostIdResponse - */ -export declare const SMMRequestPostIdResponse: SMMRequestPostIdResponse$Type; export {}; diff --git a/javascript/miiverse/v2/smm_request_post_id_rpc.js b/javascript/miiverse/v2/smm_request_post_id_rpc.js index c4a99c5..8d45cc3 100644 --- a/javascript/miiverse/v2/smm_request_post_id_rpc.js +++ b/javascript/miiverse/v2/smm_request_post_id_rpc.js @@ -1,106 +1,122 @@ -/* eslint-disable */ -// @generated by protobuf-ts 2.9.4 with parameter eslint_disable,output_javascript,output_legacy_commonjs,ts_nocheck -// @generated from protobuf file "miiverse/v2/smm_request_post_id_rpc.proto" (package "miiverse.v2", syntax proto3) -// tslint:disable -// @ts-nocheck "use strict"; +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/v2/smm_request_post_id_rpc.proto Object.defineProperty(exports, "__esModule", { value: true }); -exports.SMMRequestPostIdResponse = exports.SMMRequestPostIdRequest = void 0; -const runtime_1 = require("@protobuf-ts/runtime"); -const runtime_2 = require("@protobuf-ts/runtime"); -const runtime_3 = require("@protobuf-ts/runtime"); -const runtime_4 = require("@protobuf-ts/runtime"); -// @generated message type with reflection information, may provide speed optimized methods -class SMMRequestPostIdRequest$Type extends runtime_4.MessageType { - constructor() { - super("miiverse.v2.SMMRequestPostIdRequest", [ - { no: 1, name: "course_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.courseId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; +exports.SMMRequestPostIdResponse = exports.SMMRequestPostIdRequest = exports.protobufPackage = void 0; +/* eslint-disable */ +const wire_1 = require("@bufbuild/protobuf/wire"); +exports.protobufPackage = "miiverse.v2"; +function createBaseSMMRequestPostIdRequest() { + return { courseId: 0n }; +} +exports.SMMRequestPostIdRequest = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.courseId !== 0n) { + if (BigInt.asUintN(64, message.courseId) !== message.courseId) { + throw new globalThis.Error("value provided for field message.courseId of type uint64 too large"); + } + writer.uint32(8).uint64(message.courseId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIdRequest(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 course_id */ 1: - message.courseId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.courseId = reader.uint64(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 course_id = 1; */ - if (message.courseId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.courseId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message miiverse.v2.SMMRequestPostIdRequest - */ -exports.SMMRequestPostIdRequest = new SMMRequestPostIdRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class SMMRequestPostIdResponse$Type extends runtime_4.MessageType { - constructor() { - super("miiverse.v2.SMMRequestPostIdResponse", [ - { no: 1, name: "post_id", kind: "scalar", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ } - ]); - } - create(value) { - const message = globalThis.Object.create((this.messagePrototype)); - message.postId = 0n; - if (value !== undefined) - runtime_3.reflectionMergePartial(this, message, value); + }, + fromJSON(object) { + return { courseId: isSet(object.courseId) ? BigInt(object.courseId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.courseId !== 0n) { + obj.courseId = message.courseId.toString(); + } + return obj; + }, + create(base) { + return exports.SMMRequestPostIdRequest.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSMMRequestPostIdRequest(); + message.courseId = object.courseId ?? 0n; return message; - } - internalBinaryRead(reader, length, options, target) { - let message = target ?? this.create(), end = reader.pos + length; + }, +}; +function createBaseSMMRequestPostIdResponse() { + return { postId: 0n }; +} +exports.SMMRequestPostIdResponse = { + encode(message, writer = new wire_1.BinaryWriter()) { + if (message.postId !== 0n) { + if (BigInt.asUintN(64, message.postId) !== message.postId) { + throw new globalThis.Error("value provided for field message.postId of type uint64 too large"); + } + writer.uint32(8).uint64(message.postId); + } + return writer; + }, + decode(input, length) { + const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIdResponse(); while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* uint64 post_id */ 1: - message.postId = reader.uint64().toBigInt(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + message.postId = reader.uint64(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } return message; - } - internalBinaryWrite(message, writer, options) { - /* uint64 post_id = 1; */ - if (message.postId !== 0n) - writer.tag(1, runtime_1.WireType.Varint).uint64(message.postId); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } + }, + fromJSON(object) { + return { postId: isSet(object.postId) ? BigInt(object.postId) : 0n }; + }, + toJSON(message) { + const obj = {}; + if (message.postId !== 0n) { + obj.postId = message.postId.toString(); + } + return obj; + }, + create(base) { + return exports.SMMRequestPostIdResponse.fromPartial(base ?? {}); + }, + fromPartial(object) { + const message = createBaseSMMRequestPostIdResponse(); + message.postId = object.postId ?? 0n; + return message; + }, +}; +function isSet(value) { + return value !== null && value !== undefined; } -/** - * @generated MessageType for protobuf message miiverse.v2.SMMRequestPostIdResponse - */ -exports.SMMRequestPostIdResponse = new SMMRequestPostIdResponse$Type(); diff --git a/javascript/miiverse/v2/smm_request_post_id_rpc.ts b/javascript/miiverse/v2/smm_request_post_id_rpc.ts new file mode 100644 index 0000000..fe231d4 --- /dev/null +++ b/javascript/miiverse/v2/smm_request_post_id_rpc.ts @@ -0,0 +1,162 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.3.0 +// protoc unknown +// source: miiverse/v2/smm_request_post_id_rpc.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; + +export const protobufPackage = "miiverse.v2"; + +export interface SMMRequestPostIdRequest { + /** TODO - Other course/user data? */ + courseId: bigint; +} + +export interface SMMRequestPostIdResponse { + postId: bigint; +} + +function createBaseSMMRequestPostIdRequest(): SMMRequestPostIdRequest { + return { courseId: 0n }; +} + +export const SMMRequestPostIdRequest: MessageFns = { + encode(message: SMMRequestPostIdRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.courseId !== 0n) { + if (BigInt.asUintN(64, message.courseId) !== message.courseId) { + throw new globalThis.Error("value provided for field message.courseId of type uint64 too large"); + } + writer.uint32(8).uint64(message.courseId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SMMRequestPostIdRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIdRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.courseId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SMMRequestPostIdRequest { + return { courseId: isSet(object.courseId) ? BigInt(object.courseId) : 0n }; + }, + + toJSON(message: SMMRequestPostIdRequest): unknown { + const obj: any = {}; + if (message.courseId !== 0n) { + obj.courseId = message.courseId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SMMRequestPostIdRequest { + return SMMRequestPostIdRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SMMRequestPostIdRequest { + const message = createBaseSMMRequestPostIdRequest(); + message.courseId = object.courseId ?? 0n; + return message; + }, +}; + +function createBaseSMMRequestPostIdResponse(): SMMRequestPostIdResponse { + return { postId: 0n }; +} + +export const SMMRequestPostIdResponse: MessageFns = { + encode(message: SMMRequestPostIdResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.postId !== 0n) { + if (BigInt.asUintN(64, message.postId) !== message.postId) { + throw new globalThis.Error("value provided for field message.postId of type uint64 too large"); + } + writer.uint32(8).uint64(message.postId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SMMRequestPostIdResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSMMRequestPostIdResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.postId = reader.uint64() as bigint; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SMMRequestPostIdResponse { + return { postId: isSet(object.postId) ? BigInt(object.postId) : 0n }; + }, + + toJSON(message: SMMRequestPostIdResponse): unknown { + const obj: any = {}; + if (message.postId !== 0n) { + obj.postId = message.postId.toString(); + } + return obj; + }, + + create(base?: DeepPartial): SMMRequestPostIdResponse { + return SMMRequestPostIdResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SMMRequestPostIdResponse { + const message = createBaseSMMRequestPostIdResponse(); + message.postId = object.postId ?? 0n; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/javascript/package.json b/javascript/package.json index 361108c..118b7d1 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,12 +1,12 @@ { "name": "@pretendonetwork/grpc", - "version": "2.0.0", + "version": "2.0.1", "license": "AGPL-3.0-only", "scripts": { "build": "npm-run-all clean generate copy:*", "clean": "rimraf javascript go", - "generate": "buf generate", - "generate:debug": "buf generate --debug", + "generate": "buf generate && tsc", + "generate:debug": "buf generate --debug && tsc", "copy:js": "copyfiles -f package.json README.md template/GENERATED_DO_NOT_EDIT.md javascript", "copy:go": "copyfiles -f template/GENERATED_DO_NOT_EDIT.md template/go/* go", "lint": "buf lint", @@ -17,12 +17,15 @@ }, "devDependencies": { "@bufbuild/buf": "^1.46.0", - "@protobuf-ts/plugin": "^2.9.4", + "@types/node": "^22.9.3", "copyfiles": "^2.4.1", "npm-run-all": "^4.1.5", - "rimraf": "^6.0.1" + "rimraf": "^6.0.1", + "ts-proto": "^2.3.0" }, "dependencies": { - "@protobuf-ts/runtime": "^2.9.4" + "@bufbuild/protobuf": "^2.2.2", + "nice-grpc-common": "^2.0.2", + "typescript": "^5.7.2" } }