@@ -54,38 +54,40 @@ var DgraphClient = (function () {
5454 }
5555 DgraphClient . prototype . alter = function ( op , metadata , options ) {
5656 return __awaiter ( this , void 0 , void 0 , function ( ) {
57- var c , payload , operation , e_1 , pl ;
57+ var c , payload , operation , _a , _b , e_1 , _c , _d ;
5858 var _this = this ;
59- return __generator ( this , function ( _a ) {
60- switch ( _a . label ) {
59+ return __generator ( this , function ( _e ) {
60+ switch ( _e . label ) {
6161 case 0 :
6262 this . debug ( "Alter request:\n" + util_1 . stringifyMessage ( op ) ) ;
6363 c = this . anyClient ( ) ;
6464 operation = function ( ) { return __awaiter ( _this , void 0 , void 0 , function ( ) { return __generator ( this , function ( _a ) {
6565 return [ 2 , c . alter ( op , metadata , options ) ] ;
6666 } ) ; } ) ; } ;
67- _a . label = 1 ;
67+ _e . label = 1 ;
6868 case 1 :
69- _a . trys . push ( [ 1 , 3 , , 7 ] ) ;
69+ _e . trys . push ( [ 1 , 3 , , 8 ] ) ;
70+ _b = ( _a = types ) . createPayload ;
7071 return [ 4 , operation ( ) ] ;
7172 case 2 :
72- payload = _a . sent ( ) ;
73- return [ 3 , 7 ] ;
73+ payload = _b . apply ( _a , [ _e . sent ( ) ] ) ;
74+ return [ 3 , 8 ] ;
7475 case 3 :
75- e_1 = _a . sent ( ) ;
76+ e_1 = _e . sent ( ) ;
7677 if ( ! ( isJwtExpired ( e_1 ) === true ) ) return [ 3 , 6 ] ;
7778 return [ 4 , c . retryLogin ( metadata , options ) ] ;
7879 case 4 :
79- _a . sent ( ) ;
80+ _e . sent ( ) ;
81+ _d = ( _c = types ) . createPayload ;
8082 return [ 4 , operation ( ) ] ;
8183 case 5 :
82- payload = _a . sent ( ) ;
83- _a . label = 6 ;
84- case 6 : return [ 3 , 7 ] ;
85- case 7 :
86- pl = types . createPayload ( payload ) ;
87- this . debug ( "Alter response:\n" + util_1 . stringifyMessage ( pl ) ) ;
88- return [ 2 , pl ] ;
84+ payload = _d . apply ( _c , [ _e . sent ( ) ] ) ;
85+ return [ 3 , 7 ] ;
86+ case 6 : throw e_1 ;
87+ case 7 : return [ 3 , 8 ] ;
88+ case 8 :
89+ this . debug ( "Alter response:\n" + util_1 . stringifyMessage ( payload ) ) ;
90+ return [ 2 , payload ] ;
8991 }
9092 } ) ;
9193 } ) ;
0 commit comments