@oasislabs/gateway
Advanced tools
Comparing version 1.0.0-rc.33 to 1.0.0-rc.34
import { HttpClient, HttpHeaders, Http } from './http'; | ||
export declare class HttpSession implements Http { | ||
url: string; | ||
apiToken: string; | ||
/** | ||
* The gateway base url. | ||
*/ | ||
url: string; | ||
/** | ||
* session key passed to the developer gateway in the header. | ||
@@ -7,0 +10,0 @@ */ |
@@ -27,3 +27,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
constructor(url, apiToken, headers, client) { | ||
this.url = url; | ||
this.apiToken = apiToken; | ||
@@ -37,5 +36,8 @@ this.sessionKey = uuid.v4(); | ||
this.client = client ? client : new AxiosClient(); | ||
this.url = url + (url.endsWith('/') ? '' : '/'); | ||
} | ||
request(method, api, body) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
console.log('api', api); | ||
console.log('url', this.url); | ||
const url = new URL(api, this.url).href; | ||
@@ -42,0 +44,0 @@ const headers = { headers: new Map() }; |
{ | ||
"name": "@oasislabs/gateway", | ||
"version": "1.0.0-rc.33", | ||
"version": "1.0.0-rc.34", | ||
"description": "Oasis Gateway implementation used as the client backend", | ||
@@ -50,3 +50,4 @@ "keywords": [ | ||
"@types/uuid": "^3.4.5", | ||
"axios": "^0.19.0" | ||
"axios": "^0.19.0", | ||
"uuid": "^3.4.0" | ||
}, | ||
@@ -57,3 +58,3 @@ "browser": { | ||
}, | ||
"gitHead": "b9e72b5ac47ac9329a88620898c859777e133594" | ||
"gitHead": "1fe11d5a5f4a64664b910b56c87d41f13f8e03e1" | ||
} |
@@ -22,2 +22,7 @@ import { AxiosClient, HttpClient, HttpHeaders, Http } from './http'; | ||
/** | ||
* The gateway base url. | ||
*/ | ||
public url: string; | ||
/** | ||
* session key passed to the developer gateway in the header. | ||
@@ -39,3 +44,3 @@ */ | ||
public constructor( | ||
public url: string, | ||
url: string, | ||
public apiToken: string, | ||
@@ -52,2 +57,3 @@ headers: HttpHeaders, | ||
this.client = client ? client : new AxiosClient(); | ||
this.url = url + (url.endsWith('/') ? '' : '/'); | ||
} | ||
@@ -60,3 +66,3 @@ | ||
): Promise<any> { | ||
const url = new URL(api, this.url).href; | ||
const url = this.url + api; | ||
const headers: HttpHeaders = { headers: new Map() }; | ||
@@ -63,0 +69,0 @@ headers.headers.set('X-OASIS-INSECURE-AUTH', '1'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6416682
60690
5
+ Addeduuid@^3.4.0
+ Addeduuid@3.4.0(transitive)