Comparing version 2.0.0 to 2.1.0
@@ -59,4 +59,4 @@ "use strict"; | ||
} | ||
exports.OneMap = OneMap; | ||
_OneMap_token = new WeakMap(); | ||
OneMap.BASE_URL = 'https://www.onemap.gov.sg/api'; | ||
exports.OneMap = OneMap; |
@@ -19,4 +19,4 @@ import { OneMap } from '../OneMap'; | ||
export interface GetPlanningareaReq { | ||
lat: number; | ||
lng: number; | ||
latitude: number; | ||
longitude: number; | ||
year: number; | ||
@@ -23,0 +23,0 @@ } |
@@ -32,9 +32,9 @@ "use strict"; | ||
async fetch(endpoint, query) { | ||
if (__classPrivateFieldGet(this, _Service_auth, "f")) { | ||
query.token = await this.onemap.getAccessToken(); | ||
} | ||
const uri = __classPrivateFieldGet(this, _Service_instances, "m", _Service_getUri).call(this, endpoint, query); | ||
const response = await (0, axios_1.default)(uri, { | ||
proxy: this.onemap.options?.proxy, | ||
method: 'GET' | ||
method: 'GET', | ||
headers: __classPrivateFieldGet(this, _Service_auth, "f") ? { | ||
'Authorization': `Bearer ${await this.onemap.getAccessToken()}` | ||
} : undefined | ||
}); | ||
@@ -41,0 +41,0 @@ return response.data; |
{ | ||
"name": "onemapsg", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Chang Zhe Jiet", | ||
@@ -33,17 +33,17 @@ "description": "Helper library for using OneMap APIs.", | ||
"dependencies": { | ||
"axios": "^0.26.1", | ||
"dayjs": "^1.11.7" | ||
"axios": "^1.6.2", | ||
"dayjs": "^1.11.10" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^29.5.0", | ||
"@typescript-eslint/eslint-plugin": "^5.55.0", | ||
"@typescript-eslint/parser": "^5.55.0", | ||
"eslint": "^8.36.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"@types/jest": "^29.5.10", | ||
"@typescript-eslint/eslint-plugin": "^6.12.0", | ||
"@typescript-eslint/parser": "^6.12.0", | ||
"eslint": "^8.54.0", | ||
"eslint-plugin-import": "^2.29.0", | ||
"eslint-plugin-security": "^1.7.1", | ||
"jest": "^29.5.0", | ||
"ts-jest": "^29.0.5", | ||
"jest": "^29.7.0", | ||
"ts-jest": "^29.1.1", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.0.2" | ||
"typescript": "^5.3.2" | ||
} | ||
} |
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
32808
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.7(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removedaxios@0.26.1(transitive)
Updatedaxios@^1.6.2
Updateddayjs@^1.11.10