@earthmover/icechunk 2.0.0-alpha.11 → 2.0.0-alpha.13
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/README.md +39 -8
- package/fetch-storage.d.ts +20 -0
- package/fetch-storage.mjs +126 -0
- package/index.d.ts +18 -1
- package/index.js +50 -50
- package/package.json +20 -7
package/README.md
CHANGED
|
@@ -46,14 +46,30 @@ In-memory storage works on all platforms. The following backends are available o
|
|
|
46
46
|
- **HTTP** — `Storage.newHttp(baseUrl, config?)`
|
|
47
47
|
- **Local Filesystem** — `Storage.newLocalFilesystem(path)`
|
|
48
48
|
|
|
49
|
+
### Fetch Storage (read-only, works everywhere)
|
|
50
|
+
|
|
51
|
+
For read-only access to a publicly hosted Icechunk repository, use the built-in fetch-based storage. This works on both native and WASM builds, making it the easiest way to open a repository in the browser:
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { Repository } from '@earthmover/icechunk'
|
|
55
|
+
import { createFetchStorage } from '@earthmover/icechunk/fetch-storage'
|
|
56
|
+
|
|
57
|
+
const storage = createFetchStorage('https://my-bucket.s3.us-west-2.amazonaws.com/my-repo.icechunk')
|
|
58
|
+
const repo = await Repository.open(storage)
|
|
59
|
+
const session = await repo.readonlySession({ branch: 'main' })
|
|
60
|
+
const keys = await session.store.list()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The repository must be on S3-compatible storage with public read access and XML listing enabled. `createFetchStorage` uses the browser `fetch` API under the hood, so it works in any environment where `fetch` is available.
|
|
64
|
+
|
|
49
65
|
### Custom Storage Backends
|
|
50
66
|
|
|
51
67
|
For WASM builds (or any environment where the built-in backends aren't suitable), you can provide your own storage implementation in JavaScript using `Storage.newCustom()`:
|
|
52
68
|
|
|
53
69
|
```typescript
|
|
54
70
|
const storage = Storage.newCustom({
|
|
55
|
-
canWrite: async () => true,
|
|
56
|
-
getObjectRange: async ({ path, rangeStart, rangeEnd }) => {
|
|
71
|
+
canWrite: async (_err, ) => true,
|
|
72
|
+
getObjectRange: async (_err, { path, rangeStart, rangeEnd }) => {
|
|
57
73
|
const headers: Record<string, string> = {}
|
|
58
74
|
if (rangeStart != null && rangeEnd != null) {
|
|
59
75
|
headers['Range'] = `bytes=${rangeStart}-${rangeEnd - 1}`
|
|
@@ -61,15 +77,17 @@ const storage = Storage.newCustom({
|
|
|
61
77
|
const resp = await fetch(`https://my-bucket.example.com/${path}`, { headers })
|
|
62
78
|
return { data: new Uint8Array(await resp.arrayBuffer()), version: { etag: resp.headers.get('etag') ?? undefined } }
|
|
63
79
|
},
|
|
64
|
-
putObject: async ({ path, data, contentType }) => { /* ... */ },
|
|
65
|
-
copyObject: async ({ from, to }) => { /* ... */ },
|
|
66
|
-
listObjects: async (prefix) => { /* return [{ id, createdAt, sizeBytes }] */ },
|
|
67
|
-
deleteBatch: async ({ prefix, batch }) => { /* return { deletedObjects, deletedBytes } */ },
|
|
68
|
-
getObjectLastModified: async (path) => { /* return Date */ },
|
|
69
|
-
getObjectConditional: async ({ path, previousVersion }) => { /* ... */ },
|
|
80
|
+
putObject: async (_err, { path, data, contentType }) => { /* ... */ },
|
|
81
|
+
copyObject: async (_err, { from, to }) => { /* ... */ },
|
|
82
|
+
listObjects: async (_err, prefix) => { /* return [{ id, createdAt, sizeBytes }] */ },
|
|
83
|
+
deleteBatch: async (_err, { prefix, batch }) => { /* return { deletedObjects, deletedBytes } */ },
|
|
84
|
+
getObjectLastModified: async (_err, path) => { /* return Date */ },
|
|
85
|
+
getObjectConditional: async (_err, { path, previousVersion }) => { /* ... */ },
|
|
70
86
|
})
|
|
71
87
|
```
|
|
72
88
|
|
|
89
|
+
> **Note:** Callbacks use the Node.js error-first convention — the first argument is always `null` (reserved for errors) and the actual arguments follow. Use `_err` to skip it.
|
|
90
|
+
|
|
73
91
|
This is the primary way to use cloud storage in the browser, where native Rust networking is unavailable. Each callback method maps to an operation on the underlying `Storage` trait. See the exported `Storage*` TypeScript interfaces for the full type signatures.
|
|
74
92
|
|
|
75
93
|
### Virtual Chunks
|
|
@@ -84,6 +102,18 @@ Install the package with the `--cpu=wasm32` flag to get the WASM binary:
|
|
|
84
102
|
npm install @earthmover/icechunk --cpu=wasm32
|
|
85
103
|
```
|
|
86
104
|
|
|
105
|
+
To open a public repository in the browser, use fetch storage:
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { Repository } from '@earthmover/icechunk'
|
|
109
|
+
import { createFetchStorage } from '@earthmover/icechunk/fetch-storage'
|
|
110
|
+
|
|
111
|
+
const storage = createFetchStorage('https://my-bucket.s3.us-west-2.amazonaws.com/my-repo.icechunk')
|
|
112
|
+
const repo = await Repository.open(storage)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
For more control, use `Storage.newCustom()` to implement your own storage backend with any JS networking library.
|
|
116
|
+
|
|
87
117
|
The WASM build uses `SharedArrayBuffer` for threading, which requires your server to send these headers:
|
|
88
118
|
|
|
89
119
|
```
|
|
@@ -102,6 +132,7 @@ export default defineConfig({
|
|
|
102
132
|
plugins: [wasm(), topLevelAwait()],
|
|
103
133
|
optimizeDeps: {
|
|
104
134
|
exclude: ['@earthmover/icechunk', '@earthmover/icechunk-wasm32-wasi'],
|
|
135
|
+
include: ['@earthmover/icechunk > @earthmover/icechunk-wasm32-wasi'],
|
|
105
136
|
},
|
|
106
137
|
server: {
|
|
107
138
|
headers: {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Storage } from '@earthmover/icechunk'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create a read-only storage backend that fetches objects over HTTP.
|
|
5
|
+
*
|
|
6
|
+
* Works with any publicly accessible icechunk repository hosted on S3-compatible
|
|
7
|
+
* storage. Requires the bucket to support anonymous reads and S3 XML listing.
|
|
8
|
+
*
|
|
9
|
+
* @param baseUrl - Base URL of the icechunk repository (no trailing slash)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { Repository } from '@earthmover/icechunk'
|
|
14
|
+
* import { createFetchStorage } from '@earthmover/icechunk/fetch-storage'
|
|
15
|
+
*
|
|
16
|
+
* const storage = createFetchStorage('https://my-bucket.s3.us-west-2.amazonaws.com/path/to/repo.icechunk')
|
|
17
|
+
* const repo = await Repository.open(storage)
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function createFetchStorage(baseUrl: string): Storage
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only fetch-based storage backend for Icechunk.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { Repository } from '@earthmover/icechunk'
|
|
6
|
+
* import { createFetchStorage } from '@earthmover/icechunk/fetch-storage'
|
|
7
|
+
*
|
|
8
|
+
* const storage = createFetchStorage('https://my-bucket.s3.amazonaws.com/my-repo.icechunk')
|
|
9
|
+
* const repo = await Repository.open(storage)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { Storage } from '@earthmover/icechunk'
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} baseUrl - Base URL of the icechunk repository (no trailing slash)
|
|
16
|
+
* @returns {Storage}
|
|
17
|
+
*/
|
|
18
|
+
export function createFetchStorage(baseUrl) {
|
|
19
|
+
// Normalize: strip trailing slash
|
|
20
|
+
const base = baseUrl.replace(/\/+$/, '')
|
|
21
|
+
|
|
22
|
+
function throwForStatus(resp, url) {
|
|
23
|
+
if (resp.ok) return
|
|
24
|
+
if (resp.status === 404) {
|
|
25
|
+
throw new Error(`ObjectNotFound: ${url}`)
|
|
26
|
+
}
|
|
27
|
+
throw new Error(`HTTP ${resp.status}: ${url}`)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return Storage.newCustom({
|
|
31
|
+
canWrite: async (_err) => false,
|
|
32
|
+
|
|
33
|
+
getObjectRange: async (_err, { path, rangeStart, rangeEnd }) => {
|
|
34
|
+
const url = `${base}/${path}`
|
|
35
|
+
const headers = {}
|
|
36
|
+
|
|
37
|
+
if (rangeStart != null && rangeEnd != null) {
|
|
38
|
+
headers['Range'] = `bytes=${rangeStart}-${rangeEnd - 1}`
|
|
39
|
+
} else if (rangeStart != null) {
|
|
40
|
+
headers['Range'] = `bytes=${rangeStart}-`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const resp = await fetch(url, { headers })
|
|
44
|
+
throwForStatus(resp, url)
|
|
45
|
+
|
|
46
|
+
const data = new Uint8Array(await resp.arrayBuffer())
|
|
47
|
+
const etag = resp.headers.get('etag') ?? undefined
|
|
48
|
+
return { data, version: { etag } }
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
putObject: async () => {
|
|
52
|
+
throw new Error('Read-only storage: putObject not supported')
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
copyObject: async () => {
|
|
56
|
+
throw new Error('Read-only storage: copyObject not supported')
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
listObjects: async (_err, prefix) => {
|
|
60
|
+
// S3-style XML listing
|
|
61
|
+
const url = new URL(base)
|
|
62
|
+
const keyPrefix = url.pathname.replace(/^\//, '') + '/' + prefix
|
|
63
|
+
const listUrl = `${url.origin}/?list-type=2&prefix=${encodeURIComponent(keyPrefix)}`
|
|
64
|
+
|
|
65
|
+
const resp = await fetch(listUrl)
|
|
66
|
+
throwForStatus(resp, listUrl)
|
|
67
|
+
|
|
68
|
+
const xml = await resp.text()
|
|
69
|
+
const results = []
|
|
70
|
+
const contentRegex = /<Contents>([\s\S]*?)<\/Contents>/g
|
|
71
|
+
let match
|
|
72
|
+
while ((match = contentRegex.exec(xml)) !== null) {
|
|
73
|
+
const block = match[1]
|
|
74
|
+
const key = block.match(/<Key>(.*?)<\/Key>/)?.[1]
|
|
75
|
+
const lastModified = block.match(/<LastModified>(.*?)<\/LastModified>/)?.[1]
|
|
76
|
+
const size = block.match(/<Size>(.*?)<\/Size>/)?.[1]
|
|
77
|
+
if (key && lastModified && size) {
|
|
78
|
+
const id = key.startsWith(keyPrefix) ? key.slice(keyPrefix.length) : key
|
|
79
|
+
results.push({
|
|
80
|
+
id,
|
|
81
|
+
createdAt: new Date(lastModified),
|
|
82
|
+
sizeBytes: Number(size),
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return results
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
deleteBatch: async () => {
|
|
91
|
+
throw new Error('Read-only storage: deleteBatch not supported')
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
getObjectLastModified: async (_err, path) => {
|
|
95
|
+
const url = `${base}/${path}`
|
|
96
|
+
const resp = await fetch(url, { method: 'HEAD' })
|
|
97
|
+
throwForStatus(resp, url)
|
|
98
|
+
const lastModified = resp.headers.get('last-modified')
|
|
99
|
+
if (!lastModified) {
|
|
100
|
+
throw new Error(`No Last-Modified header: ${url}`)
|
|
101
|
+
}
|
|
102
|
+
return new Date(lastModified)
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
getObjectConditional: async (_err, { path, previousVersion }) => {
|
|
106
|
+
const url = `${base}/${path}`
|
|
107
|
+
const headers = {}
|
|
108
|
+
|
|
109
|
+
if (previousVersion?.etag) {
|
|
110
|
+
headers['If-None-Match'] = previousVersion.etag
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const resp = await fetch(url, { headers })
|
|
114
|
+
|
|
115
|
+
if (resp.status === 304) {
|
|
116
|
+
return { kind: 'on_latest_version' }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
throwForStatus(resp, url)
|
|
120
|
+
|
|
121
|
+
const data = new Uint8Array(await resp.arrayBuffer())
|
|
122
|
+
const etag = resp.headers.get('etag') ?? undefined
|
|
123
|
+
return { kind: 'modified', data, newVersion: { etag } }
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -84,7 +84,14 @@ export type JsStorage = Storage
|
|
|
84
84
|
|
|
85
85
|
export declare class Store {
|
|
86
86
|
get(key: string): Promise<Buffer | null>
|
|
87
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Fetch a byte range from a key.
|
|
89
|
+
*
|
|
90
|
+
* Accepts zarrita's RangeQuery format:
|
|
91
|
+
* { offset: number, length: number } - fetch length bytes starting at offset
|
|
92
|
+
* { suffixLength: number } - fetch the last suffixLength bytes
|
|
93
|
+
*/
|
|
94
|
+
getRange(key: string, range: RangeQuery): Promise<Buffer | null>
|
|
88
95
|
set(key: string, value: Buffer): Promise<void>
|
|
89
96
|
exists(key: string): Promise<boolean>
|
|
90
97
|
delete(key: string): Promise<void>
|
|
@@ -223,6 +230,16 @@ export type ObjectStoreConfig =
|
|
|
223
230
|
| { type: 'Azure', field0: Record<string, string> }
|
|
224
231
|
| { type: 'Tigris', field0: S3Options }
|
|
225
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Range query matching zarrita's RangeQuery type:
|
|
235
|
+
* { offset: number, length: number } | { suffixLength: number }
|
|
236
|
+
*/
|
|
237
|
+
export interface RangeQuery {
|
|
238
|
+
offset?: number
|
|
239
|
+
length?: number
|
|
240
|
+
suffixLength?: number
|
|
241
|
+
}
|
|
242
|
+
|
|
226
243
|
export interface ReadonlySessionOptions {
|
|
227
244
|
branch?: string
|
|
228
245
|
tag?: string
|
package/index.js
CHANGED
|
@@ -80,8 +80,8 @@ function requireNative() {
|
|
|
80
80
|
try {
|
|
81
81
|
const binding = require('@earthmover/icechunk-android-arm64')
|
|
82
82
|
const bindingPackageVersion = require('@earthmover/icechunk-android-arm64/package.json').version
|
|
83
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
84
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
83
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
84
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
85
85
|
}
|
|
86
86
|
return binding
|
|
87
87
|
} catch (e) {
|
|
@@ -96,8 +96,8 @@ function requireNative() {
|
|
|
96
96
|
try {
|
|
97
97
|
const binding = require('@earthmover/icechunk-android-arm-eabi')
|
|
98
98
|
const bindingPackageVersion = require('@earthmover/icechunk-android-arm-eabi/package.json').version
|
|
99
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
100
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
99
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
100
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
101
101
|
}
|
|
102
102
|
return binding
|
|
103
103
|
} catch (e) {
|
|
@@ -116,8 +116,8 @@ function requireNative() {
|
|
|
116
116
|
try {
|
|
117
117
|
const binding = require('@earthmover/icechunk-win32-x64-msvc')
|
|
118
118
|
const bindingPackageVersion = require('@earthmover/icechunk-win32-x64-msvc/package.json').version
|
|
119
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
120
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
119
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
120
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
121
121
|
}
|
|
122
122
|
return binding
|
|
123
123
|
} catch (e) {
|
|
@@ -132,8 +132,8 @@ function requireNative() {
|
|
|
132
132
|
try {
|
|
133
133
|
const binding = require('@earthmover/icechunk-win32-ia32-msvc')
|
|
134
134
|
const bindingPackageVersion = require('@earthmover/icechunk-win32-ia32-msvc/package.json').version
|
|
135
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
136
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
135
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
136
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
137
137
|
}
|
|
138
138
|
return binding
|
|
139
139
|
} catch (e) {
|
|
@@ -148,8 +148,8 @@ function requireNative() {
|
|
|
148
148
|
try {
|
|
149
149
|
const binding = require('@earthmover/icechunk-win32-arm64-msvc')
|
|
150
150
|
const bindingPackageVersion = require('@earthmover/icechunk-win32-arm64-msvc/package.json').version
|
|
151
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
152
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
151
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
152
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
153
153
|
}
|
|
154
154
|
return binding
|
|
155
155
|
} catch (e) {
|
|
@@ -167,8 +167,8 @@ function requireNative() {
|
|
|
167
167
|
try {
|
|
168
168
|
const binding = require('@earthmover/icechunk-darwin-universal')
|
|
169
169
|
const bindingPackageVersion = require('@earthmover/icechunk-darwin-universal/package.json').version
|
|
170
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
171
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
170
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
171
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
172
172
|
}
|
|
173
173
|
return binding
|
|
174
174
|
} catch (e) {
|
|
@@ -183,8 +183,8 @@ function requireNative() {
|
|
|
183
183
|
try {
|
|
184
184
|
const binding = require('@earthmover/icechunk-darwin-x64')
|
|
185
185
|
const bindingPackageVersion = require('@earthmover/icechunk-darwin-x64/package.json').version
|
|
186
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
187
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
186
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
187
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
188
188
|
}
|
|
189
189
|
return binding
|
|
190
190
|
} catch (e) {
|
|
@@ -199,8 +199,8 @@ function requireNative() {
|
|
|
199
199
|
try {
|
|
200
200
|
const binding = require('@earthmover/icechunk-darwin-arm64')
|
|
201
201
|
const bindingPackageVersion = require('@earthmover/icechunk-darwin-arm64/package.json').version
|
|
202
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
203
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
202
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
203
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
204
204
|
}
|
|
205
205
|
return binding
|
|
206
206
|
} catch (e) {
|
|
@@ -219,8 +219,8 @@ function requireNative() {
|
|
|
219
219
|
try {
|
|
220
220
|
const binding = require('@earthmover/icechunk-freebsd-x64')
|
|
221
221
|
const bindingPackageVersion = require('@earthmover/icechunk-freebsd-x64/package.json').version
|
|
222
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
223
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
222
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
223
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
224
224
|
}
|
|
225
225
|
return binding
|
|
226
226
|
} catch (e) {
|
|
@@ -235,8 +235,8 @@ function requireNative() {
|
|
|
235
235
|
try {
|
|
236
236
|
const binding = require('@earthmover/icechunk-freebsd-arm64')
|
|
237
237
|
const bindingPackageVersion = require('@earthmover/icechunk-freebsd-arm64/package.json').version
|
|
238
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
239
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
238
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
239
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
240
240
|
}
|
|
241
241
|
return binding
|
|
242
242
|
} catch (e) {
|
|
@@ -256,8 +256,8 @@ function requireNative() {
|
|
|
256
256
|
try {
|
|
257
257
|
const binding = require('@earthmover/icechunk-linux-x64-musl')
|
|
258
258
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-musl/package.json').version
|
|
259
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
260
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
259
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
260
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
261
261
|
}
|
|
262
262
|
return binding
|
|
263
263
|
} catch (e) {
|
|
@@ -272,8 +272,8 @@ function requireNative() {
|
|
|
272
272
|
try {
|
|
273
273
|
const binding = require('@earthmover/icechunk-linux-x64-gnu')
|
|
274
274
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-gnu/package.json').version
|
|
275
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
276
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
275
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
276
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
277
277
|
}
|
|
278
278
|
return binding
|
|
279
279
|
} catch (e) {
|
|
@@ -290,8 +290,8 @@ function requireNative() {
|
|
|
290
290
|
try {
|
|
291
291
|
const binding = require('@earthmover/icechunk-linux-arm64-musl')
|
|
292
292
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-musl/package.json').version
|
|
293
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
294
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
293
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
294
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
295
295
|
}
|
|
296
296
|
return binding
|
|
297
297
|
} catch (e) {
|
|
@@ -306,8 +306,8 @@ function requireNative() {
|
|
|
306
306
|
try {
|
|
307
307
|
const binding = require('@earthmover/icechunk-linux-arm64-gnu')
|
|
308
308
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-gnu/package.json').version
|
|
309
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
310
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
309
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
310
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
311
311
|
}
|
|
312
312
|
return binding
|
|
313
313
|
} catch (e) {
|
|
@@ -324,8 +324,8 @@ function requireNative() {
|
|
|
324
324
|
try {
|
|
325
325
|
const binding = require('@earthmover/icechunk-linux-arm-musleabihf')
|
|
326
326
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-musleabihf/package.json').version
|
|
327
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
328
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
327
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
328
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
329
329
|
}
|
|
330
330
|
return binding
|
|
331
331
|
} catch (e) {
|
|
@@ -340,8 +340,8 @@ function requireNative() {
|
|
|
340
340
|
try {
|
|
341
341
|
const binding = require('@earthmover/icechunk-linux-arm-gnueabihf')
|
|
342
342
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-gnueabihf/package.json').version
|
|
343
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
344
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
343
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
344
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
345
345
|
}
|
|
346
346
|
return binding
|
|
347
347
|
} catch (e) {
|
|
@@ -358,8 +358,8 @@ function requireNative() {
|
|
|
358
358
|
try {
|
|
359
359
|
const binding = require('@earthmover/icechunk-linux-loong64-musl')
|
|
360
360
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-musl/package.json').version
|
|
361
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
362
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
361
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
362
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
363
363
|
}
|
|
364
364
|
return binding
|
|
365
365
|
} catch (e) {
|
|
@@ -374,8 +374,8 @@ function requireNative() {
|
|
|
374
374
|
try {
|
|
375
375
|
const binding = require('@earthmover/icechunk-linux-loong64-gnu')
|
|
376
376
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-gnu/package.json').version
|
|
377
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
378
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
377
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
378
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
379
379
|
}
|
|
380
380
|
return binding
|
|
381
381
|
} catch (e) {
|
|
@@ -392,8 +392,8 @@ function requireNative() {
|
|
|
392
392
|
try {
|
|
393
393
|
const binding = require('@earthmover/icechunk-linux-riscv64-musl')
|
|
394
394
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-musl/package.json').version
|
|
395
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
396
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
395
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
396
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
397
397
|
}
|
|
398
398
|
return binding
|
|
399
399
|
} catch (e) {
|
|
@@ -408,8 +408,8 @@ function requireNative() {
|
|
|
408
408
|
try {
|
|
409
409
|
const binding = require('@earthmover/icechunk-linux-riscv64-gnu')
|
|
410
410
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-gnu/package.json').version
|
|
411
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
412
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
411
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
412
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
413
413
|
}
|
|
414
414
|
return binding
|
|
415
415
|
} catch (e) {
|
|
@@ -425,8 +425,8 @@ function requireNative() {
|
|
|
425
425
|
try {
|
|
426
426
|
const binding = require('@earthmover/icechunk-linux-ppc64-gnu')
|
|
427
427
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-ppc64-gnu/package.json').version
|
|
428
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
429
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
428
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
429
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
430
430
|
}
|
|
431
431
|
return binding
|
|
432
432
|
} catch (e) {
|
|
@@ -441,8 +441,8 @@ function requireNative() {
|
|
|
441
441
|
try {
|
|
442
442
|
const binding = require('@earthmover/icechunk-linux-s390x-gnu')
|
|
443
443
|
const bindingPackageVersion = require('@earthmover/icechunk-linux-s390x-gnu/package.json').version
|
|
444
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
445
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
444
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
445
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
446
446
|
}
|
|
447
447
|
return binding
|
|
448
448
|
} catch (e) {
|
|
@@ -461,8 +461,8 @@ function requireNative() {
|
|
|
461
461
|
try {
|
|
462
462
|
const binding = require('@earthmover/icechunk-openharmony-arm64')
|
|
463
463
|
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm64/package.json').version
|
|
464
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
465
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
464
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
465
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
466
466
|
}
|
|
467
467
|
return binding
|
|
468
468
|
} catch (e) {
|
|
@@ -477,8 +477,8 @@ function requireNative() {
|
|
|
477
477
|
try {
|
|
478
478
|
const binding = require('@earthmover/icechunk-openharmony-x64')
|
|
479
479
|
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-x64/package.json').version
|
|
480
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
481
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
480
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
481
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
482
482
|
}
|
|
483
483
|
return binding
|
|
484
484
|
} catch (e) {
|
|
@@ -493,8 +493,8 @@ function requireNative() {
|
|
|
493
493
|
try {
|
|
494
494
|
const binding = require('@earthmover/icechunk-openharmony-arm')
|
|
495
495
|
const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm/package.json').version
|
|
496
|
-
if (bindingPackageVersion !== '2.0.0-alpha.
|
|
497
|
-
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.
|
|
496
|
+
if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
497
|
+
throw new Error(`Native binding package version mismatch, expected 2.0.0-alpha.13 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
498
498
|
}
|
|
499
499
|
return binding
|
|
500
500
|
} catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earthmover/icechunk",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.13",
|
|
4
4
|
"description": "JavaScript/TypeScript bindings for Icechunk",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -19,10 +19,22 @@
|
|
|
19
19
|
"science",
|
|
20
20
|
"geospatial"
|
|
21
21
|
],
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"browser": "./browser.js",
|
|
25
|
+
"default": "./index.js"
|
|
26
|
+
},
|
|
27
|
+
"./fetch-storage": {
|
|
28
|
+
"types": "./fetch-storage.d.ts",
|
|
29
|
+
"default": "./fetch-storage.mjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
22
32
|
"files": [
|
|
23
33
|
"index.d.ts",
|
|
24
34
|
"index.js",
|
|
25
|
-
"browser.js"
|
|
35
|
+
"browser.js",
|
|
36
|
+
"fetch-storage.mjs",
|
|
37
|
+
"fetch-storage.d.ts"
|
|
26
38
|
],
|
|
27
39
|
"napi": {
|
|
28
40
|
"binaryName": "icechunk",
|
|
@@ -72,7 +84,8 @@
|
|
|
72
84
|
"oxlint": "^1.14.0",
|
|
73
85
|
"prettier": "^3.6.2",
|
|
74
86
|
"tinybench": "^6.0.0",
|
|
75
|
-
"typescript": "^5.9.2"
|
|
87
|
+
"typescript": "^5.9.2",
|
|
88
|
+
"zarrita": "^0.6.2"
|
|
76
89
|
},
|
|
77
90
|
"lint-staged": {
|
|
78
91
|
"*.@(js|ts|tsx)": [
|
|
@@ -108,9 +121,9 @@
|
|
|
108
121
|
},
|
|
109
122
|
"packageManager": "yarn@4.12.0",
|
|
110
123
|
"optionalDependencies": {
|
|
111
|
-
"@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.
|
|
112
|
-
"@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.
|
|
113
|
-
"@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.
|
|
114
|
-
"@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.
|
|
124
|
+
"@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.13",
|
|
125
|
+
"@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.13",
|
|
126
|
+
"@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.13",
|
|
127
|
+
"@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.13"
|
|
115
128
|
}
|
|
116
129
|
}
|