2
2
3
3
// Original file comments:
4
4
//
5
- // Copyright (C) 2017 Dgraph Labs, Inc. and Contributors
6
- //
7
- // Licensed under the Apache License, Version 2.0 (the "License");
8
- // you may not use this file except in compliance with the License.
9
- // You may obtain a copy of the License at
10
- //
11
- // http://www.apache.org/licenses/LICENSE-2.0
12
- //
13
- // Unless required by applicable law or agreed to in writing, software
14
- // distributed under the License is distributed on an "AS IS" BASIS,
15
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- // See the License for the specific language governing permissions and
17
- // limitations under the License.
5
+ // SPDX-FileCopyrightText: © Hypermode Inc. <[email protected] >
6
+ // SPDX-License-Identifier: Apache-2.0
18
7
//
19
8
// Style guide for Protocol Buffer 3.
20
9
// Use PascalCase (camelCase with an initial capital) for message names – for example,
21
10
// SongServerRequest. Use snake_case (underscore_separated_names) for field names – for
22
11
// example, song_name.
23
12
//
24
- " use strict"
25
- var grpc = require ( " @grpc/grpc-js" )
26
- var api_pb = require ( " ./api_pb.js" )
13
+ ' use strict' ;
14
+ var grpc = require ( ' @grpc/grpc-js' ) ;
15
+ var api_pb = require ( ' ./api_pb.js' ) ;
27
16
28
17
function serialize_api_Check ( arg ) {
29
18
if ( ! ( arg instanceof api_pb . Check ) ) {
30
- throw new Error ( " Expected argument of type api.Check" )
19
+ throw new Error ( ' Expected argument of type api.Check' ) ;
31
20
}
32
- return Buffer . from ( arg . serializeBinary ( ) )
21
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
33
22
}
34
23
35
24
function deserialize_api_Check ( buffer_arg ) {
36
- return api_pb . Check . deserializeBinary ( new Uint8Array ( buffer_arg ) )
25
+ return api_pb . Check . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
37
26
}
38
27
39
28
function serialize_api_LoginRequest ( arg ) {
40
29
if ( ! ( arg instanceof api_pb . LoginRequest ) ) {
41
- throw new Error ( " Expected argument of type api.LoginRequest" )
30
+ throw new Error ( ' Expected argument of type api.LoginRequest' ) ;
42
31
}
43
- return Buffer . from ( arg . serializeBinary ( ) )
32
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
44
33
}
45
34
46
35
function deserialize_api_LoginRequest ( buffer_arg ) {
47
- return api_pb . LoginRequest . deserializeBinary ( new Uint8Array ( buffer_arg ) )
36
+ return api_pb . LoginRequest . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
48
37
}
49
38
50
39
function serialize_api_Operation ( arg ) {
51
40
if ( ! ( arg instanceof api_pb . Operation ) ) {
52
- throw new Error ( " Expected argument of type api.Operation" )
41
+ throw new Error ( ' Expected argument of type api.Operation' ) ;
53
42
}
54
- return Buffer . from ( arg . serializeBinary ( ) )
43
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
55
44
}
56
45
57
46
function deserialize_api_Operation ( buffer_arg ) {
58
- return api_pb . Operation . deserializeBinary ( new Uint8Array ( buffer_arg ) )
47
+ return api_pb . Operation . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
59
48
}
60
49
61
50
function serialize_api_Payload ( arg ) {
62
51
if ( ! ( arg instanceof api_pb . Payload ) ) {
63
- throw new Error ( " Expected argument of type api.Payload" )
52
+ throw new Error ( ' Expected argument of type api.Payload' ) ;
64
53
}
65
- return Buffer . from ( arg . serializeBinary ( ) )
54
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
66
55
}
67
56
68
57
function deserialize_api_Payload ( buffer_arg ) {
69
- return api_pb . Payload . deserializeBinary ( new Uint8Array ( buffer_arg ) )
58
+ return api_pb . Payload . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
70
59
}
71
60
72
61
function serialize_api_Request ( arg ) {
73
62
if ( ! ( arg instanceof api_pb . Request ) ) {
74
- throw new Error ( " Expected argument of type api.Request" )
63
+ throw new Error ( ' Expected argument of type api.Request' ) ;
75
64
}
76
- return Buffer . from ( arg . serializeBinary ( ) )
65
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
77
66
}
78
67
79
68
function deserialize_api_Request ( buffer_arg ) {
80
- return api_pb . Request . deserializeBinary ( new Uint8Array ( buffer_arg ) )
69
+ return api_pb . Request . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
81
70
}
82
71
83
72
function serialize_api_Response ( arg ) {
84
73
if ( ! ( arg instanceof api_pb . Response ) ) {
85
- throw new Error ( " Expected argument of type api.Response" )
74
+ throw new Error ( ' Expected argument of type api.Response' ) ;
86
75
}
87
- return Buffer . from ( arg . serializeBinary ( ) )
76
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
88
77
}
89
78
90
79
function deserialize_api_Response ( buffer_arg ) {
91
- return api_pb . Response . deserializeBinary ( new Uint8Array ( buffer_arg ) )
80
+ return api_pb . Response . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
92
81
}
93
82
94
83
function serialize_api_TxnContext ( arg ) {
95
84
if ( ! ( arg instanceof api_pb . TxnContext ) ) {
96
- throw new Error ( " Expected argument of type api.TxnContext" )
85
+ throw new Error ( ' Expected argument of type api.TxnContext' ) ;
97
86
}
98
- return Buffer . from ( arg . serializeBinary ( ) )
87
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
99
88
}
100
89
101
90
function deserialize_api_TxnContext ( buffer_arg ) {
102
- return api_pb . TxnContext . deserializeBinary ( new Uint8Array ( buffer_arg ) )
91
+ return api_pb . TxnContext . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
103
92
}
104
93
105
94
function serialize_api_Version ( arg ) {
106
95
if ( ! ( arg instanceof api_pb . Version ) ) {
107
- throw new Error ( " Expected argument of type api.Version" )
96
+ throw new Error ( ' Expected argument of type api.Version' ) ;
108
97
}
109
- return Buffer . from ( arg . serializeBinary ( ) )
98
+ return Buffer . from ( arg . serializeBinary ( ) ) ;
110
99
}
111
100
112
101
function deserialize_api_Version ( buffer_arg ) {
113
- return api_pb . Version . deserializeBinary ( new Uint8Array ( buffer_arg ) )
102
+ return api_pb . Version . deserializeBinary ( new Uint8Array ( buffer_arg ) ) ;
114
103
}
115
104
105
+
116
106
// Graph response.
117
- var DgraphService = ( exports . DgraphService = {
107
+ var DgraphService = exports . DgraphService = {
118
108
login : {
119
- path : " /api.Dgraph/Login" ,
109
+ path : ' /api.Dgraph/Login' ,
120
110
requestStream : false ,
121
111
responseStream : false ,
122
112
requestType : api_pb . LoginRequest ,
@@ -127,7 +117,7 @@ var DgraphService = (exports.DgraphService = {
127
117
responseDeserialize : deserialize_api_Response ,
128
118
} ,
129
119
query : {
130
- path : " /api.Dgraph/Query" ,
120
+ path : ' /api.Dgraph/Query' ,
131
121
requestStream : false ,
132
122
responseStream : false ,
133
123
requestType : api_pb . Request ,
@@ -138,7 +128,7 @@ var DgraphService = (exports.DgraphService = {
138
128
responseDeserialize : deserialize_api_Response ,
139
129
} ,
140
130
alter : {
141
- path : " /api.Dgraph/Alter" ,
131
+ path : ' /api.Dgraph/Alter' ,
142
132
requestStream : false ,
143
133
responseStream : false ,
144
134
requestType : api_pb . Operation ,
@@ -149,7 +139,7 @@ var DgraphService = (exports.DgraphService = {
149
139
responseDeserialize : deserialize_api_Payload ,
150
140
} ,
151
141
commitOrAbort : {
152
- path : " /api.Dgraph/CommitOrAbort" ,
142
+ path : ' /api.Dgraph/CommitOrAbort' ,
153
143
requestStream : false ,
154
144
responseStream : false ,
155
145
requestType : api_pb . TxnContext ,
@@ -160,7 +150,7 @@ var DgraphService = (exports.DgraphService = {
160
150
responseDeserialize : deserialize_api_TxnContext ,
161
151
} ,
162
152
checkVersion : {
163
- path : " /api.Dgraph/CheckVersion" ,
153
+ path : ' /api.Dgraph/CheckVersion' ,
164
154
requestStream : false ,
165
155
responseStream : false ,
166
156
requestType : api_pb . Check ,
@@ -170,6 +160,6 @@ var DgraphService = (exports.DgraphService = {
170
160
responseSerialize : serialize_api_Version ,
171
161
responseDeserialize : deserialize_api_Version ,
172
162
} ,
173
- } )
163
+ } ;
174
164
175
- exports . DgraphClient = grpc . makeGenericClientConstructor ( DgraphService )
165
+ exports . DgraphClient = grpc . makeGenericClientConstructor ( DgraphService ) ;
0 commit comments