google-device-access: request logging

This commit is contained in:
Koushik Dutta
2022-03-07 10:16:11 -08:00
parent e463b63348
commit d2ef9da0bf
3 changed files with 5 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/google-device-access",
"version": "0.0.92",
"version": "0.0.93",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/google-device-access",
"version": "0.0.92",
"version": "0.0.93",
"dependencies": {
"@googleapis/smartdevicemanagement": "^0.2.0",
"axios": "^0.21.1",

View File

@@ -49,5 +49,5 @@
"@types/node": "^14.17.11",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.92"
"version": "0.0.93"
}

View File

@@ -692,6 +692,7 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient,
}
async authGet(path: string) {
this.console.log('SDM request', path);
await this.loadToken();
return axios(`https://${this.apiHostname}/v1/enterprises/${this.projectId}${path}`, {
headers: {
@@ -701,6 +702,7 @@ class GoogleSmartDeviceAccess extends ScryptedDeviceBase implements OauthClient,
}
async authPost(path: string, data: any) {
this.console.log('SDM request', path);
await this.loadToken();
return axios.post(`https://${this.apiHostname}/v1/enterprises/${this.projectId}${path}`, data, {
headers: {