@walkthru-earth/objex 1.3.1 → 1.5.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/LICENSE +5 -0
- package/README.md +28 -20
- package/dist/components/browser/FileTreeSidebar.svelte +32 -17
- package/dist/components/layout/AboutSheet.svelte +5 -2
- package/dist/components/layout/ConnectionDialog.svelte +7 -2
- package/dist/components/layout/SettingsSheet.svelte +238 -0
- package/dist/components/layout/SettingsSheet.svelte.d.ts +6 -0
- package/dist/components/layout/Sidebar.svelte +73 -6
- package/dist/components/layout/Sidebar.svelte.d.ts +4 -1
- package/dist/components/layout/StatusBar.svelte +17 -14
- package/dist/components/layout/TabBar.svelte +4 -4
- package/dist/components/ui/context-menu/context-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte.d.ts +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +1 -1
- package/dist/components/ui/input/input.svelte.d.ts +1 -1
- package/dist/components/ui/resizable/index.d.ts +1 -1
- package/dist/components/ui/resizable/index.js +2 -2
- package/dist/components/ui/slider/index.d.ts +3 -0
- package/dist/components/ui/slider/index.js +5 -0
- package/dist/components/ui/slider/range-slider.svelte +94 -0
- package/dist/components/ui/slider/range-slider.svelte.d.ts +21 -0
- package/dist/components/ui/slider/slider.svelte +83 -0
- package/dist/components/ui/slider/slider.svelte.d.ts +7 -0
- package/dist/components/viewers/ArchiveViewer.svelte +140 -113
- package/dist/components/viewers/CodeViewer.svelte +45 -48
- package/dist/components/viewers/CodeViewer.svelte.d.ts +1 -1
- package/dist/components/viewers/CogControls.svelte +338 -184
- package/dist/components/viewers/CogControls.svelte.d.ts +33 -10
- package/dist/components/viewers/CogViewer.svelte +269 -116
- package/dist/components/viewers/CopcViewer.svelte +8 -15
- package/dist/components/viewers/DatabaseViewer.svelte +22 -21
- package/dist/components/viewers/FileInfo.svelte +16 -16
- package/dist/components/viewers/FlatGeobufViewer.svelte +16 -46
- package/dist/components/viewers/GeoParquetMapViewer.svelte +11 -9
- package/dist/components/viewers/GeoParquetMapViewer.svelte.d.ts +1 -1
- package/dist/components/viewers/ImageViewer.svelte +12 -14
- package/dist/components/viewers/LoadProgress.svelte +6 -6
- package/dist/components/viewers/MarkdownViewer.svelte +29 -30
- package/dist/components/viewers/MediaViewer.svelte +13 -14
- package/dist/components/viewers/ModelViewer.svelte +18 -21
- package/dist/components/viewers/MultiCogViewer.svelte +474 -106
- package/dist/components/viewers/MultiCogViewer.svelte.d.ts +1 -1
- package/dist/components/viewers/NotebookViewer.svelte +28 -29
- package/dist/components/viewers/PdfViewer.svelte +24 -33
- package/dist/components/viewers/PmtilesViewer.svelte +13 -15
- package/dist/components/viewers/QueryHistoryPanel.svelte +18 -18
- package/dist/components/viewers/RawViewer.svelte +27 -21
- package/dist/components/viewers/StacMapViewer.svelte +6 -13
- package/dist/components/viewers/StacMosaicViewer.svelte +1764 -410
- package/dist/components/viewers/StacMosaicViewer.svelte.d.ts +1 -1
- package/dist/components/viewers/StacTabViewer.svelte +26 -15
- package/dist/components/viewers/StacTabViewer.svelte.d.ts +1 -1
- package/dist/components/viewers/TableGrid.svelte +38 -34
- package/dist/components/viewers/TableStatusBar.svelte +7 -7
- package/dist/components/viewers/TableToolbar.svelte +10 -9
- package/dist/components/viewers/TableViewer.svelte +47 -30
- package/dist/components/viewers/TableViewer.svelte.d.ts +1 -0
- package/dist/components/viewers/ViewerHeader.svelte +18 -0
- package/dist/components/viewers/ViewerHeader.svelte.d.ts +10 -0
- package/dist/components/viewers/ViewerRouter.svelte +16 -8
- package/dist/components/viewers/ViewerStatus.svelte +19 -0
- package/dist/components/viewers/ViewerStatus.svelte.d.ts +7 -0
- package/dist/components/viewers/ZarrMapViewer.svelte +24 -21
- package/dist/components/viewers/ZarrViewer.svelte +98 -65
- package/dist/components/viewers/cog/ChannelPicker.svelte +83 -0
- package/dist/components/viewers/cog/ChannelPicker.svelte.d.ts +13 -0
- package/dist/components/viewers/cog/PixelInspectorPanel.svelte +87 -0
- package/dist/components/viewers/cog/PixelInspectorPanel.svelte.d.ts +17 -0
- package/dist/components/viewers/cog/buildRgbLayer.d.ts +78 -0
- package/dist/components/viewers/cog/buildRgbLayer.js +176 -0
- package/dist/components/viewers/map/AttributeTable.svelte +7 -7
- package/dist/components/viewers/map/MapContainer.svelte +38 -12
- package/dist/components/viewers/pmtiles/PmtilesArchiveView.svelte +109 -83
- package/dist/components/viewers/pmtiles/PmtilesTileInspector.svelte +16 -16
- package/dist/components/viewers/stac/StacDatetimeBar.svelte +175 -0
- package/dist/components/viewers/stac/StacDatetimeBar.svelte.d.ts +10 -0
- package/dist/components/viewers/stac/StacFilterPanel.svelte +243 -0
- package/dist/components/viewers/stac/StacFilterPanel.svelte.d.ts +14 -0
- package/dist/components/viewers/stac/StacItemInspector.svelte +223 -0
- package/dist/components/viewers/stac/StacItemInspector.svelte.d.ts +10 -0
- package/dist/components/viewers/stac/StacItemStrip.svelte +228 -0
- package/dist/components/viewers/stac/StacItemStrip.svelte.d.ts +12 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +8 -0
- package/dist/file-icons/index.d.ts +1 -1
- package/dist/file-icons/index.js +1 -1
- package/dist/i18n/ar.js +113 -2
- package/dist/i18n/en.js +113 -2
- package/dist/index.d.ts +2 -28
- package/dist/index.js +7 -23
- package/dist/query/engine.d.ts +10 -0
- package/dist/query/source.js +1 -1
- package/dist/query/stac-source-factory.d.ts +65 -0
- package/dist/query/stac-source-factory.js +77 -0
- package/dist/query/stac-source-parquet.d.ts +135 -0
- package/dist/query/stac-source-parquet.js +468 -0
- package/dist/query/wasm.d.ts +8 -0
- package/dist/query/wasm.js +310 -65
- package/dist/storage/presign.js +3 -2
- package/dist/storage/providers.js +7 -6
- package/dist/stores/config.svelte.d.ts +15 -0
- package/dist/stores/config.svelte.js +46 -0
- package/dist/stores/connections.svelte.d.ts +2 -2
- package/dist/stores/connections.svelte.js +1 -2
- package/dist/stores/files.svelte.d.ts +1 -1
- package/dist/stores/files.svelte.js +1 -1
- package/dist/stores/query-history.svelte.js +1 -1
- package/dist/stores/settings.svelte.d.ts +16 -1
- package/dist/stores/settings.svelte.js +104 -48
- package/dist/stores/tabs.svelte.d.ts +3 -0
- package/dist/stores/tabs.svelte.js +17 -0
- package/dist/utils/cog-histogram.d.ts +121 -0
- package/dist/utils/cog-histogram.js +424 -0
- package/dist/utils/cog.d.ts +177 -20
- package/dist/utils/cog.js +361 -76
- package/dist/utils/colormap-sprite.d.ts +0 -9
- package/dist/utils/colormap-sprite.js +0 -21
- package/dist/utils/deck.d.ts +18 -12
- package/dist/utils/deck.js +15 -7
- package/dist/utils/media-query.svelte.d.ts +14 -0
- package/dist/utils/media-query.svelte.js +29 -0
- package/dist/utils/pmtiles-tile.js +2 -2
- package/dist/utils/signed-url-effect.d.ts +7 -0
- package/dist/utils/signed-url-effect.js +19 -0
- package/dist/utils/{url.d.ts → signed-url.d.ts} +15 -1
- package/dist/utils/{url.js → signed-url.js} +32 -10
- package/dist/utils/url-state.d.ts +36 -0
- package/dist/utils/url-state.js +72 -2
- package/dist/utils/zarr-tab.d.ts +1 -2
- package/dist/utils/zarr-tab.js +1 -2
- package/dist/utils/zarr.d.ts +0 -17
- package/dist/utils/zarr.js +1 -45
- package/package.json +55 -84
- package/dist/components/browser/Breadcrumb.svelte +0 -50
- package/dist/components/browser/Breadcrumb.svelte.d.ts +0 -7
- package/dist/components/browser/CreateFolderDialog.svelte +0 -98
- package/dist/components/browser/CreateFolderDialog.svelte.d.ts +0 -6
- package/dist/components/browser/DeleteConfirmDialog.svelte +0 -90
- package/dist/components/browser/DeleteConfirmDialog.svelte.d.ts +0 -8
- package/dist/components/browser/DropZone.svelte +0 -83
- package/dist/components/browser/DropZone.svelte.d.ts +0 -7
- package/dist/components/browser/FileBrowser.svelte +0 -252
- package/dist/components/browser/FileBrowser.svelte.d.ts +0 -3
- package/dist/components/browser/FileRow.svelte +0 -117
- package/dist/components/browser/FileRow.svelte.d.ts +0 -9
- package/dist/components/browser/RenameDialog.svelte +0 -101
- package/dist/components/browser/RenameDialog.svelte.d.ts +0 -8
- package/dist/components/browser/SearchBar.svelte +0 -40
- package/dist/components/browser/SearchBar.svelte.d.ts +0 -6
- package/dist/components/browser/UploadButton.svelte +0 -65
- package/dist/components/browser/UploadButton.svelte.d.ts +0 -3
- package/dist/query/stac-geoparquet.d.ts +0 -31
- package/dist/query/stac-geoparquet.js +0 -136
- package/dist/utils/clipboard.d.ts +0 -13
- package/dist/utils/clipboard.js +0 -38
- package/dist/utils/cloud-url.d.ts +0 -27
- package/dist/utils/cloud-url.js +0 -61
- package/dist/utils/cog-pure.d.ts +0 -25
- package/dist/utils/cog-pure.js +0 -35
- package/dist/utils/column-types.d.ts +0 -5
- package/dist/utils/column-types.js +0 -137
- package/dist/utils/connection-identity.d.ts +0 -51
- package/dist/utils/connection-identity.js +0 -97
- package/dist/utils/error.d.ts +0 -8
- package/dist/utils/error.js +0 -12
- package/dist/utils/evidence-context.d.ts +0 -22
- package/dist/utils/evidence-context.js +0 -56
- package/dist/utils/export.d.ts +0 -22
- package/dist/utils/export.js +0 -76
- package/dist/utils/file-sort.d.ts +0 -20
- package/dist/utils/file-sort.js +0 -41
- package/dist/utils/format.d.ts +0 -24
- package/dist/utils/format.js +0 -78
- package/dist/utils/geoarrow.d.ts +0 -32
- package/dist/utils/geoarrow.js +0 -672
- package/dist/utils/geometry-type.d.ts +0 -52
- package/dist/utils/geometry-type.js +0 -76
- package/dist/utils/hex.d.ts +0 -10
- package/dist/utils/hex.js +0 -27
- package/dist/utils/host-detection.d.ts +0 -23
- package/dist/utils/host-detection.js +0 -95
- package/dist/utils/local-storage.d.ts +0 -16
- package/dist/utils/local-storage.js +0 -37
- package/dist/utils/markdown-sql.d.ts +0 -30
- package/dist/utils/markdown-sql.js +0 -72
- package/dist/utils/notebook.d.ts +0 -59
- package/dist/utils/notebook.js +0 -211
- package/dist/utils/parquet-metadata.d.ts +0 -64
- package/dist/utils/parquet-metadata.js +0 -262
- package/dist/utils/stac-geoparquet.d.ts +0 -90
- package/dist/utils/stac-geoparquet.js +0 -223
- package/dist/utils/stac-hydrate.d.ts +0 -38
- package/dist/utils/stac-hydrate.js +0 -243
- package/dist/utils/stac.d.ts +0 -136
- package/dist/utils/stac.js +0 -176
- package/dist/utils/storage-url.d.ts +0 -90
- package/dist/utils/storage-url.js +0 -568
- package/dist/utils/wkb.d.ts +0 -43
- package/dist/utils/wkb.js +0 -359
package/dist/utils/stac.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* STAC (SpatioTemporal Asset Catalog) detection and parsing.
|
|
3
|
-
*
|
|
4
|
-
* Pure TypeScript helpers shared by ViewerRouter, StacMosaicViewer, and
|
|
5
|
-
* MultiCogViewer. No Svelte dependency, publishable via objex-utils.
|
|
6
|
-
*/
|
|
7
|
-
/** Asset keys providers use for the single "display COG" asset, in priority order. */
|
|
8
|
-
export const STAC_COG_ASSET_KEYS = ['visual', 'image', 'data', 'rendered_preview'];
|
|
9
|
-
/** Shape-check a parsed JSON object as a STAC Item. */
|
|
10
|
-
export function isStacItem(json) {
|
|
11
|
-
if (!json || typeof json !== 'object')
|
|
12
|
-
return false;
|
|
13
|
-
const obj = json;
|
|
14
|
-
return obj.type === 'Feature' && typeof obj.stac_version === 'string';
|
|
15
|
-
}
|
|
16
|
-
/** Shape-check a parsed JSON object as a STAC FeatureCollection. */
|
|
17
|
-
export function isStacFeatureCollection(json) {
|
|
18
|
-
if (!json || typeof json !== 'object')
|
|
19
|
-
return false;
|
|
20
|
-
const obj = json;
|
|
21
|
-
if (obj.type !== 'FeatureCollection')
|
|
22
|
-
return false;
|
|
23
|
-
if (!Array.isArray(obj.features) || obj.features.length === 0)
|
|
24
|
-
return false;
|
|
25
|
-
if (typeof obj.stac_version === 'string')
|
|
26
|
-
return true;
|
|
27
|
-
return isStacItem(obj.features[0]);
|
|
28
|
-
}
|
|
29
|
-
/** STAC Collection detection: `type === 'Collection'` + stac_version + links array. */
|
|
30
|
-
export function isStacCollection(json) {
|
|
31
|
-
if (!json || typeof json !== 'object')
|
|
32
|
-
return false;
|
|
33
|
-
const obj = json;
|
|
34
|
-
return (obj.type === 'Collection' && typeof obj.stac_version === 'string' && Array.isArray(obj.links));
|
|
35
|
-
}
|
|
36
|
-
/** STAC Catalog detection: `type === 'Catalog'` + stac_version + links array. */
|
|
37
|
-
export function isStacCatalog(json) {
|
|
38
|
-
if (!json || typeof json !== 'object')
|
|
39
|
-
return false;
|
|
40
|
-
const obj = json;
|
|
41
|
-
return obj.type === 'Catalog' && typeof obj.stac_version === 'string' && Array.isArray(obj.links);
|
|
42
|
-
}
|
|
43
|
-
/** Classify an arbitrary parsed JSON into one of the STAC routing buckets. */
|
|
44
|
-
export function classifyStac(json) {
|
|
45
|
-
if (isStacItem(json))
|
|
46
|
-
return { kind: 'item', item: json };
|
|
47
|
-
if (isStacFeatureCollection(json))
|
|
48
|
-
return { kind: 'item-collection', fc: json };
|
|
49
|
-
if (isStacCollection(json))
|
|
50
|
-
return { kind: 'collection', payload: json };
|
|
51
|
-
if (isStacCatalog(json))
|
|
52
|
-
return { kind: 'catalog', payload: json };
|
|
53
|
-
return { kind: 'none' };
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Pick the COG-ish asset href from a STAC Item. Returns the href of the named
|
|
57
|
-
* asset when `preferred` is given and present, else scans STAC_COG_ASSET_KEYS,
|
|
58
|
-
* else falls back to any asset whose `type` contains "tiff". Returns null when
|
|
59
|
-
* nothing matches.
|
|
60
|
-
*/
|
|
61
|
-
export function pickCogAssetHref(item, preferred) {
|
|
62
|
-
const assets = item.assets ?? {};
|
|
63
|
-
if (preferred && assets[preferred]?.href)
|
|
64
|
-
return assets[preferred].href;
|
|
65
|
-
for (const key of STAC_COG_ASSET_KEYS) {
|
|
66
|
-
if (assets[key]?.href)
|
|
67
|
-
return assets[key].href;
|
|
68
|
-
}
|
|
69
|
-
for (const asset of Object.values(assets)) {
|
|
70
|
-
const t = typeof asset?.type === 'string' ? asset.type.toLowerCase() : '';
|
|
71
|
-
if (asset?.href && t.includes('tiff'))
|
|
72
|
-
return asset.href;
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
/** True when a single STAC Item exposes a COG-ish asset and a bbox. */
|
|
77
|
-
export function detectMosaicCapable(item) {
|
|
78
|
-
return stacItemBbox(item) !== null && pickCogAssetHref(item) !== null;
|
|
79
|
-
}
|
|
80
|
-
/** True when a single STAC Item exposes Sentinel-2-style RGB bands (MultiCog). */
|
|
81
|
-
export function detectMultiCogCapable(item) {
|
|
82
|
-
return hasRgbBands(extractSentinelBandAssets(item));
|
|
83
|
-
}
|
|
84
|
-
/** WGS84 bbox helper. Returns `null` if no bbox can be derived. */
|
|
85
|
-
export function stacItemBbox(item) {
|
|
86
|
-
if (Array.isArray(item.bbox) && item.bbox.length >= 4) {
|
|
87
|
-
return [Number(item.bbox[0]), Number(item.bbox[1]), Number(item.bbox[2]), Number(item.bbox[3])];
|
|
88
|
-
}
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Normalize a STAC Item or a plain `{id?, bbox, href}` record into a
|
|
93
|
-
* MosaicSourceMeta. Returns null when essentials (bbox / href) are missing.
|
|
94
|
-
*/
|
|
95
|
-
export function buildMosaicSourceMeta(input, assetKey) {
|
|
96
|
-
if (!input || typeof input !== 'object')
|
|
97
|
-
return null;
|
|
98
|
-
if (isStacItem(input)) {
|
|
99
|
-
const bbox = stacItemBbox(input);
|
|
100
|
-
if (!bbox)
|
|
101
|
-
return null;
|
|
102
|
-
const href = pickCogAssetHref(input, assetKey);
|
|
103
|
-
if (!href)
|
|
104
|
-
return null;
|
|
105
|
-
return {
|
|
106
|
-
id: String(input.id ?? href),
|
|
107
|
-
bbox,
|
|
108
|
-
href
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
const raw = input;
|
|
112
|
-
if (Array.isArray(raw.bbox) && raw.bbox.length >= 4 && typeof raw.href === 'string') {
|
|
113
|
-
return {
|
|
114
|
-
id: String(raw.id ?? raw.href),
|
|
115
|
-
bbox: [Number(raw.bbox[0]), Number(raw.bbox[1]), Number(raw.bbox[2]), Number(raw.bbox[3])],
|
|
116
|
-
href: raw.href
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
// Provider-specific asset key conventions. Each entry maps a BandSlot to the
|
|
122
|
-
// asset keys providers are known to use. First match wins, so list more
|
|
123
|
-
// specific keys before generic ones.
|
|
124
|
-
const BAND_KEY_FALLBACKS = {
|
|
125
|
-
red: ['red', 'B04', 'B4', 'visual-red'],
|
|
126
|
-
green: ['green', 'B03', 'B3', 'visual-green'],
|
|
127
|
-
blue: ['blue', 'B02', 'B2', 'visual-blue'],
|
|
128
|
-
nir: ['nir', 'nir08', 'B08', 'B8', 'B8A'],
|
|
129
|
-
swir1: ['swir16', 'swir1', 'B11'],
|
|
130
|
-
swir2: ['swir22', 'swir2', 'B12'],
|
|
131
|
-
rededge: ['rededge1', 'rededge', 'B05', 'B5']
|
|
132
|
-
};
|
|
133
|
-
/**
|
|
134
|
-
* Map Sentinel-2 STAC item assets to a BandMap. Recognizes:
|
|
135
|
-
* - `eo:bands[0].common_name` (preferred, stable across providers)
|
|
136
|
-
* - asset key heuristics for Microsoft PC / Element 84 / AWS S2 L2A buckets
|
|
137
|
-
* Returns an empty map when no bands are identifiable so callers can fall
|
|
138
|
-
* back to a different viewer.
|
|
139
|
-
*/
|
|
140
|
-
export function extractSentinelBandAssets(item) {
|
|
141
|
-
const out = {};
|
|
142
|
-
const assets = item.assets ?? {};
|
|
143
|
-
for (const [key, asset] of Object.entries(assets)) {
|
|
144
|
-
if (!asset?.href)
|
|
145
|
-
continue;
|
|
146
|
-
const bands = asset['eo:bands'];
|
|
147
|
-
if (Array.isArray(bands) && bands.length >= 1) {
|
|
148
|
-
const common = bands[0]?.common_name?.toLowerCase();
|
|
149
|
-
if (common && isBandSlot(common)) {
|
|
150
|
-
if (!out[common])
|
|
151
|
-
out[common] = asset.href;
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
for (const slot of Object.keys(BAND_KEY_FALLBACKS)) {
|
|
156
|
-
if (BAND_KEY_FALLBACKS[slot].includes(key) && !out[slot]) {
|
|
157
|
-
out[slot] = asset.href;
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
return out;
|
|
163
|
-
}
|
|
164
|
-
function isBandSlot(value) {
|
|
165
|
-
return (value === 'red' ||
|
|
166
|
-
value === 'green' ||
|
|
167
|
-
value === 'blue' ||
|
|
168
|
-
value === 'nir' ||
|
|
169
|
-
value === 'swir1' ||
|
|
170
|
-
value === 'swir2' ||
|
|
171
|
-
value === 'rededge');
|
|
172
|
-
}
|
|
173
|
-
/** True when the band map has enough channels for a True Color composite. */
|
|
174
|
-
export function hasRgbBands(map) {
|
|
175
|
-
return Boolean(map.red && map.green && map.blue);
|
|
176
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Universal cloud storage URL / bucket parser.
|
|
3
|
-
*
|
|
4
|
-
* Accepts the many URI/URL formats that users commonly paste and extracts
|
|
5
|
-
* the correct bucket, region, endpoint, and provider.
|
|
6
|
-
*
|
|
7
|
-
* Supported URI schemes:
|
|
8
|
-
* s3:// s3a:// s3n:// aws:// — Amazon S3 / S3-compatible
|
|
9
|
-
* r2:// — Cloudflare R2
|
|
10
|
-
* gs:// gcs:// — Google Cloud Storage
|
|
11
|
-
* azure:// az:// — Azure Blob Storage
|
|
12
|
-
* abfs:// abfss:// — Azure Data Lake (ADLS Gen2)
|
|
13
|
-
* wasbs:// — Azure Blob (Hadoop WASB driver)
|
|
14
|
-
* swift:// — OpenStack Swift
|
|
15
|
-
* file:// filesystem:// — Local filesystem
|
|
16
|
-
*
|
|
17
|
-
* Supported HTTPS URL patterns:
|
|
18
|
-
* https://<bucket>.s3.<region>.amazonaws.com[/prefix] — AWS virtual-hosted
|
|
19
|
-
* https://s3.<region>.amazonaws.com/<bucket>[/prefix] — AWS path-style
|
|
20
|
-
* https://s3.amazonaws.com/<bucket> — AWS global
|
|
21
|
-
* https://<account>.r2.cloudflarestorage.com/<bucket> — Cloudflare R2
|
|
22
|
-
* https://storage.googleapis.com/<bucket> — Google Cloud Storage
|
|
23
|
-
* https://<bucket>.storage.googleapis.com[/prefix] — GCS virtual-hosted
|
|
24
|
-
* https://<bucket>.<region>.digitaloceanspaces.com — DigitalOcean Spaces
|
|
25
|
-
* https://<region>.digitaloceanspaces.com/<bucket> — DO Spaces path-style
|
|
26
|
-
* https://s3.<region>.wasabisys.com/<bucket> — Wasabi
|
|
27
|
-
* https://f<id>.backblazeb2.com/file/<bucket> — Backblaze B2
|
|
28
|
-
* https://<bucket>.s3.<region>.backblazeb2.com — B2 S3-compatible
|
|
29
|
-
* https://<bucket>.oss-<region>.aliyuncs.com — Alibaba Cloud OSS
|
|
30
|
-
* https://<bucket>.cos.<region>.myqcloud.com — Tencent COS
|
|
31
|
-
* https://storage.yandexcloud.net/<bucket> — Yandex Cloud
|
|
32
|
-
* https://gateway.storjshare.io/<bucket> — Storj S3 gateway
|
|
33
|
-
* https://link.storjshare.io/raw/<access>/<bucket> — Storj linksharing
|
|
34
|
-
* https://<custom-endpoint>/<bucket> — Generic S3-compatible
|
|
35
|
-
*
|
|
36
|
-
* Also handles plain bucket names (no protocol).
|
|
37
|
-
*/
|
|
38
|
-
export type StorageProvider = string;
|
|
39
|
-
export interface ParsedStorageUrl {
|
|
40
|
-
bucket: string;
|
|
41
|
-
region: string;
|
|
42
|
-
endpoint: string;
|
|
43
|
-
provider: StorageProvider;
|
|
44
|
-
/** Original prefix/path after bucket, if any */
|
|
45
|
-
prefix: string;
|
|
46
|
-
}
|
|
47
|
-
/** STAC API path test, one source of truth. Tests pathname only. */
|
|
48
|
-
export declare const STAC_API_PATH_RE: RegExp;
|
|
49
|
-
/**
|
|
50
|
-
* Returns true when the host matches any of the provider host patterns
|
|
51
|
-
* that `parseStorageUrl` recognizes on the HTTPS branch.
|
|
52
|
-
*/
|
|
53
|
-
export declare function isKnownBucketHost(host: string): boolean;
|
|
54
|
-
export interface Defaults {
|
|
55
|
-
region?: string;
|
|
56
|
-
endpoint?: string;
|
|
57
|
-
provider?: StorageProvider;
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Parse a user-provided bucket/URL string into structured storage connection parts.
|
|
61
|
-
*/
|
|
62
|
-
export declare function parseStorageUrl(input: string, defaults?: Defaults): ParsedStorageUrl;
|
|
63
|
-
/**
|
|
64
|
-
* Returns true if the input looks like a URL/URI rather than a plain bucket name.
|
|
65
|
-
* Covers all recognized cloud storage URI schemes.
|
|
66
|
-
*/
|
|
67
|
-
export declare function looksLikeUrl(input: string): boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Given a parsed URL result, build a human-readable summary of what was detected.
|
|
70
|
-
*/
|
|
71
|
-
export declare function describeParseResult(parsed: ParsedStorageUrl): string;
|
|
72
|
-
export type UrlClassification = {
|
|
73
|
-
kind: 'scheme';
|
|
74
|
-
parsed: ParsedStorageUrl;
|
|
75
|
-
} | {
|
|
76
|
-
kind: 'object-storage';
|
|
77
|
-
parsed: ParsedStorageUrl;
|
|
78
|
-
} | {
|
|
79
|
-
kind: 'stac-api';
|
|
80
|
-
url: URL;
|
|
81
|
-
} | {
|
|
82
|
-
kind: 'remote-file';
|
|
83
|
-
url: URL;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* Classify a user-supplied URL/URI into one of four buckets. Unparseable or
|
|
87
|
-
* plain inputs fall through to `remote-file` with a best-effort URL parse,
|
|
88
|
-
* returning a synthetic `https://` URL when `new URL()` would throw.
|
|
89
|
-
*/
|
|
90
|
-
export declare function classifyUrl(input: string): UrlClassification;
|