Comparing version 1.0.4 to 1.0.5
@@ -5,4 +5,6 @@ # Changelog | ||
### 1.0.5 (2023-12-02) | ||
### 1.0.4 (2021-08-03) | ||
### [1.0.3](https://github.com/samuraitruong/aus-abr/compare/v1.0.1...v1.0.3) (2021-08-03) |
@@ -0,4 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
}; | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TableNames = void 0; | ||
@@ -9,3 +9,3 @@ var TableNames; | ||
TableNames["BUSINESS_NAME"] = "Business name(s)"; | ||
})(TableNames = exports.TableNames || (exports.TableNames = {})); | ||
})(TableNames || (exports.TableNames = TableNames = {})); | ||
//# sourceMappingURL=enum.js.map |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.readTableWithHeader = exports.readTable = exports.getFieldName = void 0; | ||
@@ -23,3 +23,3 @@ var locationValue = function (location) { | ||
status: status === statusText ? "unregistered" : status, | ||
from: from | ||
from: from, | ||
}; | ||
@@ -43,3 +43,3 @@ }; | ||
type: [{ header: "Type" }], | ||
abn: [{ header: "ABN", transformValue: removeText("Active") }] | ||
abn: [{ header: "ABN", transformValue: removeText("Active") }], | ||
}; | ||
@@ -46,0 +46,0 @@ function getFieldName(header) { |
@@ -17,3 +17,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -42,3 +42,3 @@ if (y = 0, t) op = [op[0] & 2, t.value]; | ||
}; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.searchActive = exports.getHistory = exports.lookupABN = void 0; | ||
@@ -54,6 +54,6 @@ var axios_1 = __importDefault(require("axios")); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, axios_1["default"].get(url)]; | ||
case 0: return [4 /*yield*/, axios_1.default.get(url)]; | ||
case 1: | ||
response = _a.sent(); | ||
$ = cheerio_1["default"].load(response.data); | ||
$ = cheerio_1.default.load(response.data); | ||
tables = $("table").toArray(); | ||
@@ -81,3 +81,3 @@ parseTable = tables.reduce(function (current, table) { | ||
stripped = abn.replace(/\s/gi, ""); | ||
url = "https://abr.business.gov.au/ABN/View?id=" + stripped; | ||
url = "https://abr.business.gov.au/ABN/View?id=".concat(stripped); | ||
return [4 /*yield*/, fetch(url)]; | ||
@@ -90,5 +90,5 @@ case 1: | ||
return [2 /*return*/, { | ||
details: helper_1.readTable($, parseTable[enum_1.TableNames.ABN_DETAILS]), | ||
tradingNames: helper_1.readTableWithHeader($, parseTable[enum_1.TableNames.TRADING_NAME], 1), | ||
businessNames: helper_1.readTableWithHeader($, parseTable[enum_1.TableNames.BUSINESS_NAME]) | ||
details: (0, helper_1.readTable)($, parseTable[enum_1.TableNames.ABN_DETAILS]), | ||
tradingNames: (0, helper_1.readTableWithHeader)($, parseTable[enum_1.TableNames.TRADING_NAME], 1), | ||
businessNames: (0, helper_1.readTableWithHeader)($, parseTable[enum_1.TableNames.BUSINESS_NAME]), | ||
}]; | ||
@@ -107,3 +107,3 @@ } | ||
stripped = abn.replace(/\s/gi, ""); | ||
url = "https://abr.business.gov.au/AbnHistory/View?id=" + stripped; | ||
url = "https://abr.business.gov.au/AbnHistory/View?id=".concat(stripped); | ||
return [4 /*yield*/, fetch(url)]; | ||
@@ -121,3 +121,3 @@ case 1: | ||
if (th.length > 0) { | ||
keyName = helper_1.getFieldName($(th[0]).text().trim()).key; | ||
keyName = (0, helper_1.getFieldName)($(th[0]).text().trim()).key; | ||
result[keyName] = result[keyName] || []; | ||
@@ -130,3 +130,3 @@ } | ||
from: $(td[1]).text().trim(), | ||
to: $(td[2]).text().trim() | ||
to: $(td[2]).text().trim(), | ||
}); | ||
@@ -152,7 +152,7 @@ } | ||
case 0: | ||
url = "https://abr.business.gov.au/Search/ResultsActive?SearchText=" + decodeURIComponent(keyword); | ||
url = "https://abr.business.gov.au/Search/ResultsActive?SearchText=".concat(decodeURIComponent(keyword)); | ||
return [4 /*yield*/, fetch(url)]; | ||
case 1: | ||
_a = _b.sent(), $ = _a.$, parseTable = _a.parseTable; | ||
return [2 /*return*/, helper_1.readTableWithHeader($, parseTable["Matching names"])]; | ||
return [2 /*return*/, (0, helper_1.readTableWithHeader)($, parseTable["Matching names"])]; | ||
} | ||
@@ -159,0 +159,0 @@ }); |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=intefaces.js.map |
{ | ||
"name": "aus-abr", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "NodeJS package to retrieve ABN or ACN from https://abr.business.gov.au/ using html parse to extract information", | ||
@@ -32,15 +32,15 @@ "main": "lib/index.js", | ||
"@types/jest": ">=26.0.24", | ||
"@typescript-eslint/eslint-plugin": "^3.6.1", | ||
"@typescript-eslint/parser": "^3.6.1", | ||
"@typescript-eslint/eslint-plugin": "^6.13.1", | ||
"@typescript-eslint/parser": "^6.13.1", | ||
"coveralls": "^3.1.1", | ||
"eslint": "^7.30.0", | ||
"eslint": "^8.55.0", | ||
"husky": "^7.0.1", | ||
"jest": "^27.0.6", | ||
"jest": "^29.7.0", | ||
"standard-version": "^9.3.1", | ||
"ts-jest": "^27.0.3", | ||
"typescript": "^4.3.5" | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^5.3.2" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"cheerio": "^1.0.0-rc.10" | ||
"axios": "^1.6.2", | ||
"cheerio": "^1.0.0-rc.12" | ||
}, | ||
@@ -47,0 +47,0 @@ "publishConfig": { |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
615
145075
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(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.21.4(transitive)
Updatedaxios@^1.6.2
Updatedcheerio@^1.0.0-rc.12