|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | import neo4j from "../../types/index";
|
21 |
| -import {Driver} from "../../types/v1/driver"; |
22 |
| -import Integer from "../../types/v1/integer"; |
23 |
| -import {Neo4jError} from "../../types/v1/error"; |
24 | 21 |
|
25 |
| -const driver1: Driver = neo4j.driver("bolt+routing://localhost"); |
26 |
| -const driver2: Driver = neo4j.driver("bolt://localhost:7687", neo4j.auth.basic("neo4j", "password")); |
| 22 | +const driver1: neo4j.Driver = neo4j.driver("bolt+routing://localhost"); |
| 23 | +const driver2: neo4j.Driver = neo4j.driver("bolt://localhost:7687", neo4j.auth.basic("neo4j", "password")); |
| 24 | + |
| 25 | +const sessionModeRead: string = neo4j.session.READ; |
| 26 | +const sessionModeWrite: string = neo4j.session.WRITE; |
27 | 27 |
|
28 | 28 | const readSession = driver1.session(neo4j.session.READ);
|
29 | 29 | const writeSession = driver1.session(neo4j.session.WRITE);
|
30 | 30 |
|
31 |
| -const int1: Integer = neo4j.int(42); |
32 |
| -const int2: Integer = neo4j.int("42"); |
33 |
| -const int3: Integer = neo4j.int(neo4j.int(42)); |
34 |
| -const int4: Integer = neo4j.int({low: 1, high: 1}); |
| 31 | +const int1: neo4j.Integer = neo4j.int(42); |
| 32 | +const int2: neo4j.Integer = neo4j.int("42"); |
| 33 | +const int3: neo4j.Integer = neo4j.int(neo4j.int(42)); |
| 34 | +const int4: neo4j.Integer = neo4j.int({low: 1, high: 1}); |
35 | 35 |
|
36 | 36 | const isInt1: boolean = neo4j.isInt({});
|
37 | 37 | const isInt2: boolean = neo4j.isInt(neo4j.int("42"));
|
38 | 38 |
|
| 39 | +const toNumber1: number = neo4j.integer.toNumber(1); |
| 40 | +const toNumber2: number = neo4j.integer.toNumber("1"); |
| 41 | +const toNumber3: number = neo4j.integer.toNumber({high: 0, low: 0}); |
| 42 | +const toNumber4: number = neo4j.integer.toNumber(int1); |
| 43 | + |
| 44 | +const toString1: string = neo4j.integer.toString(1); |
| 45 | +const toString2: string = neo4j.integer.toString("1"); |
| 46 | +const toString3: string = neo4j.integer.toString({high: 0, low: 0}); |
| 47 | +const toString4: string = neo4j.integer.toString(int1); |
| 48 | + |
| 49 | +const inSafeRange1: boolean = neo4j.integer.inSafeRange(1); |
| 50 | +const inSafeRange2: boolean = neo4j.integer.inSafeRange("1"); |
| 51 | +const inSafeRange3: boolean = neo4j.integer.inSafeRange({high: 0, low: 0}); |
| 52 | +const inSafeRange4: boolean = neo4j.integer.inSafeRange(int1); |
| 53 | + |
| 54 | +const isPoint1: boolean = neo4j.spatial.isPoint({}); |
| 55 | +const isPoint2: boolean = neo4j.isPoint({}); |
| 56 | + |
| 57 | +const isDuration1: boolean = neo4j.temporal.isDuration({}); |
| 58 | +const isDuration2: boolean = neo4j.isDuration({}); |
| 59 | + |
| 60 | +const isLocalTime1: boolean = neo4j.temporal.isLocalTime({}); |
| 61 | +const isLocalTime2: boolean = neo4j.isLocalTime({}); |
| 62 | + |
| 63 | +const isTime1: boolean = neo4j.temporal.isTime({}); |
| 64 | +const isTime2: boolean = neo4j.isTime({}); |
| 65 | + |
| 66 | +const isDate1: boolean = neo4j.temporal.isDate({}); |
| 67 | +const isDate2: boolean = neo4j.isDate({}); |
| 68 | + |
| 69 | +const isLocalDateTime1: boolean = neo4j.temporal.isLocalDateTime({}); |
| 70 | +const isLocalDateTime2: boolean = neo4j.isLocalDateTime({}); |
| 71 | + |
| 72 | +const isDateTime1: boolean = neo4j.temporal.isDateTime({}); |
| 73 | +const isDateTime2: boolean = neo4j.isDateTime({}); |
| 74 | + |
39 | 75 | const serviceUnavailable: string = neo4j.error.SERVICE_UNAVAILABLE;
|
40 | 76 | const sessionExpired: string = neo4j.error.SESSION_EXPIRED;
|
41 | 77 | const protocolError: string = neo4j.error.PROTOCOL_ERROR;
|
42 | 78 |
|
43 |
| -const error1: Neo4jError = new neo4j.Neo4jError("Error message"); |
44 |
| -const error2: Neo4jError = new neo4j.Neo4jError("Error message", "Error code"); |
| 79 | +const error1: neo4j.Neo4jError = new neo4j.Neo4jError("Error message"); |
| 80 | +const error2: neo4j.Neo4jError = new neo4j.Neo4jError("Error message", "Error code"); |
| 81 | + |
| 82 | +const result: neo4j.Result = readSession.run(""); |
| 83 | + |
| 84 | +result.then(value => { |
| 85 | + const resultSummary: neo4j.ResultSummary = value.summary; |
| 86 | +}); |
| 87 | + |
| 88 | +const point: neo4j.Point = new neo4j.types.Point(int1, 1, 2, 3); |
| 89 | +const duration: neo4j.Duration = new neo4j.types.Duration(int1, int1, int1, int1); |
| 90 | +const localTime: neo4j.LocalTime = new neo4j.types.LocalTime(int1, int1, int1, int1); |
| 91 | +const time: neo4j.Time = new neo4j.types.Time(int1, int1, int1, int1, int1); |
| 92 | +const date: neo4j.Date = new neo4j.types.Date(int1, int1, int1); |
| 93 | +const localDateTime: neo4j.LocalDateTime = new neo4j.types.LocalDateTime(int1, int1, int1, int1, int1, int1, int1); |
| 94 | +const dateTime: neo4j.DateTime = new neo4j.types.DateTime(int1, int1, int1, int1, int1, int1, int1, int1); |
0 commit comments