@inpassor/firebase-config
Advanced tools
Comparing version 0.2.5 to 0.2.7
@@ -18,4 +18,4 @@ import { Data, FirebaseConfigOptions, CacheOptions } from './interfaces'; | ||
getAccessToken(): Promise<string>; | ||
get(): Promise<Data>; | ||
get(): Promise<Data | null>; | ||
set(parameters: Data): Promise<null>; | ||
} |
@@ -62,5 +62,3 @@ "use strict"; | ||
else { | ||
const client = new google_auth_library_1.Compute(); | ||
const url = `https://www.googleapis.com/dns/v1/projects/${this.projectId}`; | ||
client.request({ url }, (error, { data }) => { | ||
(new google_auth_library_1.Compute()).getAccessToken((error, token) => { | ||
if (error) { | ||
@@ -70,4 +68,3 @@ reject(error); | ||
else { | ||
console.log(data); | ||
resolve(data + ''); | ||
resolve(token); | ||
} | ||
@@ -117,3 +114,3 @@ }); | ||
else { | ||
reject(this.defaultErrorMessage); | ||
resolve(null); | ||
} | ||
@@ -120,0 +117,0 @@ }) |
{ | ||
"name": "@inpassor/firebase-config", | ||
"version": "0.2.5", | ||
"version": "0.2.7", | ||
"license": "MIT", | ||
@@ -36,3 +36,3 @@ "author": "Oleg V. Kuzmin", | ||
"devDependencies": { | ||
"@types/node": "^10.12.9", | ||
"@types/node": "^10.12.10", | ||
"tslint": "^5.11.0", | ||
@@ -39,0 +39,0 @@ "typescript": "^3.1.6" |
@@ -72,10 +72,7 @@ import fetch from 'node-fetch'; | ||
} else { | ||
const client = new Compute(); | ||
const url = `https://www.googleapis.com/dns/v1/projects/${this.projectId}`; | ||
client.request({url}, (error: any, {data}) => { | ||
(new Compute()).getAccessToken((error: any, token?: string | null) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
console.log(data); | ||
resolve(data + ''); | ||
resolve(token); | ||
} | ||
@@ -87,3 +84,3 @@ }); | ||
public get(): Promise<Data> { | ||
public get(): Promise<Data | null> { | ||
return new Promise((resolve, reject) => { | ||
@@ -124,3 +121,3 @@ this.getAccessToken().then((accessToken: string) => { | ||
} else { | ||
reject(this.defaultErrorMessage); | ||
resolve(null); | ||
} | ||
@@ -127,0 +124,0 @@ }) |
Sorry, the diff of this file is not supported yet
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
24789
489