@bradmartin/kinvey-nativescript-sdk
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,2 +0,2 @@ | ||
import { Http, Device } from '@nativescript/core'; | ||
import { Http, Device } from "@nativescript/core"; | ||
function deviceInformation() { | ||
@@ -7,8 +7,11 @@ const platform = Device.os; | ||
const parts = [`js-${name}/${version}`]; | ||
return parts.concat([platform, version, manufacturer]).map((part) => { | ||
return parts | ||
.concat([platform, version, manufacturer]) | ||
.map((part) => { | ||
if (part) { | ||
return part.toString().replace(/\s/g, '_').toLowerCase(); | ||
return part.toString().replace(/\s/g, "_").toLowerCase(); | ||
} | ||
return 'unknown'; | ||
}).join(' '); | ||
return "unknown"; | ||
}) | ||
.join(" "); | ||
} | ||
@@ -21,5 +24,9 @@ function deviceInfo() { | ||
ov: Device.osVersion, | ||
sdk: { | ||
name: "@bradmartin/kinvey-nativescript-sdk", | ||
version: "1.0.4", | ||
}, | ||
pv: Device.sdkVersion, | ||
ty: Device.deviceType, | ||
id: Device.uuid | ||
id: Device.uuid, | ||
}; | ||
@@ -32,4 +39,4 @@ } | ||
if (kinveyUrlRegex.test(url)) { | ||
headers['X-Kinvey-Device-Information'] = deviceInformation(); | ||
headers['X-Kinvey-Device-Info'] = JSON.stringify(deviceInfo()); | ||
headers["X-Kinvey-Device-Information"] = deviceInformation(); | ||
headers["X-Kinvey-Device-Info"] = JSON.stringify(deviceInfo()); | ||
} | ||
@@ -41,3 +48,3 @@ const response = await Http.request({ | ||
content: body, | ||
timeout | ||
timeout, | ||
}); | ||
@@ -57,5 +64,5 @@ let data; | ||
headers: response.headers, | ||
data | ||
data, | ||
}; | ||
} | ||
//# sourceMappingURL=httpAdapter.js.map |
{ | ||
"name": "@bradmartin/kinvey-nativescript-sdk", | ||
"description": "Kinvey JavaScript SDK for NativeScript applications.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"license": "Apache-2.0", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/Kinvey/js-sdk/tree/master/packages/nativescript-sdk", |
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
85595
1306