@earthmover/icechunk 2.0.0-alpha.12 → 2.0.0-alpha.14

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 CHANGED
@@ -132,6 +132,7 @@ export default defineConfig({
132
132
  plugins: [wasm(), topLevelAwait()],
133
133
  optimizeDeps: {
134
134
  exclude: ['@earthmover/icechunk', '@earthmover/icechunk-wasm32-wasi'],
135
+ include: ['@earthmover/icechunk > @earthmover/icechunk-wasm32-wasi'],
135
136
  },
136
137
  server: {
137
138
  headers: {
@@ -9,13 +9,13 @@
9
9
  * const repo = await Repository.open(storage)
10
10
  */
11
11
 
12
- const { Storage } = require('@earthmover/icechunk')
12
+ import { Storage } from '@earthmover/icechunk'
13
13
 
14
14
  /**
15
15
  * @param {string} baseUrl - Base URL of the icechunk repository (no trailing slash)
16
16
  * @returns {Storage}
17
17
  */
18
- function createFetchStorage(baseUrl) {
18
+ export function createFetchStorage(baseUrl) {
19
19
  // Normalize: strip trailing slash
20
20
  const base = baseUrl.replace(/\/+$/, '')
21
21
 
@@ -57,9 +57,7 @@ function createFetchStorage(baseUrl) {
57
57
  },
58
58
 
59
59
  listObjects: async (_err, prefix) => {
60
- // Try S3-style XML listing
61
- // Derive bucket URL and key prefix from the base URL
62
- // e.g. https://bucket.s3.region.amazonaws.com/prefix -> bucket URL + key prefix
60
+ // S3-style XML listing
63
61
  const url = new URL(base)
64
62
  const keyPrefix = url.pathname.replace(/^\//, '') + '/' + prefix
65
63
  const listUrl = `${url.origin}/?list-type=2&prefix=${encodeURIComponent(keyPrefix)}`
@@ -126,5 +124,3 @@ function createFetchStorage(baseUrl) {
126
124
  },
127
125
  })
128
126
  }
129
-
130
- module.exports = { createFetchStorage }
package/index.d.ts CHANGED
@@ -51,8 +51,6 @@ export declare class Session {
51
51
  amend(message: string): Promise<string>
52
52
  flush(message: string): Promise<string>
53
53
  rebase(): Promise<void>
54
- /** Get all virtual chunk locations referenced by this session */
55
- allVirtualChunkLocations(): Promise<Array<string>>
56
54
  }
57
55
  export type JsSession = Session
58
56
 
@@ -66,25 +64,19 @@ export declare class Storage {
66
64
  * especially useful for WASM builds where native Rust networking is unavailable.
67
65
  */
68
66
  static newCustom(backend: { canWrite: () => Promise<boolean>; getObjectRange: (args: StorageGetObjectRangeArgs) => Promise<StorageGetObjectResponse>; putObject: (args: StoragePutObjectArgs) => Promise<StorageVersionedUpdateResult>; copyObject: (args: StorageCopyObjectArgs) => Promise<StorageVersionedUpdateResult>; listObjects: (prefix: string) => Promise<Array<StorageListInfo>>; deleteBatch: (args: StorageDeleteBatchArgs) => Promise<StorageDeleteObjectsResult>; getObjectLastModified: (path: string) => Promise<Date>; getObjectConditional: (args: StorageGetObjectConditionalArgs) => Promise<StorageGetModifiedResult> }): Storage
69
- static newLocalFilesystem(path: string): Promise<Storage>
70
- static newS3(bucket: string, prefix?: string | undefined | null, credentials?: S3Credentials | undefined | null, options?: S3Options | undefined | null): Storage
71
- static newR2(bucket?: string | undefined | null, prefix?: string | undefined | null, accountId?: string | undefined | null, credentials?: S3Credentials | undefined | null, options?: S3Options | undefined | null): Storage
72
- static newTigris(bucket: string, prefix?: string | undefined | null, credentials?: S3Credentials | undefined | null, options?: S3Options | undefined | null, useWeakConsistency?: boolean | undefined | null): Storage
73
- static newS3ObjectStore(bucket: string, prefix?: string | undefined | null, credentials?: S3Credentials | undefined | null, options?: S3Options | undefined | null): Promise<Storage>
74
- static newGcs(bucket: string, prefix?: string | undefined | null, credentials?: GcsCredentials | undefined | null, config?: Record<string, string> | undefined | null): Storage
75
- static newAzureBlob(account: string, container: string, prefix?: string | undefined | null, credentials?: AzureCredentials | undefined | null, config?: Record<string, string> | undefined | null): Promise<Storage>
76
- static newHttp(baseUrl: string, config?: Record<string, string> | undefined | null): Storage
77
- static newS3WithRefreshableCredentials(bucket: string, prefix: string | undefined | null, credentialsCallback: () => Promise<S3StaticCredentials>, initialCredentials?: S3StaticCredentials | undefined | null, options?: S3Options | undefined | null): Storage
78
- static newR2WithRefreshableCredentials(bucket: string | undefined | null, prefix: string | undefined | null, accountId: string | undefined | null, credentialsCallback: () => Promise<S3StaticCredentials>, initialCredentials?: S3StaticCredentials | undefined | null, options?: S3Options | undefined | null): Storage
79
- static newTigrisWithRefreshableCredentials(bucket: string, prefix: string | undefined | null, credentialsCallback: () => Promise<S3StaticCredentials>, initialCredentials?: S3StaticCredentials | undefined | null, options?: S3Options | undefined | null, useWeakConsistency?: boolean | undefined | null): Storage
80
- static newS3ObjectStoreWithRefreshableCredentials(bucket: string, prefix: string | undefined | null, credentialsCallback: () => Promise<S3StaticCredentials>, initialCredentials?: S3StaticCredentials | undefined | null, options?: S3Options | undefined | null): Promise<Storage>
81
- static newGcsWithRefreshableCredentials(bucket: string, prefix: string | undefined | null, credentialsCallback: () => Promise<GcsBearerCredential>, initialCredentials?: GcsBearerCredential | undefined | null, config?: Record<string, string> | undefined | null): Storage
82
67
  }
83
68
  export type JsStorage = Storage
84
69
 
85
70
  export declare class Store {
86
- get(key: string): Promise<Buffer | null>
87
- getRange(key: string, offset: number, length?: number | undefined | null): Promise<Buffer | null>
71
+ get(key: string): Promise<Uint8Array | null>
72
+ /**
73
+ * Fetch a byte range from a key.
74
+ *
75
+ * Accepts zarrita's RangeQuery format:
76
+ * { offset: number, length: number } - fetch length bytes starting at offset
77
+ * { suffixLength: number } - fetch the last suffixLength bytes
78
+ */
79
+ getRange(key: string, range: RangeQuery): Promise<Uint8Array | null>
88
80
  set(key: string, value: Buffer): Promise<void>
89
81
  exists(key: string): Promise<boolean>
90
82
  delete(key: string): Promise<void>
@@ -102,32 +94,9 @@ export declare class Store {
102
94
  deleteDir(prefix: string): Promise<void>
103
95
  getsize(key: string): Promise<number>
104
96
  getsizePrefix(prefix: string): Promise<number>
105
- /**
106
- * Set a single virtual reference to a chunk
107
- *
108
- * For checksum validation, provide either etag_checksum (string) or last_modified (JS Date object).
109
- * If both are provided, etag_checksum takes precedence.
110
- */
111
- setVirtualRef(key: string, location: string, offset: number, length: number, etagChecksum: string | undefined | null, lastModified: Date | undefined | null, validateContainer: boolean): Promise<void>
112
- /**
113
- * Set multiple virtual references for the same array
114
- * Returns the indices of failed chunk references if any
115
- */
116
- setVirtualRefs(arrayPath: string, chunks: Array<VirtualChunkSpec>, validateContainers: boolean): Promise<Array<Array<number>> | null>
117
97
  }
118
98
  export type JsStore = Store
119
99
 
120
- /** Azure credentials */
121
- export type AzureCredentials =
122
- | { type: 'FromEnv' }
123
- | { type: 'Static', field0: AzureStaticCredentials }
124
-
125
- /** Azure static credentials */
126
- export type AzureStaticCredentials =
127
- | { type: 'AccessKey', field0: string }
128
- | { type: 'SasToken', field0: string }
129
- | { type: 'BearerToken', field0: string }
130
-
131
100
  /** Caching configuration */
132
101
  export interface CachingConfig {
133
102
  numSnapshotNodes?: number
@@ -148,12 +117,6 @@ export interface CompressionConfig {
148
117
  level?: number
149
118
  }
150
119
 
151
- /** Credentials for virtual chunk access */
152
- export type Credentials =
153
- | { type: 'S3', field0: S3Credentials }
154
- | { type: 'Gcs', field0: GcsCredentials }
155
- | { type: 'Azure', field0: AzureCredentials }
156
-
157
120
  export interface DiffOptions {
158
121
  fromBranch?: string
159
122
  fromTag?: string
@@ -182,25 +145,6 @@ export interface FeatureFlag {
182
145
  enabled: boolean
183
146
  }
184
147
 
185
- /** GCS bearer credential with optional expiry */
186
- export interface GcsBearerCredential {
187
- bearer: string
188
- expiresAfter?: Date
189
- }
190
-
191
- /** GCS credentials */
192
- export type GcsCredentials =
193
- | { type: 'Anonymous' }
194
- | { type: 'FromEnv' }
195
- | { type: 'Static', field0: GcsStaticCredentials }
196
-
197
- /** GCS static credentials */
198
- export type GcsStaticCredentials =
199
- | { type: 'ServiceAccount', field0: string }
200
- | { type: 'ServiceAccountKey', field0: string }
201
- | { type: 'ApplicationCredentials', field0: string }
202
- | { type: 'BearerToken', field0: string }
203
-
204
148
  export interface ManifestFileInfo {
205
149
  id: string
206
150
  sizeBytes: number
@@ -212,16 +156,15 @@ export interface MovedNode {
212
156
  to: string
213
157
  }
214
158
 
215
- /** Object store configuration for virtual chunk containers */
216
- export type ObjectStoreConfig =
217
- | { type: 'InMemory' }
218
- | { type: 'LocalFileSystem', field0: string }
219
- | { type: 'Http', field0: Record<string, string> }
220
- | { type: 'S3Compatible', field0: S3Options }
221
- | { type: 'S3', field0: S3Options }
222
- | { type: 'Gcs', field0: Record<string, string> }
223
- | { type: 'Azure', field0: Record<string, string> }
224
- | { type: 'Tigris', field0: S3Options }
159
+ /**
160
+ * Range query matching zarrita's RangeQuery type:
161
+ * { offset: number, length: number } | { suffixLength: number }
162
+ */
163
+ export interface RangeQuery {
164
+ offset?: number
165
+ length?: number
166
+ suffixLength?: number
167
+ }
225
168
 
226
169
  export interface ReadonlySessionOptions {
227
170
  branch?: string
@@ -229,28 +172,7 @@ export interface ReadonlySessionOptions {
229
172
  snapshotId?: string
230
173
  }
231
174
 
232
- /**
233
- * Repository configuration
234
- *
235
- * The `manifest` field accepts a JSON object matching the serde serialization
236
- * of `ManifestConfig`. Example:
237
- * ```js
238
- * {
239
- * manifest: {
240
- * preload: {
241
- * max_total_refs: 1000,
242
- * preload_if: { true: null },
243
- * max_arrays_to_scan: 10
244
- * },
245
- * splitting: {
246
- * split_sizes: [
247
- * [{ path_matches: { regex: ".*" } }, [{ condition: "any", num_chunks: 100 }]]
248
- * ]
249
- * }
250
- * }
251
- * }
252
- * ```
253
- */
175
+ /** Repository configuration (WASM build — no virtual chunk support) */
254
176
  export interface RepositoryConfig {
255
177
  inlineChunkThresholdBytes?: number
256
178
  getPartialValuesConcurrency?: number
@@ -263,33 +185,6 @@ export interface RepositoryConfig {
263
185
  * The object is deserialized using serde, matching the Rust ManifestConfig structure.
264
186
  */
265
187
  manifest?: any
266
- /** Virtual chunk containers configuration */
267
- virtualChunkContainers?: Record<string, VirtualChunkContainer>
268
- }
269
-
270
- /** S3 credentials */
271
- export type S3Credentials =
272
- | { type: 'FromEnv' }
273
- | { type: 'Anonymous' }
274
- | { type: 'Static', field0: S3StaticCredentials }
275
-
276
- /** S3 options */
277
- export interface S3Options {
278
- region?: string
279
- endpointUrl?: string
280
- allowHttp?: boolean
281
- anonymous?: boolean
282
- forcePathStyle?: boolean
283
- networkStreamTimeoutSeconds?: number
284
- requesterPays?: boolean
285
- }
286
-
287
- /** S3 static credentials */
288
- export interface S3StaticCredentials {
289
- accessKeyId: string
290
- secretAccessKey: string
291
- sessionToken?: string
292
- expiresAfter?: Date
293
188
  }
294
189
 
295
190
  export interface SnapshotInfo {
@@ -428,21 +323,3 @@ export interface VersionOptions {
428
323
  tag?: string
429
324
  snapshotId?: string
430
325
  }
431
-
432
- /** Virtual chunk container configuration */
433
- export interface VirtualChunkContainer {
434
- name?: string
435
- urlPrefix: string
436
- store: JsObjectStoreConfig
437
- }
438
-
439
- /** Specification for a virtual chunk reference */
440
- export interface VirtualChunkSpec {
441
- index: Array<number>
442
- location: string
443
- offset: number
444
- length: number
445
- etagChecksum?: string
446
- /** Last modified datetime (accepts JS Date object) */
447
- lastModified?: Date
448
- }
package/index.js CHANGED
@@ -3,9 +3,6 @@
3
3
  // @ts-nocheck
4
4
  /* auto-generated by NAPI-RS */
5
5
 
6
- const { createRequire } = require('node:module')
7
- require = createRequire(__filename)
8
-
9
6
  const { readFileSync } = require('node:fs')
10
7
  let nativeBinding = null
11
8
  const loadErrors = []
@@ -80,8 +77,8 @@ function requireNative() {
80
77
  try {
81
78
  const binding = require('@earthmover/icechunk-android-arm64')
82
79
  const bindingPackageVersion = require('@earthmover/icechunk-android-arm64/package.json').version
83
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
80
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
81
+ 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
82
  }
86
83
  return binding
87
84
  } catch (e) {
@@ -96,8 +93,8 @@ function requireNative() {
96
93
  try {
97
94
  const binding = require('@earthmover/icechunk-android-arm-eabi')
98
95
  const bindingPackageVersion = require('@earthmover/icechunk-android-arm-eabi/package.json').version
99
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
96
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
97
+ 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
98
  }
102
99
  return binding
103
100
  } catch (e) {
@@ -108,7 +105,24 @@ function requireNative() {
108
105
  }
109
106
  } else if (process.platform === 'win32') {
110
107
  if (process.arch === 'x64') {
108
+ if (process.config?.variables?.shlib_suffix === 'dll.a' || process.config?.variables?.node_target_type === 'shared_library') {
109
+ try {
110
+ return require('./icechunk.win32-x64-gnu.node')
111
+ } catch (e) {
112
+ loadErrors.push(e)
113
+ }
111
114
  try {
115
+ const binding = require('@earthmover/icechunk-win32-x64-gnu')
116
+ const bindingPackageVersion = require('@earthmover/icechunk-win32-x64-gnu/package.json').version
117
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
118
+ 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.`)
119
+ }
120
+ return binding
121
+ } catch (e) {
122
+ loadErrors.push(e)
123
+ }
124
+ } else {
125
+ try {
112
126
  return require('./icechunk.win32-x64-msvc.node')
113
127
  } catch (e) {
114
128
  loadErrors.push(e)
@@ -116,13 +130,14 @@ function requireNative() {
116
130
  try {
117
131
  const binding = require('@earthmover/icechunk-win32-x64-msvc')
118
132
  const bindingPackageVersion = require('@earthmover/icechunk-win32-x64-msvc/package.json').version
119
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
133
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
134
+ 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
135
  }
122
136
  return binding
123
137
  } catch (e) {
124
138
  loadErrors.push(e)
125
139
  }
140
+ }
126
141
  } else if (process.arch === 'ia32') {
127
142
  try {
128
143
  return require('./icechunk.win32-ia32-msvc.node')
@@ -132,8 +147,8 @@ function requireNative() {
132
147
  try {
133
148
  const binding = require('@earthmover/icechunk-win32-ia32-msvc')
134
149
  const bindingPackageVersion = require('@earthmover/icechunk-win32-ia32-msvc/package.json').version
135
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
150
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
151
+ 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
152
  }
138
153
  return binding
139
154
  } catch (e) {
@@ -148,8 +163,8 @@ function requireNative() {
148
163
  try {
149
164
  const binding = require('@earthmover/icechunk-win32-arm64-msvc')
150
165
  const bindingPackageVersion = require('@earthmover/icechunk-win32-arm64-msvc/package.json').version
151
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
166
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
167
+ 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
168
  }
154
169
  return binding
155
170
  } catch (e) {
@@ -167,8 +182,8 @@ function requireNative() {
167
182
  try {
168
183
  const binding = require('@earthmover/icechunk-darwin-universal')
169
184
  const bindingPackageVersion = require('@earthmover/icechunk-darwin-universal/package.json').version
170
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
185
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
186
+ 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
187
  }
173
188
  return binding
174
189
  } catch (e) {
@@ -183,8 +198,8 @@ function requireNative() {
183
198
  try {
184
199
  const binding = require('@earthmover/icechunk-darwin-x64')
185
200
  const bindingPackageVersion = require('@earthmover/icechunk-darwin-x64/package.json').version
186
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
201
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
202
+ 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
203
  }
189
204
  return binding
190
205
  } catch (e) {
@@ -199,8 +214,8 @@ function requireNative() {
199
214
  try {
200
215
  const binding = require('@earthmover/icechunk-darwin-arm64')
201
216
  const bindingPackageVersion = require('@earthmover/icechunk-darwin-arm64/package.json').version
202
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
217
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
218
+ 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
219
  }
205
220
  return binding
206
221
  } catch (e) {
@@ -219,8 +234,8 @@ function requireNative() {
219
234
  try {
220
235
  const binding = require('@earthmover/icechunk-freebsd-x64')
221
236
  const bindingPackageVersion = require('@earthmover/icechunk-freebsd-x64/package.json').version
222
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
237
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
238
+ 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
239
  }
225
240
  return binding
226
241
  } catch (e) {
@@ -235,8 +250,8 @@ function requireNative() {
235
250
  try {
236
251
  const binding = require('@earthmover/icechunk-freebsd-arm64')
237
252
  const bindingPackageVersion = require('@earthmover/icechunk-freebsd-arm64/package.json').version
238
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
253
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
254
+ 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
255
  }
241
256
  return binding
242
257
  } catch (e) {
@@ -256,8 +271,8 @@ function requireNative() {
256
271
  try {
257
272
  const binding = require('@earthmover/icechunk-linux-x64-musl')
258
273
  const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-musl/package.json').version
259
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
274
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
275
+ 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
276
  }
262
277
  return binding
263
278
  } catch (e) {
@@ -272,8 +287,8 @@ function requireNative() {
272
287
  try {
273
288
  const binding = require('@earthmover/icechunk-linux-x64-gnu')
274
289
  const bindingPackageVersion = require('@earthmover/icechunk-linux-x64-gnu/package.json').version
275
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
290
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
291
+ 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
292
  }
278
293
  return binding
279
294
  } catch (e) {
@@ -290,8 +305,8 @@ function requireNative() {
290
305
  try {
291
306
  const binding = require('@earthmover/icechunk-linux-arm64-musl')
292
307
  const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-musl/package.json').version
293
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
308
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
309
+ 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
310
  }
296
311
  return binding
297
312
  } catch (e) {
@@ -306,8 +321,8 @@ function requireNative() {
306
321
  try {
307
322
  const binding = require('@earthmover/icechunk-linux-arm64-gnu')
308
323
  const bindingPackageVersion = require('@earthmover/icechunk-linux-arm64-gnu/package.json').version
309
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
324
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
325
+ 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
326
  }
312
327
  return binding
313
328
  } catch (e) {
@@ -324,8 +339,8 @@ function requireNative() {
324
339
  try {
325
340
  const binding = require('@earthmover/icechunk-linux-arm-musleabihf')
326
341
  const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-musleabihf/package.json').version
327
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
342
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
343
+ 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
344
  }
330
345
  return binding
331
346
  } catch (e) {
@@ -340,8 +355,8 @@ function requireNative() {
340
355
  try {
341
356
  const binding = require('@earthmover/icechunk-linux-arm-gnueabihf')
342
357
  const bindingPackageVersion = require('@earthmover/icechunk-linux-arm-gnueabihf/package.json').version
343
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
358
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
359
+ 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
360
  }
346
361
  return binding
347
362
  } catch (e) {
@@ -358,8 +373,8 @@ function requireNative() {
358
373
  try {
359
374
  const binding = require('@earthmover/icechunk-linux-loong64-musl')
360
375
  const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-musl/package.json').version
361
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
376
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
377
+ 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
378
  }
364
379
  return binding
365
380
  } catch (e) {
@@ -374,8 +389,8 @@ function requireNative() {
374
389
  try {
375
390
  const binding = require('@earthmover/icechunk-linux-loong64-gnu')
376
391
  const bindingPackageVersion = require('@earthmover/icechunk-linux-loong64-gnu/package.json').version
377
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
392
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
393
+ 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
394
  }
380
395
  return binding
381
396
  } catch (e) {
@@ -392,8 +407,8 @@ function requireNative() {
392
407
  try {
393
408
  const binding = require('@earthmover/icechunk-linux-riscv64-musl')
394
409
  const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-musl/package.json').version
395
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
410
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
411
+ 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
412
  }
398
413
  return binding
399
414
  } catch (e) {
@@ -408,8 +423,8 @@ function requireNative() {
408
423
  try {
409
424
  const binding = require('@earthmover/icechunk-linux-riscv64-gnu')
410
425
  const bindingPackageVersion = require('@earthmover/icechunk-linux-riscv64-gnu/package.json').version
411
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
426
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
427
+ 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
428
  }
414
429
  return binding
415
430
  } catch (e) {
@@ -425,8 +440,8 @@ function requireNative() {
425
440
  try {
426
441
  const binding = require('@earthmover/icechunk-linux-ppc64-gnu')
427
442
  const bindingPackageVersion = require('@earthmover/icechunk-linux-ppc64-gnu/package.json').version
428
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
443
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
444
+ 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
445
  }
431
446
  return binding
432
447
  } catch (e) {
@@ -441,8 +456,8 @@ function requireNative() {
441
456
  try {
442
457
  const binding = require('@earthmover/icechunk-linux-s390x-gnu')
443
458
  const bindingPackageVersion = require('@earthmover/icechunk-linux-s390x-gnu/package.json').version
444
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
459
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
460
+ 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
461
  }
447
462
  return binding
448
463
  } catch (e) {
@@ -461,8 +476,8 @@ function requireNative() {
461
476
  try {
462
477
  const binding = require('@earthmover/icechunk-openharmony-arm64')
463
478
  const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm64/package.json').version
464
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
479
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
480
+ 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
481
  }
467
482
  return binding
468
483
  } catch (e) {
@@ -477,8 +492,8 @@ function requireNative() {
477
492
  try {
478
493
  const binding = require('@earthmover/icechunk-openharmony-x64')
479
494
  const bindingPackageVersion = require('@earthmover/icechunk-openharmony-x64/package.json').version
480
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
495
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
496
+ 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
497
  }
483
498
  return binding
484
499
  } catch (e) {
@@ -493,8 +508,8 @@ function requireNative() {
493
508
  try {
494
509
  const binding = require('@earthmover/icechunk-openharmony-arm')
495
510
  const bindingPackageVersion = require('@earthmover/icechunk-openharmony-arm/package.json').version
496
- if (bindingPackageVersion !== '2.0.0-alpha.11' && 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.11 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
511
+ if (bindingPackageVersion !== '2.0.0-alpha.13' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
512
+ 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
513
  }
499
514
  return binding
500
515
  } catch (e) {
@@ -521,13 +536,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
521
536
  wasiBindingError = err
522
537
  }
523
538
  }
524
- if (!nativeBinding) {
539
+ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
525
540
  try {
526
541
  wasiBinding = require('@earthmover/icechunk-wasm32-wasi')
527
542
  nativeBinding = wasiBinding
528
543
  } catch (err) {
529
544
  if (process.env.NAPI_RS_FORCE_WASI) {
530
- wasiBindingError.cause = err
545
+ if (!wasiBindingError) {
546
+ wasiBindingError = err
547
+ } else {
548
+ wasiBindingError.cause = err
549
+ }
531
550
  loadErrors.push(err)
532
551
  }
533
552
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earthmover/icechunk",
3
- "version": "2.0.0-alpha.12",
3
+ "version": "2.0.0-alpha.14",
4
4
  "description": "JavaScript/TypeScript bindings for Icechunk",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -26,14 +26,14 @@
26
26
  },
27
27
  "./fetch-storage": {
28
28
  "types": "./fetch-storage.d.ts",
29
- "default": "./fetch-storage.js"
29
+ "default": "./fetch-storage.mjs"
30
30
  }
31
31
  },
32
32
  "files": [
33
33
  "index.d.ts",
34
34
  "index.js",
35
35
  "browser.js",
36
- "fetch-storage.js",
36
+ "fetch-storage.mjs",
37
37
  "fetch-storage.d.ts"
38
38
  ],
39
39
  "napi": {
@@ -84,7 +84,8 @@
84
84
  "oxlint": "^1.14.0",
85
85
  "prettier": "^3.6.2",
86
86
  "tinybench": "^6.0.0",
87
- "typescript": "^5.9.2"
87
+ "typescript": "^5.9.2",
88
+ "zarrita": "^0.6.2"
88
89
  },
89
90
  "lint-staged": {
90
91
  "*.@(js|ts|tsx)": [
@@ -120,9 +121,9 @@
120
121
  },
121
122
  "packageManager": "yarn@4.12.0",
122
123
  "optionalDependencies": {
123
- "@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.12",
124
- "@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.12",
125
- "@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.12",
126
- "@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.12"
124
+ "@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.14",
125
+ "@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.14",
126
+ "@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.14",
127
+ "@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.14"
127
128
  }
128
129
  }