@mountainpass/addressr 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -57
- package/lib/service/DefaultService.js +1 -1
- package/lib/service/address-service.js +3 -7
- package/lib/version.js +1 -1
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -1,79 +1,56 @@
|
|
|
1
1
|
# Addressr
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
[Australian Address Validation, Search and Autocomplete](https://addressr.io) - [addressr.io](https://addressr.io)
|
|
6
6
|
|
|
7
|
-
[](https://github.com/mountain-pass/addressr/blob/master/LICENSE) [](https://www.npmjs.com/package/@mountainpass/addressr) [](https://www.npmjs.com/package/@mountainpass/addressr)
|
|
7
|
+
[](https://github.com/mountain-pass/addressr/blob/master/LICENSE) [](https://www.npmjs.com/package/@mountainpass/addressr) [](https://www.npmjs.com/package/@mountainpass/addressr)
|
|
8
8
|
|
|
9
|
-
[](https://codeclimate.com/github/mountain-pass/addressr/maintainability) [](https://codeclimate.com/github/mountain-pass/addressr/test_coverage) 
|
|
10
10
|
|
|
11
|
-
[](https://github.com/mountain-pass/addressr/issues) [](https://github.com/mountain-pass/addressr/pulls)
|
|
12
|
-
|
|
13
|
-
[](https://gitter.im/mountainpass-addressr/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
14
|
-
|
|
15
|
-

|
|
11
|
+
[](https://github.com/mountain-pass/addressr/issues) [](https://github.com/mountain-pass/addressr/pulls)
|
|
16
12
|
|
|
17
13
|
# About
|
|
18
14
|
|
|
19
|
-
Australian Address Validation, Search and Autocomplete
|
|
20
|
-
|
|
21
|
-
## Australian Data Source
|
|
22
|
-
|
|
23
|
-
Addresses validated against the Geocoded National Address File (referred to as G-NAF), Australia’s **authoritative** address file.
|
|
24
|
-
|
|
25
|
-
## Software As or **NOT** As A Service
|
|
26
|
-
|
|
27
|
-
We love SaaS, but we know its not for everyone. SaaS or self hosted, we've got you covered.
|
|
28
|
-
|
|
29
|
-
## Always Up-To-Date
|
|
30
|
-
|
|
31
|
-
Addressr automatically updates with the latest data, so you're never out-of-date.
|
|
15
|
+
Australian Address Validation, Search and Autocomplete powered by the Geocoded National Address File (G-NAF), Australia’s **authoritative** address database with 15+ million addresses.
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Add address autocomplete, search and validation to your forms.
|
|
36
|
-
|
|
37
|
-
## Easy To Use API
|
|
17
|
+
# Quick Start
|
|
38
18
|
|
|
39
|
-
|
|
19
|
+
## Use the Hosted API
|
|
40
20
|
|
|
41
|
-
|
|
21
|
+
The fastest way to get started. No infrastructure to manage.
|
|
42
22
|
|
|
43
|
-
|
|
23
|
+
1. Get an API key at [RapidAPI](https://rapidapi.com/addressr-addressr-default/api/addressr)
|
|
24
|
+
2. Search for an address:
|
|
44
25
|
|
|
45
|
-
|
|
26
|
+
```sh
|
|
27
|
+
curl "https://addressr.p.rapidapi.com/addresses?q=1+george+st+sydney" \
|
|
28
|
+
-H "x-rapidapi-key: YOUR_KEY" \
|
|
29
|
+
-H "x-rapidapi-host: addressr.p.rapidapi.com"
|
|
30
|
+
```
|
|
46
31
|
|
|
47
|
-
|
|
48
|
-
Or for peace of mind for your mission critical solutions, get commercial support you can truly rely on.
|
|
32
|
+
## Use with AI Assistants
|
|
49
33
|
|
|
50
|
-
|
|
34
|
+
Connect Addressr to Claude, Cursor, VS Code Copilot, or any MCP-compatible AI assistant.
|
|
51
35
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- [Self Hosted](#self-hosted)
|
|
64
|
-
- [How it Works](#how-it-works)
|
|
65
|
-
- [Additional Settings](#additional-settings)
|
|
66
|
-
- [System requirements](#system-requirements)
|
|
67
|
-
- [Open Search](#open-search)
|
|
68
|
-
- [Addressr Loader](#addressr-loader)
|
|
69
|
-
- [Default](#default)
|
|
70
|
-
- [With Geocoding enabled](#with-geocoding-enabled)
|
|
71
|
-
- [Addressr Server](#addressr-server)
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"addressr": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@mountainpass/addressr-mcp"],
|
|
42
|
+
"env": { "RAPIDAPI_KEY": "your-key" }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
72
47
|
|
|
73
|
-
|
|
48
|
+
Three tools available: **search-addresses**, **get-address**, and **health**. See [@mountainpass/addressr-mcp](https://github.com/mountain-pass/addressr-mcp) for full setup instructions.
|
|
74
49
|
|
|
75
50
|
## Self Hosted
|
|
76
51
|
|
|
52
|
+
Run Addressr on your own infrastructure for full control over your data.
|
|
53
|
+
|
|
77
54
|
1. Install addressr
|
|
78
55
|
|
|
79
56
|
```
|
|
@@ -186,12 +163,12 @@ opensearch >= 1.2.4 with 1.4GiB of memory
|
|
|
186
163
|
|
|
187
164
|
#### Default
|
|
188
165
|
|
|
189
|
-
Node.js >=
|
|
166
|
+
Node.js >= 22 with 1GiB of memory
|
|
190
167
|
|
|
191
168
|
#### With Geocoding enabled
|
|
192
169
|
|
|
193
|
-
Node.js >=
|
|
170
|
+
Node.js >= 22 with 8GiB of memory
|
|
194
171
|
|
|
195
172
|
### Addressr Server
|
|
196
173
|
|
|
197
|
-
Node.js >=
|
|
174
|
+
Node.js >= 22 with 64MiB of memory
|
|
@@ -21,7 +21,7 @@ async function getApiRoot() {
|
|
|
21
21
|
const link = new _httpLinkHeader.default();
|
|
22
22
|
for (const p of paths) {
|
|
23
23
|
const op = global.swaggerDoc.paths[p].get;
|
|
24
|
-
if (op.parameters && op.parameters.
|
|
24
|
+
if (op.parameters && op.parameters.some(parameter => parameter.required === true)) {
|
|
25
25
|
// skip
|
|
26
26
|
} else {
|
|
27
27
|
link.set({
|
|
@@ -24,7 +24,7 @@ var _unzipStream = _interopRequireDefault(require("unzip-stream"));
|
|
|
24
24
|
var _elasticsearch = require("../client/elasticsearch");
|
|
25
25
|
var _streamDown = _interopRequireDefault(require("../utils/stream-down"));
|
|
26
26
|
var _setLinkOptions = require("./setLinkOptions");
|
|
27
|
-
var _keyv =
|
|
27
|
+
var _keyv = require("keyv");
|
|
28
28
|
var _keyvFile = require("keyv-file");
|
|
29
29
|
var _nodeCrypto = _interopRequireDefault(require("node:crypto"));
|
|
30
30
|
var _glob = require("glob");
|
|
@@ -37,7 +37,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
37
37
|
const fsp = _nodeFs.default.promises;
|
|
38
38
|
var logger = (0, _debug.default)('api');
|
|
39
39
|
var error = (0, _debug.default)('error');
|
|
40
|
-
const cache = new _keyv.
|
|
40
|
+
const cache = new _keyv.Keyv({
|
|
41
41
|
store: new _keyvFile.KeyvFile({
|
|
42
42
|
filename: 'target/keyv-file.msgpack'
|
|
43
43
|
})
|
|
@@ -976,7 +976,7 @@ async function getFiles(currentDir, baseDir) {
|
|
|
976
976
|
}
|
|
977
977
|
function countFileLines(filePath) {
|
|
978
978
|
return new Promise((resolve, reject) => {
|
|
979
|
-
const readStream = _nodeFs.default.createReadStream(filePath, '
|
|
979
|
+
const readStream = _nodeFs.default.createReadStream(filePath, 'utf8');
|
|
980
980
|
let lines = 0;
|
|
981
981
|
let last;
|
|
982
982
|
readStream.on('data', function (chunk) {
|
|
@@ -1113,10 +1113,6 @@ async function loadFileCounts(countsFile) {
|
|
|
1113
1113
|
logger('filesCounts', filesCounts);
|
|
1114
1114
|
return filesCounts;
|
|
1115
1115
|
}
|
|
1116
|
-
async function loadFileContents(contentsFile) {
|
|
1117
|
-
const contents = await fsp.readFile(contentsFile);
|
|
1118
|
-
return contents.toString().split('\n').map(line => line.trim());
|
|
1119
|
-
}
|
|
1120
1116
|
async function loadState(files, directory, state) {
|
|
1121
1117
|
const stateFile = files.find(f => f.match(new RegExp(`${state}_STATE_psv`)));
|
|
1122
1118
|
if (stateFile === undefined) {
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mountainpass/addressr",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Australian Address Validation, Search and Autocomplete",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mountain Pass",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"test:cli2:geo": "ES_INDEX_NAME=test PORT=$npm_package_config_localport ADDRESSR_ENABLE_GEO=1 DEBUG=error,api,express:*,swagger-tools*,test,es run-p --race start:server2:preinstalled dotest:cli2:geo",
|
|
107
107
|
"dotest:cli2:geo": "ADDRESSR_ENABLE_GEO=1 ES_INDEX_NAME=test COVERED_STATES=OT TEST_PROFILE=cli2 cucumber-js -p cli2 -- --harmony_async_iteration",
|
|
108
108
|
"cover:cli:geo": "nyc --report-dir coverage/cli --temp-dir coverage/cli/.nyc_output npm run test:cli:nogeo",
|
|
109
|
+
"test:mcp:smoke": "node --test test/mcp/smoke.test.mjs",
|
|
109
110
|
"test:nodejs:QLD:nogeo": "PORT=$npm_package_config_localport ES_INDEX_NAME=test COVERED_STATES=QLD DEBUG=error,api,express:*,swagger-tools*,test,es TEST_PROFILE=default cucumber-js -p default -- --harmony_async_iteration",
|
|
110
111
|
"test:nodejs:QLD:geo": "PORT=$npm_package_config_localport ADDRESSR_ENABLE_GEO=1 ES_INDEX_NAME=test-geo COVERED_STATES=QLD DEBUG=error,api,express:*,swagger-tools*,test,es TEST_PROFILE=default NODE_OPTIONS=--max_old_space_size=8196 cucumber-js -p default -- --harmony_async_iteration",
|
|
111
112
|
"prebuildX": "npm run genversion && cat ./templates/LICENSE.md | envsubst '${PRODUCT},${VERSION},${COMPANY},${YEAR}' > ./LICENSE.md",
|
|
@@ -170,9 +171,9 @@
|
|
|
170
171
|
"glob": "^13.0.6",
|
|
171
172
|
"http-link-header": "^1.1.3",
|
|
172
173
|
"js-yaml": "^4.1.1",
|
|
173
|
-
"json-ptr": "
|
|
174
|
-
"keyv": "^
|
|
175
|
-
"keyv-file": "^
|
|
174
|
+
"json-ptr": "^3.1.1",
|
|
175
|
+
"keyv": "^5.6.0",
|
|
176
|
+
"keyv-file": "^5.3.3",
|
|
176
177
|
"node-machine-id": "^1.1.12",
|
|
177
178
|
"papaparse": "^5.0.0",
|
|
178
179
|
"progress": "^2.0.3",
|
|
@@ -180,7 +181,7 @@
|
|
|
180
181
|
"swagger-tools": "^0.10.4",
|
|
181
182
|
"unzip-stream": "^0.3.0",
|
|
182
183
|
"uri-template-lite": "^23.4.0",
|
|
183
|
-
"wait-port": "^
|
|
184
|
+
"wait-port": "^1.1.0"
|
|
184
185
|
},
|
|
185
186
|
"devDependencies": {
|
|
186
187
|
"@babel/cli": "^7.6.2",
|
|
@@ -195,10 +196,11 @@
|
|
|
195
196
|
"@babel/register": "^7.7.0",
|
|
196
197
|
"@babel/runtime": "^7.5.0",
|
|
197
198
|
"@cucumber/cucumber": "^12.7.0",
|
|
199
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
198
200
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
199
201
|
"@eslint/js": "^9.39.4",
|
|
200
202
|
"@istanbuljs/nyc-config-babel": "^3.0.0",
|
|
201
|
-
"@mountainpass/waychaser": "^5.0.
|
|
203
|
+
"@mountainpass/waychaser": "^5.0.50",
|
|
202
204
|
"babel-plugin-istanbul": "^7.0.1",
|
|
203
205
|
"bats": "^1.13.0",
|
|
204
206
|
"chai": "^4.2.0",
|
|
@@ -211,7 +213,7 @@
|
|
|
211
213
|
"eslint-plugin-prettier": "^5.5.5",
|
|
212
214
|
"eslint-plugin-promise": "^7.2.1",
|
|
213
215
|
"eslint-plugin-security": "^4.0.0",
|
|
214
|
-
"eslint-plugin-unicorn": "^
|
|
216
|
+
"eslint-plugin-unicorn": "^64.0.0",
|
|
215
217
|
"genversion": "^3.0.0",
|
|
216
218
|
"globals": "^17.4.0",
|
|
217
219
|
"husky": "^9.1.7",
|
|
@@ -222,7 +224,7 @@
|
|
|
222
224
|
"nodemon": "^3.1.14",
|
|
223
225
|
"npm-check": "^6.0.1",
|
|
224
226
|
"npm-run-all": "^4.1.5",
|
|
225
|
-
"nyc": "^
|
|
227
|
+
"nyc": "^18.0.0",
|
|
226
228
|
"prettier": "^3.8.1",
|
|
227
229
|
"prettier-config-standard": "^7.0.0",
|
|
228
230
|
"turbo": "^2.8.17"
|