@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.
Files changed (38) hide show
  1. package/dist/dist.dev.js +665 -472
  2. package/dist/dist.min.js +3 -3
  3. package/dist/index.cjs +9 -6
  4. package/dist/index.cjs.map +2 -2
  5. package/dist/mlt/index.cjs +9 -11
  6. package/dist/mlt/index.cjs.map +1 -1
  7. package/dist/mlt/mlt-loader.js +1 -1
  8. package/dist/mlt/mlt-writer.js +1 -1
  9. package/dist/mvt/arrow-table-tile-source-loader-types.js +1 -1
  10. package/dist/mvt/arrow-table-tile-source-loader.cjs +8 -10
  11. package/dist/mvt/arrow-table-tile-source-loader.cjs.map +1 -1
  12. package/dist/mvt/dist.dev.js +15 -20
  13. package/dist/mvt/dist.min.js +19 -19
  14. package/dist/mvt/index.cjs +14 -24
  15. package/dist/mvt/index.cjs.map +3 -3
  16. package/dist/mvt/lib/mvt-worker-transport.d.ts.map +1 -1
  17. package/dist/mvt/lib/mvt-worker-transport.js +1 -1
  18. package/dist/mvt/lib/mvt-worker-transport.js.map +1 -1
  19. package/dist/mvt/map-style-loader.js +1 -1
  20. package/dist/mvt/mvt-geojson-loader-types.js +1 -1
  21. package/dist/mvt/mvt-geojson-loader.cjs +1 -1
  22. package/dist/mvt/mvt-loader.js +1 -1
  23. package/dist/mvt/mvt-writer.js +1 -1
  24. package/dist/mvt/tilejson-loader.js +1 -1
  25. package/dist/mvt-worker-node.js +69 -27
  26. package/dist/mvt-worker-node.js.map +4 -4
  27. package/dist/mvt-worker.js +68 -27
  28. package/dist/pmtiles/dist.dev.js +18 -23
  29. package/dist/pmtiles/dist.min.js +15 -15
  30. package/dist/pmtiles/geoarrow.cjs +7 -9
  31. package/dist/pmtiles/geoarrow.cjs.map +1 -1
  32. package/dist/pmtiles/index.cjs +13 -23
  33. package/dist/pmtiles/index.cjs.map +3 -3
  34. package/dist/pmtiles/lib/version.js +1 -1
  35. package/dist/pmtiles/pmtiles-writer.js +1 -1
  36. package/dist/pmtiles/raster.cjs.map +1 -1
  37. package/package.json +9 -9
  38. 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
- if ((_a = requestOptions.signal) == null ? void 0 : _a.aborted) throw createAbortError();
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
- if ((_e = requestOptions.signal) == null ? void 0 : _e.aborted) throw createAbortError();
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
- if ((_g = requestOptions.signal) == null ? void 0 : _g.aborted) throw createAbortError();
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: typeof fetchOption === "object" && fetchOption ? fetchOption : void 0,
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
- if (signal == null ? void 0 : signal.aborted) throw createAbortError();
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
- if (signal == null ? void 0 : signal.aborted) throw createAbortError();
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"() {