|
21 | 21 | // SongServerRequest. Use snake_case (underscore_separated_names) for field names – for |
22 | 22 | // example, song_name. |
23 | 23 | // |
24 | | -"use strict"; |
25 | | -var grpc = require("@grpc/grpc-js"); |
26 | | -var api_pb = require("./api_pb.js"); |
| 24 | +'use strict'; |
| 25 | +var grpc = require('@grpc/grpc-js'); |
| 26 | +var api_pb = require('./api_pb.js'); |
27 | 27 |
|
28 | 28 | function serialize_api_Check(arg) { |
29 | | - if (!(arg instanceof api_pb.Check)) { |
30 | | - throw new Error("Expected argument of type api.Check"); |
31 | | - } |
32 | | - return Buffer.from(arg.serializeBinary()); |
| 29 | + if (!(arg instanceof api_pb.Check)) { |
| 30 | + throw new Error('Expected argument of type api.Check'); |
| 31 | + } |
| 32 | + return Buffer.from(arg.serializeBinary()); |
33 | 33 | } |
34 | 34 |
|
35 | 35 | function deserialize_api_Check(buffer_arg) { |
36 | | - return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg)); |
| 36 | + return api_pb.Check.deserializeBinary(new Uint8Array(buffer_arg)); |
37 | 37 | } |
38 | 38 |
|
39 | 39 | function serialize_api_LoginRequest(arg) { |
40 | | - if (!(arg instanceof api_pb.LoginRequest)) { |
41 | | - throw new Error("Expected argument of type api.LoginRequest"); |
42 | | - } |
43 | | - return Buffer.from(arg.serializeBinary()); |
| 40 | + if (!(arg instanceof api_pb.LoginRequest)) { |
| 41 | + throw new Error('Expected argument of type api.LoginRequest'); |
| 42 | + } |
| 43 | + return Buffer.from(arg.serializeBinary()); |
44 | 44 | } |
45 | 45 |
|
46 | 46 | function deserialize_api_LoginRequest(buffer_arg) { |
47 | | - return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
| 47 | + return api_pb.LoginRequest.deserializeBinary(new Uint8Array(buffer_arg)); |
48 | 48 | } |
49 | 49 |
|
50 | 50 | function serialize_api_Operation(arg) { |
51 | | - if (!(arg instanceof api_pb.Operation)) { |
52 | | - throw new Error("Expected argument of type api.Operation"); |
53 | | - } |
54 | | - return Buffer.from(arg.serializeBinary()); |
| 51 | + if (!(arg instanceof api_pb.Operation)) { |
| 52 | + throw new Error('Expected argument of type api.Operation'); |
| 53 | + } |
| 54 | + return Buffer.from(arg.serializeBinary()); |
55 | 55 | } |
56 | 56 |
|
57 | 57 | function deserialize_api_Operation(buffer_arg) { |
58 | | - return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg)); |
| 58 | + return api_pb.Operation.deserializeBinary(new Uint8Array(buffer_arg)); |
59 | 59 | } |
60 | 60 |
|
61 | 61 | function serialize_api_Payload(arg) { |
62 | | - if (!(arg instanceof api_pb.Payload)) { |
63 | | - throw new Error("Expected argument of type api.Payload"); |
64 | | - } |
65 | | - return Buffer.from(arg.serializeBinary()); |
| 62 | + if (!(arg instanceof api_pb.Payload)) { |
| 63 | + throw new Error('Expected argument of type api.Payload'); |
| 64 | + } |
| 65 | + return Buffer.from(arg.serializeBinary()); |
66 | 66 | } |
67 | 67 |
|
68 | 68 | function deserialize_api_Payload(buffer_arg) { |
69 | | - return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg)); |
| 69 | + return api_pb.Payload.deserializeBinary(new Uint8Array(buffer_arg)); |
70 | 70 | } |
71 | 71 |
|
72 | 72 | function serialize_api_Request(arg) { |
73 | | - if (!(arg instanceof api_pb.Request)) { |
74 | | - throw new Error("Expected argument of type api.Request"); |
75 | | - } |
76 | | - return Buffer.from(arg.serializeBinary()); |
| 73 | + if (!(arg instanceof api_pb.Request)) { |
| 74 | + throw new Error('Expected argument of type api.Request'); |
| 75 | + } |
| 76 | + return Buffer.from(arg.serializeBinary()); |
77 | 77 | } |
78 | 78 |
|
79 | 79 | function deserialize_api_Request(buffer_arg) { |
80 | | - return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg)); |
| 80 | + return api_pb.Request.deserializeBinary(new Uint8Array(buffer_arg)); |
81 | 81 | } |
82 | 82 |
|
83 | 83 | function serialize_api_Response(arg) { |
84 | | - if (!(arg instanceof api_pb.Response)) { |
85 | | - throw new Error("Expected argument of type api.Response"); |
86 | | - } |
87 | | - return Buffer.from(arg.serializeBinary()); |
| 84 | + if (!(arg instanceof api_pb.Response)) { |
| 85 | + throw new Error('Expected argument of type api.Response'); |
| 86 | + } |
| 87 | + return Buffer.from(arg.serializeBinary()); |
88 | 88 | } |
89 | 89 |
|
90 | 90 | function deserialize_api_Response(buffer_arg) { |
91 | | - return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg)); |
| 91 | + return api_pb.Response.deserializeBinary(new Uint8Array(buffer_arg)); |
92 | 92 | } |
93 | 93 |
|
94 | 94 | function serialize_api_TxnContext(arg) { |
95 | | - if (!(arg instanceof api_pb.TxnContext)) { |
96 | | - throw new Error("Expected argument of type api.TxnContext"); |
97 | | - } |
98 | | - return Buffer.from(arg.serializeBinary()); |
| 95 | + if (!(arg instanceof api_pb.TxnContext)) { |
| 96 | + throw new Error('Expected argument of type api.TxnContext'); |
| 97 | + } |
| 98 | + return Buffer.from(arg.serializeBinary()); |
99 | 99 | } |
100 | 100 |
|
101 | 101 | function deserialize_api_TxnContext(buffer_arg) { |
102 | | - return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg)); |
| 102 | + return api_pb.TxnContext.deserializeBinary(new Uint8Array(buffer_arg)); |
103 | 103 | } |
104 | 104 |
|
105 | 105 | function serialize_api_Version(arg) { |
106 | | - if (!(arg instanceof api_pb.Version)) { |
107 | | - throw new Error("Expected argument of type api.Version"); |
108 | | - } |
109 | | - return Buffer.from(arg.serializeBinary()); |
| 106 | + if (!(arg instanceof api_pb.Version)) { |
| 107 | + throw new Error('Expected argument of type api.Version'); |
| 108 | + } |
| 109 | + return Buffer.from(arg.serializeBinary()); |
110 | 110 | } |
111 | 111 |
|
112 | 112 | function deserialize_api_Version(buffer_arg) { |
113 | | - return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg)); |
| 113 | + return api_pb.Version.deserializeBinary(new Uint8Array(buffer_arg)); |
114 | 114 | } |
115 | 115 |
|
| 116 | + |
116 | 117 | // Graph response. |
117 | | -var DgraphService = (exports.DgraphService = { |
118 | | - login: { |
119 | | - path: "/api.Dgraph/Login", |
120 | | - requestStream: false, |
121 | | - responseStream: false, |
122 | | - requestType: api_pb.LoginRequest, |
123 | | - responseType: api_pb.Response, |
124 | | - requestSerialize: serialize_api_LoginRequest, |
125 | | - requestDeserialize: deserialize_api_LoginRequest, |
126 | | - responseSerialize: serialize_api_Response, |
127 | | - responseDeserialize: deserialize_api_Response, |
128 | | - }, |
129 | | - query: { |
130 | | - path: "/api.Dgraph/Query", |
131 | | - requestStream: false, |
132 | | - responseStream: false, |
133 | | - requestType: api_pb.Request, |
134 | | - responseType: api_pb.Response, |
135 | | - requestSerialize: serialize_api_Request, |
136 | | - requestDeserialize: deserialize_api_Request, |
137 | | - responseSerialize: serialize_api_Response, |
138 | | - responseDeserialize: deserialize_api_Response, |
139 | | - }, |
140 | | - alter: { |
141 | | - path: "/api.Dgraph/Alter", |
142 | | - requestStream: false, |
143 | | - responseStream: false, |
144 | | - requestType: api_pb.Operation, |
145 | | - responseType: api_pb.Payload, |
146 | | - requestSerialize: serialize_api_Operation, |
147 | | - requestDeserialize: deserialize_api_Operation, |
148 | | - responseSerialize: serialize_api_Payload, |
149 | | - responseDeserialize: deserialize_api_Payload, |
150 | | - }, |
151 | | - commitOrAbort: { |
152 | | - path: "/api.Dgraph/CommitOrAbort", |
153 | | - requestStream: false, |
154 | | - responseStream: false, |
155 | | - requestType: api_pb.TxnContext, |
156 | | - responseType: api_pb.TxnContext, |
157 | | - requestSerialize: serialize_api_TxnContext, |
158 | | - requestDeserialize: deserialize_api_TxnContext, |
159 | | - responseSerialize: serialize_api_TxnContext, |
160 | | - responseDeserialize: deserialize_api_TxnContext, |
161 | | - }, |
162 | | - checkVersion: { |
163 | | - path: "/api.Dgraph/CheckVersion", |
164 | | - requestStream: false, |
165 | | - responseStream: false, |
166 | | - requestType: api_pb.Check, |
167 | | - responseType: api_pb.Version, |
168 | | - requestSerialize: serialize_api_Check, |
169 | | - requestDeserialize: deserialize_api_Check, |
170 | | - responseSerialize: serialize_api_Version, |
171 | | - responseDeserialize: deserialize_api_Version, |
172 | | - }, |
173 | | -}); |
| 118 | +var DgraphService = exports.DgraphService = { |
| 119 | + login: { |
| 120 | + path: '/api.Dgraph/Login', |
| 121 | + requestStream: false, |
| 122 | + responseStream: false, |
| 123 | + requestType: api_pb.LoginRequest, |
| 124 | + responseType: api_pb.Response, |
| 125 | + requestSerialize: serialize_api_LoginRequest, |
| 126 | + requestDeserialize: deserialize_api_LoginRequest, |
| 127 | + responseSerialize: serialize_api_Response, |
| 128 | + responseDeserialize: deserialize_api_Response, |
| 129 | + }, |
| 130 | + query: { |
| 131 | + path: '/api.Dgraph/Query', |
| 132 | + requestStream: false, |
| 133 | + responseStream: false, |
| 134 | + requestType: api_pb.Request, |
| 135 | + responseType: api_pb.Response, |
| 136 | + requestSerialize: serialize_api_Request, |
| 137 | + requestDeserialize: deserialize_api_Request, |
| 138 | + responseSerialize: serialize_api_Response, |
| 139 | + responseDeserialize: deserialize_api_Response, |
| 140 | + }, |
| 141 | + alter: { |
| 142 | + path: '/api.Dgraph/Alter', |
| 143 | + requestStream: false, |
| 144 | + responseStream: false, |
| 145 | + requestType: api_pb.Operation, |
| 146 | + responseType: api_pb.Payload, |
| 147 | + requestSerialize: serialize_api_Operation, |
| 148 | + requestDeserialize: deserialize_api_Operation, |
| 149 | + responseSerialize: serialize_api_Payload, |
| 150 | + responseDeserialize: deserialize_api_Payload, |
| 151 | + }, |
| 152 | + commitOrAbort: { |
| 153 | + path: '/api.Dgraph/CommitOrAbort', |
| 154 | + requestStream: false, |
| 155 | + responseStream: false, |
| 156 | + requestType: api_pb.TxnContext, |
| 157 | + responseType: api_pb.TxnContext, |
| 158 | + requestSerialize: serialize_api_TxnContext, |
| 159 | + requestDeserialize: deserialize_api_TxnContext, |
| 160 | + responseSerialize: serialize_api_TxnContext, |
| 161 | + responseDeserialize: deserialize_api_TxnContext, |
| 162 | + }, |
| 163 | + checkVersion: { |
| 164 | + path: '/api.Dgraph/CheckVersion', |
| 165 | + requestStream: false, |
| 166 | + responseStream: false, |
| 167 | + requestType: api_pb.Check, |
| 168 | + responseType: api_pb.Version, |
| 169 | + requestSerialize: serialize_api_Check, |
| 170 | + requestDeserialize: deserialize_api_Check, |
| 171 | + responseSerialize: serialize_api_Version, |
| 172 | + responseDeserialize: deserialize_api_Version, |
| 173 | + }, |
| 174 | +}; |
174 | 175 |
|
175 | 176 | exports.DgraphClient = grpc.makeGenericClientConstructor(DgraphService); |
0 commit comments