Skip to content

Commit

Permalink
Update node and tequilapi (#173)
Browse files Browse the repository at this point in the history
Update node to newest 0.13.2 version and tequilapi with new connectionLocation() method to fetch location from current active connection.
  • Loading branch information
anjmao authored Nov 5, 2019
1 parent 8b36d7f commit 64d5515
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ dependencies {
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'network.mysterium:mobile-node:0.10.1'
implementation 'network.mysterium:mobile-node:0.13.2'
// implementation files('libs/Mysterium.aar')
}

Expand Down
3 changes: 3 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ buildscript {
allprojects {
repositories {
mavenLocal()
maven {
url 'https://dl.bintray.com/mysteriumnetwork/maven'
}
maven { url 'https://maven.fabric.io/public' }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"android": "react-native run-android",
"log-android": "react-native log-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test:unit": "jest",
"lint": "tsc --noEmit --skipLibCheck && tslint -p . 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}'",
"ci": "yarn lint && yarn test:unit && util_scripts/check-headers.sh",
Expand Down Expand Up @@ -45,7 +47,7 @@
"mobx": "^4.3.1",
"mobx-react": "^5.1.0",
"mobx-utils": "^5.0.2",
"mysterium-tequilapi": "^0.8.4",
"mysterium-tequilapi": "^0.9.0",
"mysterium-vpn-js": "^0.0.2",
"native-base": "^2.8.1",
"react": "^16.4.1",
Expand Down
2 changes: 1 addition & 1 deletion src/app/adapters/connection/connection-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ConnectionAdapter {
fetchStatus (): Promise<ConnectionStatusDTO>
fetchStatistics (): Promise<ConnectionStatistics>
fetchOriginalLocation (): Promise<string | undefined>
fetchLocation (): Promise<Location>
fetchConnectionLocation (): Promise<Location>
}

class ConnectionCanceled extends Error {
Expand Down
4 changes: 2 additions & 2 deletions src/app/adapters/connection/tequilapi-connection-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class TequilapiConnectionAdapter implements ConnectionAdapter {
return this.tequilapiClient.connectionStatistics()
}

public async fetchLocation (): Promise<Location> {
const dto = await this.tequilapiClient.location()
public async fetchConnectionLocation (): Promise<Location> {
const dto = await this.tequilapiClient.connectionLocation()

return { ip: dto.ip, countryCode: dto.country }
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/domain/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Connection {
}

private buildLocationFetcher (): LocationFetcher {
const fetchLocation = this.connectionAdapter.fetchLocation.bind(this.connectionAdapter)
const fetchLocation = this.connectionAdapter.fetchConnectionLocation.bind(this.connectionAdapter)
return new LocationFetcher(fetchLocation, this, location => {
this.updateLocation(location)
})
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/mocks/mock-connection-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class MockConnectionAdapter implements ConnectionAdapter {
}
}

public async fetchLocation (): Promise<Location> {
public async fetchConnectionLocation (): Promise<Location> {
return { ip: '100.101.102.103', countryCode: 'lt' }
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5547,10 +5547,10 @@ mv@^2.1.1, mv@~2:
ncp "~2.0.0"
rimraf "~2.4.0"

mysterium-tequilapi@^0.8.4:
version "0.8.4"
resolved "https://registry.yarnpkg.com/mysterium-tequilapi/-/mysterium-tequilapi-0.8.4.tgz#9bd819fb7f8eae5faf4af6891e307dfb37cb3a39"
integrity sha512-f1jzHDEKalIhCRBysOXsHqEl3NYmbDCHoFYkS8gRXT5h9KuYLMZqxN84tXs5fEvRLI9qhYclOJ0ldhCQlrr6XQ==
mysterium-tequilapi@^0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/mysterium-tequilapi/-/mysterium-tequilapi-0.9.0.tgz#779b726e40773a459b52b2ee414ccf3dd472b39d"
integrity sha512-4NdMBE64M/oHoSgqiDE7mgj/q0p2prnC1uj0TWFGLhhRmdN7EaBjxiTFZ1DsAsvhwEjihbu+Xs4C0CY5/TzJiw==
dependencies:
"@babel/runtime" "^7.1.5"
axios "^0.18.0"
Expand Down

0 comments on commit 64d5515

Please sign in to comment.