@@ -108,6 +108,7 @@ var DgraphClientStub = (function () {
108
108
return this . callAPI ( "alter" , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : body } ) ) ;
109
109
} ;
110
110
DgraphClientStub . prototype . query = function ( req ) {
111
+ var _a ;
111
112
var headers = this . options . headers !== undefined
112
113
? __assign ( { } , this . options . headers ) : { } ;
113
114
if ( req . vars !== undefined ) {
@@ -166,6 +167,12 @@ var DgraphClientStub = (function () {
166
167
value : "true" ,
167
168
} ) ;
168
169
}
170
+ if ( ( ( _a = req === null || req === void 0 ? void 0 : req . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
171
+ params . push ( {
172
+ key : "hash" ,
173
+ value : "" + req . hash ,
174
+ } ) ;
175
+ }
169
176
if ( params . length > 0 ) {
170
177
url += "?" ;
171
178
url += params
@@ -179,6 +186,7 @@ var DgraphClientStub = (function () {
179
186
return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : req . query , headers : headers } ) ) ;
180
187
} ;
181
188
DgraphClientStub . prototype . mutate = function ( mu ) {
189
+ var _a ;
182
190
var body ;
183
191
var usingJSON = false ;
184
192
if ( mu . setJson !== undefined || mu . deleteJson !== undefined ) {
@@ -229,6 +237,11 @@ var DgraphClientStub = (function () {
229
237
( ! this . legacyApi ? "?startTs=" : "/" ) + mu . startTs . toString ( ) ;
230
238
nextDelim = "&" ;
231
239
}
240
+ if ( ( ( _a = mu === null || mu === void 0 ? void 0 : mu . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
241
+ if ( ! this . legacyApi ) {
242
+ url += nextDelim + "hash=" + mu . hash ;
243
+ }
244
+ }
232
245
if ( mu . commitNow ) {
233
246
if ( ! this . legacyApi ) {
234
247
url += nextDelim + "commitNow=true" ;
@@ -241,6 +254,7 @@ var DgraphClientStub = (function () {
241
254
headers : headers } ) ) ;
242
255
} ;
243
256
DgraphClientStub . prototype . commit = function ( ctx ) {
257
+ var _a ;
244
258
var body ;
245
259
if ( ctx . keys === undefined ) {
246
260
body = "[]" ;
@@ -251,12 +265,23 @@ var DgraphClientStub = (function () {
251
265
var url = ! this . legacyApi
252
266
? "commit?startTs=" + ctx . start_ts
253
267
: "commit/" + ctx . start_ts ;
268
+ if ( ( ( _a = ctx === null || ctx === void 0 ? void 0 : ctx . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
269
+ if ( ! this . legacyApi ) {
270
+ url += "&hash=" + ctx . hash ;
271
+ }
272
+ }
254
273
return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : body } ) ) ;
255
274
} ;
256
275
DgraphClientStub . prototype . abort = function ( ctx ) {
276
+ var _a ;
257
277
var url = ! this . legacyApi
258
278
? "commit?startTs=" + ctx . start_ts + "&abort=true"
259
279
: "abort/" + ctx . start_ts ;
280
+ if ( ( ( _a = ctx === null || ctx === void 0 ? void 0 : ctx . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
281
+ if ( ! this . legacyApi ) {
282
+ url += "&hash=" + ctx . hash ;
283
+ }
284
+ }
260
285
return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" } ) ) ;
261
286
} ;
262
287
DgraphClientStub . prototype . login = function ( userid , password , refreshToken ) {
0 commit comments