@loaders.gl/tiles 5.0.0-alpha.13 → 5.0.0-alpha.14
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/dist/dist.dev.js +665 -472
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +2 -2
- package/dist/mlt/index.cjs +9 -11
- package/dist/mlt/index.cjs.map +1 -1
- package/dist/mlt/mlt-loader.js +1 -1
- package/dist/mlt/mlt-writer.js +1 -1
- package/dist/mvt/arrow-table-tile-source-loader-types.js +1 -1
- package/dist/mvt/arrow-table-tile-source-loader.cjs +8 -10
- package/dist/mvt/arrow-table-tile-source-loader.cjs.map +1 -1
- package/dist/mvt/dist.dev.js +15 -20
- package/dist/mvt/dist.min.js +19 -19
- package/dist/mvt/index.cjs +14 -24
- package/dist/mvt/index.cjs.map +3 -3
- package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -1
- package/dist/mvt/lib/mvt-worker-transport.js +1 -1
- package/dist/mvt/lib/mvt-worker-transport.js.map +1 -1
- package/dist/mvt/map-style-loader.js +1 -1
- package/dist/mvt/mvt-geojson-loader-types.js +1 -1
- package/dist/mvt/mvt-geojson-loader.cjs +1 -1
- package/dist/mvt/mvt-loader.js +1 -1
- package/dist/mvt/mvt-writer.js +1 -1
- package/dist/mvt/tilejson-loader.js +1 -1
- package/dist/mvt-worker-node.js +69 -27
- package/dist/mvt-worker-node.js.map +4 -4
- package/dist/mvt-worker.js +68 -27
- package/dist/pmtiles/dist.dev.js +18 -23
- package/dist/pmtiles/dist.min.js +15 -15
- package/dist/pmtiles/geoarrow.cjs +7 -9
- package/dist/pmtiles/geoarrow.cjs.map +1 -1
- package/dist/pmtiles/index.cjs +13 -23
- package/dist/pmtiles/index.cjs.map +3 -3
- package/dist/pmtiles/lib/version.js +1 -1
- package/dist/pmtiles/pmtiles-writer.js +1 -1
- package/dist/pmtiles/raster.cjs.map +1 -1
- package/package.json +9 -9
- package/src/mvt/lib/mvt-worker-transport.ts +5 -2
|
@@ -256,7 +256,7 @@ function createAuthenticatedFetch(options) {
|
|
|
256
256
|
const authenticatedFetch = async (url, requestOptions = {}) => {
|
|
257
257
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
258
258
|
requestOptions = mergeFetchOptions(fetchOptions, requestOptions);
|
|
259
|
-
|
|
259
|
+
(_a = requestOptions.signal) == null ? void 0 : _a.throwIfAborted();
|
|
260
260
|
if (!credentials.length) return baseFetch(url, requestOptions);
|
|
261
261
|
const resolvedURL = parseHTTPURL(url);
|
|
262
262
|
const authorization = resolvedURL ? await authorizeRequest(resolvedURL, requestOptions, tokenCredentials) : { url, options: requestOptions, credentials: [] };
|
|
@@ -275,7 +275,7 @@ function createAuthenticatedFetch(options) {
|
|
|
275
275
|
}
|
|
276
276
|
);
|
|
277
277
|
if (!refreshableCredentials.length && !shouldRetrySignature) return response;
|
|
278
|
-
|
|
278
|
+
(_e = requestOptions.signal) == null ? void 0 : _e.throwIfAborted();
|
|
279
279
|
const refreshedTokens = /* @__PURE__ */ new Map();
|
|
280
280
|
await Promise.all(
|
|
281
281
|
refreshableCredentials.map(async ({ credential }) => {
|
|
@@ -286,7 +286,7 @@ function createAuthenticatedFetch(options) {
|
|
|
286
286
|
if (!refreshedTokens.size && !shouldRetrySignature) return response;
|
|
287
287
|
await ((_f = response.body) == null ? void 0 : _f.cancel().catch(() => {
|
|
288
288
|
}));
|
|
289
|
-
|
|
289
|
+
(_g = requestOptions.signal) == null ? void 0 : _g.throwIfAborted();
|
|
290
290
|
const replayAuthorization = resolvedURL ? await authorizeRequest(
|
|
291
291
|
resolvedURL,
|
|
292
292
|
requestOptions,
|
|
@@ -321,9 +321,10 @@ function getAuthenticatedFetch(options = {}) {
|
|
|
321
321
|
} else {
|
|
322
322
|
fetchFunction = (url, requestOptions) => fetch(url, requestOptions);
|
|
323
323
|
}
|
|
324
|
+
const fetchOptions = typeof fetchOption === "object" && fetchOption ? fetchOption : void 0;
|
|
324
325
|
return createAuthenticatedFetch({
|
|
325
326
|
fetch: fetchFunction,
|
|
326
|
-
fetchOptions:
|
|
327
|
+
fetchOptions: options.signal ? { ...fetchOptions, signal: options.signal } : fetchOptions,
|
|
327
328
|
credentials: ((_b = options.core) == null ? void 0 : _b.credentials) || [],
|
|
328
329
|
authentications: (_c = options.core) == null ? void 0 : _c.authentications
|
|
329
330
|
});
|
|
@@ -343,7 +344,7 @@ async function authenticateRequest(request, credentials, reason, response) {
|
|
|
343
344
|
for (const credential of credentials) {
|
|
344
345
|
const origin = getRequestOrigin(request.url);
|
|
345
346
|
if (!origin || !normalizeRequestOrigins(credential.origins).includes(origin)) continue;
|
|
346
|
-
|
|
347
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
347
348
|
const authenticatedRequest = await credential.authenticate({
|
|
348
349
|
url: request.url,
|
|
349
350
|
options: { ...request.options, headers: new Headers(request.options.headers) },
|
|
@@ -359,7 +360,7 @@ async function authenticateRequest(request, credentials, reason, response) {
|
|
|
359
360
|
};
|
|
360
361
|
appliedCredentials.push(credential);
|
|
361
362
|
}
|
|
362
|
-
|
|
363
|
+
signal == null ? void 0 : signal.throwIfAborted();
|
|
363
364
|
return { ...request, credentials: appliedCredentials };
|
|
364
365
|
}
|
|
365
366
|
function getRequestOrigin(url) {
|
|
@@ -449,9 +450,6 @@ function isReplayableRequest(options) {
|
|
|
449
450
|
if (!["GET", "HEAD", "OPTIONS", "PUT", "DELETE"].includes(method)) return false;
|
|
450
451
|
return !(options.body && typeof ReadableStream !== "undefined" && options.body instanceof ReadableStream);
|
|
451
452
|
}
|
|
452
|
-
function createAbortError() {
|
|
453
|
-
return new DOMException("The operation was aborted.", "AbortError");
|
|
454
|
-
}
|
|
455
453
|
var AUTHENTICATED_FETCH, refreshPromises;
|
|
456
454
|
var init_request_credentials = __esm({
|
|
457
455
|
"../core/src/loader-utils/lib/request-utils/request-credentials.ts"() {
|