@walkthru-earth/objex-utils 1.2.0 → 1.2.1
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/index.cjs +52 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +48 -6
- package/dist/index.js.map +1 -1
- package/docs/cog.md +14 -225
- package/docs/storage.md +2 -0
- package/package.json +9 -4
package/dist/index.d.cts
CHANGED
|
@@ -285,6 +285,12 @@ declare const PROVIDER_IDS: ProviderId[];
|
|
|
285
285
|
declare function getProvider(id: string): ProviderDef;
|
|
286
286
|
/** Build endpoint URL from template + region. */
|
|
287
287
|
declare function buildEndpointFromTemplate(id: ProviderId, region: string): string;
|
|
288
|
+
/**
|
|
289
|
+
* Resolve an endpoint URL for a provider using its registered template,
|
|
290
|
+
* falling back to the provider's default region when none is supplied.
|
|
291
|
+
* Returns '' when the provider has no template (e.g. plain S3 or MinIO).
|
|
292
|
+
*/
|
|
293
|
+
declare function resolveProviderEndpoint(provider: string, region?: string): string;
|
|
288
294
|
/**
|
|
289
295
|
* Build the base URL for API requests (endpoint + bucket).
|
|
290
296
|
* Used by browser-cloud adapter and url-state.
|
|
@@ -292,6 +298,33 @@ declare function buildEndpointFromTemplate(id: ProviderId, region: string): stri
|
|
|
292
298
|
declare function buildProviderBaseUrl(provider: ProviderId, endpoint: string, bucket: string, region: string): string;
|
|
293
299
|
/** Check if a provider uses the GCS JSON API (not S3 XML). */
|
|
294
300
|
declare function isGcsProvider(provider: string, endpoint: string): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Minimal connection shape needed to decide access mode.
|
|
303
|
+
* Kept loose so callers don't need to import the full Connection type.
|
|
304
|
+
*/
|
|
305
|
+
interface AccessModeInput {
|
|
306
|
+
provider: string;
|
|
307
|
+
anonymous?: boolean;
|
|
308
|
+
endpoint?: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* How a connection's files can be read by the browser:
|
|
312
|
+
*
|
|
313
|
+
* - `public-https`: plain HTTPS via any HTTP client. No auth, no signing.
|
|
314
|
+
* Covers anonymous AWS/GCS/R2/Storj/Wasabi/etc.
|
|
315
|
+
* - `sas-https`: HTTPS with SAS token embedded in the URL. Still works with
|
|
316
|
+
* any HTTP client. Azure only.
|
|
317
|
+
* - `signed-s3`: requires SigV4 signing. DuckDB uses the `s3://` URI and
|
|
318
|
+
* signs it via its S3 config; other viewers must go through the storage
|
|
319
|
+
* adapter (which returns a blob) instead of streaming the HTTPS URL.
|
|
320
|
+
*/
|
|
321
|
+
type AccessMode = 'public-https' | 'sas-https' | 'signed-s3';
|
|
322
|
+
declare function getAccessMode(conn: AccessModeInput): AccessMode;
|
|
323
|
+
/**
|
|
324
|
+
* True when the connection's files can be fetched by any HTTP client
|
|
325
|
+
* (fetch/img/video/DuckDB httpfs/COG/Zarr/etc.) without the storage adapter.
|
|
326
|
+
*/
|
|
327
|
+
declare function isPubliclyStreamable(conn: AccessModeInput): boolean;
|
|
295
328
|
|
|
296
329
|
/**
|
|
297
330
|
* Minimal adapter for direct HTTPS URLs (source: 'url').
|
|
@@ -394,6 +427,14 @@ declare function serializeToCsv(columns: string[], rows: Record<string, unknown>
|
|
|
394
427
|
* Pure function — no browser APIs, works in Node.js.
|
|
395
428
|
*/
|
|
396
429
|
declare function serializeToJson(columns: string[], rows: Record<string, unknown>[]): string;
|
|
430
|
+
/**
|
|
431
|
+
* Export data as CSV file (triggers browser download).
|
|
432
|
+
*/
|
|
433
|
+
declare function exportToCsv(columns: string[], rows: Record<string, unknown>[], filename: string): void;
|
|
434
|
+
/**
|
|
435
|
+
* Export data as JSON file (triggers browser download).
|
|
436
|
+
*/
|
|
437
|
+
declare function exportToJson(columns: string[], rows: Record<string, unknown>[], filename: string): void;
|
|
397
438
|
|
|
398
439
|
/**
|
|
399
440
|
* Pure file entry sorting — framework-agnostic, works in Node.js.
|
|
@@ -701,4 +742,4 @@ declare function findGeoColumnFromRows(rows: Record<string, unknown>[], schema:
|
|
|
701
742
|
type: string;
|
|
702
743
|
}[]): string | null;
|
|
703
744
|
|
|
704
|
-
export { COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
745
|
+
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
package/dist/index.d.ts
CHANGED
|
@@ -285,6 +285,12 @@ declare const PROVIDER_IDS: ProviderId[];
|
|
|
285
285
|
declare function getProvider(id: string): ProviderDef;
|
|
286
286
|
/** Build endpoint URL from template + region. */
|
|
287
287
|
declare function buildEndpointFromTemplate(id: ProviderId, region: string): string;
|
|
288
|
+
/**
|
|
289
|
+
* Resolve an endpoint URL for a provider using its registered template,
|
|
290
|
+
* falling back to the provider's default region when none is supplied.
|
|
291
|
+
* Returns '' when the provider has no template (e.g. plain S3 or MinIO).
|
|
292
|
+
*/
|
|
293
|
+
declare function resolveProviderEndpoint(provider: string, region?: string): string;
|
|
288
294
|
/**
|
|
289
295
|
* Build the base URL for API requests (endpoint + bucket).
|
|
290
296
|
* Used by browser-cloud adapter and url-state.
|
|
@@ -292,6 +298,33 @@ declare function buildEndpointFromTemplate(id: ProviderId, region: string): stri
|
|
|
292
298
|
declare function buildProviderBaseUrl(provider: ProviderId, endpoint: string, bucket: string, region: string): string;
|
|
293
299
|
/** Check if a provider uses the GCS JSON API (not S3 XML). */
|
|
294
300
|
declare function isGcsProvider(provider: string, endpoint: string): boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Minimal connection shape needed to decide access mode.
|
|
303
|
+
* Kept loose so callers don't need to import the full Connection type.
|
|
304
|
+
*/
|
|
305
|
+
interface AccessModeInput {
|
|
306
|
+
provider: string;
|
|
307
|
+
anonymous?: boolean;
|
|
308
|
+
endpoint?: string;
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* How a connection's files can be read by the browser:
|
|
312
|
+
*
|
|
313
|
+
* - `public-https`: plain HTTPS via any HTTP client. No auth, no signing.
|
|
314
|
+
* Covers anonymous AWS/GCS/R2/Storj/Wasabi/etc.
|
|
315
|
+
* - `sas-https`: HTTPS with SAS token embedded in the URL. Still works with
|
|
316
|
+
* any HTTP client. Azure only.
|
|
317
|
+
* - `signed-s3`: requires SigV4 signing. DuckDB uses the `s3://` URI and
|
|
318
|
+
* signs it via its S3 config; other viewers must go through the storage
|
|
319
|
+
* adapter (which returns a blob) instead of streaming the HTTPS URL.
|
|
320
|
+
*/
|
|
321
|
+
type AccessMode = 'public-https' | 'sas-https' | 'signed-s3';
|
|
322
|
+
declare function getAccessMode(conn: AccessModeInput): AccessMode;
|
|
323
|
+
/**
|
|
324
|
+
* True when the connection's files can be fetched by any HTTP client
|
|
325
|
+
* (fetch/img/video/DuckDB httpfs/COG/Zarr/etc.) without the storage adapter.
|
|
326
|
+
*/
|
|
327
|
+
declare function isPubliclyStreamable(conn: AccessModeInput): boolean;
|
|
295
328
|
|
|
296
329
|
/**
|
|
297
330
|
* Minimal adapter for direct HTTPS URLs (source: 'url').
|
|
@@ -394,6 +427,14 @@ declare function serializeToCsv(columns: string[], rows: Record<string, unknown>
|
|
|
394
427
|
* Pure function — no browser APIs, works in Node.js.
|
|
395
428
|
*/
|
|
396
429
|
declare function serializeToJson(columns: string[], rows: Record<string, unknown>[]): string;
|
|
430
|
+
/**
|
|
431
|
+
* Export data as CSV file (triggers browser download).
|
|
432
|
+
*/
|
|
433
|
+
declare function exportToCsv(columns: string[], rows: Record<string, unknown>[], filename: string): void;
|
|
434
|
+
/**
|
|
435
|
+
* Export data as JSON file (triggers browser download).
|
|
436
|
+
*/
|
|
437
|
+
declare function exportToJson(columns: string[], rows: Record<string, unknown>[], filename: string): void;
|
|
397
438
|
|
|
398
439
|
/**
|
|
399
440
|
* Pure file entry sorting — framework-agnostic, works in Node.js.
|
|
@@ -701,4 +742,4 @@ declare function findGeoColumnFromRows(rows: Record<string, unknown>[], schema:
|
|
|
701
742
|
type: string;
|
|
702
743
|
}[]): string | null;
|
|
703
744
|
|
|
704
|
-
export { COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
745
|
+
export { type AccessMode, type AccessModeInput, COPY_FEEDBACK_MS, type CogInfo, type Connection, type ConnectionConfig, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, type Defaults, type DuckDbReadFn, type FileCategory, type FileEntry, type FileTypeInfo, type GeoArrowGeomType, type GeoArrowResult, type GeoBounds, type GeoColumnMeta, type GeoParquetMeta, type GeoType, type HexRow, LAYER_HUE_MULTIPLIER, type ListPage, MAX_QUERY_HISTORY_ENTRIES, type MapQueryHandle, type MapQueryResult, PROVIDERS, PROVIDER_IDS, type ParquetFileMetadata, type ParsedGeometry, type ParsedMarkdownDocument, type ParsedStorageUrl, type ProviderDef, type ProviderId, type ProviderRegion, QueryCancelledError, type QueryEngine, type QueryHandle, type QueryResult, type QuerySource, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, type SchemaField, type SortConfig, type SortDirection, type SortField, type SqlBlock, type StorageAdapter, type StorageProvider, type Tab, type Theme, type TypeCategory, UrlAdapter, VIEWER_DIR_EXTENSIONS, type ViewerKind, WGS84_CODES, type WriteResult, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
package/dist/index.js
CHANGED
|
@@ -1355,6 +1355,11 @@ function buildEndpointFromTemplate(id, region) {
|
|
|
1355
1355
|
if (!def?.endpointTemplate) return "";
|
|
1356
1356
|
return def.endpointTemplate.replace("{region}", region);
|
|
1357
1357
|
}
|
|
1358
|
+
function resolveProviderEndpoint(provider, region) {
|
|
1359
|
+
const def = PROVIDERS[provider];
|
|
1360
|
+
if (!def?.endpointTemplate) return "";
|
|
1361
|
+
return buildEndpointFromTemplate(provider, region || def.defaultRegion);
|
|
1362
|
+
}
|
|
1358
1363
|
function buildProviderBaseUrl(provider, endpoint, bucket, region) {
|
|
1359
1364
|
if (endpoint) {
|
|
1360
1365
|
return `${endpoint.replace(/\/$/, "")}/${bucket}`;
|
|
@@ -1369,6 +1374,15 @@ function buildProviderBaseUrl(provider, endpoint, bucket, region) {
|
|
|
1369
1374
|
function isGcsProvider(provider, endpoint) {
|
|
1370
1375
|
return provider === "gcs" || !!endpoint && /storage\.googleapis\.com/i.test(endpoint);
|
|
1371
1376
|
}
|
|
1377
|
+
function getAccessMode(conn) {
|
|
1378
|
+
if (conn.provider === "azure") return "sas-https";
|
|
1379
|
+
if (conn.anonymous) return "public-https";
|
|
1380
|
+
return "signed-s3";
|
|
1381
|
+
}
|
|
1382
|
+
function isPubliclyStreamable(conn) {
|
|
1383
|
+
const mode = getAccessMode(conn);
|
|
1384
|
+
return mode === "public-https" || mode === "sas-https";
|
|
1385
|
+
}
|
|
1372
1386
|
|
|
1373
1387
|
// ../../src/lib/storage/url-adapter.ts
|
|
1374
1388
|
var UrlAdapter = class {
|
|
@@ -1638,6 +1652,17 @@ function formatValue(value) {
|
|
|
1638
1652
|
}
|
|
1639
1653
|
|
|
1640
1654
|
// ../../src/lib/utils/export.ts
|
|
1655
|
+
function triggerDownload(content, filename, mimeType) {
|
|
1656
|
+
const blob = new Blob([content], { type: mimeType });
|
|
1657
|
+
const url = URL.createObjectURL(blob);
|
|
1658
|
+
const a = document.createElement("a");
|
|
1659
|
+
a.href = url;
|
|
1660
|
+
a.download = filename;
|
|
1661
|
+
document.body.appendChild(a);
|
|
1662
|
+
a.click();
|
|
1663
|
+
document.body.removeChild(a);
|
|
1664
|
+
URL.revokeObjectURL(url);
|
|
1665
|
+
}
|
|
1641
1666
|
function formatCellValue(value) {
|
|
1642
1667
|
if (value === null || value === void 0) return "";
|
|
1643
1668
|
if (value instanceof Date) return value.toISOString();
|
|
@@ -1672,6 +1697,20 @@ function serializeToJson(columns, rows) {
|
|
|
1672
1697
|
});
|
|
1673
1698
|
return JSON.stringify(data, jsonReplacerBigInt, 2);
|
|
1674
1699
|
}
|
|
1700
|
+
function exportToCsv(columns, rows, filename) {
|
|
1701
|
+
triggerDownload(
|
|
1702
|
+
serializeToCsv(columns, rows),
|
|
1703
|
+
filename.endsWith(".csv") ? filename : `${filename}.csv`,
|
|
1704
|
+
"text/csv;charset=utf-8;"
|
|
1705
|
+
);
|
|
1706
|
+
}
|
|
1707
|
+
function exportToJson(columns, rows, filename) {
|
|
1708
|
+
triggerDownload(
|
|
1709
|
+
serializeToJson(columns, rows),
|
|
1710
|
+
filename.endsWith(".json") ? filename : `${filename}.json`,
|
|
1711
|
+
"application/json"
|
|
1712
|
+
);
|
|
1713
|
+
}
|
|
1675
1714
|
|
|
1676
1715
|
// ../../src/lib/utils/file-sort.ts
|
|
1677
1716
|
function sortFileEntries(entries, config) {
|
|
@@ -2998,7 +3037,10 @@ var GEO_TYPE_KEYWORDS = [
|
|
|
2998
3037
|
"geometrycollection",
|
|
2999
3038
|
"sdo_geometry"
|
|
3000
3039
|
];
|
|
3001
|
-
var GEO_NAME_HINTS = ["geom", "geometry", "
|
|
3040
|
+
var GEO_NAME_HINTS = ["geom", "geometry", "wkb", "wkt", "shape", "spatial", "geo"];
|
|
3041
|
+
function tokenizeColumnName(name) {
|
|
3042
|
+
return name.replace(/([a-z])([A-Z])/g, "$1_$2").replace(/([a-z])([0-9])/g, "$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
3043
|
+
}
|
|
3002
3044
|
var GEOJSON_TYPES = [
|
|
3003
3045
|
"Point",
|
|
3004
3046
|
"LineString",
|
|
@@ -3028,14 +3070,14 @@ function findGeoColumn(schema) {
|
|
|
3028
3070
|
if (GEO_NAMES.includes(f.name.toLowerCase())) return f.name;
|
|
3029
3071
|
}
|
|
3030
3072
|
for (const f of schema) {
|
|
3031
|
-
const
|
|
3073
|
+
const tokens = tokenizeColumnName(f.name);
|
|
3032
3074
|
const t = f.type.toLowerCase();
|
|
3033
3075
|
const isBinary = t.includes("blob") || t.includes("binary") || t.includes("bytea");
|
|
3034
|
-
if (isBinary &&
|
|
3076
|
+
if (isBinary && tokens.some((tok) => GEO_NAME_HINTS.includes(tok))) return f.name;
|
|
3035
3077
|
}
|
|
3036
3078
|
for (const f of schema) {
|
|
3037
|
-
const
|
|
3038
|
-
if (
|
|
3079
|
+
const tokens = tokenizeColumnName(f.name);
|
|
3080
|
+
if (tokens.some((tok) => GEO_NAME_HINTS.includes(tok))) return f.name;
|
|
3039
3081
|
}
|
|
3040
3082
|
return null;
|
|
3041
3083
|
}
|
|
@@ -3092,6 +3134,6 @@ function isWKT(value) {
|
|
|
3092
3134
|
return WKT_TYPES.some((t) => s.startsWith(t) || s.startsWith(`MULTI${t}`));
|
|
3093
3135
|
}
|
|
3094
3136
|
|
|
3095
|
-
export { COPY_FEEDBACK_MS, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, LAYER_HUE_MULTIPLIER, MAX_QUERY_HISTORY_ENTRIES, PROVIDERS, PROVIDER_IDS, QueryCancelledError, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, UrlAdapter, VIEWER_DIR_EXTENSIONS, WGS84_CODES, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
3137
|
+
export { COPY_FEEDBACK_MS, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, LAYER_HUE_MULTIPLIER, MAX_QUERY_HISTORY_ENTRIES, PROVIDERS, PROVIDER_IDS, QueryCancelledError, SF_LABELS, SQL_PREVIEW_LENGTH, STORAGE_KEYS, UrlAdapter, VIEWER_DIR_EXTENSIONS, WGS84_CODES, buildDataTypeLabel, buildDuckDbSource, buildEndpointFromTemplate, buildGeoArrowTables, buildProviderBaseUrl, clampBounds, classifyType, describeParseResult, escapeCsvField, exportToCsv, exportToJson, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getAccessMode, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getNativeScheme, getProvider, getViewerKind, handleLoadError, interpolateTemplates, isCloudNativeFormat, isGcsProvider, isPubliclyStreamable, isQueryable, jsonReplacerBigInt, loadFromStorage, looksLikeUrl, markSqlBlocks, normalizeGeomType, parseMarkdownDocument, parseStorageUrl, parseWKB, persistToStorage, readParquetMetadata, resolveCloudUrl, resolveProviderEndpoint, safeClamp, safeDecodeURIComponent, serializeToCsv, serializeToJson, sortFileEntries, toBinary, toggleSortField, typeBadgeClass, typeColor, typeLabel };
|
|
3096
3138
|
//# sourceMappingURL=index.js.map
|
|
3097
3139
|
//# sourceMappingURL=index.js.map
|