diff --git a/src/client/rpcVaults.ts b/src/client/rpcVaults.ts index 90aab0e844..020d0a792b 100644 --- a/src/client/rpcVaults.ts +++ b/src/client/rpcVaults.ts @@ -644,21 +644,30 @@ const createVaultRPC = ({ }, secretsEnv: async ( call: grpc.ServerWritableStream< - clientPB.VaultMessage, - clientPB.DirectoryMessage + secretsPB.Directory, + secretsPB.Directory >, ): Promise => { const genWritable = grpcUtils.generatorWritable(call); try { - await utils.checkPassword(call.metadata, sessionManager); - const name = call.request.getName(); - const pattern = call.request.getId(); - const id = utils.parseVaultInput(name, vaultManager); - const vault = vaultManager.getVault(id); - const res = await utils.glob(vault.EncryptedFS, pattern); - const dirMessage = new clientPB.DirectoryMessage(); + await sessionManager.verifyToken(utils.getToken(call.metadata)); + const responseMeta = utils.createMetaTokenResponse( + await sessionManager.generateToken(), + ); + call.sendMetadata(responseMeta); + //Getting the vault. + const directoryMessage = call.request; + const vaultMessage = directoryMessage.getVault(); + if (vaultMessage == null) { + await genWritable.throw({ code: grpc.status.NOT_FOUND }); + return; + } + const vaultId = await utils.parseVaultInput(vaultMessage, vaultManager); + const pattern = directoryMessage.getSecretDirectory(); + const res = await vaultManager.glob(vaultId, pattern); + const dirMessage = new secretsPB.Directory(); for (const file in res) { - dirMessage.setDir(file); + dirMessage.setSecretDirectory(file); await genWritable.next(dirMessage); } await genWritable.next(null); diff --git a/src/client/utils.ts b/src/client/utils.ts index cb52cae99e..6d8d225167 100644 --- a/src/client/utils.ts +++ b/src/client/utils.ts @@ -2,12 +2,7 @@ import type { VaultId, VaultName } from '../vaults/types'; import type { Session } from '../sessions'; import type { VaultManager } from '../vaults'; import type { SessionToken } from '../sessions/types'; -import type { Path } from 'globrex'; -import fs from 'fs'; -import path from 'path'; -import globrex from 'globrex'; -import globalyzer from 'globalyzer'; import * as grpc from '@grpc/grpc-js'; import * as clientErrors from '../client/errors'; import { ErrorVaultUndefined } from '../vaults/errors'; @@ -74,75 +69,5 @@ function createMetaTokenResponse(token: SessionToken): grpc.Metadata { return meta; } -const isHidden = /(^|[\\\/])\.[^\\\/\.]/g; -let CACHE = {}; - -async function walk(filesystem: typeof fs, output: string[], prefix: string, lexer, opts, dirname='', level=0) { - const readdir = utils.promisify(filesystem.readdir).bind(filesystem); - const lstat = utils.promisify(filesystem.lstat).bind(filesystem); - - const rgx = lexer.segments[level]; - const dir = path.resolve(opts.cwd, prefix, dirname); - const files = await readdir(dir); - const { dot, filesOnly } = opts; - - let i=0, len=files.length, file; - let fullpath, relpath, stats, isMatch; - - for (; i < len; i++) { - fullpath = path.join(dir, file=files[i]); - relpath = dirname ? path.join(dirname, file) : file; - // if (!dot && isHidden.test(relpath)) continue; - isMatch = lexer.regex.test(relpath); - - if ((stats=CACHE[relpath]) === void 0) { - CACHE[relpath] = stats = await lstat(fullpath); - } - - if (!stats.isDirectory()) { - isMatch && output.push(path.relative(opts.cwd, fullpath)); - continue; - } - - if (rgx && !rgx.test(file)) continue; - !filesOnly && isMatch && output.push(path.join(prefix, relpath)); - - await walk(filesystem, output, prefix, lexer, opts, relpath, rgx && rgx.toString() !== lexer.globstar && level + 1); - } -} - -async function glob(filesystem: typeof fs, str: string, opts={ cwd: '.', absolute: true, filesOnly: false, flush: true }) { - const stat = utils.promisify(filesystem.stat).bind(filesystem); - - if (!str) return []; - - let glob = globalyzer(str); - - opts.cwd = opts.cwd || '.'; - - if (!glob.isGlob) { - try { - let resolved = path.resolve(opts.cwd, str); - let dirent = await stat(resolved); - if (opts.filesOnly && !dirent.isFile()) return []; - - return opts.absolute ? [resolved] : [str]; - } catch (err) { - if (err.code != 'ENOENT') throw err; - - return []; - } - } - - if (opts.flush) CACHE = {}; - - let matches = []; - const res = globrex(glob.glob, { filepath:true, globstar:true, extended:true }); - const globPath = res.path; - - await walk(filesystem, matches, glob.base, globPath, opts, '.', 0); - - return opts.absolute ? matches.map(x => path.resolve(opts.cwd, x)) : matches; -} export { parseVaultInput, getToken, refreshSession, createMetaTokenResponse }; diff --git a/src/git/GitRequest.ts b/src/git/GitRequest.ts deleted file mode 100644 index 14f304d664..0000000000 --- a/src/git/GitRequest.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Responsible for converting HTTP messages from isomorphic-git into requests and sending them to a specific node. - */ - -class GitRequest { - private requestInfo: ( - vaultNameOrId: string, - ) => AsyncIterableIterator; - private requestPack: ( - vaultNameOrId: string, - body: any, - ) => AsyncIterableIterator; - private requestVaultNames: () => Promise; - - constructor( - requestInfo: (vaultNameOrId: string) => AsyncIterableIterator, - requestPack: ( - vaultNameOrId: string, - body: Buffer, - ) => AsyncIterableIterator, - requestVaultNames: () => Promise, - ) { - this.requestInfo = requestInfo; - this.requestPack = requestPack; - this.requestVaultNames = requestVaultNames; - } - - /** - * The custom http request method to feed into isomorphic-git's [custom http object](https://isomorphic-git.org/docs/en/http) - * In the future this will need to be changed in order to handle the receive-pack command from isomorphic-git. This will be - * in the url passed into the request function and is needed for push functionality - */ - public async request({ - url, - method = 'GET', - headers = {}, - body = Buffer.from(''), - }) { - const u = new URL(url); - - // Parse request - if (method === 'GET') { - const match = u.pathname.match(/\/(.+)\/info\/refs$/); - if (!match || /\.\./.test(match[1])) { - throw new Error('Error'); - } - - const vaultNameOrId = match![1]; - const infoResponse = this.requestInfo(vaultNameOrId); - - return { - url: url, - method: method, - body: infoResponse, - headers: headers, - statusCode: 200, - statusMessage: 'OK', - }; - } else if (method === 'POST') { - const match = u.pathname.match(/\/(.+)\/git-(.+)/); - if (!match || /\.\./.test(match[1])) { - throw new Error('Error'); - } - - const vaultNameOrId = match![1]; - - const packResponse = this.requestPack(vaultNameOrId, body[0]); - - return { - url: url, - method: method, - body: packResponse, - headers: headers, - statusCode: 200, - statusMessage: 'OK', - }; - } else { - throw new Error('Method not supported'); - } - } - - public async scanVaults() { - return await this.requestVaultNames(); - } -} - -export default GitRequest; diff --git a/src/git/index.ts b/src/git/index.ts index dae0d1ba12..0060192136 100644 --- a/src/git/index.ts +++ b/src/git/index.ts @@ -1,4 +1,3 @@ -export { default as GitRequest } from './GitRequest'; export * as utils from './utils'; export * as types from './types'; export * as errors from './errors'; diff --git a/src/proto/js/Client_grpc_pb.d.ts b/src/proto/js/Client_grpc_pb.d.ts deleted file mode 100644 index 1f0a4e45b0..0000000000 --- a/src/proto/js/Client_grpc_pb.d.ts +++ /dev/null @@ -1,722 +0,0 @@ -// package: clientInterface -// file: Client.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as grpc from "@grpc/grpc-js"; -import {handleClientStreamingCall} from "@grpc/grpc-js/build/src/server-call"; -import * as Client_pb from "./Client_pb"; - -interface IClientService extends grpc.ServiceDefinition { - echo: IClientService_IEcho; - agentStop: IClientService_IAgentStop; - nodesList: IClientService_INodesList; - keysRootKeyPair: IClientService_IKeysRootKeyPair; - keysResetKeyPair: IClientService_IKeysResetKeyPair; - keysRenewKeyPair: IClientService_IKeysRenewKeyPair; - keysEncrypt: IClientService_IKeysEncrypt; - keysDecrypt: IClientService_IKeysDecrypt; - keysSign: IClientService_IKeysSign; - keysVerify: IClientService_IKeysVerify; - keysChangePassword: IClientService_IKeysChangePassword; - certsGet: IClientService_ICertsGet; - certsChainGet: IClientService_ICertsChainGet; - vaultsList: IClientService_IVaultsList; - vaultsCreate: IClientService_IVaultsCreate; - vaultsRename: IClientService_IVaultsRename; - vaultsDelete: IClientService_IVaultsDelete; - vaultsListSecrets: IClientService_IVaultsListSecrets; - vaultsMkdir: IClientService_IVaultsMkdir; - vaultsStat: IClientService_IVaultsStat; - vaultsPull: IClientService_IVaultsPull; - vaultsScan: IClientService_IVaultsScan; - vaultsDeleteSecret: IClientService_IVaultsDeleteSecret; - vaultsEditSecret: IClientService_IVaultsEditSecret; - vaultsGetSecret: IClientService_IVaultsGetSecret; - vaultsRenameSecret: IClientService_IVaultsRenameSecret; - vaultsNewSecret: IClientService_IVaultsNewSecret; - vaultsNewDirSecret: IClientService_IVaultsNewDirSecret; - vaultsShare: IClientService_IVaultsShare; - vaultsPermissions: IClientService_IVaultsPermissions; - secretsEnv: IClientService_ISecretsEnv; - identitiesAuthenticate: IClientService_IIdentitiesAuthenticate; - tokensPut: IClientService_ITokensPut; - tokensGet: IClientService_ITokensGet; - tokensDelete: IClientService_ITokensDelete; - providersGet: IClientService_IProvidersGet; - gestaltsGetNode: IClientService_IGestaltsGetNode; - gestaltsGetIdentity: IClientService_IGestaltsGetIdentity; - gestaltsList: IClientService_IGestaltsList; - gestaltsSetNode: IClientService_IGestaltsSetNode; - gestaltsSetIdentity: IClientService_IGestaltsSetIdentity; - gestaltSync: IClientService_IGestaltSync; -} - -interface IClientService_IEcho extends grpc.MethodDefinition { - path: "/clientInterface.Client/Echo"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IAgentStop extends grpc.MethodDefinition { - path: "/clientInterface.Client/AgentStop"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_INodesList extends grpc.MethodDefinition { - path: "/clientInterface.Client/NodesList"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysRootKeyPair extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysRootKeyPair"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysResetKeyPair extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysResetKeyPair"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysRenewKeyPair extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysRenewKeyPair"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysEncrypt extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysEncrypt"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysDecrypt extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysDecrypt"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysSign extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysSign"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysVerify extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysVerify"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IKeysChangePassword extends grpc.MethodDefinition { - path: "/clientInterface.Client/KeysChangePassword"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ICertsGet extends grpc.MethodDefinition { - path: "/clientInterface.Client/CertsGet"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ICertsChainGet extends grpc.MethodDefinition { - path: "/clientInterface.Client/CertsChainGet"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsList extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsList"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsCreate extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsCreate"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsRename extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsRename"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsDelete extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsDelete"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsListSecrets extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsListSecrets"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsMkdir extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsMkdir"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsStat extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsStat"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsPull extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsPull"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsScan extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsScan"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsDeleteSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsDeleteSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsEditSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsEditSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsGetSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsGetSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsRenameSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsRenameSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsNewSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsNewSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsNewDirSecret extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsNewDirSecret"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsShare extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsShare"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IVaultsPermissions extends grpc.MethodDefinition { - path: "/clientInterface.Client/VaultsPermissions"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ISecretsEnv extends grpc.MethodDefinition { - path: "/clientInterface.Client/SecretsEnv"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IIdentitiesAuthenticate extends grpc.MethodDefinition { - path: "/clientInterface.Client/IdentitiesAuthenticate"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ITokensPut extends grpc.MethodDefinition { - path: "/clientInterface.Client/TokensPut"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ITokensGet extends grpc.MethodDefinition { - path: "/clientInterface.Client/TokensGet"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_ITokensDelete extends grpc.MethodDefinition { - path: "/clientInterface.Client/TokensDelete"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IProvidersGet extends grpc.MethodDefinition { - path: "/clientInterface.Client/ProvidersGet"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltsGetNode extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltsGetNode"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltsGetIdentity extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltsGetIdentity"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltsList extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltsList"; - requestStream: false; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltsSetNode extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltsSetNode"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltsSetIdentity extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltsSetIdentity"; - requestStream: false; - responseStream: false; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} -interface IClientService_IGestaltSync extends grpc.MethodDefinition { - path: "/clientInterface.Client/GestaltSync"; - requestStream: true; - responseStream: true; - requestSerialize: grpc.serialize; - requestDeserialize: grpc.deserialize; - responseSerialize: grpc.serialize; - responseDeserialize: grpc.deserialize; -} - -export const ClientService: IClientService; - -export interface IClientServer extends grpc.UntypedServiceImplementation { - echo: grpc.handleUnaryCall; - agentStop: grpc.handleUnaryCall; - nodesList: grpc.handleServerStreamingCall; - keysRootKeyPair: grpc.handleUnaryCall; - keysResetKeyPair: grpc.handleUnaryCall; - keysRenewKeyPair: grpc.handleUnaryCall; - keysEncrypt: grpc.handleUnaryCall; - keysDecrypt: grpc.handleUnaryCall; - keysSign: grpc.handleUnaryCall; - keysVerify: grpc.handleUnaryCall; - keysChangePassword: grpc.handleUnaryCall; - certsGet: grpc.handleUnaryCall; - certsChainGet: grpc.handleServerStreamingCall; - vaultsList: grpc.handleServerStreamingCall; - vaultsCreate: grpc.handleUnaryCall; - vaultsRename: grpc.handleUnaryCall; - vaultsDelete: grpc.handleUnaryCall; - vaultsListSecrets: grpc.handleServerStreamingCall; - vaultsMkdir: grpc.handleUnaryCall; - vaultsStat: grpc.handleUnaryCall; - vaultsPull: grpc.handleUnaryCall; - vaultsScan: grpc.handleServerStreamingCall; - vaultsDeleteSecret: grpc.handleUnaryCall; - vaultsEditSecret: grpc.handleUnaryCall; - vaultsGetSecret: grpc.handleUnaryCall; - vaultsRenameSecret: grpc.handleUnaryCall; - vaultsNewSecret: grpc.handleUnaryCall; - vaultsNewDirSecret: grpc.handleUnaryCall; - vaultsShare: grpc.handleUnaryCall; - vaultsPermissions: grpc.handleServerStreamingCall; - secretsEnv: grpc.handleServerStreamingCall; - identitiesAuthenticate: grpc.handleUnaryCall; - tokensPut: grpc.handleUnaryCall; - tokensGet: grpc.handleUnaryCall; - tokensDelete: grpc.handleUnaryCall; - providersGet: grpc.handleUnaryCall; - gestaltsGetNode: grpc.handleUnaryCall; - gestaltsGetIdentity: grpc.handleUnaryCall; - gestaltsList: grpc.handleServerStreamingCall; - gestaltsSetNode: grpc.handleUnaryCall; - gestaltsSetIdentity: grpc.handleUnaryCall; - gestaltSync: grpc.handleBidiStreamingCall; -} - -export interface IClientClient { - echo(request: Client_pb.EchoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - echo(request: Client_pb.EchoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - echo(request: Client_pb.EchoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - agentStop(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - agentStop(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - agentStop(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - nodesList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - nodesList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - keysRootKeyPair(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - keysRootKeyPair(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - keysRootKeyPair(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - keysResetKeyPair(request: Client_pb.KeyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysResetKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysResetKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysRenewKeyPair(request: Client_pb.KeyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysRenewKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysRenewKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysEncrypt(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysEncrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysEncrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysDecrypt(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysDecrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysDecrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysSign(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysSign(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysSign(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - keysVerify(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - keysVerify(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - keysVerify(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - keysChangePassword(request: Client_pb.PasswordMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysChangePassword(request: Client_pb.PasswordMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - keysChangePassword(request: Client_pb.PasswordMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - certsGet(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - certsGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - certsGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - certsChainGet(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - certsChainGet(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - vaultsList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - vaultsList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - vaultsCreate(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsCreate(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsCreate(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsRename(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsRename(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsRename(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsDelete(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsDelete(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsDelete(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsListSecrets(request: Client_pb.VaultMessage, options?: Partial): grpc.ClientReadableStream; - vaultsListSecrets(request: Client_pb.VaultMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - vaultsMkdir(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsMkdir(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsMkdir(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsStat(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - vaultsStat(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - vaultsStat(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - vaultsPull(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsPull(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsPull(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsScan(request: Client_pb.NodeMessage, options?: Partial): grpc.ClientReadableStream; - vaultsScan(request: Client_pb.NodeMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsEditSecret(request: Client_pb.SecretSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsEditSecret(request: Client_pb.SecretSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsEditSecret(request: Client_pb.SecretSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsGetSecret(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - vaultsGetSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - vaultsGetSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - vaultsRenameSecret(request: Client_pb.SecretRenameMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsRenameSecret(request: Client_pb.SecretRenameMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsRenameSecret(request: Client_pb.SecretRenameMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsNewSecret(request: Client_pb.SecretNewMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsNewSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsNewSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - vaultsNewDirSecret(request: Client_pb.SecretNewMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsNewDirSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsNewDirSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsShare(request: Client_pb.ShareMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsShare(request: Client_pb.ShareMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsShare(request: Client_pb.ShareMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - vaultsPermissions(request: Client_pb.ShareMessage, options?: Partial): grpc.ClientReadableStream; - vaultsPermissions(request: Client_pb.ShareMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - secretsEnv(request: Client_pb.VaultMessage, options?: Partial): grpc.ClientReadableStream; - secretsEnv(request: Client_pb.VaultMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - identitiesAuthenticate(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - identitiesAuthenticate(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - identitiesAuthenticate(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - tokensPut(request: Client_pb.TokenSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - tokensPut(request: Client_pb.TokenSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - tokensPut(request: Client_pb.TokenSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - tokensGet(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - tokensGet(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - tokensGet(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - tokensDelete(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - tokensDelete(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - tokensDelete(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - providersGet(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - providersGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - providersGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - gestaltsGetNode(request: Client_pb.GestaltMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsGetNode(request: Client_pb.GestaltMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsGetNode(request: Client_pb.GestaltMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsGetIdentity(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsGetIdentity(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsGetIdentity(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - gestaltsList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - gestaltsList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - gestaltsSetNode(request: Client_pb.GestaltTrustMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltsSetNode(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltsSetNode(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - gestaltSync(): grpc.ClientDuplexStream; - gestaltSync(options: Partial): grpc.ClientDuplexStream; - gestaltSync(metadata: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; -} - -export class ClientClient extends grpc.Client implements IClientClient { - constructor(address: string, credentials: grpc.ChannelCredentials, options?: Partial); - public echo(request: Client_pb.EchoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - public echo(request: Client_pb.EchoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - public echo(request: Client_pb.EchoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EchoMessage) => void): grpc.ClientUnaryCall; - public agentStop(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public agentStop(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public agentStop(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public nodesList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - public nodesList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public keysRootKeyPair(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - public keysRootKeyPair(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - public keysRootKeyPair(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.KeyPairMessage) => void): grpc.ClientUnaryCall; - public keysResetKeyPair(request: Client_pb.KeyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysResetKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysResetKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysRenewKeyPair(request: Client_pb.KeyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysRenewKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysRenewKeyPair(request: Client_pb.KeyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysEncrypt(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysEncrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysEncrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysDecrypt(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysDecrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysDecrypt(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysSign(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysSign(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysSign(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CryptoMessage) => void): grpc.ClientUnaryCall; - public keysVerify(request: Client_pb.CryptoMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public keysVerify(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public keysVerify(request: Client_pb.CryptoMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public keysChangePassword(request: Client_pb.PasswordMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysChangePassword(request: Client_pb.PasswordMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public keysChangePassword(request: Client_pb.PasswordMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public certsGet(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - public certsGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - public certsGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.CertificateMessage) => void): grpc.ClientUnaryCall; - public certsChainGet(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - public certsChainGet(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public vaultsList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - public vaultsList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public vaultsCreate(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsCreate(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsCreate(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsRename(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsRename(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsRename(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsDelete(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsDelete(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsDelete(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsListSecrets(request: Client_pb.VaultMessage, options?: Partial): grpc.ClientReadableStream; - public vaultsListSecrets(request: Client_pb.VaultMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public vaultsMkdir(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsMkdir(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsMkdir(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsStat(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - public vaultsStat(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - public vaultsStat(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatMessage) => void): grpc.ClientUnaryCall; - public vaultsPull(request: Client_pb.VaultMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsPull(request: Client_pb.VaultMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsPull(request: Client_pb.VaultMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsScan(request: Client_pb.NodeMessage, options?: Partial): grpc.ClientReadableStream; - public vaultsScan(request: Client_pb.NodeMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsDeleteSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsEditSecret(request: Client_pb.SecretSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsEditSecret(request: Client_pb.SecretSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsEditSecret(request: Client_pb.SecretSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsGetSecret(request: Client_pb.VaultSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - public vaultsGetSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - public vaultsGetSecret(request: Client_pb.VaultSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.SecretMessage) => void): grpc.ClientUnaryCall; - public vaultsRenameSecret(request: Client_pb.SecretRenameMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsRenameSecret(request: Client_pb.SecretRenameMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsRenameSecret(request: Client_pb.SecretRenameMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsNewSecret(request: Client_pb.SecretNewMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsNewSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsNewSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.StatusMessage) => void): grpc.ClientUnaryCall; - public vaultsNewDirSecret(request: Client_pb.SecretNewMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsNewDirSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsNewDirSecret(request: Client_pb.SecretNewMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsShare(request: Client_pb.ShareMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsShare(request: Client_pb.ShareMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsShare(request: Client_pb.ShareMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public vaultsPermissions(request: Client_pb.ShareMessage, options?: Partial): grpc.ClientReadableStream; - public vaultsPermissions(request: Client_pb.ShareMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public secretsEnv(request: Client_pb.VaultMessage, options?: Partial): grpc.ClientReadableStream; - public secretsEnv(request: Client_pb.VaultMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public identitiesAuthenticate(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public identitiesAuthenticate(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public identitiesAuthenticate(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public tokensPut(request: Client_pb.TokenSpecificMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public tokensPut(request: Client_pb.TokenSpecificMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public tokensPut(request: Client_pb.TokenSpecificMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public tokensGet(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - public tokensGet(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - public tokensGet(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.TokenMessage) => void): grpc.ClientUnaryCall; - public tokensDelete(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public tokensDelete(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public tokensDelete(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public providersGet(request: Client_pb.EmptyMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public providersGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public providersGet(request: Client_pb.EmptyMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.ProviderMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetNode(request: Client_pb.GestaltMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetNode(request: Client_pb.GestaltMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetNode(request: Client_pb.GestaltMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetIdentity(request: Client_pb.ProviderMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetIdentity(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsGetIdentity(request: Client_pb.ProviderMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.GestaltMessage) => void): grpc.ClientUnaryCall; - public gestaltsList(request: Client_pb.EmptyMessage, options?: Partial): grpc.ClientReadableStream; - public gestaltsList(request: Client_pb.EmptyMessage, metadata?: grpc.Metadata, options?: Partial): grpc.ClientReadableStream; - public gestaltsSetNode(request: Client_pb.GestaltTrustMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltsSetNode(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltsSetNode(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltsSetIdentity(request: Client_pb.GestaltTrustMessage, metadata: grpc.Metadata, options: Partial, callback: (error: grpc.ServiceError | null, response: Client_pb.EmptyMessage) => void): grpc.ClientUnaryCall; - public gestaltSync(options?: Partial): grpc.ClientDuplexStream; - public gestaltSync(metadata?: grpc.Metadata, options?: Partial): grpc.ClientDuplexStream; -} diff --git a/src/proto/js/Client_grpc_pb.js b/src/proto/js/Client_grpc_pb.js deleted file mode 100644 index 537390c326..0000000000 --- a/src/proto/js/Client_grpc_pb.js +++ /dev/null @@ -1,743 +0,0 @@ -// GENERATED CODE -- DO NOT EDIT! - -'use strict'; -var grpc = require('@grpc/grpc-js'); -var Client_pb = require('./Client_pb.js'); - -function serialize_clientInterface_CertificateMessage(arg) { - if (!(arg instanceof Client_pb.CertificateMessage)) { - throw new Error('Expected argument of type clientInterface.CertificateMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_CertificateMessage(buffer_arg) { - return Client_pb.CertificateMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_CryptoMessage(arg) { - if (!(arg instanceof Client_pb.CryptoMessage)) { - throw new Error('Expected argument of type clientInterface.CryptoMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_CryptoMessage(buffer_arg) { - return Client_pb.CryptoMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_DirectoryMessage(arg) { - if (!(arg instanceof Client_pb.DirectoryMessage)) { - throw new Error('Expected argument of type clientInterface.DirectoryMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_DirectoryMessage(buffer_arg) { - return Client_pb.DirectoryMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_EchoMessage(arg) { - if (!(arg instanceof Client_pb.EchoMessage)) { - throw new Error('Expected argument of type clientInterface.EchoMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_EchoMessage(buffer_arg) { - return Client_pb.EchoMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_EmptyMessage(arg) { - if (!(arg instanceof Client_pb.EmptyMessage)) { - throw new Error('Expected argument of type clientInterface.EmptyMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_EmptyMessage(buffer_arg) { - return Client_pb.EmptyMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_GestaltMessage(arg) { - if (!(arg instanceof Client_pb.GestaltMessage)) { - throw new Error('Expected argument of type clientInterface.GestaltMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_GestaltMessage(buffer_arg) { - return Client_pb.GestaltMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_GestaltTrustMessage(arg) { - if (!(arg instanceof Client_pb.GestaltTrustMessage)) { - throw new Error('Expected argument of type clientInterface.GestaltTrustMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_GestaltTrustMessage(buffer_arg) { - return Client_pb.GestaltTrustMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_KeyMessage(arg) { - if (!(arg instanceof Client_pb.KeyMessage)) { - throw new Error('Expected argument of type clientInterface.KeyMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_KeyMessage(buffer_arg) { - return Client_pb.KeyMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_KeyPairMessage(arg) { - if (!(arg instanceof Client_pb.KeyPairMessage)) { - throw new Error('Expected argument of type clientInterface.KeyPairMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_KeyPairMessage(buffer_arg) { - return Client_pb.KeyPairMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_NodeMessage(arg) { - if (!(arg instanceof Client_pb.NodeMessage)) { - throw new Error('Expected argument of type clientInterface.NodeMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_NodeMessage(buffer_arg) { - return Client_pb.NodeMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_PasswordMessage(arg) { - if (!(arg instanceof Client_pb.PasswordMessage)) { - throw new Error('Expected argument of type clientInterface.PasswordMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_PasswordMessage(buffer_arg) { - return Client_pb.PasswordMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_PermissionMessage(arg) { - if (!(arg instanceof Client_pb.PermissionMessage)) { - throw new Error('Expected argument of type clientInterface.PermissionMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_PermissionMessage(buffer_arg) { - return Client_pb.PermissionMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_ProviderMessage(arg) { - if (!(arg instanceof Client_pb.ProviderMessage)) { - throw new Error('Expected argument of type clientInterface.ProviderMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_ProviderMessage(buffer_arg) { - return Client_pb.ProviderMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_SecretMessage(arg) { - if (!(arg instanceof Client_pb.SecretMessage)) { - throw new Error('Expected argument of type clientInterface.SecretMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_SecretMessage(buffer_arg) { - return Client_pb.SecretMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_SecretNewMessage(arg) { - if (!(arg instanceof Client_pb.SecretNewMessage)) { - throw new Error('Expected argument of type clientInterface.SecretNewMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_SecretNewMessage(buffer_arg) { - return Client_pb.SecretNewMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_SecretRenameMessage(arg) { - if (!(arg instanceof Client_pb.SecretRenameMessage)) { - throw new Error('Expected argument of type clientInterface.SecretRenameMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_SecretRenameMessage(buffer_arg) { - return Client_pb.SecretRenameMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_SecretSpecificMessage(arg) { - if (!(arg instanceof Client_pb.SecretSpecificMessage)) { - throw new Error('Expected argument of type clientInterface.SecretSpecificMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_SecretSpecificMessage(buffer_arg) { - return Client_pb.SecretSpecificMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_ShareMessage(arg) { - if (!(arg instanceof Client_pb.ShareMessage)) { - throw new Error('Expected argument of type clientInterface.ShareMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_ShareMessage(buffer_arg) { - return Client_pb.ShareMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_StatMessage(arg) { - if (!(arg instanceof Client_pb.StatMessage)) { - throw new Error('Expected argument of type clientInterface.StatMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_StatMessage(buffer_arg) { - return Client_pb.StatMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_StatusMessage(arg) { - if (!(arg instanceof Client_pb.StatusMessage)) { - throw new Error('Expected argument of type clientInterface.StatusMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_StatusMessage(buffer_arg) { - return Client_pb.StatusMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_TokenMessage(arg) { - if (!(arg instanceof Client_pb.TokenMessage)) { - throw new Error('Expected argument of type clientInterface.TokenMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_TokenMessage(buffer_arg) { - return Client_pb.TokenMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_TokenSpecificMessage(arg) { - if (!(arg instanceof Client_pb.TokenSpecificMessage)) { - throw new Error('Expected argument of type clientInterface.TokenSpecificMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_TokenSpecificMessage(buffer_arg) { - return Client_pb.TokenSpecificMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_VaultMessage(arg) { - if (!(arg instanceof Client_pb.VaultMessage)) { - throw new Error('Expected argument of type clientInterface.VaultMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_VaultMessage(buffer_arg) { - return Client_pb.VaultMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - -function serialize_clientInterface_VaultSpecificMessage(arg) { - if (!(arg instanceof Client_pb.VaultSpecificMessage)) { - throw new Error('Expected argument of type clientInterface.VaultSpecificMessage'); - } - return Buffer.from(arg.serializeBinary()); -} - -function deserialize_clientInterface_VaultSpecificMessage(buffer_arg) { - return Client_pb.VaultSpecificMessage.deserializeBinary(new Uint8Array(buffer_arg)); -} - - -var ClientService = exports.ClientService = { - echo: { - path: '/clientInterface.Client/Echo', - requestStream: false, - responseStream: false, - requestType: Client_pb.EchoMessage, - responseType: Client_pb.EchoMessage, - requestSerialize: serialize_clientInterface_EchoMessage, - requestDeserialize: deserialize_clientInterface_EchoMessage, - responseSerialize: serialize_clientInterface_EchoMessage, - responseDeserialize: deserialize_clientInterface_EchoMessage, - }, - // Agent -agentStop: { - path: '/clientInterface.Client/AgentStop', - requestStream: false, - responseStream: false, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - // Nodes -nodesList: { - path: '/clientInterface.Client/NodesList', - requestStream: false, - responseStream: true, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.NodeMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_NodeMessage, - responseDeserialize: deserialize_clientInterface_NodeMessage, - }, - // Keys -keysRootKeyPair: { - path: '/clientInterface.Client/KeysRootKeyPair', - requestStream: false, - responseStream: false, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.KeyPairMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_KeyPairMessage, - responseDeserialize: deserialize_clientInterface_KeyPairMessage, - }, - keysResetKeyPair: { - path: '/clientInterface.Client/KeysResetKeyPair', - requestStream: false, - responseStream: false, - requestType: Client_pb.KeyMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_KeyMessage, - requestDeserialize: deserialize_clientInterface_KeyMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - keysRenewKeyPair: { - path: '/clientInterface.Client/KeysRenewKeyPair', - requestStream: false, - responseStream: false, - requestType: Client_pb.KeyMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_KeyMessage, - requestDeserialize: deserialize_clientInterface_KeyMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - keysEncrypt: { - path: '/clientInterface.Client/KeysEncrypt', - requestStream: false, - responseStream: false, - requestType: Client_pb.CryptoMessage, - responseType: Client_pb.CryptoMessage, - requestSerialize: serialize_clientInterface_CryptoMessage, - requestDeserialize: deserialize_clientInterface_CryptoMessage, - responseSerialize: serialize_clientInterface_CryptoMessage, - responseDeserialize: deserialize_clientInterface_CryptoMessage, - }, - keysDecrypt: { - path: '/clientInterface.Client/KeysDecrypt', - requestStream: false, - responseStream: false, - requestType: Client_pb.CryptoMessage, - responseType: Client_pb.CryptoMessage, - requestSerialize: serialize_clientInterface_CryptoMessage, - requestDeserialize: deserialize_clientInterface_CryptoMessage, - responseSerialize: serialize_clientInterface_CryptoMessage, - responseDeserialize: deserialize_clientInterface_CryptoMessage, - }, - keysSign: { - path: '/clientInterface.Client/KeysSign', - requestStream: false, - responseStream: false, - requestType: Client_pb.CryptoMessage, - responseType: Client_pb.CryptoMessage, - requestSerialize: serialize_clientInterface_CryptoMessage, - requestDeserialize: deserialize_clientInterface_CryptoMessage, - responseSerialize: serialize_clientInterface_CryptoMessage, - responseDeserialize: deserialize_clientInterface_CryptoMessage, - }, - keysVerify: { - path: '/clientInterface.Client/KeysVerify', - requestStream: false, - responseStream: false, - requestType: Client_pb.CryptoMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_CryptoMessage, - requestDeserialize: deserialize_clientInterface_CryptoMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - keysChangePassword: { - path: '/clientInterface.Client/KeysChangePassword', - requestStream: false, - responseStream: false, - requestType: Client_pb.PasswordMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_PasswordMessage, - requestDeserialize: deserialize_clientInterface_PasswordMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - certsGet: { - path: '/clientInterface.Client/CertsGet', - requestStream: false, - responseStream: false, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.CertificateMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_CertificateMessage, - responseDeserialize: deserialize_clientInterface_CertificateMessage, - }, - certsChainGet: { - path: '/clientInterface.Client/CertsChainGet', - requestStream: false, - responseStream: true, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.CertificateMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_CertificateMessage, - responseDeserialize: deserialize_clientInterface_CertificateMessage, - }, - // Vaults -vaultsList: { - path: '/clientInterface.Client/VaultsList', - requestStream: false, - responseStream: true, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.VaultMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_VaultMessage, - responseDeserialize: deserialize_clientInterface_VaultMessage, - }, - vaultsCreate: { - path: '/clientInterface.Client/VaultsCreate', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsRename: { - path: '/clientInterface.Client/VaultsRename', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsDelete: { - path: '/clientInterface.Client/VaultsDelete', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsListSecrets: { - path: '/clientInterface.Client/VaultsListSecrets', - requestStream: false, - responseStream: true, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.SecretMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_SecretMessage, - responseDeserialize: deserialize_clientInterface_SecretMessage, - }, - vaultsMkdir: { - path: '/clientInterface.Client/VaultsMkdir', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultSpecificMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_VaultSpecificMessage, - requestDeserialize: deserialize_clientInterface_VaultSpecificMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - vaultsStat: { - path: '/clientInterface.Client/VaultsStat', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.StatMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_StatMessage, - responseDeserialize: deserialize_clientInterface_StatMessage, - }, - vaultsPull: { - path: '/clientInterface.Client/VaultsPull', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - vaultsScan: { - path: '/clientInterface.Client/VaultsScan', - requestStream: false, - responseStream: true, - requestType: Client_pb.NodeMessage, - responseType: Client_pb.VaultMessage, - requestSerialize: serialize_clientInterface_NodeMessage, - requestDeserialize: deserialize_clientInterface_NodeMessage, - responseSerialize: serialize_clientInterface_VaultMessage, - responseDeserialize: deserialize_clientInterface_VaultMessage, - }, - vaultsDeleteSecret: { - path: '/clientInterface.Client/VaultsDeleteSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultSpecificMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_VaultSpecificMessage, - requestDeserialize: deserialize_clientInterface_VaultSpecificMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsEditSecret: { - path: '/clientInterface.Client/VaultsEditSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.SecretSpecificMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_SecretSpecificMessage, - requestDeserialize: deserialize_clientInterface_SecretSpecificMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - vaultsGetSecret: { - path: '/clientInterface.Client/VaultsGetSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.VaultSpecificMessage, - responseType: Client_pb.SecretMessage, - requestSerialize: serialize_clientInterface_VaultSpecificMessage, - requestDeserialize: deserialize_clientInterface_VaultSpecificMessage, - responseSerialize: serialize_clientInterface_SecretMessage, - responseDeserialize: deserialize_clientInterface_SecretMessage, - }, - vaultsRenameSecret: { - path: '/clientInterface.Client/VaultsRenameSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.SecretRenameMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_SecretRenameMessage, - requestDeserialize: deserialize_clientInterface_SecretRenameMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsNewSecret: { - path: '/clientInterface.Client/VaultsNewSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.SecretNewMessage, - responseType: Client_pb.StatusMessage, - requestSerialize: serialize_clientInterface_SecretNewMessage, - requestDeserialize: deserialize_clientInterface_SecretNewMessage, - responseSerialize: serialize_clientInterface_StatusMessage, - responseDeserialize: deserialize_clientInterface_StatusMessage, - }, - vaultsNewDirSecret: { - path: '/clientInterface.Client/VaultsNewDirSecret', - requestStream: false, - responseStream: false, - requestType: Client_pb.SecretNewMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_SecretNewMessage, - requestDeserialize: deserialize_clientInterface_SecretNewMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - vaultsShare: { - path: '/clientInterface.Client/VaultsShare', - requestStream: false, - responseStream: false, - requestType: Client_pb.ShareMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_ShareMessage, - requestDeserialize: deserialize_clientInterface_ShareMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - vaultsPermissions: { - path: '/clientInterface.Client/VaultsPermissions', - requestStream: false, - responseStream: true, - requestType: Client_pb.ShareMessage, - responseType: Client_pb.PermissionMessage, - requestSerialize: serialize_clientInterface_ShareMessage, - requestDeserialize: deserialize_clientInterface_ShareMessage, - responseSerialize: serialize_clientInterface_PermissionMessage, - responseDeserialize: deserialize_clientInterface_PermissionMessage, - }, - secretsEnv: { - path: '/clientInterface.Client/SecretsEnv', - requestStream: false, - responseStream: true, - requestType: Client_pb.VaultMessage, - responseType: Client_pb.DirectoryMessage, - requestSerialize: serialize_clientInterface_VaultMessage, - requestDeserialize: deserialize_clientInterface_VaultMessage, - responseSerialize: serialize_clientInterface_DirectoryMessage, - responseDeserialize: deserialize_clientInterface_DirectoryMessage, - }, - // Identities -identitiesAuthenticate: { - path: '/clientInterface.Client/IdentitiesAuthenticate', - requestStream: false, - responseStream: false, - requestType: Client_pb.ProviderMessage, - responseType: Client_pb.ProviderMessage, - requestSerialize: serialize_clientInterface_ProviderMessage, - requestDeserialize: deserialize_clientInterface_ProviderMessage, - responseSerialize: serialize_clientInterface_ProviderMessage, - responseDeserialize: deserialize_clientInterface_ProviderMessage, - }, - tokensPut: { - path: '/clientInterface.Client/TokensPut', - requestStream: false, - responseStream: false, - requestType: Client_pb.TokenSpecificMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_TokenSpecificMessage, - requestDeserialize: deserialize_clientInterface_TokenSpecificMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - tokensGet: { - path: '/clientInterface.Client/TokensGet', - requestStream: false, - responseStream: false, - requestType: Client_pb.ProviderMessage, - responseType: Client_pb.TokenMessage, - requestSerialize: serialize_clientInterface_ProviderMessage, - requestDeserialize: deserialize_clientInterface_ProviderMessage, - responseSerialize: serialize_clientInterface_TokenMessage, - responseDeserialize: deserialize_clientInterface_TokenMessage, - }, - tokensDelete: { - path: '/clientInterface.Client/TokensDelete', - requestStream: false, - responseStream: false, - requestType: Client_pb.ProviderMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_ProviderMessage, - requestDeserialize: deserialize_clientInterface_ProviderMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - providersGet: { - path: '/clientInterface.Client/ProvidersGet', - requestStream: false, - responseStream: false, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.ProviderMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_ProviderMessage, - responseDeserialize: deserialize_clientInterface_ProviderMessage, - }, - // Gestalts -gestaltsGetNode: { - path: '/clientInterface.Client/GestaltsGetNode', - requestStream: false, - responseStream: false, - requestType: Client_pb.GestaltMessage, - responseType: Client_pb.GestaltMessage, - requestSerialize: serialize_clientInterface_GestaltMessage, - requestDeserialize: deserialize_clientInterface_GestaltMessage, - responseSerialize: serialize_clientInterface_GestaltMessage, - responseDeserialize: deserialize_clientInterface_GestaltMessage, - }, - gestaltsGetIdentity: { - path: '/clientInterface.Client/GestaltsGetIdentity', - requestStream: false, - responseStream: false, - requestType: Client_pb.ProviderMessage, - responseType: Client_pb.GestaltMessage, - requestSerialize: serialize_clientInterface_ProviderMessage, - requestDeserialize: deserialize_clientInterface_ProviderMessage, - responseSerialize: serialize_clientInterface_GestaltMessage, - responseDeserialize: deserialize_clientInterface_GestaltMessage, - }, - gestaltsList: { - path: '/clientInterface.Client/GestaltsList', - requestStream: false, - responseStream: true, - requestType: Client_pb.EmptyMessage, - responseType: Client_pb.GestaltMessage, - requestSerialize: serialize_clientInterface_EmptyMessage, - requestDeserialize: deserialize_clientInterface_EmptyMessage, - responseSerialize: serialize_clientInterface_GestaltMessage, - responseDeserialize: deserialize_clientInterface_GestaltMessage, - }, - gestaltsSetNode: { - path: '/clientInterface.Client/GestaltsSetNode', - requestStream: false, - responseStream: false, - requestType: Client_pb.GestaltTrustMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_GestaltTrustMessage, - requestDeserialize: deserialize_clientInterface_GestaltTrustMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - gestaltsSetIdentity: { - path: '/clientInterface.Client/GestaltsSetIdentity', - requestStream: false, - responseStream: false, - requestType: Client_pb.GestaltTrustMessage, - responseType: Client_pb.EmptyMessage, - requestSerialize: serialize_clientInterface_GestaltTrustMessage, - requestDeserialize: deserialize_clientInterface_GestaltTrustMessage, - responseSerialize: serialize_clientInterface_EmptyMessage, - responseDeserialize: deserialize_clientInterface_EmptyMessage, - }, - gestaltSync: { - path: '/clientInterface.Client/GestaltSync', - requestStream: true, - responseStream: true, - requestType: Client_pb.GestaltMessage, - responseType: Client_pb.GestaltMessage, - requestSerialize: serialize_clientInterface_GestaltMessage, - requestDeserialize: deserialize_clientInterface_GestaltMessage, - responseSerialize: serialize_clientInterface_GestaltMessage, - responseDeserialize: deserialize_clientInterface_GestaltMessage, - }, -}; - -exports.ClientClient = grpc.makeGenericClientConstructor(ClientService); diff --git a/src/proto/js/Client_pb.d.ts b/src/proto/js/Client_pb.d.ts deleted file mode 100644 index cf6a908914..0000000000 --- a/src/proto/js/Client_pb.d.ts +++ /dev/null @@ -1,556 +0,0 @@ -// package: clientInterface -// file: Client.proto - -/* tslint:disable */ -/* eslint-disable */ - -import * as jspb from "google-protobuf"; - -export class EmptyMessage extends jspb.Message { - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EmptyMessage.AsObject; - static toObject(includeInstance: boolean, msg: EmptyMessage): EmptyMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EmptyMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EmptyMessage; - static deserializeBinaryFromReader(message: EmptyMessage, reader: jspb.BinaryReader): EmptyMessage; -} - -export namespace EmptyMessage { - export type AsObject = { - } -} - -export class StatusMessage extends jspb.Message { - getSuccess(): boolean; - setSuccess(value: boolean): StatusMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StatusMessage.AsObject; - static toObject(includeInstance: boolean, msg: StatusMessage): StatusMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StatusMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StatusMessage; - static deserializeBinaryFromReader(message: StatusMessage, reader: jspb.BinaryReader): StatusMessage; -} - -export namespace StatusMessage { - export type AsObject = { - success: boolean, - } -} - -export class EchoMessage extends jspb.Message { - getChallenge(): string; - setChallenge(value: string): EchoMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): EchoMessage.AsObject; - static toObject(includeInstance: boolean, msg: EchoMessage): EchoMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: EchoMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): EchoMessage; - static deserializeBinaryFromReader(message: EchoMessage, reader: jspb.BinaryReader): EchoMessage; -} - -export namespace EchoMessage { - export type AsObject = { - challenge: string, - } -} - -export class VaultMessage extends jspb.Message { - getName(): string; - setName(value: string): VaultMessage; - getId(): string; - setId(value: string): VaultMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): VaultMessage.AsObject; - static toObject(includeInstance: boolean, msg: VaultMessage): VaultMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: VaultMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): VaultMessage; - static deserializeBinaryFromReader(message: VaultMessage, reader: jspb.BinaryReader): VaultMessage; -} - -export namespace VaultMessage { - export type AsObject = { - name: string, - id: string, - } -} - -export class VaultSpecificMessage extends jspb.Message { - - hasVault(): boolean; - clearVault(): void; - getVault(): VaultMessage | undefined; - setVault(value?: VaultMessage): VaultSpecificMessage; - getName(): string; - setName(value: string): VaultSpecificMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): VaultSpecificMessage.AsObject; - static toObject(includeInstance: boolean, msg: VaultSpecificMessage): VaultSpecificMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: VaultSpecificMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): VaultSpecificMessage; - static deserializeBinaryFromReader(message: VaultSpecificMessage, reader: jspb.BinaryReader): VaultSpecificMessage; -} - -export namespace VaultSpecificMessage { - export type AsObject = { - vault?: VaultMessage.AsObject, - name: string, - } -} - -export class SecretSpecificMessage extends jspb.Message { - - hasVault(): boolean; - clearVault(): void; - getVault(): VaultSpecificMessage | undefined; - setVault(value?: VaultSpecificMessage): SecretSpecificMessage; - getContent(): string; - setContent(value: string): SecretSpecificMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecretSpecificMessage.AsObject; - static toObject(includeInstance: boolean, msg: SecretSpecificMessage): SecretSpecificMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecretSpecificMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecretSpecificMessage; - static deserializeBinaryFromReader(message: SecretSpecificMessage, reader: jspb.BinaryReader): SecretSpecificMessage; -} - -export namespace SecretSpecificMessage { - export type AsObject = { - vault?: VaultSpecificMessage.AsObject, - content: string, - } -} - -export class SecretRenameMessage extends jspb.Message { - - hasVault(): boolean; - clearVault(): void; - getVault(): VaultMessage | undefined; - setVault(value?: VaultMessage): SecretRenameMessage; - - hasOldname(): boolean; - clearOldname(): void; - getOldname(): SecretMessage | undefined; - setOldname(value?: SecretMessage): SecretRenameMessage; - - hasNewname(): boolean; - clearNewname(): void; - getNewname(): SecretMessage | undefined; - setNewname(value?: SecretMessage): SecretRenameMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecretRenameMessage.AsObject; - static toObject(includeInstance: boolean, msg: SecretRenameMessage): SecretRenameMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecretRenameMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecretRenameMessage; - static deserializeBinaryFromReader(message: SecretRenameMessage, reader: jspb.BinaryReader): SecretRenameMessage; -} - -export namespace SecretRenameMessage { - export type AsObject = { - vault?: VaultMessage.AsObject, - oldname?: SecretMessage.AsObject, - newname?: SecretMessage.AsObject, - } -} - -export class SecretNewMessage extends jspb.Message { - - hasVault(): boolean; - clearVault(): void; - getVault(): VaultMessage | undefined; - setVault(value?: VaultMessage): SecretNewMessage; - getName(): string; - setName(value: string): SecretNewMessage; - getContent(): string; - setContent(value: string): SecretNewMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecretNewMessage.AsObject; - static toObject(includeInstance: boolean, msg: SecretNewMessage): SecretNewMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecretNewMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecretNewMessage; - static deserializeBinaryFromReader(message: SecretNewMessage, reader: jspb.BinaryReader): SecretNewMessage; -} - -export namespace SecretNewMessage { - export type AsObject = { - vault?: VaultMessage.AsObject, - name: string, - content: string, - } -} - -export class SecretMessage extends jspb.Message { - getName(): string; - setName(value: string): SecretMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): SecretMessage.AsObject; - static toObject(includeInstance: boolean, msg: SecretMessage): SecretMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: SecretMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): SecretMessage; - static deserializeBinaryFromReader(message: SecretMessage, reader: jspb.BinaryReader): SecretMessage; -} - -export namespace SecretMessage { - export type AsObject = { - name: string, - } -} - -export class StatMessage extends jspb.Message { - getStats(): string; - setStats(value: string): StatMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): StatMessage.AsObject; - static toObject(includeInstance: boolean, msg: StatMessage): StatMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: StatMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): StatMessage; - static deserializeBinaryFromReader(message: StatMessage, reader: jspb.BinaryReader): StatMessage; -} - -export namespace StatMessage { - export type AsObject = { - stats: string, - } -} - -export class ShareMessage extends jspb.Message { - getName(): string; - setName(value: string): ShareMessage; - getId(): string; - setId(value: string): ShareMessage; - getSet(): boolean; - setSet(value: boolean): ShareMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ShareMessage.AsObject; - static toObject(includeInstance: boolean, msg: ShareMessage): ShareMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ShareMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ShareMessage; - static deserializeBinaryFromReader(message: ShareMessage, reader: jspb.BinaryReader): ShareMessage; -} - -export namespace ShareMessage { - export type AsObject = { - name: string, - id: string, - set: boolean, - } -} - -export class PermissionMessage extends jspb.Message { - getId(): string; - setId(value: string): PermissionMessage; - getAction(): string; - setAction(value: string): PermissionMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PermissionMessage.AsObject; - static toObject(includeInstance: boolean, msg: PermissionMessage): PermissionMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PermissionMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PermissionMessage; - static deserializeBinaryFromReader(message: PermissionMessage, reader: jspb.BinaryReader): PermissionMessage; -} - -export namespace PermissionMessage { - export type AsObject = { - id: string, - action: string, - } -} - -export class DirectoryMessage extends jspb.Message { - getDir(): string; - setDir(value: string): DirectoryMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): DirectoryMessage.AsObject; - static toObject(includeInstance: boolean, msg: DirectoryMessage): DirectoryMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: DirectoryMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): DirectoryMessage; - static deserializeBinaryFromReader(message: DirectoryMessage, reader: jspb.BinaryReader): DirectoryMessage; -} - -export namespace DirectoryMessage { - export type AsObject = { - dir: string, - } -} - -export class NodeMessage extends jspb.Message { - getName(): string; - setName(value: string): NodeMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): NodeMessage.AsObject; - static toObject(includeInstance: boolean, msg: NodeMessage): NodeMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: NodeMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): NodeMessage; - static deserializeBinaryFromReader(message: NodeMessage, reader: jspb.BinaryReader): NodeMessage; -} - -export namespace NodeMessage { - export type AsObject = { - name: string, - } -} - -export class CryptoMessage extends jspb.Message { - getData(): string; - setData(value: string): CryptoMessage; - getSignature(): string; - setSignature(value: string): CryptoMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CryptoMessage.AsObject; - static toObject(includeInstance: boolean, msg: CryptoMessage): CryptoMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CryptoMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CryptoMessage; - static deserializeBinaryFromReader(message: CryptoMessage, reader: jspb.BinaryReader): CryptoMessage; -} - -export namespace CryptoMessage { - export type AsObject = { - data: string, - signature: string, - } -} - -export class KeyMessage extends jspb.Message { - getName(): string; - setName(value: string): KeyMessage; - getKey(): string; - setKey(value: string): KeyMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): KeyMessage.AsObject; - static toObject(includeInstance: boolean, msg: KeyMessage): KeyMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: KeyMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): KeyMessage; - static deserializeBinaryFromReader(message: KeyMessage, reader: jspb.BinaryReader): KeyMessage; -} - -export namespace KeyMessage { - export type AsObject = { - name: string, - key: string, - } -} - -export class KeyPairMessage extends jspb.Message { - getPublic(): string; - setPublic(value: string): KeyPairMessage; - getPrivate(): string; - setPrivate(value: string): KeyPairMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): KeyPairMessage.AsObject; - static toObject(includeInstance: boolean, msg: KeyPairMessage): KeyPairMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: KeyPairMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): KeyPairMessage; - static deserializeBinaryFromReader(message: KeyPairMessage, reader: jspb.BinaryReader): KeyPairMessage; -} - -export namespace KeyPairMessage { - export type AsObject = { - pb_public: string, - pb_private: string, - } -} - -export class CertificateMessage extends jspb.Message { - getCert(): string; - setCert(value: string): CertificateMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): CertificateMessage.AsObject; - static toObject(includeInstance: boolean, msg: CertificateMessage): CertificateMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: CertificateMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): CertificateMessage; - static deserializeBinaryFromReader(message: CertificateMessage, reader: jspb.BinaryReader): CertificateMessage; -} - -export namespace CertificateMessage { - export type AsObject = { - cert: string, - } -} - -export class PasswordMessage extends jspb.Message { - getPassword(): string; - setPassword(value: string): PasswordMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): PasswordMessage.AsObject; - static toObject(includeInstance: boolean, msg: PasswordMessage): PasswordMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: PasswordMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): PasswordMessage; - static deserializeBinaryFromReader(message: PasswordMessage, reader: jspb.BinaryReader): PasswordMessage; -} - -export namespace PasswordMessage { - export type AsObject = { - password: string, - } -} - -export class ProviderMessage extends jspb.Message { - getId(): string; - setId(value: string): ProviderMessage; - getMessage(): string; - setMessage(value: string): ProviderMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): ProviderMessage.AsObject; - static toObject(includeInstance: boolean, msg: ProviderMessage): ProviderMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: ProviderMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): ProviderMessage; - static deserializeBinaryFromReader(message: ProviderMessage, reader: jspb.BinaryReader): ProviderMessage; -} - -export namespace ProviderMessage { - export type AsObject = { - id: string, - message: string, - } -} - -export class TokenSpecificMessage extends jspb.Message { - - hasProvider(): boolean; - clearProvider(): void; - getProvider(): ProviderMessage | undefined; - setProvider(value?: ProviderMessage): TokenSpecificMessage; - getToken(): string; - setToken(value: string): TokenSpecificMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TokenSpecificMessage.AsObject; - static toObject(includeInstance: boolean, msg: TokenSpecificMessage): TokenSpecificMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TokenSpecificMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TokenSpecificMessage; - static deserializeBinaryFromReader(message: TokenSpecificMessage, reader: jspb.BinaryReader): TokenSpecificMessage; -} - -export namespace TokenSpecificMessage { - export type AsObject = { - provider?: ProviderMessage.AsObject, - token: string, - } -} - -export class TokenMessage extends jspb.Message { - getToken(): string; - setToken(value: string): TokenMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): TokenMessage.AsObject; - static toObject(includeInstance: boolean, msg: TokenMessage): TokenMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: TokenMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): TokenMessage; - static deserializeBinaryFromReader(message: TokenMessage, reader: jspb.BinaryReader): TokenMessage; -} - -export namespace TokenMessage { - export type AsObject = { - token: string, - } -} - -export class GestaltMessage extends jspb.Message { - getName(): string; - setName(value: string): GestaltMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GestaltMessage.AsObject; - static toObject(includeInstance: boolean, msg: GestaltMessage): GestaltMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GestaltMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GestaltMessage; - static deserializeBinaryFromReader(message: GestaltMessage, reader: jspb.BinaryReader): GestaltMessage; -} - -export namespace GestaltMessage { - export type AsObject = { - name: string, - } -} - -export class GestaltTrustMessage extends jspb.Message { - getProvider(): string; - setProvider(value: string): GestaltTrustMessage; - getName(): string; - setName(value: string): GestaltTrustMessage; - getSet(): boolean; - setSet(value: boolean): GestaltTrustMessage; - - serializeBinary(): Uint8Array; - toObject(includeInstance?: boolean): GestaltTrustMessage.AsObject; - static toObject(includeInstance: boolean, msg: GestaltTrustMessage): GestaltTrustMessage.AsObject; - static extensions: {[key: number]: jspb.ExtensionFieldInfo}; - static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; - static serializeBinaryToWriter(message: GestaltTrustMessage, writer: jspb.BinaryWriter): void; - static deserializeBinary(bytes: Uint8Array): GestaltTrustMessage; - static deserializeBinaryFromReader(message: GestaltTrustMessage, reader: jspb.BinaryReader): GestaltTrustMessage; -} - -export namespace GestaltTrustMessage { - export type AsObject = { - provider: string, - name: string, - set: boolean, - } -} diff --git a/src/proto/js/Client_pb.js b/src/proto/js/Client_pb.js deleted file mode 100644 index 040166d096..0000000000 --- a/src/proto/js/Client_pb.js +++ /dev/null @@ -1,4293 +0,0 @@ -// source: Client.proto -/** - * @fileoverview - * @enhanceable - * @suppress {messageConventions} JS Compiler reports an error if a variable or - * field starts with 'MSG_' and isn't a translatable message. - * @public - */ -// GENERATED CODE -- DO NOT EDIT! -/* eslint-disable */ -// @ts-nocheck - -var jspb = require('google-protobuf'); -var goog = jspb; -var global = Function('return this')(); - -goog.exportSymbol('proto.clientInterface.CertificateMessage', null, global); -goog.exportSymbol('proto.clientInterface.CryptoMessage', null, global); -goog.exportSymbol('proto.clientInterface.DirectoryMessage', null, global); -goog.exportSymbol('proto.clientInterface.EchoMessage', null, global); -goog.exportSymbol('proto.clientInterface.EmptyMessage', null, global); -goog.exportSymbol('proto.clientInterface.GestaltMessage', null, global); -goog.exportSymbol('proto.clientInterface.GestaltTrustMessage', null, global); -goog.exportSymbol('proto.clientInterface.KeyMessage', null, global); -goog.exportSymbol('proto.clientInterface.KeyPairMessage', null, global); -goog.exportSymbol('proto.clientInterface.NodeMessage', null, global); -goog.exportSymbol('proto.clientInterface.PasswordMessage', null, global); -goog.exportSymbol('proto.clientInterface.PermissionMessage', null, global); -goog.exportSymbol('proto.clientInterface.ProviderMessage', null, global); -goog.exportSymbol('proto.clientInterface.SecretMessage', null, global); -goog.exportSymbol('proto.clientInterface.SecretNewMessage', null, global); -goog.exportSymbol('proto.clientInterface.SecretRenameMessage', null, global); -goog.exportSymbol('proto.clientInterface.SecretSpecificMessage', null, global); -goog.exportSymbol('proto.clientInterface.ShareMessage', null, global); -goog.exportSymbol('proto.clientInterface.StatMessage', null, global); -goog.exportSymbol('proto.clientInterface.StatusMessage', null, global); -goog.exportSymbol('proto.clientInterface.TokenMessage', null, global); -goog.exportSymbol('proto.clientInterface.TokenSpecificMessage', null, global); -goog.exportSymbol('proto.clientInterface.VaultMessage', null, global); -goog.exportSymbol('proto.clientInterface.VaultSpecificMessage', null, global); -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.EmptyMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.EmptyMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.EmptyMessage.displayName = 'proto.clientInterface.EmptyMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.StatusMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.StatusMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.StatusMessage.displayName = 'proto.clientInterface.StatusMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.EchoMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.EchoMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.EchoMessage.displayName = 'proto.clientInterface.EchoMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.VaultMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.VaultMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.VaultMessage.displayName = 'proto.clientInterface.VaultMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.VaultSpecificMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.VaultSpecificMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.VaultSpecificMessage.displayName = 'proto.clientInterface.VaultSpecificMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.SecretSpecificMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.SecretSpecificMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.SecretSpecificMessage.displayName = 'proto.clientInterface.SecretSpecificMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.SecretRenameMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.SecretRenameMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.SecretRenameMessage.displayName = 'proto.clientInterface.SecretRenameMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.SecretNewMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.SecretNewMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.SecretNewMessage.displayName = 'proto.clientInterface.SecretNewMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.SecretMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.SecretMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.SecretMessage.displayName = 'proto.clientInterface.SecretMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.StatMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.StatMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.StatMessage.displayName = 'proto.clientInterface.StatMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.ShareMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.ShareMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.ShareMessage.displayName = 'proto.clientInterface.ShareMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.PermissionMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.PermissionMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.PermissionMessage.displayName = 'proto.clientInterface.PermissionMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.DirectoryMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.DirectoryMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.DirectoryMessage.displayName = 'proto.clientInterface.DirectoryMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.NodeMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.NodeMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.NodeMessage.displayName = 'proto.clientInterface.NodeMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.CryptoMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.CryptoMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.CryptoMessage.displayName = 'proto.clientInterface.CryptoMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.KeyMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.KeyMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.KeyMessage.displayName = 'proto.clientInterface.KeyMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.KeyPairMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.KeyPairMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.KeyPairMessage.displayName = 'proto.clientInterface.KeyPairMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.CertificateMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.CertificateMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.CertificateMessage.displayName = 'proto.clientInterface.CertificateMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.PasswordMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.PasswordMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.PasswordMessage.displayName = 'proto.clientInterface.PasswordMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.ProviderMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.ProviderMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.ProviderMessage.displayName = 'proto.clientInterface.ProviderMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.TokenSpecificMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.TokenSpecificMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.TokenSpecificMessage.displayName = 'proto.clientInterface.TokenSpecificMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.TokenMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.TokenMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.TokenMessage.displayName = 'proto.clientInterface.TokenMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.GestaltMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.GestaltMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.GestaltMessage.displayName = 'proto.clientInterface.GestaltMessage'; -} -/** - * Generated by JsPbCodeGenerator. - * @param {Array=} opt_data Optional initial data array, typically from a - * server response, or constructed directly in Javascript. The array is used - * in place and becomes part of the constructed object. It is not cloned. - * If no data is provided, the constructed object will be empty, but still - * valid. - * @extends {jspb.Message} - * @constructor - */ -proto.clientInterface.GestaltTrustMessage = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); -}; -goog.inherits(proto.clientInterface.GestaltTrustMessage, jspb.Message); -if (goog.DEBUG && !COMPILED) { - /** - * @public - * @override - */ - proto.clientInterface.GestaltTrustMessage.displayName = 'proto.clientInterface.GestaltTrustMessage'; -} - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.EmptyMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.EmptyMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.EmptyMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.EmptyMessage.toObject = function(includeInstance, msg) { - var f, obj = { - - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.EmptyMessage} - */ -proto.clientInterface.EmptyMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.EmptyMessage; - return proto.clientInterface.EmptyMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.EmptyMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.EmptyMessage} - */ -proto.clientInterface.EmptyMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.EmptyMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.EmptyMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.EmptyMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.EmptyMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.StatusMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.StatusMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.StatusMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.StatusMessage.toObject = function(includeInstance, msg) { - var f, obj = { - success: jspb.Message.getBooleanFieldWithDefault(msg, 1, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.StatusMessage} - */ -proto.clientInterface.StatusMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.StatusMessage; - return proto.clientInterface.StatusMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.StatusMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.StatusMessage} - */ -proto.clientInterface.StatusMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSuccess(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.StatusMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.StatusMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.StatusMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.StatusMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getSuccess(); - if (f) { - writer.writeBool( - 1, - f - ); - } -}; - - -/** - * optional bool success = 1; - * @return {boolean} - */ -proto.clientInterface.StatusMessage.prototype.getSuccess = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.clientInterface.StatusMessage} returns this - */ -proto.clientInterface.StatusMessage.prototype.setSuccess = function(value) { - return jspb.Message.setProto3BooleanField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.EchoMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.EchoMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.EchoMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.EchoMessage.toObject = function(includeInstance, msg) { - var f, obj = { - challenge: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.EchoMessage} - */ -proto.clientInterface.EchoMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.EchoMessage; - return proto.clientInterface.EchoMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.EchoMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.EchoMessage} - */ -proto.clientInterface.EchoMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setChallenge(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.EchoMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.EchoMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.EchoMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.EchoMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getChallenge(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string challenge = 1; - * @return {string} - */ -proto.clientInterface.EchoMessage.prototype.getChallenge = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.EchoMessage} returns this - */ -proto.clientInterface.EchoMessage.prototype.setChallenge = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.VaultMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.VaultMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.VaultMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.VaultMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - id: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.VaultMessage} - */ -proto.clientInterface.VaultMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.VaultMessage; - return proto.clientInterface.VaultMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.VaultMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.VaultMessage} - */ -proto.clientInterface.VaultMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.VaultMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.VaultMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.VaultMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.VaultMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.VaultMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.VaultMessage} returns this - */ -proto.clientInterface.VaultMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string id = 2; - * @return {string} - */ -proto.clientInterface.VaultMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.VaultMessage} returns this - */ -proto.clientInterface.VaultMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.VaultSpecificMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.VaultSpecificMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.VaultSpecificMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.VaultSpecificMessage.toObject = function(includeInstance, msg) { - var f, obj = { - vault: (f = msg.getVault()) && proto.clientInterface.VaultMessage.toObject(includeInstance, f), - name: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.VaultSpecificMessage} - */ -proto.clientInterface.VaultSpecificMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.VaultSpecificMessage; - return proto.clientInterface.VaultSpecificMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.VaultSpecificMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.VaultSpecificMessage} - */ -proto.clientInterface.VaultSpecificMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.clientInterface.VaultMessage; - reader.readMessage(value,proto.clientInterface.VaultMessage.deserializeBinaryFromReader); - msg.setVault(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.VaultSpecificMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.VaultSpecificMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.VaultSpecificMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.VaultSpecificMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVault(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.clientInterface.VaultMessage.serializeBinaryToWriter - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional VaultMessage vault = 1; - * @return {?proto.clientInterface.VaultMessage} - */ -proto.clientInterface.VaultSpecificMessage.prototype.getVault = function() { - return /** @type{?proto.clientInterface.VaultMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.VaultMessage, 1)); -}; - - -/** - * @param {?proto.clientInterface.VaultMessage|undefined} value - * @return {!proto.clientInterface.VaultSpecificMessage} returns this -*/ -proto.clientInterface.VaultSpecificMessage.prototype.setVault = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.VaultSpecificMessage} returns this - */ -proto.clientInterface.VaultSpecificMessage.prototype.clearVault = function() { - return this.setVault(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.VaultSpecificMessage.prototype.hasVault = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string name = 2; - * @return {string} - */ -proto.clientInterface.VaultSpecificMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.VaultSpecificMessage} returns this - */ -proto.clientInterface.VaultSpecificMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.SecretSpecificMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.SecretSpecificMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.SecretSpecificMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretSpecificMessage.toObject = function(includeInstance, msg) { - var f, obj = { - vault: (f = msg.getVault()) && proto.clientInterface.VaultSpecificMessage.toObject(includeInstance, f), - content: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.SecretSpecificMessage} - */ -proto.clientInterface.SecretSpecificMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.SecretSpecificMessage; - return proto.clientInterface.SecretSpecificMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.SecretSpecificMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.SecretSpecificMessage} - */ -proto.clientInterface.SecretSpecificMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.clientInterface.VaultSpecificMessage; - reader.readMessage(value,proto.clientInterface.VaultSpecificMessage.deserializeBinaryFromReader); - msg.setVault(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setContent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.SecretSpecificMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.SecretSpecificMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.SecretSpecificMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretSpecificMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVault(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.clientInterface.VaultSpecificMessage.serializeBinaryToWriter - ); - } - f = message.getContent(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional VaultSpecificMessage vault = 1; - * @return {?proto.clientInterface.VaultSpecificMessage} - */ -proto.clientInterface.SecretSpecificMessage.prototype.getVault = function() { - return /** @type{?proto.clientInterface.VaultSpecificMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.VaultSpecificMessage, 1)); -}; - - -/** - * @param {?proto.clientInterface.VaultSpecificMessage|undefined} value - * @return {!proto.clientInterface.SecretSpecificMessage} returns this -*/ -proto.clientInterface.SecretSpecificMessage.prototype.setVault = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.SecretSpecificMessage} returns this - */ -proto.clientInterface.SecretSpecificMessage.prototype.clearVault = function() { - return this.setVault(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.SecretSpecificMessage.prototype.hasVault = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string content = 2; - * @return {string} - */ -proto.clientInterface.SecretSpecificMessage.prototype.getContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.SecretSpecificMessage} returns this - */ -proto.clientInterface.SecretSpecificMessage.prototype.setContent = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.SecretRenameMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.SecretRenameMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.SecretRenameMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretRenameMessage.toObject = function(includeInstance, msg) { - var f, obj = { - vault: (f = msg.getVault()) && proto.clientInterface.VaultMessage.toObject(includeInstance, f), - oldname: (f = msg.getOldname()) && proto.clientInterface.SecretMessage.toObject(includeInstance, f), - newname: (f = msg.getNewname()) && proto.clientInterface.SecretMessage.toObject(includeInstance, f) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.SecretRenameMessage} - */ -proto.clientInterface.SecretRenameMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.SecretRenameMessage; - return proto.clientInterface.SecretRenameMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.SecretRenameMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.SecretRenameMessage} - */ -proto.clientInterface.SecretRenameMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.clientInterface.VaultMessage; - reader.readMessage(value,proto.clientInterface.VaultMessage.deserializeBinaryFromReader); - msg.setVault(value); - break; - case 2: - var value = new proto.clientInterface.SecretMessage; - reader.readMessage(value,proto.clientInterface.SecretMessage.deserializeBinaryFromReader); - msg.setOldname(value); - break; - case 3: - var value = new proto.clientInterface.SecretMessage; - reader.readMessage(value,proto.clientInterface.SecretMessage.deserializeBinaryFromReader); - msg.setNewname(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.SecretRenameMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.SecretRenameMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.SecretRenameMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretRenameMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVault(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.clientInterface.VaultMessage.serializeBinaryToWriter - ); - } - f = message.getOldname(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.clientInterface.SecretMessage.serializeBinaryToWriter - ); - } - f = message.getNewname(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.clientInterface.SecretMessage.serializeBinaryToWriter - ); - } -}; - - -/** - * optional VaultMessage vault = 1; - * @return {?proto.clientInterface.VaultMessage} - */ -proto.clientInterface.SecretRenameMessage.prototype.getVault = function() { - return /** @type{?proto.clientInterface.VaultMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.VaultMessage, 1)); -}; - - -/** - * @param {?proto.clientInterface.VaultMessage|undefined} value - * @return {!proto.clientInterface.SecretRenameMessage} returns this -*/ -proto.clientInterface.SecretRenameMessage.prototype.setVault = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.SecretRenameMessage} returns this - */ -proto.clientInterface.SecretRenameMessage.prototype.clearVault = function() { - return this.setVault(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.SecretRenameMessage.prototype.hasVault = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional SecretMessage oldName = 2; - * @return {?proto.clientInterface.SecretMessage} - */ -proto.clientInterface.SecretRenameMessage.prototype.getOldname = function() { - return /** @type{?proto.clientInterface.SecretMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.SecretMessage, 2)); -}; - - -/** - * @param {?proto.clientInterface.SecretMessage|undefined} value - * @return {!proto.clientInterface.SecretRenameMessage} returns this -*/ -proto.clientInterface.SecretRenameMessage.prototype.setOldname = function(value) { - return jspb.Message.setWrapperField(this, 2, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.SecretRenameMessage} returns this - */ -proto.clientInterface.SecretRenameMessage.prototype.clearOldname = function() { - return this.setOldname(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.SecretRenameMessage.prototype.hasOldname = function() { - return jspb.Message.getField(this, 2) != null; -}; - - -/** - * optional SecretMessage newName = 3; - * @return {?proto.clientInterface.SecretMessage} - */ -proto.clientInterface.SecretRenameMessage.prototype.getNewname = function() { - return /** @type{?proto.clientInterface.SecretMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.SecretMessage, 3)); -}; - - -/** - * @param {?proto.clientInterface.SecretMessage|undefined} value - * @return {!proto.clientInterface.SecretRenameMessage} returns this -*/ -proto.clientInterface.SecretRenameMessage.prototype.setNewname = function(value) { - return jspb.Message.setWrapperField(this, 3, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.SecretRenameMessage} returns this - */ -proto.clientInterface.SecretRenameMessage.prototype.clearNewname = function() { - return this.setNewname(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.SecretRenameMessage.prototype.hasNewname = function() { - return jspb.Message.getField(this, 3) != null; -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.SecretNewMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.SecretNewMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.SecretNewMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretNewMessage.toObject = function(includeInstance, msg) { - var f, obj = { - vault: (f = msg.getVault()) && proto.clientInterface.VaultMessage.toObject(includeInstance, f), - name: jspb.Message.getFieldWithDefault(msg, 2, ""), - content: jspb.Message.getFieldWithDefault(msg, 3, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.SecretNewMessage} - */ -proto.clientInterface.SecretNewMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.SecretNewMessage; - return proto.clientInterface.SecretNewMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.SecretNewMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.SecretNewMessage} - */ -proto.clientInterface.SecretNewMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.clientInterface.VaultMessage; - reader.readMessage(value,proto.clientInterface.VaultMessage.deserializeBinaryFromReader); - msg.setVault(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 3: - var value = /** @type {string} */ (reader.readString()); - msg.setContent(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.SecretNewMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.SecretNewMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.SecretNewMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretNewMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getVault(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.clientInterface.VaultMessage.serializeBinaryToWriter - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getContent(); - if (f.length > 0) { - writer.writeString( - 3, - f - ); - } -}; - - -/** - * optional VaultMessage vault = 1; - * @return {?proto.clientInterface.VaultMessage} - */ -proto.clientInterface.SecretNewMessage.prototype.getVault = function() { - return /** @type{?proto.clientInterface.VaultMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.VaultMessage, 1)); -}; - - -/** - * @param {?proto.clientInterface.VaultMessage|undefined} value - * @return {!proto.clientInterface.SecretNewMessage} returns this -*/ -proto.clientInterface.SecretNewMessage.prototype.setVault = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.SecretNewMessage} returns this - */ -proto.clientInterface.SecretNewMessage.prototype.clearVault = function() { - return this.setVault(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.SecretNewMessage.prototype.hasVault = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string name = 2; - * @return {string} - */ -proto.clientInterface.SecretNewMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.SecretNewMessage} returns this - */ -proto.clientInterface.SecretNewMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional string content = 3; - * @return {string} - */ -proto.clientInterface.SecretNewMessage.prototype.getContent = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.SecretNewMessage} returns this - */ -proto.clientInterface.SecretNewMessage.prototype.setContent = function(value) { - return jspb.Message.setProto3StringField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.SecretMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.SecretMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.SecretMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.SecretMessage} - */ -proto.clientInterface.SecretMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.SecretMessage; - return proto.clientInterface.SecretMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.SecretMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.SecretMessage} - */ -proto.clientInterface.SecretMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.SecretMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.SecretMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.SecretMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.SecretMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.SecretMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.SecretMessage} returns this - */ -proto.clientInterface.SecretMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.StatMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.StatMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.StatMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.StatMessage.toObject = function(includeInstance, msg) { - var f, obj = { - stats: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.StatMessage} - */ -proto.clientInterface.StatMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.StatMessage; - return proto.clientInterface.StatMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.StatMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.StatMessage} - */ -proto.clientInterface.StatMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setStats(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.StatMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.StatMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.StatMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.StatMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStats(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string stats = 1; - * @return {string} - */ -proto.clientInterface.StatMessage.prototype.getStats = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.StatMessage} returns this - */ -proto.clientInterface.StatMessage.prototype.setStats = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.ShareMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.ShareMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.ShareMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.ShareMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - id: jspb.Message.getFieldWithDefault(msg, 2, ""), - set: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.ShareMessage} - */ -proto.clientInterface.ShareMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.ShareMessage; - return proto.clientInterface.ShareMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.ShareMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.ShareMessage} - */ -proto.clientInterface.ShareMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSet(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.ShareMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.ShareMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.ShareMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.ShareMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getSet(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.ShareMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.ShareMessage} returns this - */ -proto.clientInterface.ShareMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string id = 2; - * @return {string} - */ -proto.clientInterface.ShareMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.ShareMessage} returns this - */ -proto.clientInterface.ShareMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool set = 3; - * @return {boolean} - */ -proto.clientInterface.ShareMessage.prototype.getSet = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.clientInterface.ShareMessage} returns this - */ -proto.clientInterface.ShareMessage.prototype.setSet = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.PermissionMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.PermissionMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.PermissionMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.PermissionMessage.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - action: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.PermissionMessage} - */ -proto.clientInterface.PermissionMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.PermissionMessage; - return proto.clientInterface.PermissionMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.PermissionMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.PermissionMessage} - */ -proto.clientInterface.PermissionMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setAction(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.PermissionMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.PermissionMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.PermissionMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.PermissionMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getAction(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.clientInterface.PermissionMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.PermissionMessage} returns this - */ -proto.clientInterface.PermissionMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string action = 2; - * @return {string} - */ -proto.clientInterface.PermissionMessage.prototype.getAction = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.PermissionMessage} returns this - */ -proto.clientInterface.PermissionMessage.prototype.setAction = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.DirectoryMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.DirectoryMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.DirectoryMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.DirectoryMessage.toObject = function(includeInstance, msg) { - var f, obj = { - dir: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.DirectoryMessage} - */ -proto.clientInterface.DirectoryMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.DirectoryMessage; - return proto.clientInterface.DirectoryMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.DirectoryMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.DirectoryMessage} - */ -proto.clientInterface.DirectoryMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setDir(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.DirectoryMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.DirectoryMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.DirectoryMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.DirectoryMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDir(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string dir = 1; - * @return {string} - */ -proto.clientInterface.DirectoryMessage.prototype.getDir = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.DirectoryMessage} returns this - */ -proto.clientInterface.DirectoryMessage.prototype.setDir = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.NodeMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.NodeMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.NodeMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.NodeMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.NodeMessage} - */ -proto.clientInterface.NodeMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.NodeMessage; - return proto.clientInterface.NodeMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.NodeMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.NodeMessage} - */ -proto.clientInterface.NodeMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.NodeMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.NodeMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.NodeMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.NodeMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.NodeMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.NodeMessage} returns this - */ -proto.clientInterface.NodeMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.CryptoMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.CryptoMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.CryptoMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.CryptoMessage.toObject = function(includeInstance, msg) { - var f, obj = { - data: jspb.Message.getFieldWithDefault(msg, 1, ""), - signature: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.CryptoMessage} - */ -proto.clientInterface.CryptoMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.CryptoMessage; - return proto.clientInterface.CryptoMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.CryptoMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.CryptoMessage} - */ -proto.clientInterface.CryptoMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setData(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setSignature(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.CryptoMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.CryptoMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.CryptoMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.CryptoMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getData(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getSignature(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string data = 1; - * @return {string} - */ -proto.clientInterface.CryptoMessage.prototype.getData = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.CryptoMessage} returns this - */ -proto.clientInterface.CryptoMessage.prototype.setData = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string signature = 2; - * @return {string} - */ -proto.clientInterface.CryptoMessage.prototype.getSignature = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.CryptoMessage} returns this - */ -proto.clientInterface.CryptoMessage.prototype.setSignature = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.KeyMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.KeyMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.KeyMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.KeyMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, ""), - key: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.KeyMessage} - */ -proto.clientInterface.KeyMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.KeyMessage; - return proto.clientInterface.KeyMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.KeyMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.KeyMessage} - */ -proto.clientInterface.KeyMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setKey(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.KeyMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.KeyMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.KeyMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.KeyMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getKey(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.KeyMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.KeyMessage} returns this - */ -proto.clientInterface.KeyMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string key = 2; - * @return {string} - */ -proto.clientInterface.KeyMessage.prototype.getKey = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.KeyMessage} returns this - */ -proto.clientInterface.KeyMessage.prototype.setKey = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.KeyPairMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.KeyPairMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.KeyPairMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.KeyPairMessage.toObject = function(includeInstance, msg) { - var f, obj = { - pb_public: jspb.Message.getFieldWithDefault(msg, 1, ""), - pb_private: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.KeyPairMessage} - */ -proto.clientInterface.KeyPairMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.KeyPairMessage; - return proto.clientInterface.KeyPairMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.KeyPairMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.KeyPairMessage} - */ -proto.clientInterface.KeyPairMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPublic(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setPrivate(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.KeyPairMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.KeyPairMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.KeyPairMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.KeyPairMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPublic(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getPrivate(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string public = 1; - * @return {string} - */ -proto.clientInterface.KeyPairMessage.prototype.getPublic = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.KeyPairMessage} returns this - */ -proto.clientInterface.KeyPairMessage.prototype.setPublic = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string private = 2; - * @return {string} - */ -proto.clientInterface.KeyPairMessage.prototype.getPrivate = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.KeyPairMessage} returns this - */ -proto.clientInterface.KeyPairMessage.prototype.setPrivate = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.CertificateMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.CertificateMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.CertificateMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.CertificateMessage.toObject = function(includeInstance, msg) { - var f, obj = { - cert: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.CertificateMessage} - */ -proto.clientInterface.CertificateMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.CertificateMessage; - return proto.clientInterface.CertificateMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.CertificateMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.CertificateMessage} - */ -proto.clientInterface.CertificateMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setCert(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.CertificateMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.CertificateMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.CertificateMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.CertificateMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getCert(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string cert = 1; - * @return {string} - */ -proto.clientInterface.CertificateMessage.prototype.getCert = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.CertificateMessage} returns this - */ -proto.clientInterface.CertificateMessage.prototype.setCert = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.PasswordMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.PasswordMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.PasswordMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.PasswordMessage.toObject = function(includeInstance, msg) { - var f, obj = { - password: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.PasswordMessage} - */ -proto.clientInterface.PasswordMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.PasswordMessage; - return proto.clientInterface.PasswordMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.PasswordMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.PasswordMessage} - */ -proto.clientInterface.PasswordMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setPassword(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.PasswordMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.PasswordMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.PasswordMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.PasswordMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getPassword(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string password = 1; - * @return {string} - */ -proto.clientInterface.PasswordMessage.prototype.getPassword = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.PasswordMessage} returns this - */ -proto.clientInterface.PasswordMessage.prototype.setPassword = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.ProviderMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.ProviderMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.ProviderMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.ProviderMessage.toObject = function(includeInstance, msg) { - var f, obj = { - id: jspb.Message.getFieldWithDefault(msg, 1, ""), - message: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.ProviderMessage} - */ -proto.clientInterface.ProviderMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.ProviderMessage; - return proto.clientInterface.ProviderMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.ProviderMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.ProviderMessage} - */ -proto.clientInterface.ProviderMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setId(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.ProviderMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.ProviderMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.ProviderMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.ProviderMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getId(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional string id = 1; - * @return {string} - */ -proto.clientInterface.ProviderMessage.prototype.getId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.ProviderMessage} returns this - */ -proto.clientInterface.ProviderMessage.prototype.setId = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string message = 2; - * @return {string} - */ -proto.clientInterface.ProviderMessage.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.ProviderMessage} returns this - */ -proto.clientInterface.ProviderMessage.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.TokenSpecificMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.TokenSpecificMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.TokenSpecificMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.TokenSpecificMessage.toObject = function(includeInstance, msg) { - var f, obj = { - provider: (f = msg.getProvider()) && proto.clientInterface.ProviderMessage.toObject(includeInstance, f), - token: jspb.Message.getFieldWithDefault(msg, 2, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.TokenSpecificMessage} - */ -proto.clientInterface.TokenSpecificMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.TokenSpecificMessage; - return proto.clientInterface.TokenSpecificMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.TokenSpecificMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.TokenSpecificMessage} - */ -proto.clientInterface.TokenSpecificMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = new proto.clientInterface.ProviderMessage; - reader.readMessage(value,proto.clientInterface.ProviderMessage.deserializeBinaryFromReader); - msg.setProvider(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setToken(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.TokenSpecificMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.TokenSpecificMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.TokenSpecificMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.TokenSpecificMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProvider(); - if (f != null) { - writer.writeMessage( - 1, - f, - proto.clientInterface.ProviderMessage.serializeBinaryToWriter - ); - } - f = message.getToken(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } -}; - - -/** - * optional ProviderMessage provider = 1; - * @return {?proto.clientInterface.ProviderMessage} - */ -proto.clientInterface.TokenSpecificMessage.prototype.getProvider = function() { - return /** @type{?proto.clientInterface.ProviderMessage} */ ( - jspb.Message.getWrapperField(this, proto.clientInterface.ProviderMessage, 1)); -}; - - -/** - * @param {?proto.clientInterface.ProviderMessage|undefined} value - * @return {!proto.clientInterface.TokenSpecificMessage} returns this -*/ -proto.clientInterface.TokenSpecificMessage.prototype.setProvider = function(value) { - return jspb.Message.setWrapperField(this, 1, value); -}; - - -/** - * Clears the message field making it undefined. - * @return {!proto.clientInterface.TokenSpecificMessage} returns this - */ -proto.clientInterface.TokenSpecificMessage.prototype.clearProvider = function() { - return this.setProvider(undefined); -}; - - -/** - * Returns whether this field is set. - * @return {boolean} - */ -proto.clientInterface.TokenSpecificMessage.prototype.hasProvider = function() { - return jspb.Message.getField(this, 1) != null; -}; - - -/** - * optional string token = 2; - * @return {string} - */ -proto.clientInterface.TokenSpecificMessage.prototype.getToken = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.TokenSpecificMessage} returns this - */ -proto.clientInterface.TokenSpecificMessage.prototype.setToken = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.TokenMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.TokenMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.TokenMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.TokenMessage.toObject = function(includeInstance, msg) { - var f, obj = { - token: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.TokenMessage} - */ -proto.clientInterface.TokenMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.TokenMessage; - return proto.clientInterface.TokenMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.TokenMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.TokenMessage} - */ -proto.clientInterface.TokenMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setToken(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.TokenMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.TokenMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.TokenMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.TokenMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getToken(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string token = 1; - * @return {string} - */ -proto.clientInterface.TokenMessage.prototype.getToken = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.TokenMessage} returns this - */ -proto.clientInterface.TokenMessage.prototype.setToken = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.GestaltMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.GestaltMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.GestaltMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.GestaltMessage.toObject = function(includeInstance, msg) { - var f, obj = { - name: jspb.Message.getFieldWithDefault(msg, 1, "") - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.GestaltMessage} - */ -proto.clientInterface.GestaltMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.GestaltMessage; - return proto.clientInterface.GestaltMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.GestaltMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.GestaltMessage} - */ -proto.clientInterface.GestaltMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.GestaltMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.GestaltMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.GestaltMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.GestaltMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } -}; - - -/** - * optional string name = 1; - * @return {string} - */ -proto.clientInterface.GestaltMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.GestaltMessage} returns this - */ -proto.clientInterface.GestaltMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - - - - -if (jspb.Message.GENERATE_TO_OBJECT) { -/** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} - */ -proto.clientInterface.GestaltTrustMessage.prototype.toObject = function(opt_includeInstance) { - return proto.clientInterface.GestaltTrustMessage.toObject(opt_includeInstance, this); -}; - - -/** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.clientInterface.GestaltTrustMessage} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.GestaltTrustMessage.toObject = function(includeInstance, msg) { - var f, obj = { - provider: jspb.Message.getFieldWithDefault(msg, 1, ""), - name: jspb.Message.getFieldWithDefault(msg, 2, ""), - set: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; -}; -} - - -/** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.clientInterface.GestaltTrustMessage} - */ -proto.clientInterface.GestaltTrustMessage.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.clientInterface.GestaltTrustMessage; - return proto.clientInterface.GestaltTrustMessage.deserializeBinaryFromReader(msg, reader); -}; - - -/** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.clientInterface.GestaltTrustMessage} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.clientInterface.GestaltTrustMessage} - */ -proto.clientInterface.GestaltTrustMessage.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {string} */ (reader.readString()); - msg.setProvider(value); - break; - case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setName(value); - break; - case 3: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setSet(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.clientInterface.GestaltTrustMessage.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.clientInterface.GestaltTrustMessage.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.clientInterface.GestaltTrustMessage} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.clientInterface.GestaltTrustMessage.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getProvider(); - if (f.length > 0) { - writer.writeString( - 1, - f - ); - } - f = message.getName(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getSet(); - if (f) { - writer.writeBool( - 3, - f - ); - } -}; - - -/** - * optional string provider = 1; - * @return {string} - */ -proto.clientInterface.GestaltTrustMessage.prototype.getProvider = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.GestaltTrustMessage} returns this - */ -proto.clientInterface.GestaltTrustMessage.prototype.setProvider = function(value) { - return jspb.Message.setProto3StringField(this, 1, value); -}; - - -/** - * optional string name = 2; - * @return {string} - */ -proto.clientInterface.GestaltTrustMessage.prototype.getName = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); -}; - - -/** - * @param {string} value - * @return {!proto.clientInterface.GestaltTrustMessage} returns this - */ -proto.clientInterface.GestaltTrustMessage.prototype.setName = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); -}; - - -/** - * optional bool set = 3; - * @return {boolean} - */ -proto.clientInterface.GestaltTrustMessage.prototype.getSet = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); -}; - - -/** - * @param {boolean} value - * @return {!proto.clientInterface.GestaltTrustMessage} returns this - */ -proto.clientInterface.GestaltTrustMessage.prototype.setSet = function(value) { - return jspb.Message.setProto3BooleanField(this, 3, value); -}; - - -goog.object.extend(exports, proto.clientInterface); diff --git a/src/proto/schemas/Client.proto b/src/proto/schemas/Client.proto deleted file mode 100644 index 15a84391dd..0000000000 --- a/src/proto/schemas/Client.proto +++ /dev/null @@ -1,182 +0,0 @@ -syntax = "proto3"; - -package clientInterface; - -service Client { - rpc Echo(EchoMessage) returns (EchoMessage) {}; - - // Agent - rpc AgentStop(EmptyMessage) returns (EmptyMessage) {}; - - // Nodes - rpc NodesList(EmptyMessage) returns (stream NodeMessage) {}; - - // Keys - rpc KeysRootKeyPair (EmptyMessage) returns (KeyPairMessage) {}; - rpc KeysResetKeyPair (KeyMessage) returns (EmptyMessage) {}; - rpc KeysRenewKeyPair (KeyMessage) returns (EmptyMessage) {}; - rpc KeysEncrypt (CryptoMessage) returns (CryptoMessage) {}; - rpc KeysDecrypt (CryptoMessage) returns (CryptoMessage) {}; - rpc KeysSign (CryptoMessage) returns (CryptoMessage) {}; - rpc KeysVerify (CryptoMessage) returns (StatusMessage) {}; - rpc KeysChangePassword (PasswordMessage) returns (EmptyMessage) {}; - rpc CertsGet (EmptyMessage) returns (CertificateMessage) {}; - rpc CertsChainGet (EmptyMessage) returns (stream CertificateMessage) {}; - - // Vaults - rpc VaultsList(EmptyMessage) returns (stream VaultMessage) {}; - rpc VaultsCreate(VaultMessage) returns (StatusMessage) {}; - rpc VaultsRename(VaultMessage) returns (StatusMessage) {}; - rpc VaultsDelete(VaultMessage) returns (StatusMessage) {}; - rpc VaultsListSecrets(VaultMessage) returns (stream SecretMessage) {}; - rpc VaultsMkdir(VaultSpecificMessage) returns (EmptyMessage) {}; - rpc VaultsStat(VaultMessage) returns (StatMessage) {}; - rpc VaultsPull(VaultMessage) returns (EmptyMessage) {}; - rpc VaultsScan(NodeMessage) returns (stream VaultMessage) {}; - rpc VaultsDeleteSecret(VaultSpecificMessage) returns (StatusMessage) {}; - rpc VaultsEditSecret(SecretSpecificMessage) returns (EmptyMessage) {}; - rpc VaultsGetSecret(VaultSpecificMessage) returns (SecretMessage) {}; - rpc VaultsRenameSecret(SecretRenameMessage) returns (StatusMessage) {}; - rpc VaultsNewSecret(SecretNewMessage) returns (StatusMessage) {}; - rpc VaultsNewDirSecret(SecretNewMessage) returns (EmptyMessage) {}; - rpc VaultsShare(ShareMessage) returns (EmptyMessage) {}; - rpc VaultsPermissions(ShareMessage) returns (stream PermissionMessage) {}; - rpc SecretsEnv(VaultMessage) returns(stream DirectoryMessage) {}; - - // Identities - rpc IdentitiesAuthenticate(ProviderMessage) returns (ProviderMessage) {}; - rpc TokensPut(TokenSpecificMessage) returns (EmptyMessage) {}; - rpc TokensGet(ProviderMessage) returns (TokenMessage) {}; - rpc TokensDelete(ProviderMessage) returns (EmptyMessage) {}; - rpc ProvidersGet(EmptyMessage) returns (ProviderMessage) {}; - - // Gestalts - rpc GestaltsGetNode(GestaltMessage) returns (GestaltMessage) {}; - rpc GestaltsGetIdentity(ProviderMessage) returns (GestaltMessage) {}; - rpc GestaltsList(EmptyMessage) returns (stream GestaltMessage) {}; - rpc GestaltsSetNode(GestaltTrustMessage) returns (EmptyMessage) {}; - rpc GestaltsSetIdentity(GestaltTrustMessage) returns (EmptyMessage) {}; - - rpc GestaltSync(stream GestaltMessage) returns (stream GestaltMessage) {}; -} - -message EmptyMessage {} - -message StatusMessage { - bool success = 1; -} - -message EchoMessage { - string challenge = 1; -} - -// Vaults - -message VaultMessage { - string name = 1; - string id = 2; -} - -message VaultSpecificMessage { - VaultMessage vault = 1; - string name = 2; -} - -message SecretSpecificMessage { - VaultSpecificMessage vault = 1; - string content = 2; -} - -message SecretRenameMessage { - VaultMessage vault = 1; - SecretMessage oldName = 2; - SecretMessage newName = 3; -} - -message SecretNewMessage { - VaultMessage vault = 1; - string name = 2; - string content = 3; -} - -message SecretMessage { - string name = 1; -} - -message StatMessage { - string stats = 1; -} - -message ShareMessage { - string name = 1; - string id = 2; - bool set = 3; -} - -message PermissionMessage { - string id = 1; - string action = 2; -} - -message DirectoryMessage { - string dir = 1; -} - -// Nodes - -message NodeMessage { - string name = 1; -} - -// Keys - -message CryptoMessage { - string data = 1; - string signature = 2; -} - -message KeyMessage { - string name = 1; - string key = 2; -} - -message KeyPairMessage { - string public = 1; - string private = 2; -} - -message CertificateMessage { - string cert = 1; -} - -message PasswordMessage { - string password = 1; -} - -// Identities - -message ProviderMessage { - string id = 1; - string message = 2; -} - -message TokenSpecificMessage { - ProviderMessage provider = 1; - string token = 2; -} - -message TokenMessage { - string token = 1; -} - -// Gestalts - -message GestaltMessage { - string name = 1; -} - -message GestaltTrustMessage { - string provider = 1; - string name = 2; - bool set = 3; -} diff --git a/src/proto/schemas/polykey/v1/client_service.proto b/src/proto/schemas/polykey/v1/client_service.proto index 17a730f7cc..2216cdab20 100644 --- a/src/proto/schemas/polykey/v1/client_service.proto +++ b/src/proto/schemas/polykey/v1/client_service.proto @@ -64,6 +64,7 @@ service ClientService { rpc VaultsPermissions(polykey.v1.vaults.PermGet) returns (stream polykey.v1.vaults.Permission); rpc VaultsVersion(polykey.v1.vaults.Version) returns (polykey.v1.vaults.VersionResult); rpc VaultsLog(polykey.v1.vaults.Log) returns (stream polykey.v1.vaults.LogEntry); + rpc VaultsSecretsEnv(polykey.v1.secrets.Directory) returns(stream polykey.v1.secrets.Directory); // Identities rpc IdentitiesAuthenticate(polykey.v1.identities.Provider) returns (stream polykey.v1.identities.Provider); diff --git a/src/vaults/VaultInternal.ts b/src/vaults/VaultInternal.ts index 7756fdc045..e388f82808 100644 --- a/src/vaults/VaultInternal.ts +++ b/src/vaults/VaultInternal.ts @@ -343,6 +343,13 @@ class VaultInternal { ); } + @ready(new vaultsErrors.ErrorVaultDestroyed()) + public async glob( + pattern: string, + ): Promise { + return await vaultsUtils.glob(this.efsVault, pattern, {}); + } + @ready(new vaultsErrors.ErrorVaultDestroyed()) public async applySchema() {} } diff --git a/src/vaults/VaultManager.ts b/src/vaults/VaultManager.ts index 03bf1a0ad5..a03c8e22a2 100644 --- a/src/vaults/VaultManager.ts +++ b/src/vaults/VaultManager.ts @@ -660,6 +660,15 @@ class VaultManager { return vaultId; } + @ready(new vaultsErrors.ErrorVaultManagerDestroyed()) + public async glob( + vaultId: VaultId, + pattern: string, + ): Promise { + const vault = await this.getVault(vaultId); + return await vault.glob(pattern); + } + @ready(new vaultsErrors.ErrorVaultManagerDestroyed()) public async *handleInfoRequest( vaultId: VaultId, diff --git a/src/vaults/utils.ts b/src/vaults/utils.ts index 00358cd498..8e2335ca6a 100644 --- a/src/vaults/utils.ts +++ b/src/vaults/utils.ts @@ -1,4 +1,4 @@ -import type { EncryptedFS } from 'encryptedfs'; +import type { EncryptedFS, Stat } from 'encryptedfs'; import type { VaultId, VaultKey, @@ -8,13 +8,13 @@ import type { VaultIdPretty, } from './types'; import type { FileSystem } from '../types'; +import type { FileSystemWritable } from './types'; import type { NodeId } from '../nodes/types'; import fs from 'fs'; import path from 'path'; import { IdRandom } from '@matrixai/id'; -import { GitRequest } from '../git'; import * as grpc from '@grpc/grpc-js'; import { promisify } from '../utils'; @@ -130,122 +130,393 @@ async function* readdirRecursivelyEFS2( } } -/** - * Searches a list of vaults for the given vault Id and associated name - * @throws If the vault Id does not exist - */ -function searchVaultName(vaultList: VaultList, vaultId: VaultId): VaultName { - let vaultName: VaultName | undefined; - - // Search each element in the list of vaults - for (const elem in vaultList) { - // List is of form \t - const value = vaultList[elem].split('\t'); - if (value[1] === vaultId) { - vaultName = value[0]; - break; +const isHidden = /(^|[\\\/])\.[^\\\/\.]/g; +let CACHE = {}; + +async function walk(filesystem: FileSystemGlob, output: string[], prefix: string, lexer, opts, dirname='', level=0) { + const rgx = lexer.segments[level]; + const dir = path.resolve(opts.cwd, prefix, dirname); + const files = await filesystem.promises.readdir(dir, { encoding: 'utf8' }) as string[]; + const { dot, filesOnly } = opts; + + let i=0, len=files.length, file; + let fullpath, relpath, stats, isMatch; + + for (; i < len; i++) { + fullpath = path.join(dir, file=files[i]); + relpath = dirname ? path.join(dirname, file) : file; + if (!dot && isHidden.test(relpath)) continue; + isMatch = lexer.regex.test(relpath); + + if ((stats=CACHE[relpath]) === void 0) { + CACHE[relpath] = stats = await filesystem.promises.lstat(fullpath); } + if (!stats.isDirectory()) { + isMatch && output.push(path.relative(opts.cwd, fullpath)); + continue; + } + + if (rgx && !rgx.test(file)) continue; + !filesOnly && isMatch && output.push(path.join(prefix, relpath)); + + await walk(filesystem, output, prefix, lexer, opts, relpath, rgx && rgx.toString() !== lexer.globstar && level + 1); } - if (vaultName == null) { - throw new vaultErrors.ErrorRemoteVaultUndefined( - `${vaultId} does not exist on connected node`, - ); - } - return vaultName; } -/** - * Creates a GitRequest object from the desired node connection. - * @param client GRPC connection to desired node - * @param nodeId - */ -async function constructGitHandler( - client: GRPCClientAgent, - nodeId: NodeId, -): Promise { - const gitRequest = new GitRequest( - ((vaultNameOrId: string) => requestInfo(vaultNameOrId, client)).bind(this), - ((vaultNameOrId: string, body: Buffer) => - requestPack(vaultNameOrId, body, client)).bind(this), - (() => requestVaultNames(client, nodeId)).bind(this), - ); - return gitRequest; +interface FileSystemGlob { + promises: { + stat: typeof EncryptedFS.prototype.stat; + lstat: typeof EncryptedFS.prototype.lstat; + readdir: typeof EncryptedFS.prototype.readdir; + }; } -/** - * Requests remote info from the connected node for the named vault. - * @param vaultId ID of the desired vault - * @param client A connection object to the node - * @returns Async Generator of Uint8Arrays representing the Info Response - */ -async function* requestInfo( - vaultNameOrId: string, - client: GRPCClientAgent, -): AsyncGenerator { - const request = new vaultsPB.Vault(); - request.setNameOrId(vaultNameOrId); - const response = client.vaultsGitInfoGet(request); - for await (const resp of response) { - yield resp.getChunk_asU8(); +async function glob(filesystem: FileSystemGlob, str: string, { cwd = '.', absolute = true, filesOnly = false, flush = true, dot = true }) { + if (!str) return []; + + let glob = globalyzer(str); + + if (!glob.isGlob) { + try { + let resolved = path.resolve(cwd, str); + let dirent = await filesystem.promises.stat(resolved); + if (filesOnly && !dirent.isFile()) return []; + + return absolute ? [resolved] : [str]; + } catch (err) { + if (err.code != 'ENOENT') throw err; + + return []; + } } + + if (flush) CACHE = {}; + + let matches: string[] = []; + const res = globrex(glob.glob, { filepath:true, globstar:true, extended:true }); + const globPath = res.path; + + await walk(filesystem, matches, glob.base, globPath, { cwd, absolute, filesOnly, flush, dot }, '.', 0); + return absolute ? matches.map(x => path.resolve(cwd, x)) : matches; } -/** - * Requests a pack from the connected node for the named vault - * @param vaultId ID of vault - * @param body contains the pack request - * @param client A connection object to the node - * @returns AsyncGenerator of Uint8Arrays representing the Pack Response - */ -async function* requestPack( - vaultNameOrId: string, - body: Buffer, - client: GRPCClientAgent, -): AsyncGenerator { - const responseBuffers: Array = []; - - const meta = new grpc.Metadata(); - // FIXME make it a VaultIdReadable - meta.set('vaultNameOrId', vaultNameOrId); - - const stream = client.vaultsGitPackGet(meta); - const write = promisify(stream.write).bind(stream); - - stream.on('data', (d) => { - responseBuffers.push(d.getChunk_asU8()); - }); - - const chunk = new vaultsPB.PackChunk(); - chunk.setChunk(body); - write(chunk); - stream.end(); - - yield await new Promise((resolve) => { - stream.once('end', () => { - resolve(Buffer.concat(responseBuffers)); - }); - }); +const CHARS = { '{': '}', '(': ')', '[': ']'}; +const STRICT = /\\(.)|(^!|\*|[\].+)]\?|\[[^\\\]]+\]|\{[^\\}]+\}|\(\?[:!=][^\\)]+\)|\([^|]+\|[^\\)]+\)|(\\).|([@?!+*]\(.*\)))/; +const RELAXED = /\\(.)|(^!|[*?{}()[\]]|\(\?)/; + +function isglob(str: string, { strict = true } = {}): boolean { + if (str === '') return false; + let match, rgx = strict ? STRICT : RELAXED; + while ((match = rgx.exec(str))) { + if (match[2]) return true; + let idx = match.index + match[0].length; + + // if an open bracket/brace/paren is escaped, + // set the index to the next closing character + let open = match[1]; + let close = open ? CHARS[open] : null; + if (open && close) { + let n = str.indexOf(close, idx); + if (n !== -1) idx = n + 1; + } + + str = str.slice(idx); + } + return false; } -/** - * Requests the vault names from the connected node. - * @param client A connection object to the node - * @param nodeId - */ -async function requestVaultNames( - client: GRPCClientAgent, - nodeId: NodeId, -): Promise { - const request = new nodesPB.Node(); - request.setNodeId(nodeId); - const vaultList = client.vaultsScan(request); - const data: string[] = []; - for await (const vault of vaultList) { - const vaultMessage = vault.getNameOrId(); - data.push(vaultMessage); +function parent(str: string, { strict = false } = {}): string { + str = path.normalize(str).replace(/\/|\\/, '/'); + // special case for strings ending in enclosure containing path separator + if (/[\{\[].*[\/]*.*[\}\]]$/.test(str)) str += '/'; + + // preserves full path in case of trailing path separator + str += 'a'; + + do {str = path.dirname(str)} + while (isglob(str, {strict}) || /(^|[^\\])([\{\[]|\([^\)]+$)/.test(str)); + // remove escape chars and return result + return str.replace(/\\([\*\?\|\[\]\(\)\{\}])/g, '$1'); +}; + +function globalyzer(pattern: string, opts = {}) { + let base = parent(pattern, opts); + let isGlob = isglob(pattern, opts); + let glob; + if (base != '.') { + glob = pattern.substr(base.length); + if (glob.startsWith('/')) glob = glob.substr(1); + } else { + glob = pattern; + } + + if (!isGlob) { + base = path.dirname(pattern); + glob = base !== '.' ? pattern.substr(base.length) : pattern; } + if (glob.startsWith('./')) glob = glob.substr(2); + if (glob.startsWith('/')) glob = glob.substr(1); + + return { base, glob, isGlob }; +} + +const isWin = process.platform === 'win32'; +const SEP = isWin ? `\\\\+` : `\\/`; +const SEP_ESC = isWin ? `\\\\` : `/`; +const GLOBSTAR = `((?:[^/]*(?:/|$))*)`; +const WILDCARD = `([^/]*)`; +const GLOBSTAR_SEGMENT = `((?:[^${SEP_ESC}]*(?:${SEP_ESC}|$))*)`; +const WILDCARD_SEGMENT = `([^${SEP_ESC}]*)`; + +function globrex(glob: string, { extended = false, globstar = false, strict = false, filepath = false, flags = ''} = {}) { + let regex = ''; + let segment = ''; + let path: {regex: RegExp | string, segments: RegExp[], globstar?: RegExp } = { regex: '', segments: [] }; + + // If we are doing extended matching, this boolean is true when we are inside + // a group (eg {*.html,*.js}), and false otherwise. + let inGroup = false; + let inRange = false; + + // extglob stack. Keep track of scope + const ext: string[] = []; + + // Helper function to build string and segments + function add(str: string, { split, last, only }: { split?: boolean, last?: boolean, only?: string} = {}) { + if (only !== 'path') regex += str; + if (filepath && only !== 'regex') { + path.regex += (str === '\\/' ? SEP : str); + if (split) { + if (last) segment += str; + if (segment !== '') { + if (!flags.includes('g')) segment = `^${segment}$`; // change it 'includes' + path.segments.push(new RegExp(segment, flags)); + } + segment = ''; + } else { + segment += str; + } + } + } + + let c, n; + for (let i = 0; i < glob.length; i++) { + c = glob[i]; + n = glob[i + 1]; + + if (['\\', '$', '^', '.', '='].includes(c)) { + add(`\\${c}`); + continue; + } + + if (c === '/') { + add(`\\${c}`, {split: true}); + if (n === '/' && !strict) regex += '?'; + continue; + } + + if (c === '(') { + if (ext.length) { + add(c); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === ')') { + if (ext.length) { + add(c); + let type = ext.pop(); + if (type === '@') { + add('{1}'); + } else if (type === '!') { + add('([^\/]*)'); + } else { + add(type!); + } + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '|') { + if (ext.length) { + add(c); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '+') { + if (n === '(' && extended) { + ext.push(c); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '@' && extended) { + if (n === '(') { + ext.push(c); + continue; + } + } + + if (c === '!') { + if (extended) { + if (inRange) { + add('^'); + continue + } + if (n === '(') { + ext.push(c); + add('(?!'); + i++; + continue; + } + add(`\\${c}`); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '?') { + if (extended) { + if (n === '(') { + ext.push(c); + } else { + add('.'); + } + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '[') { + if (inRange && n === ':') { + i++; // skip [ + let value = ''; + while(glob[++i] !== ':') value += glob[i]; + if (value === 'alnum') add('(\\w|\\d)'); + else if (value === 'space') add('\\s'); + else if (value === 'digit') add('\\d'); + i++; // skip last ] + continue; + } + if (extended) { + inRange = true; + add(c); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === ']') { + if (extended) { + inRange = false; + add(c); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '{') { + if (extended) { + inGroup = true; + add('('); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '}') { + if (extended) { + inGroup = false; + add(')'); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === ',') { + if (inGroup) { + add('|'); + continue; + } + add(`\\${c}`); + continue; + } + + if (c === '*') { + if (n === '(' && extended) { + ext.push(c); + continue; + } + // Move over all consecutive "*"'s. + // Also store the previous and next characters + let prevChar = glob[i - 1]; + let starCount = 1; + while (glob[i + 1] === '*') { + starCount++; + i++; + } + let nextChar = glob[i + 1]; + if (!globstar) { + // globstar is disabled, so treat any number of "*" as one + add('.*'); + } else { + // globstar is enabled, so determine if this is a globstar segment + let isGlobstar = + starCount > 1 && // multiple "*"'s + (prevChar === '/' || prevChar === undefined) && // from the start of the segment + (nextChar === '/' || nextChar === undefined); // to the end of the segment + if (isGlobstar) { + // it's a globstar, so match zero or more path segments + add(GLOBSTAR, {only:'regex'}); + add(GLOBSTAR_SEGMENT, {only:'path', last:true, split:true}); + i++; // move over the "/" + } else { + // it's not a globstar, so only match one path segment + add(WILDCARD, {only:'regex'}); + add(WILDCARD_SEGMENT, {only:'path'}); + } + } + continue; + } + + add(c); + } + + + // When regexp 'g' flag is specified don't + // constrain the regular expression with ^ & $ + if (!flags.includes('g')) { + regex = `^${regex}$`; + segment = `^${segment}$`; + if (filepath) path.regex = `^${path.regex}$`; + } + let result; + result = { regex: new RegExp(regex, flags) }; + + // Push the last segment + if (filepath) { + path.segments.push(new RegExp(segment, flags)); + path.regex = new RegExp(path.regex, flags); + path.globstar = new RegExp(!flags.includes('g') ? `^${GLOBSTAR_SEGMENT}$` : GLOBSTAR_SEGMENT, flags); + result.path = path; + } - return data; + return result; } export { @@ -259,6 +530,5 @@ export { readdirRecursively, readdirRecursivelyEFS, readdirRecursivelyEFS2, - constructGitHandler, - searchVaultName, + glob, };