@versatiles/versatiles-rs 5.12.0 → 5.14.0
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 -2
- package/index.cjs +59 -56
- package/index.d.ts +50 -2
- package/index.js +60 -57
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -204,6 +204,37 @@ await convert('local.mbtiles', 'sftp://host/tiles/berlin.pmtiles', {
|
|
|
204
204
|
Uploading needs a format that can be written as a stream, which today means `.versatiles` and
|
|
205
205
|
`.pmtiles`. `.mbtiles` is a local SQLite file, and is refused with a message saying so.
|
|
206
206
|
|
|
207
|
+
#### HTTP authentication
|
|
208
|
+
|
|
209
|
+
An `http://` or `https://` source behind a password can name only its user, as
|
|
210
|
+
`https://alice@dav.example.org/tiles.pmtiles`, so that the password is not written into a pipeline
|
|
211
|
+
or a list of recent sources. The password is looked up in this order, first match wins:
|
|
212
|
+
|
|
213
|
+
1. A password written into the URL (`https://alice:secret@…`)
|
|
214
|
+
2. One registered with `setHttpPassword(origin, user, password)`
|
|
215
|
+
3. `~/.netrc` (or the file `NETRC` names), if `enableHttpNetrc()` was called or
|
|
216
|
+
`VERSATILES_HTTP_NETRC=on` is set
|
|
217
|
+
4. None: the request is sent with the user and no password
|
|
218
|
+
|
|
219
|
+
```javascript
|
|
220
|
+
import { setHttpPassword, TileSource } from '@versatiles/versatiles-rs';
|
|
221
|
+
|
|
222
|
+
// For instance from the system keychain, once at start-up
|
|
223
|
+
setHttpPassword('https://dav.example.org', 'alice', password);
|
|
224
|
+
|
|
225
|
+
const source = await TileSource.fromPath('https://alice@dav.example.org/tiles.pmtiles');
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
A registered password belongs to the scheme, host and port of `origin` and to `user`: it is sent to
|
|
229
|
+
no other server, `http://` for an `https://` origin included, and never for a URL without a user.
|
|
230
|
+
`forgetHttpPassword(origin, user)` removes it. Both hold for the whole process, so for every
|
|
231
|
+
`TileSource`, `convert` and `TileServer` from then on.
|
|
232
|
+
|
|
233
|
+
A `.netrc` entry counts only when its `machine` is the URL's host and its `login` the URL's user; a
|
|
234
|
+
`default` entry is never used, and the password is sent only over `https`, or over `http` to this
|
|
235
|
+
machine. Reading `.netrc` is off by default, so that a pipeline someone else wrote cannot sign in with
|
|
236
|
+
your password, and once enabled it stays on.
|
|
237
|
+
|
|
207
238
|
#### Disk cache
|
|
208
239
|
|
|
209
240
|
A conversion caches tiles when the source's tile order differs from the one the output needs. For a
|
|
@@ -335,7 +366,7 @@ Create a new tile server.
|
|
|
335
366
|
- `ip` (string): IP address to bind (default: `"0.0.0.0"`)
|
|
336
367
|
- `port` (number): Port number (default: `8080`)
|
|
337
368
|
- `minimalRecompression` (boolean): Use minimal recompression
|
|
338
|
-
- `cacheControl` (string): `Cache-Control` header sent with tiles
|
|
369
|
+
- `cacheControl` (string): `Cache-Control` header sent with tiles and `tiles.json` (default: `"public, max-age=2419200, no-transform"`, four weeks). Set something shorter, e.g. `"no-cache"`, when the tiles behind a name change. Static files have their own, see `addStaticSource()`.
|
|
339
370
|
|
|
340
371
|
#### `server.addTileSourceFromPath(name, path)`
|
|
341
372
|
|
|
@@ -369,7 +400,7 @@ Remove a tile source.
|
|
|
369
400
|
|
|
370
401
|
**Returns:** `Promise<boolean>` — `true` if a source with that name was removed
|
|
371
402
|
|
|
372
|
-
#### `server.addStaticSource(path, urlPrefix?)`
|
|
403
|
+
#### `server.addStaticSource(path, urlPrefix?, cacheControl?)`
|
|
373
404
|
|
|
374
405
|
Add static file source.
|
|
375
406
|
|
|
@@ -377,6 +408,7 @@ Add static file source.
|
|
|
377
408
|
|
|
378
409
|
- `path` (string): Directory or .tar file
|
|
379
410
|
- `urlPrefix` (string, optional): URL prefix (default: `"/"`)
|
|
411
|
+
- `cacheControl` (string, optional): `Cache-Control` header sent with these files (default: `"no-cache"`). Static URLs stay the same when the files change, so with `no-cache` a browser checks every time, and an unchanged file costs an empty `304`.
|
|
380
412
|
|
|
381
413
|
**Returns:** `Promise<void>`
|
|
382
414
|
|
package/index.cjs
CHANGED
|
@@ -94,8 +94,8 @@ function requireNative() {
|
|
|
94
94
|
try {
|
|
95
95
|
const binding = require('@versatiles/versatiles-rs-android-arm64')
|
|
96
96
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm64/package.json').version
|
|
97
|
-
if (bindingPackageVersion !== '5.
|
|
98
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
97
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
98
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
99
99
|
}
|
|
100
100
|
return binding
|
|
101
101
|
} catch (e) {
|
|
@@ -110,8 +110,8 @@ function requireNative() {
|
|
|
110
110
|
try {
|
|
111
111
|
const binding = require('@versatiles/versatiles-rs-android-arm-eabi')
|
|
112
112
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm-eabi/package.json').version
|
|
113
|
-
if (bindingPackageVersion !== '5.
|
|
114
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
113
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
114
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
115
115
|
}
|
|
116
116
|
return binding
|
|
117
117
|
} catch (e) {
|
|
@@ -131,8 +131,8 @@ function requireNative() {
|
|
|
131
131
|
try {
|
|
132
132
|
const binding = require('@versatiles/versatiles-rs-win32-x64-gnu')
|
|
133
133
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-gnu/package.json').version
|
|
134
|
-
if (bindingPackageVersion !== '5.
|
|
135
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
134
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
135
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
136
136
|
}
|
|
137
137
|
return binding
|
|
138
138
|
} catch (e) {
|
|
@@ -147,8 +147,8 @@ function requireNative() {
|
|
|
147
147
|
try {
|
|
148
148
|
const binding = require('@versatiles/versatiles-rs-win32-x64-msvc')
|
|
149
149
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-msvc/package.json').version
|
|
150
|
-
if (bindingPackageVersion !== '5.
|
|
151
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
150
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
151
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
152
152
|
}
|
|
153
153
|
return binding
|
|
154
154
|
} catch (e) {
|
|
@@ -164,8 +164,8 @@ function requireNative() {
|
|
|
164
164
|
try {
|
|
165
165
|
const binding = require('@versatiles/versatiles-rs-win32-ia32-msvc')
|
|
166
166
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-ia32-msvc/package.json').version
|
|
167
|
-
if (bindingPackageVersion !== '5.
|
|
168
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
167
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
168
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
169
169
|
}
|
|
170
170
|
return binding
|
|
171
171
|
} catch (e) {
|
|
@@ -180,8 +180,8 @@ function requireNative() {
|
|
|
180
180
|
try {
|
|
181
181
|
const binding = require('@versatiles/versatiles-rs-win32-arm64-msvc')
|
|
182
182
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-arm64-msvc/package.json').version
|
|
183
|
-
if (bindingPackageVersion !== '5.
|
|
184
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
183
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
184
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
185
185
|
}
|
|
186
186
|
return binding
|
|
187
187
|
} catch (e) {
|
|
@@ -199,8 +199,8 @@ function requireNative() {
|
|
|
199
199
|
try {
|
|
200
200
|
const binding = require('@versatiles/versatiles-rs-darwin-universal')
|
|
201
201
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-universal/package.json').version
|
|
202
|
-
if (bindingPackageVersion !== '5.
|
|
203
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
202
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
204
|
}
|
|
205
205
|
return binding
|
|
206
206
|
} catch (e) {
|
|
@@ -215,8 +215,8 @@ function requireNative() {
|
|
|
215
215
|
try {
|
|
216
216
|
const binding = require('@versatiles/versatiles-rs-darwin-x64')
|
|
217
217
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-x64/package.json').version
|
|
218
|
-
if (bindingPackageVersion !== '5.
|
|
219
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
218
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
219
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
220
220
|
}
|
|
221
221
|
return binding
|
|
222
222
|
} catch (e) {
|
|
@@ -231,8 +231,8 @@ function requireNative() {
|
|
|
231
231
|
try {
|
|
232
232
|
const binding = require('@versatiles/versatiles-rs-darwin-arm64')
|
|
233
233
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-arm64/package.json').version
|
|
234
|
-
if (bindingPackageVersion !== '5.
|
|
235
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
234
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
235
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
236
236
|
}
|
|
237
237
|
return binding
|
|
238
238
|
} catch (e) {
|
|
@@ -251,8 +251,8 @@ function requireNative() {
|
|
|
251
251
|
try {
|
|
252
252
|
const binding = require('@versatiles/versatiles-rs-freebsd-x64')
|
|
253
253
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-x64/package.json').version
|
|
254
|
-
if (bindingPackageVersion !== '5.
|
|
255
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
254
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
255
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
256
256
|
}
|
|
257
257
|
return binding
|
|
258
258
|
} catch (e) {
|
|
@@ -267,8 +267,8 @@ function requireNative() {
|
|
|
267
267
|
try {
|
|
268
268
|
const binding = require('@versatiles/versatiles-rs-freebsd-arm64')
|
|
269
269
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-arm64/package.json').version
|
|
270
|
-
if (bindingPackageVersion !== '5.
|
|
271
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
270
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
271
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
272
272
|
}
|
|
273
273
|
return binding
|
|
274
274
|
} catch (e) {
|
|
@@ -283,8 +283,8 @@ function requireNative() {
|
|
|
283
283
|
try {
|
|
284
284
|
const binding = require('@versatiles/versatiles-rs-freebsd-ppc64')
|
|
285
285
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-ppc64/package.json').version
|
|
286
|
-
if (bindingPackageVersion !== '5.
|
|
287
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
286
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
287
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
288
288
|
}
|
|
289
289
|
return binding
|
|
290
290
|
} catch (e) {
|
|
@@ -304,8 +304,8 @@ function requireNative() {
|
|
|
304
304
|
try {
|
|
305
305
|
const binding = require('@versatiles/versatiles-rs-linux-x64-musl')
|
|
306
306
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-musl/package.json').version
|
|
307
|
-
if (bindingPackageVersion !== '5.
|
|
308
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
307
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
308
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
309
309
|
}
|
|
310
310
|
return binding
|
|
311
311
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@versatiles/versatiles-rs-linux-x64-gnu')
|
|
322
322
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-gnu/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '5.
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
323
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -338,8 +338,8 @@ function requireNative() {
|
|
|
338
338
|
try {
|
|
339
339
|
const binding = require('@versatiles/versatiles-rs-linux-arm64-musl')
|
|
340
340
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-musl/package.json').version
|
|
341
|
-
if (bindingPackageVersion !== '5.
|
|
342
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
341
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
342
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
343
343
|
}
|
|
344
344
|
return binding
|
|
345
345
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@versatiles/versatiles-rs-linux-arm64-gnu')
|
|
356
356
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-gnu/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '5.
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
357
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -372,8 +372,8 @@ function requireNative() {
|
|
|
372
372
|
try {
|
|
373
373
|
const binding = require('@versatiles/versatiles-rs-linux-arm-musleabihf')
|
|
374
374
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-musleabihf/package.json').version
|
|
375
|
-
if (bindingPackageVersion !== '5.
|
|
376
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
375
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
376
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
377
377
|
}
|
|
378
378
|
return binding
|
|
379
379
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@versatiles/versatiles-rs-linux-arm-gnueabihf')
|
|
390
390
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-gnueabihf/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '5.
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
391
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -406,8 +406,8 @@ function requireNative() {
|
|
|
406
406
|
try {
|
|
407
407
|
const binding = require('@versatiles/versatiles-rs-linux-loong64-musl')
|
|
408
408
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-musl/package.json').version
|
|
409
|
-
if (bindingPackageVersion !== '5.
|
|
410
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
409
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
410
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
411
411
|
}
|
|
412
412
|
return binding
|
|
413
413
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@versatiles/versatiles-rs-linux-loong64-gnu')
|
|
424
424
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-gnu/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '5.
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
425
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -440,8 +440,8 @@ function requireNative() {
|
|
|
440
440
|
try {
|
|
441
441
|
const binding = require('@versatiles/versatiles-rs-linux-riscv64-musl')
|
|
442
442
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-musl/package.json').version
|
|
443
|
-
if (bindingPackageVersion !== '5.
|
|
444
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
443
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
444
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
445
445
|
}
|
|
446
446
|
return binding
|
|
447
447
|
} catch (e) {
|
|
@@ -456,8 +456,8 @@ function requireNative() {
|
|
|
456
456
|
try {
|
|
457
457
|
const binding = require('@versatiles/versatiles-rs-linux-riscv64-gnu')
|
|
458
458
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-gnu/package.json').version
|
|
459
|
-
if (bindingPackageVersion !== '5.
|
|
460
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
459
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
460
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
461
461
|
}
|
|
462
462
|
return binding
|
|
463
463
|
} catch (e) {
|
|
@@ -473,8 +473,8 @@ function requireNative() {
|
|
|
473
473
|
try {
|
|
474
474
|
const binding = require('@versatiles/versatiles-rs-linux-ppc64-gnu')
|
|
475
475
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-ppc64-gnu/package.json').version
|
|
476
|
-
if (bindingPackageVersion !== '5.
|
|
477
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
476
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
477
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
478
478
|
}
|
|
479
479
|
return binding
|
|
480
480
|
} catch (e) {
|
|
@@ -489,8 +489,8 @@ function requireNative() {
|
|
|
489
489
|
try {
|
|
490
490
|
const binding = require('@versatiles/versatiles-rs-linux-s390x-gnu')
|
|
491
491
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-s390x-gnu/package.json').version
|
|
492
|
-
if (bindingPackageVersion !== '5.
|
|
493
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
492
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
493
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
494
494
|
}
|
|
495
495
|
return binding
|
|
496
496
|
} catch (e) {
|
|
@@ -509,8 +509,8 @@ function requireNative() {
|
|
|
509
509
|
try {
|
|
510
510
|
const binding = require('@versatiles/versatiles-rs-openharmony-arm64')
|
|
511
511
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm64/package.json').version
|
|
512
|
-
if (bindingPackageVersion !== '5.
|
|
513
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
512
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
513
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
514
514
|
}
|
|
515
515
|
return binding
|
|
516
516
|
} catch (e) {
|
|
@@ -525,8 +525,8 @@ function requireNative() {
|
|
|
525
525
|
try {
|
|
526
526
|
const binding = require('@versatiles/versatiles-rs-openharmony-x64')
|
|
527
527
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-x64/package.json').version
|
|
528
|
-
if (bindingPackageVersion !== '5.
|
|
529
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
528
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
529
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
530
530
|
}
|
|
531
531
|
return binding
|
|
532
532
|
} catch (e) {
|
|
@@ -541,8 +541,8 @@ function requireNative() {
|
|
|
541
541
|
try {
|
|
542
542
|
const binding = require('@versatiles/versatiles-rs-openharmony-arm')
|
|
543
543
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm/package.json').version
|
|
544
|
-
if (bindingPackageVersion !== '5.
|
|
545
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
544
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
545
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
546
546
|
}
|
|
547
547
|
return binding
|
|
548
548
|
} catch (e) {
|
|
@@ -683,8 +683,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
683
683
|
if (!candidateFailed) {
|
|
684
684
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
685
685
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-wasm32-wasi/package.json').version
|
|
686
|
-
if (bindingPackageVersion !== '5.
|
|
687
|
-
throw new Error(`WASI binding package version mismatch, expected 5.
|
|
686
|
+
if (bindingPackageVersion !== '5.14.0') {
|
|
687
|
+
throw new Error(`WASI binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
688
688
|
}
|
|
689
689
|
}
|
|
690
690
|
wasiBinding = require('@versatiles/versatiles-rs-wasm32-wasi')
|
|
@@ -841,10 +841,13 @@ module.exports.TileServer = nativeBinding.TileServer
|
|
|
841
841
|
module.exports.TileSource = nativeBinding.TileSource
|
|
842
842
|
module.exports.checkVpl = nativeBinding.checkVpl
|
|
843
843
|
module.exports.convert = nativeBinding.convert
|
|
844
|
+
module.exports.enableHttpNetrc = nativeBinding.enableHttpNetrc
|
|
845
|
+
module.exports.forgetHttpPassword = nativeBinding.forgetHttpPassword
|
|
844
846
|
module.exports.formatVplCst = nativeBinding.formatVplCst
|
|
845
847
|
module.exports.generateVplTypescript = nativeBinding.generateVplTypescript
|
|
846
848
|
module.exports.layerStats = nativeBinding.layerStats
|
|
847
849
|
module.exports.parseVpl = nativeBinding.parseVpl
|
|
848
850
|
module.exports.parseVplCst = nativeBinding.parseVplCst
|
|
851
|
+
module.exports.setHttpPassword = nativeBinding.setHttpPassword
|
|
849
852
|
module.exports.stringifyVpl = nativeBinding.stringifyVpl
|
|
850
853
|
module.exports.stringifyVplCst = nativeBinding.stringifyVplCst
|
package/index.d.ts
CHANGED
|
@@ -372,8 +372,11 @@ export declare class TileServer {
|
|
|
372
372
|
*
|
|
373
373
|
* Serves static files from a path (can be a .tar or directory)
|
|
374
374
|
* Changes take effect immediately without requiring a restart (hot reload).
|
|
375
|
+
*
|
|
376
|
+
* The files are sent with `Cache-Control: no-cache` unless `cacheControl`
|
|
377
|
+
* says otherwise. The server's `cacheControl` option does not apply to them.
|
|
375
378
|
*/
|
|
376
|
-
addStaticSource(path: string, urlPrefix?: string | undefined | null): Promise<void>
|
|
379
|
+
addStaticSource(path: string, urlPrefix?: string | undefined | null, cacheControl?: string | undefined | null): Promise<void>
|
|
377
380
|
/**
|
|
378
381
|
* Remove a static file source from the server by URL prefix
|
|
379
382
|
*
|
|
@@ -1078,6 +1081,26 @@ export interface ConvertOptions {
|
|
|
1078
1081
|
cacheDir?: string
|
|
1079
1082
|
}
|
|
1080
1083
|
|
|
1084
|
+
/**
|
|
1085
|
+
* Lets a source that names a user but no password take it from `~/.netrc`.
|
|
1086
|
+
*
|
|
1087
|
+
* The same as `VERSATILES_HTTP_NETRC=on`, or `--netrc` on the command line,
|
|
1088
|
+
* and like them it cannot be turned off again. `NETRC` names another file. An
|
|
1089
|
+
* entry counts only when its `machine` is the URL's host and its `login` the
|
|
1090
|
+
* URL's user, a `default` entry is never used, and the password is sent only
|
|
1091
|
+
* over `https`, or over `http` to this machine.
|
|
1092
|
+
*
|
|
1093
|
+
* Off by default, so that a pipeline someone else wrote cannot sign in with
|
|
1094
|
+
* the user's password without the application deciding to.
|
|
1095
|
+
*/
|
|
1096
|
+
export declare function enableHttpNetrc(): void
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* Removes the password `setHttpPassword` registered for `user` on the server
|
|
1100
|
+
* `origin` names, if there is one.
|
|
1101
|
+
*/
|
|
1102
|
+
export declare function forgetHttpPassword(origin: string, user: string): void
|
|
1103
|
+
|
|
1081
1104
|
/**
|
|
1082
1105
|
* Reformats a lossless syntax tree, keeping the comments in it.
|
|
1083
1106
|
*
|
|
@@ -1400,7 +1423,7 @@ export interface ServerOptions {
|
|
|
1400
1423
|
*/
|
|
1401
1424
|
minimalRecompression?: boolean
|
|
1402
1425
|
/**
|
|
1403
|
-
* `Cache-Control` header sent with tiles
|
|
1426
|
+
* `Cache-Control` header sent with tiles and `tiles.json`
|
|
1404
1427
|
*
|
|
1405
1428
|
* Tile URLs are stable — built from a mount name and a coordinate — so
|
|
1406
1429
|
* when the tiles behind a mount change, the URL does not, and the browser
|
|
@@ -1408,6 +1431,9 @@ export interface ServerOptions {
|
|
|
1408
1431
|
* re-mounts under the same name will otherwise keep showing the previous
|
|
1409
1432
|
* edit.
|
|
1410
1433
|
*
|
|
1434
|
+
* Static files are sent with `"no-cache"` instead; pass another value as
|
|
1435
|
+
* the third argument of `addStaticSource()`.
|
|
1436
|
+
*
|
|
1411
1437
|
* Example: `"no-cache"`.
|
|
1412
1438
|
*
|
|
1413
1439
|
* **Default:** `"public, max-age=2419200, no-transform"` (four weeks)
|
|
@@ -1415,6 +1441,28 @@ export interface ServerOptions {
|
|
|
1415
1441
|
cacheControl?: string
|
|
1416
1442
|
}
|
|
1417
1443
|
|
|
1444
|
+
/**
|
|
1445
|
+
* Registers the password for `user` on the server `origin` names.
|
|
1446
|
+
*
|
|
1447
|
+
* Only the scheme, host and port of `origin` count: a password registered for
|
|
1448
|
+
* `https://dav.example.org/remote.php/` is sent to every URL on
|
|
1449
|
+
* `https://dav.example.org` that names `user` and has no password of its own,
|
|
1450
|
+
* and to no other server, `http://dav.example.org` included. A later call for
|
|
1451
|
+
* the same server and user replaces the password.
|
|
1452
|
+
*
|
|
1453
|
+
* So a source can be named as `https://user@host/…`, which is safe to store
|
|
1454
|
+
* and to share, while the password comes from wherever the application keeps
|
|
1455
|
+
* it.
|
|
1456
|
+
*
|
|
1457
|
+
* ```javascript
|
|
1458
|
+
* import { setHttpPassword, TileSource } from '@versatiles/versatiles-rs';
|
|
1459
|
+
*
|
|
1460
|
+
* setHttpPassword('https://dav.example.org', 'alice', process.env.DAV_PASSWORD);
|
|
1461
|
+
* const source = await TileSource.fromPath('https://alice@dav.example.org/tiles.pmtiles');
|
|
1462
|
+
* ```
|
|
1463
|
+
*/
|
|
1464
|
+
export declare function setHttpPassword(origin: string, user: string, password: string): void
|
|
1465
|
+
|
|
1418
1466
|
/** Tile source metadata describing output characteristics */
|
|
1419
1467
|
export interface SourceMetadata {
|
|
1420
1468
|
/** Tile format (e.g., "png", "jpg", "mvt") */
|
package/index.js
CHANGED
|
@@ -97,8 +97,8 @@ function requireNative() {
|
|
|
97
97
|
try {
|
|
98
98
|
const binding = require('@versatiles/versatiles-rs-android-arm64')
|
|
99
99
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm64/package.json').version
|
|
100
|
-
if (bindingPackageVersion !== '5.
|
|
101
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
100
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
101
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
102
102
|
}
|
|
103
103
|
return binding
|
|
104
104
|
} catch (e) {
|
|
@@ -113,8 +113,8 @@ function requireNative() {
|
|
|
113
113
|
try {
|
|
114
114
|
const binding = require('@versatiles/versatiles-rs-android-arm-eabi')
|
|
115
115
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-android-arm-eabi/package.json').version
|
|
116
|
-
if (bindingPackageVersion !== '5.
|
|
117
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
116
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
117
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
118
118
|
}
|
|
119
119
|
return binding
|
|
120
120
|
} catch (e) {
|
|
@@ -134,8 +134,8 @@ function requireNative() {
|
|
|
134
134
|
try {
|
|
135
135
|
const binding = require('@versatiles/versatiles-rs-win32-x64-gnu')
|
|
136
136
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-gnu/package.json').version
|
|
137
|
-
if (bindingPackageVersion !== '5.
|
|
138
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
137
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
138
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
139
139
|
}
|
|
140
140
|
return binding
|
|
141
141
|
} catch (e) {
|
|
@@ -150,8 +150,8 @@ function requireNative() {
|
|
|
150
150
|
try {
|
|
151
151
|
const binding = require('@versatiles/versatiles-rs-win32-x64-msvc')
|
|
152
152
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-x64-msvc/package.json').version
|
|
153
|
-
if (bindingPackageVersion !== '5.
|
|
154
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
153
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
154
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
155
155
|
}
|
|
156
156
|
return binding
|
|
157
157
|
} catch (e) {
|
|
@@ -167,8 +167,8 @@ function requireNative() {
|
|
|
167
167
|
try {
|
|
168
168
|
const binding = require('@versatiles/versatiles-rs-win32-ia32-msvc')
|
|
169
169
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-ia32-msvc/package.json').version
|
|
170
|
-
if (bindingPackageVersion !== '5.
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
170
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
172
|
}
|
|
173
173
|
return binding
|
|
174
174
|
} catch (e) {
|
|
@@ -183,8 +183,8 @@ function requireNative() {
|
|
|
183
183
|
try {
|
|
184
184
|
const binding = require('@versatiles/versatiles-rs-win32-arm64-msvc')
|
|
185
185
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-win32-arm64-msvc/package.json').version
|
|
186
|
-
if (bindingPackageVersion !== '5.
|
|
187
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
186
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
187
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
188
188
|
}
|
|
189
189
|
return binding
|
|
190
190
|
} catch (e) {
|
|
@@ -202,8 +202,8 @@ function requireNative() {
|
|
|
202
202
|
try {
|
|
203
203
|
const binding = require('@versatiles/versatiles-rs-darwin-universal')
|
|
204
204
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-universal/package.json').version
|
|
205
|
-
if (bindingPackageVersion !== '5.
|
|
206
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
205
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
206
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
207
207
|
}
|
|
208
208
|
return binding
|
|
209
209
|
} catch (e) {
|
|
@@ -218,8 +218,8 @@ function requireNative() {
|
|
|
218
218
|
try {
|
|
219
219
|
const binding = require('@versatiles/versatiles-rs-darwin-x64')
|
|
220
220
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-x64/package.json').version
|
|
221
|
-
if (bindingPackageVersion !== '5.
|
|
222
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
221
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
222
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
223
223
|
}
|
|
224
224
|
return binding
|
|
225
225
|
} catch (e) {
|
|
@@ -234,8 +234,8 @@ function requireNative() {
|
|
|
234
234
|
try {
|
|
235
235
|
const binding = require('@versatiles/versatiles-rs-darwin-arm64')
|
|
236
236
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-darwin-arm64/package.json').version
|
|
237
|
-
if (bindingPackageVersion !== '5.
|
|
238
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
237
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
238
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
239
239
|
}
|
|
240
240
|
return binding
|
|
241
241
|
} catch (e) {
|
|
@@ -254,8 +254,8 @@ function requireNative() {
|
|
|
254
254
|
try {
|
|
255
255
|
const binding = require('@versatiles/versatiles-rs-freebsd-x64')
|
|
256
256
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-x64/package.json').version
|
|
257
|
-
if (bindingPackageVersion !== '5.
|
|
258
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
257
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
258
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
259
259
|
}
|
|
260
260
|
return binding
|
|
261
261
|
} catch (e) {
|
|
@@ -270,8 +270,8 @@ function requireNative() {
|
|
|
270
270
|
try {
|
|
271
271
|
const binding = require('@versatiles/versatiles-rs-freebsd-arm64')
|
|
272
272
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-arm64/package.json').version
|
|
273
|
-
if (bindingPackageVersion !== '5.
|
|
274
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
273
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
274
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
275
275
|
}
|
|
276
276
|
return binding
|
|
277
277
|
} catch (e) {
|
|
@@ -286,8 +286,8 @@ function requireNative() {
|
|
|
286
286
|
try {
|
|
287
287
|
const binding = require('@versatiles/versatiles-rs-freebsd-ppc64')
|
|
288
288
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-freebsd-ppc64/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '5.
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
289
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
291
|
}
|
|
292
292
|
return binding
|
|
293
293
|
} catch (e) {
|
|
@@ -307,8 +307,8 @@ function requireNative() {
|
|
|
307
307
|
try {
|
|
308
308
|
const binding = require('@versatiles/versatiles-rs-linux-x64-musl')
|
|
309
309
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-musl/package.json').version
|
|
310
|
-
if (bindingPackageVersion !== '5.
|
|
311
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
310
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
311
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
312
312
|
}
|
|
313
313
|
return binding
|
|
314
314
|
} catch (e) {
|
|
@@ -323,8 +323,8 @@ function requireNative() {
|
|
|
323
323
|
try {
|
|
324
324
|
const binding = require('@versatiles/versatiles-rs-linux-x64-gnu')
|
|
325
325
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-x64-gnu/package.json').version
|
|
326
|
-
if (bindingPackageVersion !== '5.
|
|
327
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
326
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
327
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
328
328
|
}
|
|
329
329
|
return binding
|
|
330
330
|
} catch (e) {
|
|
@@ -341,8 +341,8 @@ function requireNative() {
|
|
|
341
341
|
try {
|
|
342
342
|
const binding = require('@versatiles/versatiles-rs-linux-arm64-musl')
|
|
343
343
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-musl/package.json').version
|
|
344
|
-
if (bindingPackageVersion !== '5.
|
|
345
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
344
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
345
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
346
346
|
}
|
|
347
347
|
return binding
|
|
348
348
|
} catch (e) {
|
|
@@ -357,8 +357,8 @@ function requireNative() {
|
|
|
357
357
|
try {
|
|
358
358
|
const binding = require('@versatiles/versatiles-rs-linux-arm64-gnu')
|
|
359
359
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm64-gnu/package.json').version
|
|
360
|
-
if (bindingPackageVersion !== '5.
|
|
361
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
360
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
361
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
362
362
|
}
|
|
363
363
|
return binding
|
|
364
364
|
} catch (e) {
|
|
@@ -375,8 +375,8 @@ function requireNative() {
|
|
|
375
375
|
try {
|
|
376
376
|
const binding = require('@versatiles/versatiles-rs-linux-arm-musleabihf')
|
|
377
377
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-musleabihf/package.json').version
|
|
378
|
-
if (bindingPackageVersion !== '5.
|
|
379
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
378
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
379
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
380
380
|
}
|
|
381
381
|
return binding
|
|
382
382
|
} catch (e) {
|
|
@@ -391,8 +391,8 @@ function requireNative() {
|
|
|
391
391
|
try {
|
|
392
392
|
const binding = require('@versatiles/versatiles-rs-linux-arm-gnueabihf')
|
|
393
393
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-arm-gnueabihf/package.json').version
|
|
394
|
-
if (bindingPackageVersion !== '5.
|
|
395
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
394
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
395
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
396
396
|
}
|
|
397
397
|
return binding
|
|
398
398
|
} catch (e) {
|
|
@@ -409,8 +409,8 @@ function requireNative() {
|
|
|
409
409
|
try {
|
|
410
410
|
const binding = require('@versatiles/versatiles-rs-linux-loong64-musl')
|
|
411
411
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-musl/package.json').version
|
|
412
|
-
if (bindingPackageVersion !== '5.
|
|
413
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
412
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
413
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
414
414
|
}
|
|
415
415
|
return binding
|
|
416
416
|
} catch (e) {
|
|
@@ -425,8 +425,8 @@ function requireNative() {
|
|
|
425
425
|
try {
|
|
426
426
|
const binding = require('@versatiles/versatiles-rs-linux-loong64-gnu')
|
|
427
427
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-loong64-gnu/package.json').version
|
|
428
|
-
if (bindingPackageVersion !== '5.
|
|
429
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
428
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
429
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
430
430
|
}
|
|
431
431
|
return binding
|
|
432
432
|
} catch (e) {
|
|
@@ -443,8 +443,8 @@ function requireNative() {
|
|
|
443
443
|
try {
|
|
444
444
|
const binding = require('@versatiles/versatiles-rs-linux-riscv64-musl')
|
|
445
445
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-musl/package.json').version
|
|
446
|
-
if (bindingPackageVersion !== '5.
|
|
447
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
446
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
447
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
448
448
|
}
|
|
449
449
|
return binding
|
|
450
450
|
} catch (e) {
|
|
@@ -459,8 +459,8 @@ function requireNative() {
|
|
|
459
459
|
try {
|
|
460
460
|
const binding = require('@versatiles/versatiles-rs-linux-riscv64-gnu')
|
|
461
461
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-riscv64-gnu/package.json').version
|
|
462
|
-
if (bindingPackageVersion !== '5.
|
|
463
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
462
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
463
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
464
464
|
}
|
|
465
465
|
return binding
|
|
466
466
|
} catch (e) {
|
|
@@ -476,8 +476,8 @@ function requireNative() {
|
|
|
476
476
|
try {
|
|
477
477
|
const binding = require('@versatiles/versatiles-rs-linux-ppc64-gnu')
|
|
478
478
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-ppc64-gnu/package.json').version
|
|
479
|
-
if (bindingPackageVersion !== '5.
|
|
480
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
479
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
480
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
481
481
|
}
|
|
482
482
|
return binding
|
|
483
483
|
} catch (e) {
|
|
@@ -492,8 +492,8 @@ function requireNative() {
|
|
|
492
492
|
try {
|
|
493
493
|
const binding = require('@versatiles/versatiles-rs-linux-s390x-gnu')
|
|
494
494
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-linux-s390x-gnu/package.json').version
|
|
495
|
-
if (bindingPackageVersion !== '5.
|
|
496
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
495
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
496
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
497
497
|
}
|
|
498
498
|
return binding
|
|
499
499
|
} catch (e) {
|
|
@@ -512,8 +512,8 @@ function requireNative() {
|
|
|
512
512
|
try {
|
|
513
513
|
const binding = require('@versatiles/versatiles-rs-openharmony-arm64')
|
|
514
514
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm64/package.json').version
|
|
515
|
-
if (bindingPackageVersion !== '5.
|
|
516
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
515
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
516
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
517
517
|
}
|
|
518
518
|
return binding
|
|
519
519
|
} catch (e) {
|
|
@@ -528,8 +528,8 @@ function requireNative() {
|
|
|
528
528
|
try {
|
|
529
529
|
const binding = require('@versatiles/versatiles-rs-openharmony-x64')
|
|
530
530
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-x64/package.json').version
|
|
531
|
-
if (bindingPackageVersion !== '5.
|
|
532
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
531
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
532
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
533
533
|
}
|
|
534
534
|
return binding
|
|
535
535
|
} catch (e) {
|
|
@@ -544,8 +544,8 @@ function requireNative() {
|
|
|
544
544
|
try {
|
|
545
545
|
const binding = require('@versatiles/versatiles-rs-openharmony-arm')
|
|
546
546
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-openharmony-arm/package.json').version
|
|
547
|
-
if (bindingPackageVersion !== '5.
|
|
548
|
-
throw new Error(`Native binding package version mismatch, expected 5.
|
|
547
|
+
if (bindingPackageVersion !== '5.14.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
548
|
+
throw new Error(`Native binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
549
549
|
}
|
|
550
550
|
return binding
|
|
551
551
|
} catch (e) {
|
|
@@ -686,8 +686,8 @@ if (!nativeBinding || forceWasi) {
|
|
|
686
686
|
if (!candidateFailed) {
|
|
687
687
|
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
688
688
|
const bindingPackageVersion = require('@versatiles/versatiles-rs-wasm32-wasi/package.json').version
|
|
689
|
-
if (bindingPackageVersion !== '5.
|
|
690
|
-
throw new Error(`WASI binding package version mismatch, expected 5.
|
|
689
|
+
if (bindingPackageVersion !== '5.14.0') {
|
|
690
|
+
throw new Error(`WASI binding package version mismatch, expected 5.14.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
wasiBinding = require('@versatiles/versatiles-rs-wasm32-wasi')
|
|
@@ -773,18 +773,21 @@ if (
|
|
|
773
773
|
}
|
|
774
774
|
}
|
|
775
775
|
|
|
776
|
-
const { SourceType, TileCoord, TileServer, TileSource, checkVpl, convert, formatVplCst, generateVplTypescript, layerStats, parseVpl, parseVplCst, stringifyVpl, stringifyVplCst } = nativeBinding
|
|
776
|
+
const { SourceType, TileCoord, TileServer, TileSource, checkVpl, convert, enableHttpNetrc, forgetHttpPassword, formatVplCst, generateVplTypescript, layerStats, parseVpl, parseVplCst, setHttpPassword, stringifyVpl, stringifyVplCst } = nativeBinding
|
|
777
777
|
export { SourceType }
|
|
778
778
|
export { TileCoord }
|
|
779
779
|
export { TileServer }
|
|
780
780
|
export { TileSource }
|
|
781
781
|
export { checkVpl }
|
|
782
782
|
export { convert }
|
|
783
|
+
export { enableHttpNetrc }
|
|
784
|
+
export { forgetHttpPassword }
|
|
783
785
|
export { formatVplCst }
|
|
784
786
|
export { generateVplTypescript }
|
|
785
787
|
export { layerStats }
|
|
786
788
|
export { parseVpl }
|
|
787
789
|
export { parseVplCst }
|
|
790
|
+
export { setHttpPassword }
|
|
788
791
|
export { stringifyVpl }
|
|
789
792
|
export { stringifyVplCst }
|
|
790
793
|
export const __napiBindingTarget = __napiLoadedBindingTarget
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versatiles/versatiles-rs",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.0",
|
|
4
4
|
"description": "Node.js bindings for VersaTiles - convert, serve, and process map tiles",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -97,29 +97,29 @@
|
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@eslint/js": "^10.0.1",
|
|
100
|
-
"@napi-rs/cli": "^3.
|
|
100
|
+
"@napi-rs/cli": "^3.11.1",
|
|
101
101
|
"@types/node": "^26.6.6",
|
|
102
|
-
"@vitest/ui": "^5.1.
|
|
102
|
+
"@vitest/ui": "^5.1.1",
|
|
103
103
|
"chalk": "^6.0.1",
|
|
104
|
-
"eslint": "^10.
|
|
104
|
+
"eslint": "^10.15.0",
|
|
105
105
|
"eslint-config-prettier": "^10.1.8",
|
|
106
106
|
"npm-check-updates": "^23.1.1",
|
|
107
107
|
"prettier": "^3.10.1",
|
|
108
108
|
"tsx": "^4.23.15",
|
|
109
109
|
"typedoc": "^0.28.20",
|
|
110
110
|
"typescript": "^6.0.3",
|
|
111
|
-
"typescript-eslint": "^8.
|
|
112
|
-
"vitest": "^5.1.
|
|
111
|
+
"typescript-eslint": "^8.74.0",
|
|
112
|
+
"vitest": "^5.1.1"
|
|
113
113
|
},
|
|
114
114
|
"optionalDependencies": {
|
|
115
|
-
"@versatiles/versatiles-rs-darwin-arm64": "5.
|
|
116
|
-
"@versatiles/versatiles-rs-darwin-x64": "5.
|
|
117
|
-
"@versatiles/versatiles-rs-linux-arm64-gnu": "5.
|
|
118
|
-
"@versatiles/versatiles-rs-linux-arm64-musl": "5.
|
|
119
|
-
"@versatiles/versatiles-rs-linux-x64-gnu": "5.
|
|
120
|
-
"@versatiles/versatiles-rs-linux-x64-musl": "5.
|
|
121
|
-
"@versatiles/versatiles-rs-win32-arm64-msvc": "5.
|
|
122
|
-
"@versatiles/versatiles-rs-win32-x64-msvc": "5.
|
|
115
|
+
"@versatiles/versatiles-rs-darwin-arm64": "5.14.0",
|
|
116
|
+
"@versatiles/versatiles-rs-darwin-x64": "5.14.0",
|
|
117
|
+
"@versatiles/versatiles-rs-linux-arm64-gnu": "5.14.0",
|
|
118
|
+
"@versatiles/versatiles-rs-linux-arm64-musl": "5.14.0",
|
|
119
|
+
"@versatiles/versatiles-rs-linux-x64-gnu": "5.14.0",
|
|
120
|
+
"@versatiles/versatiles-rs-linux-x64-musl": "5.14.0",
|
|
121
|
+
"@versatiles/versatiles-rs-win32-arm64-msvc": "5.14.0",
|
|
122
|
+
"@versatiles/versatiles-rs-win32-x64-msvc": "5.14.0"
|
|
123
123
|
},
|
|
124
124
|
"allowScripts": {
|
|
125
125
|
"esbuild": true,
|