Skip to content

Commit 1a5016d

Browse files
committed
.
1 parent 4e224d8 commit 1a5016d

File tree

13 files changed

+396
-76
lines changed

13 files changed

+396
-76
lines changed
File renamed without changes.

lib/client.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export declare class DgraphClient {
1717
debug(msg: string): void
1818
anyClient(): DgraphClientStub
1919
}
20-
export declare function isJwtExpired(err: unknown): boolean
20+
export declare function isJwtExpired(err: any): boolean
2121
export declare function deleteEdges(mu: types.Mutation, uid: string, ...predicates: string[]): void

lib/txn.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export declare class Txn {
1818
queryWithVars(
1919
q: string,
2020
vars?: {
21-
[k: string]: unknown
21+
[k: string]: any
2222
},
2323
metadata?: grpc.Metadata,
2424
options?: grpc.CallOptions,
@@ -27,7 +27,7 @@ export declare class Txn {
2727
queryRDFWithVars(
2828
q: string,
2929
vars?: {
30-
[k: string]: unknown
30+
[k: string]: any
3131
},
3232
metadata?: grpc.Metadata,
3333
options?: grpc.CallOptions,

lib/txn.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ var Txn = (function () {
248248
}
249249
Txn.prototype.doRequest = function (req, metadata, options) {
250250
return __awaiter(this, void 0, void 0, function () {
251-
var mutationList, resp, c, operation, _a, _b, e_1, _c, _d, e_2
251+
var mutationList, resp, c, operation, _a, _b, e_1, _c, _d, _e
252252
var _this = this
253-
return __generator(this, function (_e) {
254-
switch (_e.label) {
253+
return __generator(this, function (_f) {
254+
switch (_f.label) {
255255
case 0:
256256
mutationList = req.getMutationsList()
257257
if (this.finished) {
@@ -289,33 +289,33 @@ var Txn = (function () {
289289
})
290290
})
291291
}
292-
_e.label = 1
292+
_f.label = 1
293293
case 1:
294-
_e.trys.push([1, 3, , 11])
294+
_f.trys.push([1, 3, , 11])
295295
_b = (_a = types).createResponse
296296
return [4, operation()]
297297
case 2:
298-
resp = _b.apply(_a, [_e.sent()])
298+
resp = _b.apply(_a, [_f.sent()])
299299
return [3, 11]
300300
case 3:
301-
e_1 = _e.sent()
301+
e_1 = _f.sent()
302302
if (!((0, client_1.isJwtExpired)(e_1) === true)) return [3, 6]
303303
return [4, c.retryLogin(metadata, options)]
304304
case 4:
305-
_e.sent()
305+
_f.sent()
306306
_d = (_c = types).createResponse
307307
return [4, operation()]
308308
case 5:
309-
resp = _d.apply(_c, [_e.sent()])
309+
resp = _d.apply(_c, [_f.sent()])
310310
return [3, 10]
311311
case 6:
312-
_e.trys.push([6, 8, , 9])
312+
_f.trys.push([6, 8, , 9])
313313
return [4, this.discard(metadata, options)]
314314
case 7:
315-
_e.sent()
315+
_f.sent()
316316
return [3, 9]
317317
case 8:
318-
e_2 = _e.sent()
318+
_e = _f.sent()
319319
return [3, 9]
320320
case 9:
321321
throw (0, util_1.isAbortedError)(e_1) || (0, util_1.isConflictError)(e_1)
@@ -336,7 +336,7 @@ var Txn = (function () {
336336
}
337337
Txn.prototype.commit = function (metadata, options) {
338338
return __awaiter(this, void 0, void 0, function () {
339-
var c, operation, e_3
339+
var c, operation, e_2
340340
var _this = this
341341
return __generator(this, function (_a) {
342342
switch (_a.label) {
@@ -364,8 +364,8 @@ var Txn = (function () {
364364
_a.sent()
365365
return [3, 8]
366366
case 3:
367-
e_3 = _a.sent()
368-
if (!((0, client_1.isJwtExpired)(e_3) === true)) return [3, 6]
367+
e_2 = _a.sent()
368+
if (!((0, client_1.isJwtExpired)(e_2) === true)) return [3, 6]
369369
return [4, c.retryLogin(metadata, options)]
370370
case 4:
371371
_a.sent()
@@ -374,7 +374,7 @@ var Txn = (function () {
374374
_a.sent()
375375
return [3, 7]
376376
case 6:
377-
throw (0, util_1.isAbortedError)(e_3) ? errors_1.ERR_ABORTED : e_3
377+
throw (0, util_1.isAbortedError)(e_2) ? errors_1.ERR_ABORTED : e_2
378378
case 7:
379379
return [3, 8]
380380
case 8:
@@ -385,7 +385,7 @@ var Txn = (function () {
385385
}
386386
Txn.prototype.discard = function (metadata, options) {
387387
return __awaiter(this, void 0, void 0, function () {
388-
var c, operation, e_4
388+
var c, operation, e_3
389389
var _this = this
390390
return __generator(this, function (_a) {
391391
switch (_a.label) {
@@ -414,8 +414,8 @@ var Txn = (function () {
414414
_a.sent()
415415
return [3, 8]
416416
case 3:
417-
e_4 = _a.sent()
418-
if (!((0, client_1.isJwtExpired)(e_4) === true)) return [3, 6]
417+
e_3 = _a.sent()
418+
if (!((0, client_1.isJwtExpired)(e_3) === true)) return [3, 6]
419419
return [4, c.retryLogin(metadata, options)]
420420
case 4:
421421
_a.sent()
@@ -424,7 +424,7 @@ var Txn = (function () {
424424
_a.sent()
425425
return [3, 7]
426426
case 6:
427-
throw (0, util_1.isAbortedError)(e_4) ? errors_1.ERR_ABORTED : e_4
427+
throw (0, util_1.isAbortedError)(e_3) ? errors_1.ERR_ABORTED : e_3
428428
case 7:
429429
return [3, 8]
430430
case 8:

lib/types.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
import * as messages from "../generated/api_pb"
22
export declare class Payload extends messages.Payload {
3-
getData(): unknown
3+
getData(): string | Uint8Array
44
getData_asB64(): string
55
getData_asU8(): Uint8Array
6-
setData(value: unknown): void
6+
setData(value: any): void
77
}
88
export declare function createPayload(oldPayload: messages.Payload): Payload
99
export declare class Response extends messages.Response {
10-
getJson(): unknown
10+
getJson(): string | Uint8Array
1111
getJson_asB64(): string
1212
getJson_asU8(): Uint8Array
13-
setJson(value: unknown): void
13+
setJson(value: any): void
1414
}
1515
export declare function createResponse(oldResponse: messages.Response): Response
1616
export declare class Mutation extends messages.Mutation {
17-
getSetJson(): unknown
17+
getSetJson(): string | Uint8Array
1818
getSetJson_asB64(): string
1919
getSetJson_asU8(): Uint8Array
20-
setSetJson(value: unknown): void
21-
getDeleteJson(): unknown
20+
setSetJson(value: any): void
21+
getDeleteJson(): string | Uint8Array
2222
getDeleteJson_asB64(): string
2323
getDeleteJson_asU8(): Uint8Array
24-
setDeleteJson(value: unknown): void
24+
setDeleteJson(value: any): void
2525
getSetNquads(): Uint8Array | string
2626
getSetNquads_asB64(): string
2727
getSetNquads_asU8(): Uint8Array

lib/util.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import * as jspb from "google-protobuf"
2-
export declare function errorCode(err: unknown): {
2+
export declare function errorCode(err: any): {
33
valid: boolean
44
code: number
55
}
6-
export declare function isAbortedError(err: unknown): boolean
7-
export declare function isConflictError(err: unknown): boolean
8-
export declare function isUnauthenticatedError(err: unknown): boolean
6+
export declare function isAbortedError(err: any): boolean
7+
export declare function isConflictError(err: any): boolean
8+
export declare function isUnauthenticatedError(err: any): boolean
99
export declare function promisify1<A, T>(
1010
f: (arg: A, cb: (err?: Error, res?: T) => void) => void,
11-
thisContext?: unknown,
11+
thisContext?: any,
1212
): (arg: A) => Promise<T>
1313
export declare function promisify3<A, B, C, T>(
1414
f: (argA: A, argB: B, argC: C, cb: (err?: Error, res?: T) => void) => void,
15-
thisContext?: unknown,
15+
thisContext?: any,
1616
): (argA: A, argB: B, argC: C) => Promise<T>
1717
export declare function stringifyMessage(msg: jspb.Message): string
1818
export { isBase64 } from "is-base64"
1919
export declare function strToB64(str: string): string
2020
export declare function strToU8(str: string): Uint8Array
2121
export declare function b64ToStr(b64Str: string): string
2222
export declare function u8ToStr(arr: Uint8Array): string
23-
export declare function strToJson(jsonStr: string): unknown
23+
export declare function strToJson(jsonStr: string): any

lib/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function errorCode(err) {
1818
if (
1919
err === undefined ||
2020
typeof err !== "object" ||
21-
!err.hasOwnProperty("code") ||
21+
!Object.prototype.hasOwnProperty.call(err, "code") ||
2222
typeof err.code !== "number"
2323
) {
2424
return {
@@ -92,7 +92,7 @@ function u8ToStr(arr) {
9292
function strToJson(jsonStr) {
9393
try {
9494
return JSON.parse(jsonStr)
95-
} catch (e) {
95+
} catch (_a) {
9696
return {}
9797
}
9898
}

0 commit comments

Comments
 (0)