@loaders.gl/scan 5.0.0-alpha.7 → 5.0.0-alpha.9

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.min.js CHANGED
@@ -15726,6 +15726,10 @@ return true;`);
15726
15726
  return "int32";
15727
15727
  case Uint32Array:
15728
15728
  return "uint32";
15729
+ case BigInt64Array:
15730
+ return "int64";
15731
+ case BigUint64Array:
15732
+ return "uint64";
15729
15733
  case Float32Array:
15730
15734
  return "float32";
15731
15735
  case Float64Array:
@@ -18389,6 +18393,10 @@ return true;`);
18389
18393
  const result = await this.query(options);
18390
18394
  yield makeTableScanBatch(result);
18391
18395
  }
18396
+ /** Scans the addressed query result through the same batch contract as `read()`. */
18397
+ scan(options = {}) {
18398
+ return this.read(options);
18399
+ }
18392
18400
  /** Resolves and caches the addressed table while allowing failed loads to be retried. */
18393
18401
  async getTable(signal) {
18394
18402
  throwIfAborted3(signal);
@@ -18453,7 +18461,8 @@ return true;`);
18453
18461
  Object.freeze([...options.request.boundingBox[1]])
18454
18462
  ])
18455
18463
  });
18456
- const coordinateReferenceSystems = typeof request.crs === "string" ? [request.crs] : void 0;
18464
+ const boundsCrs = request.requestCrs || request.crs;
18465
+ const coordinateReferenceSystems = typeof boundsCrs === "string" ? [boundsCrs] : void 0;
18457
18466
  super(options, {
18458
18467
  sourceType: "vector-feature-table",
18459
18468
  description: `Vector feature request for ${normalizeLayers(request.layers).join(", ")}`,
package/dist/hudi.cjs CHANGED
@@ -1047,13 +1047,17 @@ var init_src = __esm({
1047
1047
 
1048
1048
  // ../loader-utils/src/lib/worker-loader-utils/parse-with-worker.ts
1049
1049
  function canParseWithWorker(loader, options) {
1050
- var _a;
1050
+ var _a, _b, _c;
1051
+ if ((_b = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a.credentials) == null ? void 0 : _b.some(
1052
+ (credential) => credential.type === "request" || "token" in credential && typeof credential.token === "function"
1053
+ ))
1054
+ return false;
1051
1055
  const workerOptions = getWorkerOptions(options);
1052
1056
  const nodeWorkers = workerOptions._nodeWorkers;
1053
1057
  if (!isBrowser2 && !nodeWorkers) {
1054
1058
  return false;
1055
1059
  }
1056
- if (loader.id === "las" && (((_a = options == null ? void 0 : options.las) == null ? void 0 : _a.shape) ?? "arrow-table") === "arrow-table") {
1060
+ if (loader.id === "las" && (((_c = options == null ? void 0 : options.las) == null ? void 0 : _c.shape) ?? "arrow-table") === "arrow-table") {
1057
1061
  return false;
1058
1062
  }
1059
1063
  if (loader.id === "csv" && !shouldParseCSVWithWorker(options)) {
@@ -1100,7 +1104,12 @@ function callParseOnMainThread(parseOnMainThread, input, options, context) {
1100
1104
  return parseOnMainThread(input, void 0, options, context);
1101
1105
  }
1102
1106
  function getWorkerOptions(options = {}, loader) {
1103
- const serializedOptions = JSON.parse(JSON.stringify(options));
1107
+ const serializedOptions = JSON.parse(
1108
+ JSON.stringify({
1109
+ ...options,
1110
+ ...options.core ? { core: { ...options.core, authentications: void 0 } } : {}
1111
+ })
1112
+ );
1104
1113
  const workerOptions = {
1105
1114
  ...serializedOptions.core,
1106
1115
  ...serializedOptions
@@ -1189,6 +1198,48 @@ var init_async_iteration = __esm({
1189
1198
  }
1190
1199
  });
1191
1200
 
1201
+ // ../loader-utils/src/lib/request-utils/authentication.ts
1202
+ function resolveCredentials(credentials, authentications = []) {
1203
+ if (credentials.every(isAuthentication)) return credentials;
1204
+ return credentials.map((credential, index) => {
1205
+ if (isAuthentication(credential)) return credential;
1206
+ const AuthenticationClass = authentications.find(
1207
+ (authentication2) => authentication2.type === (credential == null ? void 0 : credential.type)
1208
+ );
1209
+ if (!AuthenticationClass) {
1210
+ throw new Error(`No authentication class registered for credential at index ${index}.`);
1211
+ }
1212
+ let authentication;
1213
+ try {
1214
+ authentication = new AuthenticationClass(credential);
1215
+ } catch {
1216
+ throw new Error(`Invalid authentication configuration at index ${index}.`);
1217
+ }
1218
+ if (!isAuthentication(authentication)) {
1219
+ throw new Error(`Authentication class returned an invalid credential at index ${index}.`);
1220
+ }
1221
+ return authentication;
1222
+ });
1223
+ }
1224
+ function resolveAuthenticationOptions(options) {
1225
+ var _a, _b;
1226
+ if (!((_b = (_a = options.core) == null ? void 0 : _a.credentials) == null ? void 0 : _b.length)) return options;
1227
+ const credentials = resolveCredentials(options.core.credentials, options.core.authentications);
1228
+ if (credentials === options.core.credentials) return options;
1229
+ return { ...options, core: { ...options.core, credentials } };
1230
+ }
1231
+ function isAuthentication(credential) {
1232
+ if (!credential || typeof credential !== "object") return false;
1233
+ if (typeof credential.id !== "string" || !Array.isArray(credential.origins)) return false;
1234
+ if (credential.type === "request") return typeof credential.authenticate === "function";
1235
+ return (credential.type === "header" || credential.type === "query-parameter") && typeof credential.name === "string" && (typeof credential.token === "string" || typeof credential.token === "function") && Array.isArray(credential.refreshStatusCodes);
1236
+ }
1237
+ var init_authentication = __esm({
1238
+ "../loader-utils/src/lib/request-utils/authentication.ts"() {
1239
+ "use strict";
1240
+ }
1241
+ });
1242
+
1192
1243
  // ../loader-utils/src/lib/request-utils/request-cache.ts
1193
1244
  function createAbortError3() {
1194
1245
  const error = new Error("Request aborted");
@@ -1423,21 +1474,54 @@ var init_request_cache = __esm({
1423
1474
 
1424
1475
  // ../loader-utils/src/lib/request-utils/request-credentials.ts
1425
1476
  function createAuthenticatedFetch(options) {
1426
- const baseFetch = options.fetch || ((url, requestOptions) => fetch(url, requestOptions));
1427
- if (!options.credentials.length) return baseFetch;
1428
- const existingMetadata = baseFetch[AUTHENTICATED_FETCH];
1429
- if (existingMetadata === options.credentials) return baseFetch;
1477
+ const suppliedFetch = options.fetch || ((url, requestOptions) => fetch(url, requestOptions));
1478
+ const existingMetadata = suppliedFetch[AUTHENTICATED_FETCH];
1479
+ const credentialResolutions = new Map(existingMetadata == null ? void 0 : existingMetadata.credentialResolutions);
1480
+ const resolvedCredentials = resolveCredentials(
1481
+ options.credentials.map((credential) => credentialResolutions.get(credential) || credential),
1482
+ options.authentications
1483
+ );
1484
+ options.credentials.forEach((credential, index) => {
1485
+ credentialResolutions.set(credential, resolvedCredentials[index]);
1486
+ });
1487
+ if (!options.fetchOptions && (!resolvedCredentials.length || (existingMetadata == null ? void 0 : existingMetadata.credentials.length) === resolvedCredentials.length && resolvedCredentials.every(
1488
+ (credential, index) => credential === existingMetadata.credentials[index]
1489
+ )))
1490
+ return suppliedFetch;
1491
+ const baseFetch = (existingMetadata == null ? void 0 : existingMetadata.fetch) || suppliedFetch;
1492
+ const credentials = existingMetadata ? [.../* @__PURE__ */ new Set([...resolvedCredentials, ...existingMetadata.credentials])] : resolvedCredentials;
1493
+ const fetchOptions = mergeFetchOptions(
1494
+ (existingMetadata == null ? void 0 : existingMetadata.fetchOptions) || {},
1495
+ options.fetchOptions
1496
+ );
1497
+ const tokenCredentials = credentials.filter(
1498
+ (credential) => credential.type !== "request"
1499
+ );
1500
+ const requestCredentials = credentials.filter(
1501
+ (credential) => credential.type === "request"
1502
+ );
1503
+ for (const credential of requestCredentials) normalizeRequestOrigins(credential.origins);
1430
1504
  const authenticatedFetch = async (url, requestOptions = {}) => {
1431
- var _a, _b, _c;
1505
+ var _a, _b, _c, _d;
1506
+ requestOptions = mergeFetchOptions(fetchOptions, requestOptions);
1507
+ if ((_a = requestOptions.signal) == null ? void 0 : _a.aborted) throw createAbortError4();
1508
+ if (!credentials.length) return baseFetch(url, requestOptions);
1432
1509
  const resolvedURL = parseHTTPURL(url);
1433
- if (!resolvedURL) return baseFetch(url, requestOptions);
1434
- const authorization = await authorizeRequest(resolvedURL, requestOptions, options.credentials);
1435
- const response = await baseFetch(authorization.url, authorization.options);
1510
+ const authorization = resolvedURL ? await authorizeRequest(resolvedURL, requestOptions, tokenCredentials) : { url, options: requestOptions, credentials: [] };
1511
+ const signedRequest = await authenticateRequest(authorization, requestCredentials, "request");
1512
+ const response = await baseFetch(signedRequest.url, signedRequest.options);
1436
1513
  const refreshableCredentials = authorization.credentials.filter(
1437
1514
  ({ credential }) => typeof credential.token === "function" && credential.refreshStatusCodes.includes(response.status)
1438
1515
  );
1439
- if (!refreshableCredentials.length || !isReplayableRequest(requestOptions)) return response;
1440
- if ((_a = requestOptions.signal) == null ? void 0 : _a.aborted) throw createAbortError4();
1516
+ const shouldRetrySignature = signedRequest.credentials.some(
1517
+ (credential) => {
1518
+ var _a2;
1519
+ return (_a2 = credential.refreshStatusCodes) == null ? void 0 : _a2.includes(response.status);
1520
+ }
1521
+ );
1522
+ if (!refreshableCredentials.length && !shouldRetrySignature || !isReplayableRequest(requestOptions) || !isReplayableRequest(signedRequest.options))
1523
+ return response;
1524
+ if ((_b = requestOptions.signal) == null ? void 0 : _b.aborted) throw createAbortError4();
1441
1525
  const refreshedTokens = /* @__PURE__ */ new Map();
1442
1526
  await Promise.all(
1443
1527
  refreshableCredentials.map(async ({ credential }) => {
@@ -1445,24 +1529,111 @@ function createAuthenticatedFetch(options) {
1445
1529
  if (token) refreshedTokens.set(credential, token);
1446
1530
  })
1447
1531
  );
1448
- if (!refreshedTokens.size) return response;
1449
- await ((_b = response.body) == null ? void 0 : _b.cancel().catch(() => {
1532
+ if (!refreshedTokens.size && !shouldRetrySignature) return response;
1533
+ await ((_c = response.body) == null ? void 0 : _c.cancel().catch(() => {
1450
1534
  }));
1451
- if ((_c = requestOptions.signal) == null ? void 0 : _c.aborted) throw createAbortError4();
1452
- const replayAuthorization = await authorizeRequest(
1535
+ if ((_d = requestOptions.signal) == null ? void 0 : _d.aborted) throw createAbortError4();
1536
+ const replayAuthorization = resolvedURL ? await authorizeRequest(
1453
1537
  resolvedURL,
1454
1538
  requestOptions,
1455
- options.credentials,
1539
+ tokenCredentials,
1456
1540
  refreshedTokens,
1457
1541
  authorization.credentials
1542
+ ) : { url, options: requestOptions };
1543
+ const replayRequest = await authenticateRequest(
1544
+ replayAuthorization,
1545
+ requestCredentials,
1546
+ "retry",
1547
+ response
1458
1548
  );
1459
- return baseFetch(replayAuthorization.url, replayAuthorization.options);
1549
+ return baseFetch(replayRequest.url, replayRequest.options);
1460
1550
  };
1461
1551
  Object.defineProperty(authenticatedFetch, AUTHENTICATED_FETCH, {
1462
- value: options.credentials
1552
+ value: {
1553
+ fetch: baseFetch,
1554
+ credentials,
1555
+ credentialResolutions,
1556
+ fetchOptions
1557
+ }
1463
1558
  });
1464
1559
  return authenticatedFetch;
1465
1560
  }
1561
+ function getAuthenticatedFetch(options = {}) {
1562
+ var _a, _b, _c;
1563
+ const fetchOption = options.fetch ?? ((_a = options.core) == null ? void 0 : _a.fetch);
1564
+ let fetchFunction;
1565
+ if (typeof fetchOption === "function") {
1566
+ fetchFunction = fetchOption;
1567
+ } else {
1568
+ fetchFunction = (url, requestOptions) => fetch(url, requestOptions);
1569
+ }
1570
+ return createAuthenticatedFetch({
1571
+ fetch: fetchFunction,
1572
+ fetchOptions: typeof fetchOption === "object" && fetchOption ? fetchOption : void 0,
1573
+ credentials: ((_b = options.core) == null ? void 0 : _b.credentials) || [],
1574
+ authentications: (_c = options.core) == null ? void 0 : _c.authentications
1575
+ });
1576
+ }
1577
+ function mergeFetchOptions(defaultOptions, requestOptions) {
1578
+ const mergedOptions = { ...defaultOptions, ...requestOptions };
1579
+ if (defaultOptions.headers || (requestOptions == null ? void 0 : requestOptions.headers)) {
1580
+ const headers = new Headers(defaultOptions.headers);
1581
+ new Headers(requestOptions == null ? void 0 : requestOptions.headers).forEach((value, key) => headers.set(key, value));
1582
+ mergedOptions.headers = headers;
1583
+ }
1584
+ return mergedOptions;
1585
+ }
1586
+ async function authenticateRequest(request, credentials, reason, response) {
1587
+ const appliedCredentials = [];
1588
+ const signal = request.options.signal;
1589
+ for (const credential of credentials) {
1590
+ const origin = getRequestOrigin(request.url);
1591
+ if (!origin || !normalizeRequestOrigins(credential.origins).includes(origin)) continue;
1592
+ if (signal == null ? void 0 : signal.aborted) throw createAbortError4();
1593
+ const authenticatedRequest = await credential.authenticate({
1594
+ url: request.url,
1595
+ options: { ...request.options, headers: new Headers(request.options.headers) },
1596
+ reason,
1597
+ response: response ? { status: response.status, headers: new Headers(response.headers) } : void 0
1598
+ });
1599
+ if (!authenticatedRequest || typeof authenticatedRequest.url !== "string" || !authenticatedRequest.options || typeof authenticatedRequest.options !== "object") {
1600
+ throw new Error("Authentication callback returned an invalid request.");
1601
+ }
1602
+ request = {
1603
+ url: authenticatedRequest.url,
1604
+ options: { ...authenticatedRequest.options, ...signal ? { signal } : {} }
1605
+ };
1606
+ appliedCredentials.push(credential);
1607
+ }
1608
+ if (signal == null ? void 0 : signal.aborted) throw createAbortError4();
1609
+ return { ...request, credentials: appliedCredentials };
1610
+ }
1611
+ function getRequestOrigin(url) {
1612
+ try {
1613
+ const parsedURL = new URL(url);
1614
+ if (!parsedURL.host || parsedURL.username || parsedURL.password) return null;
1615
+ return parsedURL.origin !== "null" ? parsedURL.origin : `${parsedURL.protocol}//${parsedURL.host}`;
1616
+ } catch {
1617
+ return null;
1618
+ }
1619
+ }
1620
+ function normalizeRequestOrigins(origins) {
1621
+ if (!origins.length)
1622
+ throw new Error("Request authentication requires at least one exact origin.");
1623
+ return origins.map((origin) => {
1624
+ const resolvedOrigin = getRequestOrigin(origin);
1625
+ let url;
1626
+ try {
1627
+ url = new URL(origin);
1628
+ } catch {
1629
+ throw new Error("Invalid request authentication origin.");
1630
+ }
1631
+ if (!resolvedOrigin || url.pathname && url.pathname !== "/" || url.search || url.hash) {
1632
+ throw new Error("Invalid request authentication origin.");
1633
+ }
1634
+ return resolvedOrigin;
1635
+ });
1636
+ }
1466
1637
  async function authorizeRequest(sourceURL, requestOptions, credentials, tokenOverrides = /* @__PURE__ */ new Map(), previousCredentials = []) {
1467
1638
  const url = new URL(sourceURL);
1468
1639
  const headers = new Headers(requestOptions.headers);
@@ -1531,6 +1702,7 @@ var AUTHENTICATED_FETCH, refreshPromises;
1531
1702
  var init_request_credentials = __esm({
1532
1703
  "../loader-utils/src/lib/request-utils/request-credentials.ts"() {
1533
1704
  "use strict";
1705
+ init_authentication();
1534
1706
  AUTHENTICATED_FETCH = /* @__PURE__ */ Symbol("loaders.gl.authenticated-fetch");
1535
1707
  refreshPromises = /* @__PURE__ */ new WeakMap();
1536
1708
  }
@@ -1776,6 +1948,7 @@ var init_range_request_scheduler = __esm({
1776
1948
  /** Optional event callback for range batching diagnostics. */
1777
1949
  onEvent;
1778
1950
  pendingRequests = [];
1951
+ /** Pending batch window, independent of in-flight transport requests. */
1779
1952
  flushTimer = null;
1780
1953
  /** Creates a scheduler for one group of byte-range-addressable resources. */
1781
1954
  constructor(props = {}) {
@@ -1852,7 +2025,7 @@ var init_range_request_scheduler = __esm({
1852
2025
  }
1853
2026
  /** Immediately starts loading the currently queued requests. */
1854
2027
  flush() {
1855
- if (this.flushTimer) {
2028
+ if (this.flushTimer !== null) {
1856
2029
  clearTimeout(this.flushTimer);
1857
2030
  this.flushTimer = null;
1858
2031
  }
@@ -1874,9 +2047,9 @@ var init_range_request_scheduler = __esm({
1874
2047
  this.fetchMergedRequest(mergedRequest);
1875
2048
  }
1876
2049
  }
1877
- /** Schedules the next pending-request flush. */
2050
+ /** Starts a fixed batch window only when no flush is already scheduled. */
1878
2051
  scheduleFlush() {
1879
- if (this.flushTimer) {
2052
+ if (this.flushTimer !== null) {
1880
2053
  return;
1881
2054
  }
1882
2055
  this.flushTimer = setTimeout(() => this.flush(), this.props.batchDelayMs);
@@ -2396,39 +2569,25 @@ var init_blob_file = __esm({
2396
2569
 
2397
2570
  // ../loader-utils/src/lib/sources/data-source.ts
2398
2571
  function getFetchFunction(options) {
2399
- var _a, _b;
2400
- const fetchOption = (options == null ? void 0 : options.fetch) ?? ((_a = options == null ? void 0 : options.core) == null ? void 0 : _a.fetch);
2401
- let fetchFunction;
2402
- if (typeof fetchOption === "function") {
2403
- fetchFunction = (url, fetchOptions) => fetchOption(url, fetchOptions);
2404
- } else if (fetchOption) {
2405
- fetchFunction = (url, requestOptions) => fetch(url, mergeFetchOptions(fetchOption, requestOptions));
2406
- } else {
2407
- fetchFunction = (url, requestOptions) => fetch(url, requestOptions);
2408
- }
2409
- return createAuthenticatedFetch({
2410
- fetch: fetchFunction,
2411
- credentials: ((_b = options == null ? void 0 : options.core) == null ? void 0 : _b.credentials) || []
2412
- });
2413
- }
2414
- function mergeFetchOptions(fetchOptions, requestOptions) {
2415
- const mergedOptions = { ...fetchOptions, ...requestOptions };
2416
- if (fetchOptions.headers || (requestOptions == null ? void 0 : requestOptions.headers)) {
2417
- mergedOptions.headers = mergeHeaders(fetchOptions.headers, requestOptions == null ? void 0 : requestOptions.headers);
2418
- }
2419
- return mergedOptions;
2572
+ return getAuthenticatedFetch(options);
2420
2573
  }
2421
- function mergeHeaders(defaultHeaders, requestHeaders) {
2422
- const headers = new Headers(defaultHeaders);
2423
- if (requestHeaders) {
2424
- new Headers(requestHeaders).forEach((value, key) => headers.set(key, value));
2574
+ function getSourceLoaderOptions(options) {
2575
+ var _a;
2576
+ if (options.loadOptions !== void 0 || ((_a = options.core) == null ? void 0 : _a.loadOptions) !== void 0) {
2577
+ throw new Error(
2578
+ "Source loadOptions and core.loadOptions were removed. Use core and root loader namespaces directly."
2579
+ );
2425
2580
  }
2426
- return headers;
2427
- }
2428
- function normalizeDirectLoaderOptions(options) {
2429
2581
  const loadOptions = { ...options };
2430
2582
  if (options == null ? void 0 : options.core) {
2431
2583
  loadOptions.core = { ...options.core };
2584
+ const parserCore = loadOptions.core;
2585
+ for (const key of ["type", "attributions", "loaders", "onError", "loadOptions"]) {
2586
+ delete parserCore[key];
2587
+ }
2588
+ if (Object.keys(parserCore).length === 0) {
2589
+ delete loadOptions.core;
2590
+ }
2432
2591
  }
2433
2592
  const topLevelBaseUri = typeof loadOptions.baseUri === "string" ? loadOptions.baseUri : void 0;
2434
2593
  const topLevelBaseUrl = typeof loadOptions.baseUrl === "string" ? loadOptions.baseUrl : void 0;
@@ -2466,6 +2625,7 @@ var init_data_source = __esm({
2466
2625
  init_file_aliases();
2467
2626
  init_log();
2468
2627
  init_request_credentials();
2628
+ init_authentication();
2469
2629
  UNAVAILABLE_CORE_API = {
2470
2630
  fetchFile: unavailableCoreApiMethod("fetchFile"),
2471
2631
  parse: unavailableCoreApiMethod("parse"),
@@ -2480,7 +2640,6 @@ var init_data_source = __esm({
2480
2640
  core: {
2481
2641
  type: "auto",
2482
2642
  attributions: [],
2483
- loadOptions: {},
2484
2643
  loaders: [],
2485
2644
  onError: void 0
2486
2645
  }
@@ -2489,9 +2648,9 @@ var init_data_source = __esm({
2489
2648
  options;
2490
2649
  data;
2491
2650
  url;
2492
- /** The actual load options, if calling a loaders.gl loader */
2651
+ /** Shared parser options derived from the source options, excluding source-only core controls. */
2493
2652
  loadOptions;
2494
- /** A resolved fetch function extracted from loadOptions prop */
2653
+ /** A resolved fetch function extracted from the shared core options. */
2495
2654
  fetch;
2496
2655
  /** Shared source-level runtime hooks, when supplied by the source factory. */
2497
2656
  coreApi;
@@ -2499,15 +2658,13 @@ var init_data_source = __esm({
2499
2658
  hasCoreApi;
2500
2659
  _needsRefresh = true;
2501
2660
  constructor(data, options, defaultOptions, coreApi) {
2502
- var _a;
2503
- if (defaultOptions) {
2504
- this.options = mergeOptions({ ...defaultOptions, core: _DataSource.defaultOptions }, options);
2505
- } else {
2506
- this.options = { ...options };
2507
- }
2661
+ this.options = mergeOptions(
2662
+ mergeOptions(_DataSource.defaultOptions, defaultOptions || {}),
2663
+ options
2664
+ );
2508
2665
  this.data = data;
2509
2666
  this.url = typeof data === "string" ? resolvePath(data) : "";
2510
- const loadOptions = normalizeDirectLoaderOptions((_a = this.options.core) == null ? void 0 : _a.loadOptions);
2667
+ const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(this.options));
2511
2668
  this.loadOptions = loadOptions;
2512
2669
  const fetch2 = getFetchFunction(loadOptions);
2513
2670
  this.coreApi = coreApi || UNAVAILABLE_CORE_API;
@@ -2515,7 +2672,11 @@ var init_data_source = __esm({
2515
2672
  this.fetch = fetch2;
2516
2673
  }
2517
2674
  setProps(options) {
2518
- this.options = Object.assign(this.options, options);
2675
+ const mergedOptions = mergeOptions(this.options, options);
2676
+ const loadOptions = resolveAuthenticationOptions(getSourceLoaderOptions(mergedOptions));
2677
+ this.options = mergedOptions;
2678
+ this.loadOptions = loadOptions;
2679
+ this.fetch = getFetchFunction(loadOptions);
2519
2680
  this.setNeedsRefresh();
2520
2681
  }
2521
2682
  /** Mark this data source as needing a refresh (redraw) */
@@ -3014,6 +3175,10 @@ function getDataTypeFromTypedArray(array) {
3014
3175
  return "int32";
3015
3176
  case Uint32Array:
3016
3177
  return "uint32";
3178
+ case BigInt64Array:
3179
+ return "int64";
3180
+ case BigUint64Array:
3181
+ return "uint64";
3017
3182
  case Float32Array:
3018
3183
  return "float32";
3019
3184
  case Float64Array:
@@ -17436,6 +17601,7 @@ function fillParquetValueBuffer(output, value, start, end) {
17436
17601
  return;
17437
17602
  }
17438
17603
  if (Array.isArray(output)) {
17604
+ if (output.length < end) output.length = end;
17439
17605
  output.fill(value, start, end);
17440
17606
  return;
17441
17607
  }
@@ -17881,6 +18047,18 @@ function readUnsignedVarIntNumber(cursor) {
17881
18047
  }
17882
18048
  throw new Error("invalid RLE run header");
17883
18049
  }
18050
+ function encodeUnsignedVarIntNumber(value) {
18051
+ if (!Number.isSafeInteger(value) || value < 0) {
18052
+ throw new Error("RLE run header must be a non-negative safe integer");
18053
+ }
18054
+ const bytes = [];
18055
+ while (value >= 128) {
18056
+ bytes.push(value % 128 | 128);
18057
+ value = Math.floor(value / 128);
18058
+ }
18059
+ bytes.push(value);
18060
+ return Uint8Array.from(bytes);
18061
+ }
17884
18062
  function assertReadable(cursor, byteLength) {
17885
18063
  const size = cursor.size ?? cursor.buffer.length;
17886
18064
  if (byteLength < 0 || cursor.offset + byteLength > size) {
@@ -17902,10 +18080,7 @@ function encodeRunBitpacked(values, opts) {
17902
18080
  buf[Math.floor(b / 8)] |= 1 << b % 8;
17903
18081
  }
17904
18082
  }
17905
- return concatUint8Arrays([
17906
- Uint8Array.from(import_varint.default.encode(paddedValues.length / 8 << 1 | 1)),
17907
- buf
17908
- ]);
18083
+ return concatUint8Arrays([encodeUnsignedVarIntNumber(paddedValues.length / 8 << 1 | 1), buf]);
17909
18084
  }
17910
18085
  function encodeRunRepeated(value, count, opts) {
17911
18086
  const bitWidth = opts.bitWidth;
@@ -17914,15 +18089,13 @@ function encodeRunRepeated(value, count, opts) {
17914
18089
  buf[i] = value & 255;
17915
18090
  value = Math.floor(value / 256);
17916
18091
  }
17917
- return concatUint8Arrays([Uint8Array.from(import_varint.default.encode(count << 1)), buf]);
18092
+ return concatUint8Arrays([encodeUnsignedVarIntNumber(count << 1), buf]);
17918
18093
  }
17919
- var import_varint;
17920
18094
  var init_rle = __esm({
17921
18095
  "../parquet/src/parquetjs/codecs/rle.ts"() {
17922
18096
  "use strict";
17923
18097
  init_declare();
17924
18098
  init_binary_utils();
17925
- import_varint = __toESM(require("varint"), 1);
17926
18099
  }
17927
18100
  });
17928
18101
 
@@ -22875,7 +23048,20 @@ async function filterParquetRowGroupsWithBloomFilters(initialization, rowGroupIn
22875
23048
  let filtersRead = 0;
22876
23049
  let bytesRead = 0;
22877
23050
  for (const rowGroupIndex of rowGroupIndices) {
22878
- const rowGroup = initialization.metadata.rowGroups[rowGroupIndex];
23051
+ let rowGroup = initialization.metadata.rowGroups[rowGroupIndex];
23052
+ const rawRowGroup = initialization.fileMetadata.row_groups[rowGroupIndex];
23053
+ if (rawRowGroup.columns.some((columnChunk) => columnChunk.encrypted_column_metadata)) {
23054
+ await initialization.reader.resolveColumnMetadata(
23055
+ rawRowGroup,
23056
+ rowGroupIndex,
23057
+ getParquetPredicateColumns(predicate).map((column) => [column])
23058
+ );
23059
+ throwIfAborted2(signal);
23060
+ rowGroup = {
23061
+ ...rowGroup,
23062
+ columns: rawRowGroup.columns.filter((columnChunk) => Boolean(columnChunk.meta_data)).map((columnChunk) => createColumnChunkMetadata(columnChunk, initialization.parquetSchema))
23063
+ };
23064
+ }
22879
23065
  const probes = getParquetBloomFilterProbes(predicate, rowGroup);
22880
23066
  let keepRowGroup = true;
22881
23067
  for (const probe of probes) {