Skip to content

Commit

Permalink
add vector support (#214)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaji-kharse authored Aug 21, 2024
1 parent 66ab007 commit 8f77805
Show file tree
Hide file tree
Showing 18 changed files with 389 additions and 233 deletions.
2 changes: 1 addition & 1 deletion generate_proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ protoc \
yarn grpc_tools_node_protoc \
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--grpc_out=./generated/ \
--grpc_out=grpc_js:./generated/ \
--proto_path=./protos/ api.proto
201 changes: 101 additions & 100 deletions generated/api_grpc_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,155 +21,156 @@
// SongServerRequest. Use snake_case (underscore_separated_names) for field names – for
// example, song_name.
//
"use strict";
var grpc = require("@grpc/grpc-js");
var api_pb = require("./api_pb.js");
'use strict';
var grpc = require('@grpc/grpc-js');
var api_pb = require('./api_pb.js');

function serialize_api_Check(arg) {
if (!(arg instanceof api_pb.Check)) {
throw new Error("Expected argument of type api.Check");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Check)) {
throw new Error('Expected argument of type api.Check');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Check(buffer_arg) {
return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_LoginRequest(arg) {
if (!(arg instanceof api_pb.LoginRequest)) {
throw new Error("Expected argument of type api.LoginRequest");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.LoginRequest)) {
throw new Error('Expected argument of type api.LoginRequest');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_LoginRequest(buffer_arg) {
return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_Operation(arg) {
if (!(arg instanceof api_pb.Operation)) {
throw new Error("Expected argument of type api.Operation");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Operation)) {
throw new Error('Expected argument of type api.Operation');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Operation(buffer_arg) {
return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_Payload(arg) {
if (!(arg instanceof api_pb.Payload)) {
throw new Error("Expected argument of type api.Payload");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Payload)) {
throw new Error('Expected argument of type api.Payload');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Payload(buffer_arg) {
return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_Request(arg) {
if (!(arg instanceof api_pb.Request)) {
throw new Error("Expected argument of type api.Request");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Request)) {
throw new Error('Expected argument of type api.Request');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Request(buffer_arg) {
return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_Response(arg) {
if (!(arg instanceof api_pb.Response)) {
throw new Error("Expected argument of type api.Response");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Response)) {
throw new Error('Expected argument of type api.Response');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Response(buffer_arg) {
return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_TxnContext(arg) {
if (!(arg instanceof api_pb.TxnContext)) {
throw new Error("Expected argument of type api.TxnContext");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.TxnContext)) {
throw new Error('Expected argument of type api.TxnContext');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_TxnContext(buffer_arg) {
return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_api_Version(arg) {
if (!(arg instanceof api_pb.Version)) {
throw new Error("Expected argument of type api.Version");
}
return Buffer.from(arg.serializeBinary());
if (!(arg instanceof api_pb.Version)) {
throw new Error('Expected argument of type api.Version');
}
return Buffer.from(arg.serializeBinary());
}

function deserialize_api_Version(buffer_arg) {
return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg));
return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg));
}


// Graph response.
var DgraphService = (exports.DgraphService = {
login: {
path: "/api.Dgraph/Login",
requestStream: false,
responseStream: false,
requestType: api_pb.LoginRequest,
responseType: api_pb.Response,
requestSerialize: serialize_api_LoginRequest,
requestDeserialize: deserialize_api_LoginRequest,
responseSerialize: serialize_api_Response,
responseDeserialize: deserialize_api_Response,
},
query: {
path: "/api.Dgraph/Query",
requestStream: false,
responseStream: false,
requestType: api_pb.Request,
responseType: api_pb.Response,
requestSerialize: serialize_api_Request,
requestDeserialize: deserialize_api_Request,
responseSerialize: serialize_api_Response,
responseDeserialize: deserialize_api_Response,
},
alter: {
path: "/api.Dgraph/Alter",
requestStream: false,
responseStream: false,
requestType: api_pb.Operation,
responseType: api_pb.Payload,
requestSerialize: serialize_api_Operation,
requestDeserialize: deserialize_api_Operation,
responseSerialize: serialize_api_Payload,
responseDeserialize: deserialize_api_Payload,
},
commitOrAbort: {
path: "/api.Dgraph/CommitOrAbort",
requestStream: false,
responseStream: false,
requestType: api_pb.TxnContext,
responseType: api_pb.TxnContext,
requestSerialize: serialize_api_TxnContext,
requestDeserialize: deserialize_api_TxnContext,
responseSerialize: serialize_api_TxnContext,
responseDeserialize: deserialize_api_TxnContext,
},
checkVersion: {
path: "/api.Dgraph/CheckVersion",
requestStream: false,
responseStream: false,
requestType: api_pb.Check,
responseType: api_pb.Version,
requestSerialize: serialize_api_Check,
requestDeserialize: deserialize_api_Check,
responseSerialize: serialize_api_Version,
responseDeserialize: deserialize_api_Version,
},
});
var DgraphService = exports.DgraphService = {
login: {
path: '/api.Dgraph/Login',
requestStream: false,
responseStream: false,
requestType: api_pb.LoginRequest,
responseType: api_pb.Response,
requestSerialize: serialize_api_LoginRequest,
requestDeserialize: deserialize_api_LoginRequest,
responseSerialize: serialize_api_Response,
responseDeserialize: deserialize_api_Response,
},
query: {
path: '/api.Dgraph/Query',
requestStream: false,
responseStream: false,
requestType: api_pb.Request,
responseType: api_pb.Response,
requestSerialize: serialize_api_Request,
requestDeserialize: deserialize_api_Request,
responseSerialize: serialize_api_Response,
responseDeserialize: deserialize_api_Response,
},
alter: {
path: '/api.Dgraph/Alter',
requestStream: false,
responseStream: false,
requestType: api_pb.Operation,
responseType: api_pb.Payload,
requestSerialize: serialize_api_Operation,
requestDeserialize: deserialize_api_Operation,
responseSerialize: serialize_api_Payload,
responseDeserialize: deserialize_api_Payload,
},
commitOrAbort: {
path: '/api.Dgraph/CommitOrAbort',
requestStream: false,
responseStream: false,
requestType: api_pb.TxnContext,
responseType: api_pb.TxnContext,
requestSerialize: serialize_api_TxnContext,
requestDeserialize: deserialize_api_TxnContext,
responseSerialize: serialize_api_TxnContext,
responseDeserialize: deserialize_api_TxnContext,
},
checkVersion: {
path: '/api.Dgraph/CheckVersion',
requestStream: false,
responseStream: false,
requestType: api_pb.Check,
responseType: api_pb.Version,
requestSerialize: serialize_api_Check,
requestDeserialize: deserialize_api_Check,
responseSerialize: serialize_api_Version,
responseDeserialize: deserialize_api_Version,
},
};

exports.DgraphClient = grpc.makeGenericClientConstructor(DgraphService);
9 changes: 9 additions & 0 deletions generated/api_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,13 @@ export class Value extends jspb.Message {
getUidVal(): number;
setUidVal(value: number): void;

hasVfloat32Val(): boolean;
clearVfloat32Val(): void;
getVfloat32Val(): Uint8Array | string;
getVfloat32Val_asU8(): Uint8Array;
getVfloat32Val_asB64(): string;
setVfloat32Val(value: Uint8Array | string): void;

getValCase(): Value.ValCase;
serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Value.AsObject;
Expand All @@ -562,6 +569,7 @@ export namespace Value {
datetimeVal: Uint8Array | string,
passwordVal: string,
uidVal: number,
vfloat32Val: Uint8Array | string,
}

export enum ValCase {
Expand All @@ -577,6 +585,7 @@ export namespace Value {
DATETIME_VAL = 9,
PASSWORD_VAL = 10,
UID_VAL = 11,
VFLOAT32_VAL = 13,
}
}

Expand Down
Loading

0 comments on commit 8f77805

Please sign in to comment.