@walkthru-earth/objex-utils 0.1.0 → 1.0.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/dist/index.cjs +376 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -4
- package/dist/index.d.ts +52 -4
- package/dist/index.js +365 -25
- package/dist/index.js.map +1 -1
- package/package.json +10 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
import { Field, Float64, FixedSizeList, Schema, Struct, makeData, RecordBatch, Table, List, Utf8 } from 'apache-arrow';
|
|
2
2
|
|
|
3
|
+
// ../../src/lib/constants.ts
|
|
4
|
+
var STORAGE_KEYS = {
|
|
5
|
+
SETTINGS: "obstore-explore-settings",
|
|
6
|
+
CONNECTIONS: "obstore-explore-connections",
|
|
7
|
+
QUERY_HISTORY: "obstore-explore-query-history"
|
|
8
|
+
};
|
|
9
|
+
var WGS84_CODES = /* @__PURE__ */ new Set([4326, 4979]);
|
|
10
|
+
var DEFAULT_TARGET_CRS = "EPSG:4326";
|
|
11
|
+
var DUCKDB_INIT_TIMEOUT_MS = 3e4;
|
|
12
|
+
var MAX_QUERY_HISTORY_ENTRIES = 200;
|
|
13
|
+
var SQL_PREVIEW_LENGTH = 120;
|
|
14
|
+
var VIEWER_DIR_EXTENSIONS = /* @__PURE__ */ new Set(["zarr", "zr3"]);
|
|
15
|
+
var LAYER_HUE_MULTIPLIER = 137;
|
|
16
|
+
var COPY_FEEDBACK_MS = 2e3;
|
|
17
|
+
|
|
3
18
|
// ../../src/lib/file-icons/index.ts
|
|
4
19
|
var DEFAULT_INFO = {
|
|
5
20
|
icon: "File",
|
|
@@ -998,6 +1013,11 @@ var EXTENSIONS = {
|
|
|
998
1013
|
}
|
|
999
1014
|
};
|
|
1000
1015
|
function getFileTypeInfo(extension, isDir = false) {
|
|
1016
|
+
if (isDir && extension) {
|
|
1017
|
+
const ext2 = extension.startsWith(".") ? extension.toLowerCase() : `.${extension.toLowerCase()}`;
|
|
1018
|
+
const found = EXTENSIONS[ext2];
|
|
1019
|
+
if (found) return found;
|
|
1020
|
+
}
|
|
1001
1021
|
if (isDir) return FOLDER_INFO;
|
|
1002
1022
|
const ext = extension.startsWith(".") ? extension.toLowerCase() : `.${extension.toLowerCase()}`;
|
|
1003
1023
|
return EXTENSIONS[ext] ?? DEFAULT_INFO;
|
|
@@ -1198,6 +1218,12 @@ function typeLabel(category) {
|
|
|
1198
1218
|
return TYPE_LABELS[category];
|
|
1199
1219
|
}
|
|
1200
1220
|
|
|
1221
|
+
// ../../src/lib/utils/error.ts
|
|
1222
|
+
function handleLoadError(err) {
|
|
1223
|
+
if (err instanceof DOMException && err.name === "AbortError") return null;
|
|
1224
|
+
return err instanceof Error ? err.message : String(err);
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1201
1227
|
// ../../src/lib/utils/format.ts
|
|
1202
1228
|
function formatFileSize(bytes) {
|
|
1203
1229
|
if (bytes < 0) return "0 B";
|
|
@@ -1233,6 +1259,16 @@ function getFileExtension(filename) {
|
|
|
1233
1259
|
if (lastDot <= 0) return "";
|
|
1234
1260
|
return filename.slice(lastDot).toLowerCase();
|
|
1235
1261
|
}
|
|
1262
|
+
function jsonReplacerBigInt(_key, value) {
|
|
1263
|
+
return typeof value === "bigint" ? value.toString() : value;
|
|
1264
|
+
}
|
|
1265
|
+
function formatValue(value) {
|
|
1266
|
+
if (value === null || value === void 0) return "NULL";
|
|
1267
|
+
if (value instanceof Date) return value.toISOString();
|
|
1268
|
+
if (typeof value === "bigint") return value.toString();
|
|
1269
|
+
if (typeof value === "object") return JSON.stringify(value, jsonReplacerBigInt);
|
|
1270
|
+
return String(value);
|
|
1271
|
+
}
|
|
1236
1272
|
function normalizeGeomType(raw) {
|
|
1237
1273
|
const s = raw.toUpperCase().replace(/\s+/g, "");
|
|
1238
1274
|
if (s === "POINT") return "point";
|
|
@@ -1835,7 +1871,6 @@ function generateHexDump(data, bytesPerRow = 16) {
|
|
|
1835
1871
|
}
|
|
1836
1872
|
|
|
1837
1873
|
// ../../src/lib/utils/parquet-metadata.ts
|
|
1838
|
-
var WGS84_CODES = /* @__PURE__ */ new Set([4326, 4979]);
|
|
1839
1874
|
function mapParquetType(col) {
|
|
1840
1875
|
const lt = col.logical_type;
|
|
1841
1876
|
if (lt) {
|
|
@@ -1975,25 +2010,280 @@ function extractBounds(geo) {
|
|
|
1975
2010
|
return [primaryCol.bbox[0], primaryCol.bbox[1], primaryCol.bbox[2], primaryCol.bbox[3]];
|
|
1976
2011
|
}
|
|
1977
2012
|
|
|
1978
|
-
// ../../src/lib/
|
|
1979
|
-
var
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
2013
|
+
// ../../src/lib/storage/providers.ts
|
|
2014
|
+
var PROVIDERS = {
|
|
2015
|
+
s3: {
|
|
2016
|
+
label: "AWS S3",
|
|
2017
|
+
description: "Amazon S3 or any S3-compatible service",
|
|
2018
|
+
authMethod: "sigv4",
|
|
2019
|
+
needsRegion: true,
|
|
2020
|
+
needsEndpoint: false,
|
|
2021
|
+
defaultRegion: "us-east-1",
|
|
2022
|
+
endpointTemplate: null,
|
|
2023
|
+
regions: [
|
|
2024
|
+
{ code: "us-east-1", label: "US East (N. Virginia)" },
|
|
2025
|
+
{ code: "us-east-2", label: "US East (Ohio)" },
|
|
2026
|
+
{ code: "us-west-1", label: "US West (N. California)" },
|
|
2027
|
+
{ code: "us-west-2", label: "US West (Oregon)" },
|
|
2028
|
+
{ code: "eu-west-1", label: "EU (Ireland)" },
|
|
2029
|
+
{ code: "eu-west-2", label: "EU (London)" },
|
|
2030
|
+
{ code: "eu-west-3", label: "EU (Paris)" },
|
|
2031
|
+
{ code: "eu-central-1", label: "EU (Frankfurt)" },
|
|
2032
|
+
{ code: "eu-central-2", label: "EU (Zurich)" },
|
|
2033
|
+
{ code: "eu-north-1", label: "EU (Stockholm)" },
|
|
2034
|
+
{ code: "eu-south-1", label: "EU (Milan)" },
|
|
2035
|
+
{ code: "eu-south-2", label: "EU (Spain)" },
|
|
2036
|
+
{ code: "ap-northeast-1", label: "Asia Pacific (Tokyo)" },
|
|
2037
|
+
{ code: "ap-northeast-2", label: "Asia Pacific (Seoul)" },
|
|
2038
|
+
{ code: "ap-northeast-3", label: "Asia Pacific (Osaka)" },
|
|
2039
|
+
{ code: "ap-southeast-1", label: "Asia Pacific (Singapore)" },
|
|
2040
|
+
{ code: "ap-southeast-2", label: "Asia Pacific (Sydney)" },
|
|
2041
|
+
{ code: "ap-southeast-3", label: "Asia Pacific (Jakarta)" },
|
|
2042
|
+
{ code: "ap-south-1", label: "Asia Pacific (Mumbai)" },
|
|
2043
|
+
{ code: "ap-south-2", label: "Asia Pacific (Hyderabad)" },
|
|
2044
|
+
{ code: "ap-east-1", label: "Asia Pacific (Hong Kong)" },
|
|
2045
|
+
{ code: "sa-east-1", label: "South America (S\xE3o Paulo)" },
|
|
2046
|
+
{ code: "ca-central-1", label: "Canada (Central)" },
|
|
2047
|
+
{ code: "ca-west-1", label: "Canada (Calgary)" },
|
|
2048
|
+
{ code: "me-south-1", label: "Middle East (Bahrain)" },
|
|
2049
|
+
{ code: "me-central-1", label: "Middle East (UAE)" },
|
|
2050
|
+
{ code: "af-south-1", label: "Africa (Cape Town)" },
|
|
2051
|
+
{ code: "il-central-1", label: "Israel (Tel Aviv)" }
|
|
2052
|
+
],
|
|
2053
|
+
endpointPlaceholder: "Leave empty for AWS, or enter custom S3 endpoint",
|
|
2054
|
+
schemes: ["s3", "s3a", "s3n", "aws"]
|
|
2055
|
+
},
|
|
2056
|
+
gcs: {
|
|
2057
|
+
label: "Google Cloud",
|
|
2058
|
+
description: "Google Cloud Storage",
|
|
2059
|
+
authMethod: "sigv4",
|
|
2060
|
+
needsRegion: false,
|
|
2061
|
+
needsEndpoint: false,
|
|
2062
|
+
defaultRegion: "auto",
|
|
2063
|
+
endpointTemplate: "https://storage.googleapis.com",
|
|
2064
|
+
regions: [],
|
|
2065
|
+
endpointPlaceholder: "https://storage.googleapis.com",
|
|
2066
|
+
schemes: ["gs", "gcs"]
|
|
2067
|
+
},
|
|
2068
|
+
r2: {
|
|
2069
|
+
label: "Cloudflare R2",
|
|
2070
|
+
description: "Cloudflare R2 Storage",
|
|
2071
|
+
authMethod: "sigv4",
|
|
2072
|
+
needsRegion: false,
|
|
2073
|
+
needsEndpoint: true,
|
|
2074
|
+
defaultRegion: "auto",
|
|
2075
|
+
endpointTemplate: null,
|
|
2076
|
+
regions: [],
|
|
2077
|
+
endpointPlaceholder: "https://<account-id>.r2.cloudflarestorage.com",
|
|
2078
|
+
schemes: ["r2"]
|
|
2079
|
+
},
|
|
2080
|
+
azure: {
|
|
2081
|
+
label: "Azure",
|
|
2082
|
+
description: "Azure Blob Storage",
|
|
2083
|
+
authMethod: "sas-token",
|
|
2084
|
+
needsRegion: false,
|
|
2085
|
+
needsEndpoint: true,
|
|
2086
|
+
defaultRegion: "",
|
|
2087
|
+
endpointTemplate: null,
|
|
2088
|
+
regions: [],
|
|
2089
|
+
bucketLabel: "Container",
|
|
2090
|
+
endpointPlaceholder: "https://<account>.blob.core.windows.net",
|
|
2091
|
+
schemes: ["azure", "az", "abfs", "abfss", "wasbs", "adl"]
|
|
2092
|
+
},
|
|
2093
|
+
minio: {
|
|
2094
|
+
label: "MinIO",
|
|
2095
|
+
description: "Self-hosted MinIO or S3-compatible",
|
|
2096
|
+
authMethod: "sigv4",
|
|
2097
|
+
needsRegion: false,
|
|
2098
|
+
needsEndpoint: true,
|
|
2099
|
+
defaultRegion: "us-east-1",
|
|
2100
|
+
endpointTemplate: null,
|
|
2101
|
+
regions: [],
|
|
2102
|
+
endpointPlaceholder: "https://minio.example.com or http://localhost:9000",
|
|
2103
|
+
schemes: []
|
|
2104
|
+
},
|
|
2105
|
+
storj: {
|
|
2106
|
+
label: "Storj",
|
|
2107
|
+
description: "Storj Decentralized Cloud",
|
|
2108
|
+
authMethod: "sigv4",
|
|
2109
|
+
needsRegion: false,
|
|
2110
|
+
needsEndpoint: false,
|
|
2111
|
+
defaultRegion: "us1",
|
|
2112
|
+
endpointTemplate: "https://gateway.storjshare.io",
|
|
2113
|
+
regions: [
|
|
2114
|
+
{ code: "us1", label: "US1" },
|
|
2115
|
+
{ code: "eu1", label: "EU1" },
|
|
2116
|
+
{ code: "ap1", label: "AP1" }
|
|
2117
|
+
],
|
|
2118
|
+
endpointPlaceholder: "https://gateway.storjshare.io",
|
|
2119
|
+
schemes: ["storj", "sj"]
|
|
2120
|
+
},
|
|
2121
|
+
b2: {
|
|
2122
|
+
label: "Backblaze B2",
|
|
2123
|
+
description: "Backblaze B2 Cloud Storage",
|
|
2124
|
+
authMethod: "sigv4",
|
|
2125
|
+
needsRegion: true,
|
|
2126
|
+
needsEndpoint: false,
|
|
2127
|
+
defaultRegion: "us-west-004",
|
|
2128
|
+
endpointTemplate: "https://s3.{region}.backblazeb2.com",
|
|
2129
|
+
regions: [
|
|
2130
|
+
{ code: "us-west-000", label: "US West (Sacramento)" },
|
|
2131
|
+
{ code: "us-west-001", label: "US West (Stockton)" },
|
|
2132
|
+
{ code: "us-west-002", label: "US West (Phoenix)" },
|
|
2133
|
+
{ code: "us-west-004", label: "US West" },
|
|
2134
|
+
{ code: "us-east-005", label: "US East (Reston)" },
|
|
2135
|
+
{ code: "eu-central-003", label: "EU Central (Amsterdam)" },
|
|
2136
|
+
{ code: "ca-central-001", label: "Canada (Toronto)" }
|
|
2137
|
+
],
|
|
2138
|
+
endpointPlaceholder: "https://s3.us-west-004.backblazeb2.com",
|
|
2139
|
+
schemes: []
|
|
2140
|
+
},
|
|
2141
|
+
digitalocean: {
|
|
2142
|
+
label: "DigitalOcean",
|
|
2143
|
+
description: "DigitalOcean Spaces",
|
|
2144
|
+
authMethod: "sigv4",
|
|
2145
|
+
needsRegion: true,
|
|
2146
|
+
needsEndpoint: false,
|
|
2147
|
+
defaultRegion: "nyc3",
|
|
2148
|
+
endpointTemplate: "https://{region}.digitaloceanspaces.com",
|
|
2149
|
+
regions: [
|
|
2150
|
+
{ code: "nyc3", label: "New York 3" },
|
|
2151
|
+
{ code: "sfo3", label: "San Francisco 3" },
|
|
2152
|
+
{ code: "ams3", label: "Amsterdam 3" },
|
|
2153
|
+
{ code: "sgp1", label: "Singapore 1" },
|
|
2154
|
+
{ code: "lon1", label: "London 1" },
|
|
2155
|
+
{ code: "fra1", label: "Frankfurt 1" },
|
|
2156
|
+
{ code: "tor1", label: "Toronto 1" },
|
|
2157
|
+
{ code: "blr1", label: "Bangalore 1" },
|
|
2158
|
+
{ code: "syd1", label: "Sydney 1" }
|
|
2159
|
+
],
|
|
2160
|
+
endpointPlaceholder: "https://nyc3.digitaloceanspaces.com",
|
|
2161
|
+
schemes: []
|
|
2162
|
+
},
|
|
2163
|
+
wasabi: {
|
|
2164
|
+
label: "Wasabi",
|
|
2165
|
+
description: "Wasabi Hot Cloud Storage",
|
|
2166
|
+
authMethod: "sigv4",
|
|
2167
|
+
needsRegion: true,
|
|
2168
|
+
needsEndpoint: false,
|
|
2169
|
+
defaultRegion: "us-east-1",
|
|
2170
|
+
endpointTemplate: "https://s3.{region}.wasabisys.com",
|
|
2171
|
+
regions: [
|
|
2172
|
+
{ code: "us-east-1", label: "US East 1 (Virginia)" },
|
|
2173
|
+
{ code: "us-east-2", label: "US East 2 (Virginia)" },
|
|
2174
|
+
{ code: "us-central-1", label: "US Central 1 (Texas)" },
|
|
2175
|
+
{ code: "us-west-1", label: "US West 1 (Oregon)" },
|
|
2176
|
+
{ code: "eu-central-1", label: "EU Central 1 (Amsterdam)" },
|
|
2177
|
+
{ code: "eu-central-2", label: "EU Central 2 (Frankfurt)" },
|
|
2178
|
+
{ code: "eu-west-1", label: "EU West 1 (London)" },
|
|
2179
|
+
{ code: "eu-west-2", label: "EU West 2 (Paris)" },
|
|
2180
|
+
{ code: "ap-northeast-1", label: "AP Northeast 1 (Tokyo)" },
|
|
2181
|
+
{ code: "ap-northeast-2", label: "AP Northeast 2 (Osaka)" },
|
|
2182
|
+
{ code: "ap-southeast-1", label: "AP Southeast 1 (Singapore)" },
|
|
2183
|
+
{ code: "ap-southeast-2", label: "AP Southeast 2 (Sydney)" },
|
|
2184
|
+
{ code: "ca-central-1", label: "Canada (Toronto)" }
|
|
2185
|
+
],
|
|
2186
|
+
endpointPlaceholder: "https://s3.us-east-1.wasabisys.com",
|
|
2187
|
+
schemes: []
|
|
2188
|
+
},
|
|
2189
|
+
contabo: {
|
|
2190
|
+
label: "Contabo",
|
|
2191
|
+
description: "Contabo Object Storage",
|
|
2192
|
+
authMethod: "sigv4",
|
|
2193
|
+
needsRegion: true,
|
|
2194
|
+
needsEndpoint: false,
|
|
2195
|
+
defaultRegion: "eu2",
|
|
2196
|
+
endpointTemplate: "https://{region}.contabostorage.com",
|
|
2197
|
+
regions: [
|
|
2198
|
+
{ code: "eu2", label: "European Union" },
|
|
2199
|
+
{ code: "usc1", label: "US Central" },
|
|
2200
|
+
{ code: "sin1", label: "Singapore" }
|
|
2201
|
+
],
|
|
2202
|
+
endpointPlaceholder: "https://eu2.contabostorage.com",
|
|
2203
|
+
schemes: []
|
|
2204
|
+
},
|
|
2205
|
+
hetzner: {
|
|
2206
|
+
label: "Hetzner",
|
|
2207
|
+
description: "Hetzner Object Storage",
|
|
2208
|
+
authMethod: "sigv4",
|
|
2209
|
+
needsRegion: true,
|
|
2210
|
+
needsEndpoint: false,
|
|
2211
|
+
defaultRegion: "fsn1",
|
|
2212
|
+
endpointTemplate: "https://{region}.your-objectstorage.com",
|
|
2213
|
+
regions: [
|
|
2214
|
+
{ code: "fsn1", label: "Falkenstein, DE" },
|
|
2215
|
+
{ code: "nbg1", label: "Nuremberg, DE" },
|
|
2216
|
+
{ code: "hel1", label: "Helsinki, FI" }
|
|
2217
|
+
],
|
|
2218
|
+
endpointPlaceholder: "https://fsn1.your-objectstorage.com",
|
|
2219
|
+
schemes: []
|
|
2220
|
+
},
|
|
2221
|
+
linode: {
|
|
2222
|
+
label: "Linode / Akamai",
|
|
2223
|
+
description: "Akamai / Linode Object Storage",
|
|
2224
|
+
authMethod: "sigv4",
|
|
2225
|
+
needsRegion: true,
|
|
2226
|
+
needsEndpoint: false,
|
|
2227
|
+
defaultRegion: "us-east-1",
|
|
2228
|
+
endpointTemplate: "https://{region}.linodeobjects.com",
|
|
2229
|
+
regions: [
|
|
2230
|
+
{ code: "us-east-1", label: "Newark, NJ" },
|
|
2231
|
+
{ code: "us-southeast-1", label: "Atlanta, GA" },
|
|
2232
|
+
{ code: "us-ord-1", label: "Chicago, IL" },
|
|
2233
|
+
{ code: "us-iad-1", label: "Washington, DC" },
|
|
2234
|
+
{ code: "us-lax-1", label: "Los Angeles, CA" },
|
|
2235
|
+
{ code: "us-sea-1", label: "Seattle, WA" },
|
|
2236
|
+
{ code: "us-mia-1", label: "Miami, FL" },
|
|
2237
|
+
{ code: "eu-central-1", label: "Frankfurt, DE" },
|
|
2238
|
+
{ code: "nl-ams-1", label: "Amsterdam, NL" },
|
|
2239
|
+
{ code: "gb-lon-1", label: "London, UK" },
|
|
2240
|
+
{ code: "fr-par-1", label: "Paris, FR" },
|
|
2241
|
+
{ code: "ap-south-1", label: "Singapore" },
|
|
2242
|
+
{ code: "jp-osa-1", label: "Osaka, JP" },
|
|
2243
|
+
{ code: "au-mel-1", label: "Melbourne, AU" },
|
|
2244
|
+
{ code: "br-gru-1", label: "S\xE3o Paulo, BR" },
|
|
2245
|
+
{ code: "in-maa-1", label: "Chennai, IN" },
|
|
2246
|
+
{ code: "id-cgk-1", label: "Jakarta, ID" },
|
|
2247
|
+
{ code: "it-mil-1", label: "Milan, IT" },
|
|
2248
|
+
{ code: "se-sto-1", label: "Stockholm, SE" }
|
|
2249
|
+
],
|
|
2250
|
+
endpointPlaceholder: "https://us-east-1.linodeobjects.com",
|
|
2251
|
+
schemes: []
|
|
2252
|
+
},
|
|
2253
|
+
ovhcloud: {
|
|
2254
|
+
label: "OVHcloud",
|
|
2255
|
+
description: "OVHcloud Object Storage",
|
|
2256
|
+
authMethod: "sigv4",
|
|
2257
|
+
needsRegion: true,
|
|
2258
|
+
needsEndpoint: false,
|
|
2259
|
+
defaultRegion: "gra",
|
|
2260
|
+
endpointTemplate: "https://s3.{region}.io.cloud.ovh.net",
|
|
2261
|
+
regions: [
|
|
2262
|
+
{ code: "gra", label: "Gravelines, FR" },
|
|
2263
|
+
{ code: "sbg", label: "Strasbourg, FR" },
|
|
2264
|
+
{ code: "bhs", label: "Beauharnois, CA" },
|
|
2265
|
+
{ code: "de", label: "Frankfurt, DE" },
|
|
2266
|
+
{ code: "uk", label: "London, UK" },
|
|
2267
|
+
{ code: "waw", label: "Warsaw, PL" }
|
|
2268
|
+
],
|
|
2269
|
+
endpointPlaceholder: "https://s3.gra.io.cloud.ovh.net",
|
|
2270
|
+
schemes: []
|
|
2271
|
+
}
|
|
1996
2272
|
};
|
|
2273
|
+
|
|
2274
|
+
// ../../src/lib/utils/storage-url.ts
|
|
2275
|
+
function buildSchemeMap() {
|
|
2276
|
+
const map = {};
|
|
2277
|
+
for (const [id, def] of Object.entries(PROVIDERS)) {
|
|
2278
|
+
for (const scheme of def.schemes) {
|
|
2279
|
+
const key = `${scheme}://`;
|
|
2280
|
+
map[key] = { provider: id, strip: key.length };
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
map["swift://"] = { provider: "unknown", strip: 8 };
|
|
2284
|
+
return map;
|
|
2285
|
+
}
|
|
2286
|
+
var SCHEME_MAP = buildSchemeMap();
|
|
1997
2287
|
function defaultResult(defaults) {
|
|
1998
2288
|
return {
|
|
1999
2289
|
bucket: "",
|
|
@@ -2098,7 +2388,7 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2098
2388
|
bucket: doVhost[1],
|
|
2099
2389
|
region: doVhost[2],
|
|
2100
2390
|
endpoint: `${url.protocol}//${doVhost[2]}.digitaloceanspaces.com`,
|
|
2101
|
-
provider: "
|
|
2391
|
+
provider: "digitalocean",
|
|
2102
2392
|
prefix: pathParts.join("/")
|
|
2103
2393
|
};
|
|
2104
2394
|
}
|
|
@@ -2108,7 +2398,7 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2108
2398
|
bucket: pathParts[0],
|
|
2109
2399
|
region: doPath[1],
|
|
2110
2400
|
endpoint: `${url.protocol}//${url.host}`,
|
|
2111
|
-
provider: "
|
|
2401
|
+
provider: "digitalocean",
|
|
2112
2402
|
prefix: pathParts.slice(1).join("/")
|
|
2113
2403
|
};
|
|
2114
2404
|
}
|
|
@@ -2118,7 +2408,7 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2118
2408
|
bucket: pathParts[0],
|
|
2119
2409
|
region: wasabiMatch[1],
|
|
2120
2410
|
endpoint: `${url.protocol}//${url.host}`,
|
|
2121
|
-
provider: "
|
|
2411
|
+
provider: "wasabi",
|
|
2122
2412
|
prefix: pathParts.slice(1).join("/")
|
|
2123
2413
|
};
|
|
2124
2414
|
}
|
|
@@ -2128,7 +2418,7 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2128
2418
|
bucket: b2S3[1],
|
|
2129
2419
|
region: b2S3[2],
|
|
2130
2420
|
endpoint: `${url.protocol}//s3.${b2S3[2]}.backblazeb2.com`,
|
|
2131
|
-
provider: "
|
|
2421
|
+
provider: "b2",
|
|
2132
2422
|
prefix: pathParts.join("/")
|
|
2133
2423
|
};
|
|
2134
2424
|
}
|
|
@@ -2138,7 +2428,7 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2138
2428
|
bucket: pathParts[1],
|
|
2139
2429
|
region: defaults.region || "us-west-000",
|
|
2140
2430
|
endpoint: `${url.protocol}//${url.host}`,
|
|
2141
|
-
provider: "
|
|
2431
|
+
provider: "b2",
|
|
2142
2432
|
prefix: pathParts.slice(2).join("/")
|
|
2143
2433
|
};
|
|
2144
2434
|
}
|
|
@@ -2171,6 +2461,56 @@ function parseStorageUrl(input, defaults = {}) {
|
|
|
2171
2461
|
prefix: pathParts.slice(1).join("/")
|
|
2172
2462
|
};
|
|
2173
2463
|
}
|
|
2464
|
+
const contaboMatch = host.match(/^([a-z0-9]+)\.contabostorage\.com$/);
|
|
2465
|
+
if (contaboMatch && pathParts.length > 0) {
|
|
2466
|
+
return {
|
|
2467
|
+
bucket: pathParts[0],
|
|
2468
|
+
region: contaboMatch[1],
|
|
2469
|
+
endpoint: `${url.protocol}//${url.host}`,
|
|
2470
|
+
provider: "contabo",
|
|
2471
|
+
prefix: pathParts.slice(1).join("/")
|
|
2472
|
+
};
|
|
2473
|
+
}
|
|
2474
|
+
const hetznerMatch = host.match(/^([a-z0-9]+)\.your-objectstorage\.com$/);
|
|
2475
|
+
if (hetznerMatch && pathParts.length > 0) {
|
|
2476
|
+
return {
|
|
2477
|
+
bucket: pathParts[0],
|
|
2478
|
+
region: hetznerMatch[1],
|
|
2479
|
+
endpoint: `${url.protocol}//${url.host}`,
|
|
2480
|
+
provider: "hetzner",
|
|
2481
|
+
prefix: pathParts.slice(1).join("/")
|
|
2482
|
+
};
|
|
2483
|
+
}
|
|
2484
|
+
const linodeVhost = host.match(/^(.+)\.([a-z0-9-]+)\.linodeobjects\.com$/);
|
|
2485
|
+
if (linodeVhost) {
|
|
2486
|
+
return {
|
|
2487
|
+
bucket: linodeVhost[1],
|
|
2488
|
+
region: linodeVhost[2],
|
|
2489
|
+
endpoint: `${url.protocol}//${linodeVhost[2]}.linodeobjects.com`,
|
|
2490
|
+
provider: "linode",
|
|
2491
|
+
prefix: pathParts.join("/")
|
|
2492
|
+
};
|
|
2493
|
+
}
|
|
2494
|
+
const linodePath = host.match(/^([a-z0-9-]+)\.linodeobjects\.com$/);
|
|
2495
|
+
if (linodePath && pathParts.length > 0) {
|
|
2496
|
+
return {
|
|
2497
|
+
bucket: pathParts[0],
|
|
2498
|
+
region: linodePath[1],
|
|
2499
|
+
endpoint: `${url.protocol}//${url.host}`,
|
|
2500
|
+
provider: "linode",
|
|
2501
|
+
prefix: pathParts.slice(1).join("/")
|
|
2502
|
+
};
|
|
2503
|
+
}
|
|
2504
|
+
const ovhMatch = host.match(/^s3\.([a-z0-9-]+)\.io\.cloud\.ovh\.(?:net|us)$/);
|
|
2505
|
+
if (ovhMatch && pathParts.length > 0) {
|
|
2506
|
+
return {
|
|
2507
|
+
bucket: pathParts[0],
|
|
2508
|
+
region: ovhMatch[1],
|
|
2509
|
+
endpoint: `${url.protocol}//${url.host}`,
|
|
2510
|
+
provider: "ovhcloud",
|
|
2511
|
+
prefix: pathParts.slice(1).join("/")
|
|
2512
|
+
};
|
|
2513
|
+
}
|
|
2174
2514
|
const isMinioLike = host.includes("minio") || host === "localhost" || host === "127.0.0.1" || host.startsWith("192.168.") || host.startsWith("10.");
|
|
2175
2515
|
if (isMinioLike && pathParts.length > 0) {
|
|
2176
2516
|
return {
|
|
@@ -2507,6 +2847,6 @@ function isWKT(value) {
|
|
|
2507
2847
|
return WKT_TYPES.some((t) => s.startsWith(t) || s.startsWith(`MULTI${t}`));
|
|
2508
2848
|
}
|
|
2509
2849
|
|
|
2510
|
-
export { QueryCancelledError, UrlAdapter, buildDuckDbSource, buildGeoArrowTables, classifyType, describeParseResult, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, generateHexDump, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getViewerKind, isCloudNativeFormat, isQueryable, looksLikeUrl, normalizeGeomType, parseStorageUrl, parseWKB, readParquetMetadata, toBinary, typeBadgeClass, typeColor, typeLabel };
|
|
2850
|
+
export { COPY_FEEDBACK_MS, DEFAULT_TARGET_CRS, DUCKDB_INIT_TIMEOUT_MS, LAYER_HUE_MULTIPLIER, MAX_QUERY_HISTORY_ENTRIES, QueryCancelledError, SQL_PREVIEW_LENGTH, STORAGE_KEYS, UrlAdapter, VIEWER_DIR_EXTENSIONS, WGS84_CODES, buildDuckDbSource, buildGeoArrowTables, classifyType, describeParseResult, extractBounds, extractEpsgFromGeoMeta, extractGeometryTypes, findGeoColumn, findGeoColumnFromRows, formatDate, formatFileSize, formatValue, generateHexDump, getDuckDbReadFn, getFileExtension, getFileTypeInfo, getMimeType, getViewerKind, handleLoadError, isCloudNativeFormat, isQueryable, jsonReplacerBigInt, looksLikeUrl, normalizeGeomType, parseStorageUrl, parseWKB, readParquetMetadata, toBinary, typeBadgeClass, typeColor, typeLabel };
|
|
2511
2851
|
//# sourceMappingURL=index.js.map
|
|
2512
2852
|
//# sourceMappingURL=index.js.map
|