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

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
@@ -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
  ```
@@ -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,130 @@
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
+ const { Storage } = require('@earthmover/icechunk')
13
+
14
+ /**
15
+ * @param {string} baseUrl - Base URL of the icechunk repository (no trailing slash)
16
+ * @returns {Storage}
17
+ */
18
+ 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
+ // 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
63
+ const url = new URL(base)
64
+ const keyPrefix = url.pathname.replace(/^\//, '') + '/' + prefix
65
+ const listUrl = `${url.origin}/?list-type=2&prefix=${encodeURIComponent(keyPrefix)}`
66
+
67
+ const resp = await fetch(listUrl)
68
+ throwForStatus(resp, listUrl)
69
+
70
+ const xml = await resp.text()
71
+ const results = []
72
+ const contentRegex = /<Contents>([\s\S]*?)<\/Contents>/g
73
+ let match
74
+ while ((match = contentRegex.exec(xml)) !== null) {
75
+ const block = match[1]
76
+ const key = block.match(/<Key>(.*?)<\/Key>/)?.[1]
77
+ const lastModified = block.match(/<LastModified>(.*?)<\/LastModified>/)?.[1]
78
+ const size = block.match(/<Size>(.*?)<\/Size>/)?.[1]
79
+ if (key && lastModified && size) {
80
+ const id = key.startsWith(keyPrefix) ? key.slice(keyPrefix.length) : key
81
+ results.push({
82
+ id,
83
+ createdAt: new Date(lastModified),
84
+ sizeBytes: Number(size),
85
+ })
86
+ }
87
+ }
88
+
89
+ return results
90
+ },
91
+
92
+ deleteBatch: async () => {
93
+ throw new Error('Read-only storage: deleteBatch not supported')
94
+ },
95
+
96
+ getObjectLastModified: async (_err, path) => {
97
+ const url = `${base}/${path}`
98
+ const resp = await fetch(url, { method: 'HEAD' })
99
+ throwForStatus(resp, url)
100
+ const lastModified = resp.headers.get('last-modified')
101
+ if (!lastModified) {
102
+ throw new Error(`No Last-Modified header: ${url}`)
103
+ }
104
+ return new Date(lastModified)
105
+ },
106
+
107
+ getObjectConditional: async (_err, { path, previousVersion }) => {
108
+ const url = `${base}/${path}`
109
+ const headers = {}
110
+
111
+ if (previousVersion?.etag) {
112
+ headers['If-None-Match'] = previousVersion.etag
113
+ }
114
+
115
+ const resp = await fetch(url, { headers })
116
+
117
+ if (resp.status === 304) {
118
+ return { kind: 'on_latest_version' }
119
+ }
120
+
121
+ throwForStatus(resp, url)
122
+
123
+ const data = new Uint8Array(await resp.arrayBuffer())
124
+ const etag = resp.headers.get('etag') ?? undefined
125
+ return { kind: 'modified', data, newVersion: { etag } }
126
+ },
127
+ })
128
+ }
129
+
130
+ module.exports = { createFetchStorage }
package/index.d.ts CHANGED
@@ -12,6 +12,24 @@ export declare class Repository {
12
12
  listTags(): Promise<Array<string>>
13
13
  createTag(name: string, snapshotId: string): Promise<void>
14
14
  lookupManifestFiles(snapshotId: string): Promise<Array<JsManifestFileInfo>>
15
+ lookupBranch(branch: string): Promise<string>
16
+ resetBranch(branch: string, toSnapshotId: string, fromSnapshotId?: string | undefined | null): Promise<void>
17
+ deleteBranch(branch: string): Promise<void>
18
+ lookupTag(tag: string): Promise<string>
19
+ deleteTag(tag: string): Promise<void>
20
+ lookupSnapshot(snapshotId: string): Promise<SnapshotInfo>
21
+ static fetchSpecVersion(storage: JsStorage, storageSettings?: StorageSettings | undefined | null): Promise<number | null>
22
+ static fetchConfig(storage: JsStorage): Promise<RepositoryConfig | null>
23
+ saveConfig(): Promise<void>
24
+ get config(): RepositoryConfig
25
+ get specVersion(): number
26
+ diff(options: DiffOptions): Promise<DiffResult>
27
+ featureFlags(): Promise<Array<FeatureFlag>>
28
+ enabledFeatureFlags(): Promise<Array<FeatureFlag>>
29
+ disabledFeatureFlags(): Promise<Array<FeatureFlag>>
30
+ setFeatureFlag(name: string, setting?: boolean | undefined | null): Promise<void>
31
+ rearrangeSession(branch: string): Promise<JsSession>
32
+ ancestry(options: VersionOptions): Promise<Array<SnapshotInfo>>
15
33
  }
16
34
  export type JsRepository = Repository
17
35
 
@@ -23,11 +41,44 @@ export declare class Session {
23
41
  get store(): JsStore
24
42
  commit(message: string): Promise<string>
25
43
  discardChanges(): Promise<void>
44
+ get isFork(): boolean
45
+ get mode(): string
46
+ get config(): RepositoryConfig
47
+ status(): Promise<DiffResult>
48
+ moveNode(fromPath: string, toPath: string): Promise<void>
49
+ getNodeId(path: string): Promise<string>
50
+ merge(other: Session): Promise<void>
51
+ amend(message: string): Promise<string>
52
+ flush(message: string): Promise<string>
53
+ rebase(): Promise<void>
54
+ /** Get all virtual chunk locations referenced by this session */
55
+ allVirtualChunkLocations(): Promise<Array<string>>
26
56
  }
27
57
  export type JsSession = Session
28
58
 
29
59
  export declare class Storage {
30
60
  static newInMemory(): Promise<Storage>
61
+ /**
62
+ * Create a Storage backed by a JS object implementing the StorageBackend interface.
63
+ *
64
+ * This allows providing a custom storage implementation using JS libraries
65
+ * (fetch, @aws-sdk/client-s3, @google-cloud/storage, etc.), which is
66
+ * especially useful for WASM builds where native Rust networking is unavailable.
67
+ */
68
+ 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
31
82
  }
32
83
  export type JsStorage = Storage
33
84
 
@@ -43,9 +94,40 @@ export declare class Store {
43
94
  get supportsWrites(): boolean
44
95
  get supportsDeletes(): boolean
45
96
  get supportsListing(): boolean
97
+ get readOnly(): Promise<boolean>
98
+ get session(): Session
99
+ isEmpty(prefix: string): Promise<boolean>
100
+ clear(): Promise<void>
101
+ setIfNotExists(key: string, value: Buffer): Promise<void>
102
+ deleteDir(prefix: string): Promise<void>
103
+ getsize(key: string): Promise<number>
104
+ 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>
46
117
  }
47
118
  export type JsStore = Store
48
119
 
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
+
49
131
  /** Caching configuration */
50
132
  export interface CachingConfig {
51
133
  numSnapshotNodes?: number
@@ -66,19 +148,109 @@ export interface CompressionConfig {
66
148
  level?: number
67
149
  }
68
150
 
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
+ export interface DiffOptions {
158
+ fromBranch?: string
159
+ fromTag?: string
160
+ fromSnapshotId?: string
161
+ toBranch?: string
162
+ toTag?: string
163
+ toSnapshotId?: string
164
+ }
165
+
166
+ export interface DiffResult {
167
+ newGroups: Array<string>
168
+ newArrays: Array<string>
169
+ deletedGroups: Array<string>
170
+ deletedArrays: Array<string>
171
+ updatedGroups: Array<string>
172
+ updatedArrays: Array<string>
173
+ updatedChunks: any
174
+ movedNodes: Array<JsMovedNode>
175
+ }
176
+
177
+ export interface FeatureFlag {
178
+ id: number
179
+ name: string
180
+ defaultEnabled: boolean
181
+ setting?: boolean
182
+ enabled: boolean
183
+ }
184
+
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
+
69
204
  export interface ManifestFileInfo {
70
205
  id: string
71
206
  sizeBytes: number
72
207
  numChunkRefs: number
73
208
  }
74
209
 
210
+ export interface MovedNode {
211
+ from: string
212
+ to: string
213
+ }
214
+
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 }
225
+
75
226
  export interface ReadonlySessionOptions {
76
227
  branch?: string
77
228
  tag?: string
78
229
  snapshotId?: string
79
230
  }
80
231
 
81
- /** Repository configuration (WASM build — no virtual chunk support) */
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
+ */
82
254
  export interface RepositoryConfig {
83
255
  inlineChunkThresholdBytes?: number
84
256
  getPartialValuesConcurrency?: number
@@ -91,6 +263,41 @@ export interface RepositoryConfig {
91
263
  * The object is deserialized using serde, matching the Rust ManifestConfig structure.
92
264
  */
93
265
  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
+ }
294
+
295
+ export interface SnapshotInfo {
296
+ id: string
297
+ parentId?: string
298
+ writtenAt: string
299
+ message: string
300
+ metadata: any
94
301
  }
95
302
 
96
303
  /** Storage concurrency settings */
@@ -99,6 +306,81 @@ export interface StorageConcurrencySettings {
99
306
  idealConcurrentRequestSize?: number
100
307
  }
101
308
 
309
+ /** Arguments for copy_object callback */
310
+ export interface StorageCopyObjectArgs {
311
+ from: string
312
+ to: string
313
+ contentType?: string
314
+ version: StorageVersionInfo
315
+ }
316
+
317
+ /** Arguments for delete_batch callback */
318
+ export interface StorageDeleteBatchArgs {
319
+ prefix: string
320
+ batch: Array<StorageDeleteItem>
321
+ }
322
+
323
+ /** An item in a delete_batch call */
324
+ export interface StorageDeleteItem {
325
+ id: string
326
+ size: number
327
+ }
328
+
329
+ /** Result of a delete_batch call from JS */
330
+ export interface StorageDeleteObjectsResult {
331
+ deletedObjects: number
332
+ deletedBytes: number
333
+ }
334
+
335
+ /** Result of a get_object_conditional call from JS */
336
+ export interface StorageGetModifiedResult {
337
+ /** "modified" or "on_latest_version" */
338
+ kind: string
339
+ data?: Buffer
340
+ newVersion?: StorageVersionInfo
341
+ }
342
+
343
+ /** Arguments for get_object_conditional callback */
344
+ export interface StorageGetObjectConditionalArgs {
345
+ path: string
346
+ previousVersion?: StorageVersionInfo
347
+ }
348
+
349
+ /** Arguments for get_object_range callback */
350
+ export interface StorageGetObjectRangeArgs {
351
+ path: string
352
+ rangeStart?: number
353
+ rangeEnd?: number
354
+ }
355
+
356
+ /** Result of a get_object_range call from JS */
357
+ export interface StorageGetObjectResponse {
358
+ data: Buffer
359
+ version: StorageVersionInfo
360
+ }
361
+
362
+ /** A key-value pair for object metadata */
363
+ export interface StorageKeyValue {
364
+ key: string
365
+ value: string
366
+ }
367
+
368
+ /** Entry in a list_objects result from JS */
369
+ export interface StorageListInfo {
370
+ id: string
371
+ createdAt: Date
372
+ sizeBytes: number
373
+ }
374
+
375
+ /** Arguments for put_object callback */
376
+ export interface StoragePutObjectArgs {
377
+ path: string
378
+ data: Buffer
379
+ contentType?: string
380
+ metadata: Array<StorageKeyValue>
381
+ previousVersion?: StorageVersionInfo
382
+ }
383
+
102
384
  /** Storage retries settings */
103
385
  export interface StorageRetriesSettings {
104
386
  maxTries?: number
@@ -110,6 +392,7 @@ export interface StorageRetriesSettings {
110
392
  export interface StorageSettings {
111
393
  concurrency?: StorageConcurrencySettings
112
394
  retries?: StorageRetriesSettings
395
+ timeouts?: StorageTimeoutSettings
113
396
  unsafeUseConditionalUpdate?: boolean
114
397
  unsafeUseConditionalCreate?: boolean
115
398
  unsafeUseMetadata?: boolean
@@ -118,3 +401,48 @@ export interface StorageSettings {
118
401
  chunksStorageClass?: string
119
402
  minimumSizeForMultipartUpload?: number
120
403
  }
404
+
405
+ /** Storage timeout settings */
406
+ export interface StorageTimeoutSettings {
407
+ connectTimeoutMs?: number
408
+ readTimeoutMs?: number
409
+ operationTimeoutMs?: number
410
+ operationAttemptTimeoutMs?: number
411
+ }
412
+
413
+ /** Result of a put_object or copy_object call from JS */
414
+ export interface StorageVersionedUpdateResult {
415
+ /** "updated" or "not_on_latest_version" */
416
+ kind: string
417
+ newVersion?: StorageVersionInfo
418
+ }
419
+
420
+ /** Version information returned from JS storage callbacks */
421
+ export interface StorageVersionInfo {
422
+ etag?: string
423
+ generation?: string
424
+ }
425
+
426
+ export interface VersionOptions {
427
+ branch?: string
428
+ tag?: string
429
+ snapshotId?: string
430
+ }
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
@@ -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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.6' && 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.6 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
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.`)
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.10",
3
+ "version": "2.0.0-alpha.12",
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.js"
30
+ }
31
+ },
22
32
  "files": [
23
33
  "index.d.ts",
24
34
  "index.js",
25
- "browser.js"
35
+ "browser.js",
36
+ "fetch-storage.js",
37
+ "fetch-storage.d.ts"
26
38
  ],
27
39
  "napi": {
28
40
  "binaryName": "icechunk",
@@ -108,9 +120,9 @@
108
120
  },
109
121
  "packageManager": "yarn@4.12.0",
110
122
  "optionalDependencies": {
111
- "@earthmover/icechunk-win32-x64-msvc": "2.0.0-alpha.10",
112
- "@earthmover/icechunk-linux-x64-gnu": "2.0.0-alpha.10",
113
- "@earthmover/icechunk-darwin-arm64": "2.0.0-alpha.10",
114
- "@earthmover/icechunk-wasm32-wasi": "2.0.0-alpha.10"
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"
115
127
  }
116
128
  }