From 8b607a2ef4c79ea5801690ee413866a1e44e7e22 Mon Sep 17 00:00:00 2001 From: David Moore <4121492+davemooreuws@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:56:45 +1100 Subject: [PATCH] feat: kv list keys (#223) * implement keys method on kv stores * fix: don't log grpc error metadata * chore: update nitric version --------- Co-authored-by: Jye Cusch --- package.json | 2 +- src/api/errors/provider-error.ts | 3 +- src/api/keyvalue/v1/keyvalue.ts | 6 +- src/api/keyvalue/v1/store.ts | 89 +- src/context/websocket.ts | 2 +- .../proto/deployments/v1/deployments_pb.js | 2 +- .../proto/kvstore/v1/kvstore_grpc_pb.d.ts | 38 + .../proto/kvstore/v1/kvstore_grpc_pb.js | 149 ++ .../nitric/proto/kvstore/v1/kvstore_pb.d.ts | 250 +++ src/gen/nitric/proto/kvstore/v1/kvstore_pb.js | 1928 +++++++++++++++++ .../nitric/proto/topics/v1/topics_grpc_pb.js | 2 +- src/gen/nitric/proto/topics/v1/topics_pb.d.ts | 2 +- src/gen/nitric/proto/topics/v1/topics_pb.js | 4 +- .../proto/websockets/v1/websockets_pb.d.ts | 6 +- .../proto/websockets/v1/websockets_pb.js | 12 +- 15 files changed, 2451 insertions(+), 44 deletions(-) create mode 100644 src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.d.ts create mode 100644 src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.js create mode 100644 src/gen/nitric/proto/kvstore/v1/kvstore_pb.d.ts create mode 100644 src/gen/nitric/proto/kvstore/v1/kvstore_pb.js diff --git a/package.json b/package.json index d64b8dd3..8559a352 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@nitric/sdk", "description": "Nitric NodeJS client sdk", - "nitric": "v1.0.0", + "nitric": "v1.1.0", "author": "Nitric ", "repository": "https://github.com/nitrictech/node-sdk", "main": "lib/index.js", diff --git a/src/api/errors/provider-error.ts b/src/api/errors/provider-error.ts index 96c94ed4..a5a61d65 100644 --- a/src/api/errors/provider-error.ts +++ b/src/api/errors/provider-error.ts @@ -49,8 +49,7 @@ export class NitricProviderError extends Error { Nitric Provider Error: ${grpcError.name} Code: ${grpcError.code} Message: ${grpcError.message} - Details: ${details} - Metadata: ${JSON.stringify(grpcError.metadata)}`; + Details: ${details}`; super(message); } } diff --git a/src/api/keyvalue/v1/keyvalue.ts b/src/api/keyvalue/v1/keyvalue.ts index 80cb9ea3..27a93a88 100644 --- a/src/api/keyvalue/v1/keyvalue.ts +++ b/src/api/keyvalue/v1/keyvalue.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. import { SERVICE_BIND } from '../../../constants'; -import { KeyValueClient } from '@nitric/proto/keyvalue/v1/keyvalue_grpc_pb'; +import { KvStoreClient } from '@nitric/proto/kvstore/v1/kvstore_grpc_pb'; import * as grpc from '@grpc/grpc-js'; import { StoreRef, ValueStructure } from './store'; @@ -23,10 +23,10 @@ import { StoreRef, ValueStructure } from './store'; * Used to create references to key/value stores. */ export class KeyValue { - private kvClient: KeyValueClient; + private kvClient: KvStoreClient; constructor() { - this.kvClient = new KeyValueClient( + this.kvClient = new KvStoreClient( SERVICE_BIND, grpc.ChannelCredentials.createInsecure() ); diff --git a/src/api/keyvalue/v1/store.ts b/src/api/keyvalue/v1/store.ts index 4b22875c..dadeff01 100644 --- a/src/api/keyvalue/v1/store.ts +++ b/src/api/keyvalue/v1/store.ts @@ -12,15 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. import { - KeyValueDeleteRequest, - KeyValueGetRequest, - KeyValueGetResponse, - KeyValueSetRequest, + KvStoreDeleteKeyRequest, + KvStoreGetValueRequest, + KvStoreGetValueResponse, + KvStoreScanKeysRequest, + KvStoreScanKeysResponse, + KvStoreSetValueRequest, + Store, ValueRef, -} from '@nitric/proto/keyvalue/v1/keyvalue_pb'; -import { KeyValueClient } from '@nitric/proto/keyvalue/v1/keyvalue_grpc_pb'; +} from '@nitric/proto/kvstore/v1/kvstore_pb'; +import { KvStoreClient } from '@nitric/proto/kvstore/v1/kvstore_grpc_pb'; import { fromGrpcError } from '../../errors'; import { Struct } from 'google-protobuf/google/protobuf/struct_pb'; +import { Transform } from 'stream'; +import { ServiceError } from '@grpc/grpc-js'; export type ValueStructure = Record; @@ -30,10 +35,10 @@ export type ValueStructure = Record; * Provides a KeyValue API StoreRef class. */ export class StoreRef { - private kvClient: KeyValueClient; + private kvClient: KvStoreClient; public readonly name: string; - constructor(kvClient: KeyValueClient, name: string) { + constructor(kvClient: KvStoreClient, name: string) { this.kvClient = kvClient; this.name = name; } @@ -46,25 +51,28 @@ export class StoreRef { * @returns the value or null if not found */ public async get(key: string): Promise { - const request = new KeyValueGetRequest(); + const request = new KvStoreGetValueRequest(); const ref = new ValueRef(); ref.setStore(this.name); ref.setKey(key); request.setRef(ref); return new Promise((resolve, reject) => { - this.kvClient.get(request, (error, response: KeyValueGetResponse) => { - if (error) { - reject(fromGrpcError(error)); - } else if (response.hasValue()) { - const value = response.getValue(); - const content = value.getContent().toJavaScript() as T; + this.kvClient.getValue( + request, + (error, response: KvStoreGetValueResponse) => { + if (error) { + reject(fromGrpcError(error)); + } else if (response.hasValue()) { + const value = response.getValue(); + const content = value.getContent().toJavaScript() as T; - resolve(content); - } else { - resolve(null); + resolve(content); + } else { + resolve(null); + } } - }); + ); }); } @@ -77,7 +85,7 @@ export class StoreRef { * @returns void */ public async set(key: string, value: T): Promise { - const request = new KeyValueSetRequest(); + const request = new KvStoreSetValueRequest(); const ref = new ValueRef(); ref.setStore(this.name); ref.setKey(key); @@ -86,7 +94,7 @@ export class StoreRef { request.setContent(content); return new Promise((resolve, reject) => { - this.kvClient.set(request, (error) => { + this.kvClient.setValue(request, (error) => { if (error) { reject(fromGrpcError(error)); } else { @@ -104,14 +112,14 @@ export class StoreRef { * @returns void */ public async delete(key: string): Promise { - const request = new KeyValueDeleteRequest(); + const request = new KvStoreDeleteKeyRequest(); const ref = new ValueRef(); ref.setStore(this.name); ref.setKey(key); request.setRef(ref); return new Promise((resolve, reject) => { - this.kvClient.delete(request, (error) => { + this.kvClient.deleteKey(request, (error) => { if (error) { reject(fromGrpcError(error)); } else { @@ -120,4 +128,39 @@ export class StoreRef { }); }); } + + /** + * Return an async iterable of keys in the store + * + * @param prefix The prefix to filter keys by, if not provided all keys will be returned + * @returns an async iterable of keys + */ + public keys(prefix = ''): AsyncIterable { + const store = new Store(); + store.setName(this.name); + const request = new KvStoreScanKeysRequest(); + request.setStore(store); + request.setPrefix(prefix); + + const respStream = this.kvClient.scanKeys(request); + + const transform = new Transform({ + objectMode: true, + transform(result: KvStoreScanKeysResponse, _, callback) { + callback(null, result.getKey()); + }, + }); + + respStream.on('error', (e) => { + transform.destroy(fromGrpcError(e as ServiceError)); + }); + respStream.pipe(transform); + + const iterator = transform[Symbol.asyncIterator](); + return { + [Symbol.asyncIterator]() { + return iterator; + }, + } as any; + } } diff --git a/src/context/websocket.ts b/src/context/websocket.ts index 4c48b109..502fdd4b 100644 --- a/src/context/websocket.ts +++ b/src/context/websocket.ts @@ -54,7 +54,7 @@ export class WebsocketNotificationContext extends BaseContext< message ? message.getBody() : '', request.getSocketName(), request.getWebsocketEventCase(), - request.getConnectionid(), + request.getConnectionId(), query ); diff --git a/src/gen/nitric/proto/deployments/v1/deployments_pb.js b/src/gen/nitric/proto/deployments/v1/deployments_pb.js index 92cc2466..d945c537 100644 --- a/src/gen/nitric/proto/deployments/v1/deployments_pb.js +++ b/src/gen/nitric/proto/deployments/v1/deployments_pb.js @@ -1627,7 +1627,7 @@ proto.nitric.proto.deployments.v1.UpResult.prototype.setSuccess = function(value /** - * optional string Text = 2; + * optional string text = 2; * @return {string} */ proto.nitric.proto.deployments.v1.UpResult.prototype.getText = function() { diff --git a/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.d.ts b/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.d.ts new file mode 100644 index 00000000..aaafaddd --- /dev/null +++ b/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.d.ts @@ -0,0 +1,38 @@ +// GENERATED CODE -- DO NOT EDIT! + +// package: nitric.proto.kvstore.v1 +// file: nitric/proto/kvstore/v1/kvstore.proto + +import * as nitric_proto_kvstore_v1_kvstore_pb from "../../../../nitric/proto/kvstore/v1/kvstore_pb"; +import * as grpc from "@grpc/grpc-js"; + +interface IKvStoreService extends grpc.ServiceDefinition { + getValue: grpc.MethodDefinition; + setValue: grpc.MethodDefinition; + deleteKey: grpc.MethodDefinition; + scanKeys: grpc.MethodDefinition; +} + +export const KvStoreService: IKvStoreService; + +export interface IKvStoreServer extends grpc.UntypedServiceImplementation { + getValue: grpc.handleUnaryCall; + setValue: grpc.handleUnaryCall; + deleteKey: grpc.handleUnaryCall; + scanKeys: grpc.handleServerStreamingCall; +} + +export class KvStoreClient extends grpc.Client { + constructor(address: string, credentials: grpc.ChannelCredentials, options?: object); + getValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + getValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + setValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + setValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + setValue(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + deleteKey(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest, callback: grpc.requestCallback): grpc.ClientUnaryCall; + deleteKey(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest, metadataOrOptions: grpc.Metadata | grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + deleteKey(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest, metadata: grpc.Metadata | null, options: grpc.CallOptions | null, callback: grpc.requestCallback): grpc.ClientUnaryCall; + scanKeys(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysRequest, metadataOrOptions?: grpc.Metadata | grpc.CallOptions | null): grpc.ClientReadableStream; + scanKeys(argument: nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysRequest, metadata?: grpc.Metadata | null, options?: grpc.CallOptions | null): grpc.ClientReadableStream; +} diff --git a/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.js b/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.js new file mode 100644 index 00000000..1e04fc98 --- /dev/null +++ b/src/gen/nitric/proto/kvstore/v1/kvstore_grpc_pb.js @@ -0,0 +1,149 @@ +// GENERATED CODE -- DO NOT EDIT! + +'use strict'; +var grpc = require('@grpc/grpc-js'); +var nitric_proto_kvstore_v1_kvstore_pb = require('../../../../nitric/proto/kvstore/v1/kvstore_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); + +function serialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyResponse)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreGetValueRequest(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreGetValueRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreGetValueRequest(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreGetValueResponse(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueResponse)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreGetValueResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreGetValueResponse(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreScanKeysRequest(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysRequest)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreScanKeysRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreScanKeysRequest(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreScanKeysResponse(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysResponse)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreScanKeysResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreScanKeysResponse(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreSetValueRequest(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreSetValueRequest'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreSetValueRequest(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest.deserializeBinary(new Uint8Array(buffer_arg)); +} + +function serialize_nitric_proto_kvstore_v1_KvStoreSetValueResponse(arg) { + if (!(arg instanceof nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueResponse)) { + throw new Error('Expected argument of type nitric.proto.kvstore.v1.KvStoreSetValueResponse'); + } + return Buffer.from(arg.serializeBinary()); +} + +function deserialize_nitric_proto_kvstore_v1_KvStoreSetValueResponse(buffer_arg) { + return nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueResponse.deserializeBinary(new Uint8Array(buffer_arg)); +} + + +// Service for storage and retrieval of simple JSON keyValue +var KvStoreService = exports.KvStoreService = { + // Get an existing value +getValue: { + path: '/nitric.proto.kvstore.v1.KvStore/GetValue', + requestStream: false, + responseStream: false, + requestType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueRequest, + responseType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreGetValueResponse, + requestSerialize: serialize_nitric_proto_kvstore_v1_KvStoreGetValueRequest, + requestDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreGetValueRequest, + responseSerialize: serialize_nitric_proto_kvstore_v1_KvStoreGetValueResponse, + responseDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreGetValueResponse, + }, + // Create a new or overwrite an existing value +setValue: { + path: '/nitric.proto.kvstore.v1.KvStore/SetValue', + requestStream: false, + responseStream: false, + requestType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueRequest, + responseType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreSetValueResponse, + requestSerialize: serialize_nitric_proto_kvstore_v1_KvStoreSetValueRequest, + requestDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreSetValueRequest, + responseSerialize: serialize_nitric_proto_kvstore_v1_KvStoreSetValueResponse, + responseDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreSetValueResponse, + }, + // Delete a key and its value +deleteKey: { + path: '/nitric.proto.kvstore.v1.KvStore/DeleteKey', + requestStream: false, + responseStream: false, + requestType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyRequest, + responseType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreDeleteKeyResponse, + requestSerialize: serialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest, + requestDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyRequest, + responseSerialize: serialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse, + responseDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreDeleteKeyResponse, + }, + // Iterate over all keys in a store +scanKeys: { + path: '/nitric.proto.kvstore.v1.KvStore/ScanKeys', + requestStream: false, + responseStream: true, + requestType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysRequest, + responseType: nitric_proto_kvstore_v1_kvstore_pb.KvStoreScanKeysResponse, + requestSerialize: serialize_nitric_proto_kvstore_v1_KvStoreScanKeysRequest, + requestDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreScanKeysRequest, + responseSerialize: serialize_nitric_proto_kvstore_v1_KvStoreScanKeysResponse, + responseDeserialize: deserialize_nitric_proto_kvstore_v1_KvStoreScanKeysResponse, + }, +}; + +exports.KvStoreClient = grpc.makeGenericClientConstructor(KvStoreService); diff --git a/src/gen/nitric/proto/kvstore/v1/kvstore_pb.d.ts b/src/gen/nitric/proto/kvstore/v1/kvstore_pb.d.ts new file mode 100644 index 00000000..77d7c145 --- /dev/null +++ b/src/gen/nitric/proto/kvstore/v1/kvstore_pb.d.ts @@ -0,0 +1,250 @@ +// package: nitric.proto.kvstore.v1 +// file: nitric/proto/kvstore/v1/kvstore.proto + +import * as jspb from "google-protobuf"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; + +export class Store extends jspb.Message { + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Store.AsObject; + static toObject(includeInstance: boolean, msg: Store): Store.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Store, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Store; + static deserializeBinaryFromReader(message: Store, reader: jspb.BinaryReader): Store; +} + +export namespace Store { + export type AsObject = { + name: string, + } +} + +export class ValueRef extends jspb.Message { + getStore(): string; + setStore(value: string): void; + + getKey(): string; + setKey(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValueRef.AsObject; + static toObject(includeInstance: boolean, msg: ValueRef): ValueRef.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: ValueRef, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValueRef; + static deserializeBinaryFromReader(message: ValueRef, reader: jspb.BinaryReader): ValueRef; +} + +export namespace ValueRef { + export type AsObject = { + store: string, + key: string, + } +} + +export class Value extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + hasContent(): boolean; + clearContent(): void; + getContent(): google_protobuf_struct_pb.Struct | undefined; + setContent(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Value.AsObject; + static toObject(includeInstance: boolean, msg: Value): Value.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Value, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Value; + static deserializeBinaryFromReader(message: Value, reader: jspb.BinaryReader): Value; +} + +export namespace Value { + export type AsObject = { + ref?: ValueRef.AsObject, + content?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class KvStoreGetValueRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreGetValueRequest.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreGetValueRequest): KvStoreGetValueRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreGetValueRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreGetValueRequest; + static deserializeBinaryFromReader(message: KvStoreGetValueRequest, reader: jspb.BinaryReader): KvStoreGetValueRequest; +} + +export namespace KvStoreGetValueRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + } +} + +export class KvStoreGetValueResponse extends jspb.Message { + hasValue(): boolean; + clearValue(): void; + getValue(): Value | undefined; + setValue(value?: Value): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreGetValueResponse.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreGetValueResponse): KvStoreGetValueResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreGetValueResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreGetValueResponse; + static deserializeBinaryFromReader(message: KvStoreGetValueResponse, reader: jspb.BinaryReader): KvStoreGetValueResponse; +} + +export namespace KvStoreGetValueResponse { + export type AsObject = { + value?: Value.AsObject, + } +} + +export class KvStoreSetValueRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + hasContent(): boolean; + clearContent(): void; + getContent(): google_protobuf_struct_pb.Struct | undefined; + setContent(value?: google_protobuf_struct_pb.Struct): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreSetValueRequest.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreSetValueRequest): KvStoreSetValueRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreSetValueRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreSetValueRequest; + static deserializeBinaryFromReader(message: KvStoreSetValueRequest, reader: jspb.BinaryReader): KvStoreSetValueRequest; +} + +export namespace KvStoreSetValueRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + content?: google_protobuf_struct_pb.Struct.AsObject, + } +} + +export class KvStoreSetValueResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreSetValueResponse.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreSetValueResponse): KvStoreSetValueResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreSetValueResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreSetValueResponse; + static deserializeBinaryFromReader(message: KvStoreSetValueResponse, reader: jspb.BinaryReader): KvStoreSetValueResponse; +} + +export namespace KvStoreSetValueResponse { + export type AsObject = { + } +} + +export class KvStoreDeleteKeyRequest extends jspb.Message { + hasRef(): boolean; + clearRef(): void; + getRef(): ValueRef | undefined; + setRef(value?: ValueRef): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreDeleteKeyRequest.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreDeleteKeyRequest): KvStoreDeleteKeyRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreDeleteKeyRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreDeleteKeyRequest; + static deserializeBinaryFromReader(message: KvStoreDeleteKeyRequest, reader: jspb.BinaryReader): KvStoreDeleteKeyRequest; +} + +export namespace KvStoreDeleteKeyRequest { + export type AsObject = { + ref?: ValueRef.AsObject, + } +} + +export class KvStoreDeleteKeyResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreDeleteKeyResponse.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreDeleteKeyResponse): KvStoreDeleteKeyResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreDeleteKeyResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreDeleteKeyResponse; + static deserializeBinaryFromReader(message: KvStoreDeleteKeyResponse, reader: jspb.BinaryReader): KvStoreDeleteKeyResponse; +} + +export namespace KvStoreDeleteKeyResponse { + export type AsObject = { + } +} + +export class KvStoreScanKeysRequest extends jspb.Message { + hasStore(): boolean; + clearStore(): void; + getStore(): Store | undefined; + setStore(value?: Store): void; + + getPrefix(): string; + setPrefix(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreScanKeysRequest.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreScanKeysRequest): KvStoreScanKeysRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreScanKeysRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreScanKeysRequest; + static deserializeBinaryFromReader(message: KvStoreScanKeysRequest, reader: jspb.BinaryReader): KvStoreScanKeysRequest; +} + +export namespace KvStoreScanKeysRequest { + export type AsObject = { + store?: Store.AsObject, + prefix: string, + } +} + +export class KvStoreScanKeysResponse extends jspb.Message { + getKey(): string; + setKey(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KvStoreScanKeysResponse.AsObject; + static toObject(includeInstance: boolean, msg: KvStoreScanKeysResponse): KvStoreScanKeysResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KvStoreScanKeysResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KvStoreScanKeysResponse; + static deserializeBinaryFromReader(message: KvStoreScanKeysResponse, reader: jspb.BinaryReader): KvStoreScanKeysResponse; +} + +export namespace KvStoreScanKeysResponse { + export type AsObject = { + key: string, + } +} + diff --git a/src/gen/nitric/proto/kvstore/v1/kvstore_pb.js b/src/gen/nitric/proto/kvstore/v1/kvstore_pb.js new file mode 100644 index 00000000..adbe2d28 --- /dev/null +++ b/src/gen/nitric/proto/kvstore/v1/kvstore_pb.js @@ -0,0 +1,1928 @@ +// source: nitric/proto/kvstore/v1/kvstore.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @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() { + if (this) { return this; } + if (typeof window !== 'undefined') { return window; } + if (typeof global !== 'undefined') { return global; } + if (typeof self !== 'undefined') { return self; } + return Function('return this')(); +}.call(null)); + +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.Store', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.Value', null, global); +goog.exportSymbol('proto.nitric.proto.kvstore.v1.ValueRef', 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.nitric.proto.kvstore.v1.Store = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.Store, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.Store.displayName = 'proto.nitric.proto.kvstore.v1.Store'; +} +/** + * 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.nitric.proto.kvstore.v1.ValueRef = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.ValueRef, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.ValueRef.displayName = 'proto.nitric.proto.kvstore.v1.ValueRef'; +} +/** + * 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.nitric.proto.kvstore.v1.Value = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.Value, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.Value.displayName = 'proto.nitric.proto.kvstore.v1.Value'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreGetValueRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreGetValueResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreSetValueRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreSetValueResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreScanKeysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest'; +} +/** + * 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.nitric.proto.kvstore.v1.KvStoreScanKeysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.displayName = 'proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse'; +} + + + +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.nitric.proto.kvstore.v1.Store.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.Store.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.nitric.proto.kvstore.v1.Store} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.Store.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.nitric.proto.kvstore.v1.Store} + */ +proto.nitric.proto.kvstore.v1.Store.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.Store; + return proto.nitric.proto.kvstore.v1.Store.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.Store} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.Store} + */ +proto.nitric.proto.kvstore.v1.Store.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.nitric.proto.kvstore.v1.Store.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.Store.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.Store} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.Store.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.nitric.proto.kvstore.v1.Store.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.kvstore.v1.Store} returns this + */ +proto.nitric.proto.kvstore.v1.Store.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.nitric.proto.kvstore.v1.ValueRef.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.ValueRef.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.nitric.proto.kvstore.v1.ValueRef} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.ValueRef.toObject = function(includeInstance, msg) { + var f, obj = { + store: 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.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.ValueRef; + return proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.ValueRef} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.ValueRef.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.setStore(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.nitric.proto.kvstore.v1.ValueRef.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.ValueRef} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStore(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional string store = 1; + * @return {string} + */ +proto.nitric.proto.kvstore.v1.ValueRef.prototype.getStore = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.kvstore.v1.ValueRef} returns this + */ +proto.nitric.proto.kvstore.v1.ValueRef.prototype.setStore = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string key = 2; + * @return {string} + */ +proto.nitric.proto.kvstore.v1.ValueRef.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.kvstore.v1.ValueRef} returns this + */ +proto.nitric.proto.kvstore.v1.ValueRef.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.nitric.proto.kvstore.v1.Value.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.Value.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.nitric.proto.kvstore.v1.Value} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.Value.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.kvstore.v1.ValueRef.toObject(includeInstance, f), + content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.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.nitric.proto.kvstore.v1.Value} + */ +proto.nitric.proto.kvstore.v1.Value.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.Value; + return proto.nitric.proto.kvstore.v1.Value.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.Value} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.Value} + */ +proto.nitric.proto.kvstore.v1.Value.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + case 2: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setContent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.Value.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.Value.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.Value} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.Value.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter + ); + } + f = message.getContent(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.Value.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.Value} returns this +*/ +proto.nitric.proto.kvstore.v1.Value.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.Value} returns this + */ +proto.nitric.proto.kvstore.v1.Value.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.Value.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.Struct content = 2; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.kvstore.v1.Value.prototype.getContent = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 2)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.Value} returns this +*/ +proto.nitric.proto.kvstore.v1.Value.prototype.setContent = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.Value} returns this + */ +proto.nitric.proto.kvstore.v1.Value.prototype.clearContent = function() { + return this.setContent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.Value.prototype.hasContent = function() { + return jspb.Message.getField(this, 2) != 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.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.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.nitric.proto.kvstore.v1.KvStoreGetValueRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.kvstore.v1.ValueRef.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.nitric.proto.kvstore.v1.KvStoreGetValueRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest; + return proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueRequest.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != 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.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.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.nitric.proto.kvstore.v1.KvStoreGetValueResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.toObject = function(includeInstance, msg) { + var f, obj = { + value: (f = msg.getValue()) && proto.nitric.proto.kvstore.v1.Value.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.nitric.proto.kvstore.v1.KvStoreGetValueResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse; + return proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.Value; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.Value.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.Value.serializeBinaryToWriter + ); + } +}; + + +/** + * optional Value value = 1; + * @return {?proto.nitric.proto.kvstore.v1.Value} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.getValue = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.Value} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.Value, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.Value|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreGetValueResponse.prototype.hasValue = function() { + return jspb.Message.getField(this, 1) != 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.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.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.nitric.proto.kvstore.v1.KvStoreSetValueRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.kvstore.v1.ValueRef.toObject(includeInstance, f), + content: (f = msg.getContent()) && google_protobuf_struct_pb.Struct.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.nitric.proto.kvstore.v1.KvStoreSetValueRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest; + return proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + case 3: + var value = new google_protobuf_struct_pb.Struct; + reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader); + msg.setContent(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter + ); + } + f = message.getContent(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_struct_pb.Struct.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.Struct content = 3; + * @return {?proto.google.protobuf.Struct} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.getContent = function() { + return /** @type{?proto.google.protobuf.Struct} */ ( + jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3)); +}; + + +/** + * @param {?proto.google.protobuf.Struct|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.setContent = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.clearContent = function() { + return this.setContent(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueRequest.prototype.hasContent = 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.nitric.proto.kvstore.v1.KvStoreSetValueResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.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.nitric.proto.kvstore.v1.KvStoreSetValueResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.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.nitric.proto.kvstore.v1.KvStoreSetValueResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse; + return proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.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.nitric.proto.kvstore.v1.KvStoreSetValueResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreSetValueResponse.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.toObject = function(includeInstance, msg) { + var f, obj = { + ref: (f = msg.getRef()) && proto.nitric.proto.kvstore.v1.ValueRef.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest; + return proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.ValueRef; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.ValueRef.deserializeBinaryFromReader); + msg.setRef(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getRef(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.ValueRef.serializeBinaryToWriter + ); + } +}; + + +/** + * optional ValueRef ref = 1; + * @return {?proto.nitric.proto.kvstore.v1.ValueRef} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.getRef = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.ValueRef} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.ValueRef, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.ValueRef|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.setRef = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.clearRef = function() { + return this.setRef(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyRequest.prototype.hasRef = function() { + return jspb.Message.getField(this, 1) != 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.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse; + return proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.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.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreDeleteKeyResponse.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.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.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.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + store: (f = msg.getStore()) && proto.nitric.proto.kvstore.v1.Store.toObject(includeInstance, f), + prefix: 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.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest; + return proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.nitric.proto.kvstore.v1.Store; + reader.readMessage(value,proto.nitric.proto.kvstore.v1.Store.deserializeBinaryFromReader); + msg.setStore(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setPrefix(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStore(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.nitric.proto.kvstore.v1.Store.serializeBinaryToWriter + ); + } + f = message.getPrefix(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional Store store = 1; + * @return {?proto.nitric.proto.kvstore.v1.Store} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.getStore = function() { + return /** @type{?proto.nitric.proto.kvstore.v1.Store} */ ( + jspb.Message.getWrapperField(this, proto.nitric.proto.kvstore.v1.Store, 1)); +}; + + +/** + * @param {?proto.nitric.proto.kvstore.v1.Store|undefined} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} returns this +*/ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.setStore = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.clearStore = function() { + return this.setStore(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.hasStore = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional string prefix = 2; + * @return {string} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.getPrefix = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysRequest.prototype.setPrefix = 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.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.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.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + key: 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.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse; + return proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.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.setKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string key = 1; + * @return {string} + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse} returns this + */ +proto.nitric.proto.kvstore.v1.KvStoreScanKeysResponse.prototype.setKey = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +goog.object.extend(exports, proto.nitric.proto.kvstore.v1); diff --git a/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js index 87056cad..b88eaab1 100644 --- a/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js +++ b/src/gen/nitric/proto/topics/v1/topics_grpc_pb.js @@ -3,8 +3,8 @@ 'use strict'; var grpc = require('@grpc/grpc-js'); var nitric_proto_topics_v1_topics_pb = require('../../../../nitric/proto/topics/v1/topics_pb.js'); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); function serialize_nitric_proto_topics_v1_ClientMessage(arg) { if (!(arg instanceof nitric_proto_topics_v1_topics_pb.ClientMessage)) { diff --git a/src/gen/nitric/proto/topics/v1/topics_pb.d.ts b/src/gen/nitric/proto/topics/v1/topics_pb.d.ts index 3e88edc0..149a39de 100644 --- a/src/gen/nitric/proto/topics/v1/topics_pb.d.ts +++ b/src/gen/nitric/proto/topics/v1/topics_pb.d.ts @@ -2,8 +2,8 @@ // file: nitric/proto/topics/v1/topics.proto import * as jspb from "google-protobuf"; -import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; import * as google_protobuf_duration_pb from "google-protobuf/google/protobuf/duration_pb"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; export class ClientMessage extends jspb.Message { getId(): string; diff --git a/src/gen/nitric/proto/topics/v1/topics_pb.js b/src/gen/nitric/proto/topics/v1/topics_pb.js index 6c83a295..33d5c460 100644 --- a/src/gen/nitric/proto/topics/v1/topics_pb.js +++ b/src/gen/nitric/proto/topics/v1/topics_pb.js @@ -21,10 +21,10 @@ var global = (function() { return Function('return this')(); }.call(null)); -var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); -goog.object.extend(proto, google_protobuf_struct_pb); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); goog.object.extend(proto, google_protobuf_duration_pb); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); goog.exportSymbol('proto.nitric.proto.topics.v1.ClientMessage', null, global); goog.exportSymbol('proto.nitric.proto.topics.v1.ClientMessage.ContentCase', null, global); goog.exportSymbol('proto.nitric.proto.topics.v1.MessageRequest', null, global); diff --git a/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts b/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts index 3d8a4ecf..5a854ecc 100644 --- a/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts +++ b/src/gen/nitric/proto/websockets/v1/websockets_pb.d.ts @@ -212,8 +212,8 @@ export class WebsocketEventRequest extends jspb.Message { getSocketName(): string; setSocketName(value: string): void; - getConnectionid(): string; - setConnectionid(value: string): void; + getConnectionId(): string; + setConnectionId(value: string): void; hasConnection(): boolean; clearConnection(): void; @@ -244,7 +244,7 @@ export class WebsocketEventRequest extends jspb.Message { export namespace WebsocketEventRequest { export type AsObject = { socketName: string, - connectionid: string, + connectionId: string, connection?: WebsocketConnectionEvent.AsObject, disconnection?: WebsocketDisconnectionEvent.AsObject, message?: WebsocketMessageEvent.AsObject, diff --git a/src/gen/nitric/proto/websockets/v1/websockets_pb.js b/src/gen/nitric/proto/websockets/v1/websockets_pb.js index 2b390843..86e05ef5 100644 --- a/src/gen/nitric/proto/websockets/v1/websockets_pb.js +++ b/src/gen/nitric/proto/websockets/v1/websockets_pb.js @@ -1815,7 +1815,7 @@ proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.toObject = func proto.nitric.proto.websockets.v1.WebsocketEventRequest.toObject = function(includeInstance, msg) { var f, obj = { socketName: jspb.Message.getFieldWithDefault(msg, 1, ""), - connectionid: jspb.Message.getFieldWithDefault(msg, 2, ""), + connectionId: jspb.Message.getFieldWithDefault(msg, 2, ""), connection: (f = msg.getConnection()) && proto.nitric.proto.websockets.v1.WebsocketConnectionEvent.toObject(includeInstance, f), disconnection: (f = msg.getDisconnection()) && proto.nitric.proto.websockets.v1.WebsocketDisconnectionEvent.toObject(includeInstance, f), message: (f = msg.getMessage()) && proto.nitric.proto.websockets.v1.WebsocketMessageEvent.toObject(includeInstance, f) @@ -1861,7 +1861,7 @@ proto.nitric.proto.websockets.v1.WebsocketEventRequest.deserializeBinaryFromRead break; case 2: var value = /** @type {string} */ (reader.readString()); - msg.setConnectionid(value); + msg.setConnectionId(value); break; case 10: var value = new proto.nitric.proto.websockets.v1.WebsocketConnectionEvent; @@ -1914,7 +1914,7 @@ proto.nitric.proto.websockets.v1.WebsocketEventRequest.serializeBinaryToWriter = f ); } - f = message.getConnectionid(); + f = message.getConnectionId(); if (f.length > 0) { writer.writeString( 2, @@ -1967,10 +1967,10 @@ proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setSocketName = /** - * optional string connectionId = 2; + * optional string connection_id = 2; * @return {string} */ -proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getConnectionid = function() { +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getConnectionId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; @@ -1979,7 +1979,7 @@ proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.getConnectionid * @param {string} value * @return {!proto.nitric.proto.websockets.v1.WebsocketEventRequest} returns this */ -proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setConnectionid = function(value) { +proto.nitric.proto.websockets.v1.WebsocketEventRequest.prototype.setConnectionId = function(value) { return jspb.Message.setProto3StringField(this, 2, value); };