|
| 1 | +/** |
| 2 | + * Copyright (c) 2002-2017 "Neo Technology,"," |
| 3 | + * Network Engine for Objects in Lund AB [http://neotechnology.com] |
| 4 | + * |
| 5 | + * This file is part of Neo4j. |
| 6 | + * |
| 7 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + * you may not use this file except in compliance with the License. |
| 9 | + * You may obtain a copy of the License at |
| 10 | + * |
| 11 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + * |
| 13 | + * Unless required by applicable law or agreed to in writing, software |
| 14 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + * See the License for the specific language governing permissions and |
| 17 | + * limitations under the License. |
| 18 | + */ |
| 19 | + |
| 20 | +import v1, {auth, AuthToken, Config, driver, error, session} from "../../../types/v1/index"; |
| 21 | + |
| 22 | +import Driver from "../../../types/v1/driver"; |
| 23 | + |
| 24 | +const dummy: any = null; |
| 25 | + |
| 26 | +const config: Config = dummy; |
| 27 | + |
| 28 | +const basicAuthToken1: AuthToken = auth.basic("neo4j", "password"); |
| 29 | +const basicAuthToken2: AuthToken = auth.basic("neo4j", "password", "realm"); |
| 30 | + |
| 31 | +const kerberosAuthToken1: AuthToken = auth.kerberos("base64EncodedTicket"); |
| 32 | + |
| 33 | +const customAuthToken1: AuthToken = auth.custom("neo4j", "password", "realm", "scheme"); |
| 34 | +const customAuthToken2: AuthToken = auth.custom("neo4j", "password", "realm", "scheme", {"key": "value"}); |
| 35 | + |
| 36 | +const basicAuthToken3: AuthToken = v1.auth.basic("neo4j", "password"); |
| 37 | +const basicAuthToken4: AuthToken = v1.auth.basic("neo4j", "password", "realm"); |
| 38 | + |
| 39 | +const kerberosAuthToken2: AuthToken = v1.auth.kerberos("base64EncodedTicket"); |
| 40 | + |
| 41 | +const customAuthToken3: AuthToken = v1.auth.custom("neo4j", "password", "realm", "scheme"); |
| 42 | +const customAuthToken4: AuthToken = v1.auth.custom("neo4j", "password", "realm", "scheme", {"key": "value"}); |
| 43 | + |
| 44 | +const driver1: Driver = driver("bolt://localhost:7687"); |
| 45 | +const driver2: Driver = driver("bolt://localhost:7687", basicAuthToken1); |
| 46 | +const driver3: Driver = driver("bolt://localhost:7687", basicAuthToken1, config); |
| 47 | + |
| 48 | +const driver4: Driver = v1.driver("bolt://localhost:7687"); |
| 49 | +const driver5: Driver = v1.driver("bolt://localhost:7687", basicAuthToken1); |
| 50 | +const driver6: Driver = v1.driver("bolt://localhost:7687", basicAuthToken1, config); |
| 51 | + |
| 52 | +const readMode1: string = session.READ; |
| 53 | +const writeMode1: string = session.WRITE; |
| 54 | + |
| 55 | +const readMode2: string = v1.session.READ; |
| 56 | +const writeMode2: string = v1.session.WRITE; |
| 57 | + |
| 58 | +const serviceUnavailable1: string = error.SERVICE_UNAVAILABLE; |
| 59 | +const sessionExpired1: string = error.SESSION_EXPIRED; |
| 60 | +const protocolError1: string = error.PROTOCOL_ERROR; |
| 61 | + |
| 62 | +const serviceUnavailable2: string = v1.error.SERVICE_UNAVAILABLE; |
| 63 | +const sessionExpired2: string = v1.error.SESSION_EXPIRED; |
| 64 | +const protocolError2: string = v1.error.PROTOCOL_ERROR; |
| 65 | + |
0 commit comments