icechunk-js 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +32 -10
- package/dist/index.cjs +368 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +368 -57
- package/dist/index.js.map +1 -1
- package/package.json +18 -10
package/dist/index.d.cts
CHANGED
|
@@ -200,8 +200,10 @@ interface ManifestRef {
|
|
|
200
200
|
interface DimensionShape {
|
|
201
201
|
/** Length of the array along this dimension */
|
|
202
202
|
arrayLength: number;
|
|
203
|
-
/** Chunk size along this dimension */
|
|
203
|
+
/** Chunk size along this dimension (v1 format; approximate in v2) */
|
|
204
204
|
chunkLength: number;
|
|
205
|
+
/** Number of chunks along this dimension (v2 format) */
|
|
206
|
+
numChunks?: number;
|
|
205
207
|
}
|
|
206
208
|
/** Group node data (empty - just a marker) */
|
|
207
209
|
interface GroupNodeData {
|
|
@@ -514,7 +516,7 @@ interface IcechunkStoreOptions {
|
|
|
514
516
|
* import { open, get } from 'zarrita';
|
|
515
517
|
*
|
|
516
518
|
* const store = await IcechunkStore.open('https://bucket.s3.amazonaws.com/repo');
|
|
517
|
-
* const array = await open(store, { kind: 'array'
|
|
519
|
+
* const array = await open(store.resolve('/temperature'), { kind: 'array' });
|
|
518
520
|
* const data = await get(array, [0, 0, null]);
|
|
519
521
|
* ```
|
|
520
522
|
*/
|
|
@@ -689,7 +691,7 @@ declare class Repository {
|
|
|
689
691
|
* version has the highest filename. Deletion tombstones are checked.
|
|
690
692
|
*
|
|
691
693
|
* When listing is not supported (e.g., HTTP storage), only the legacy
|
|
692
|
-
* ref.json path is
|
|
694
|
+
* ref.json path is returned (caller must handle NotFoundError on read).
|
|
693
695
|
*
|
|
694
696
|
* @param dirPrefix - Directory prefix to search
|
|
695
697
|
* @param legacyPath - Optional legacy ref.json path to try if listing fails
|
|
@@ -698,7 +700,9 @@ declare class Repository {
|
|
|
698
700
|
/**
|
|
699
701
|
* List all branches in the repository.
|
|
700
702
|
*
|
|
701
|
-
*
|
|
703
|
+
* Unlike tags, branches in icechunk v1 have no tombstone mechanism —
|
|
704
|
+
* deletion removes the ref file outright. A branch is present iff it has
|
|
705
|
+
* at least one ref file in its directory.
|
|
702
706
|
*
|
|
703
707
|
* @returns Array of branch names
|
|
704
708
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -200,8 +200,10 @@ interface ManifestRef {
|
|
|
200
200
|
interface DimensionShape {
|
|
201
201
|
/** Length of the array along this dimension */
|
|
202
202
|
arrayLength: number;
|
|
203
|
-
/** Chunk size along this dimension */
|
|
203
|
+
/** Chunk size along this dimension (v1 format; approximate in v2) */
|
|
204
204
|
chunkLength: number;
|
|
205
|
+
/** Number of chunks along this dimension (v2 format) */
|
|
206
|
+
numChunks?: number;
|
|
205
207
|
}
|
|
206
208
|
/** Group node data (empty - just a marker) */
|
|
207
209
|
interface GroupNodeData {
|
|
@@ -514,7 +516,7 @@ interface IcechunkStoreOptions {
|
|
|
514
516
|
* import { open, get } from 'zarrita';
|
|
515
517
|
*
|
|
516
518
|
* const store = await IcechunkStore.open('https://bucket.s3.amazonaws.com/repo');
|
|
517
|
-
* const array = await open(store, { kind: 'array'
|
|
519
|
+
* const array = await open(store.resolve('/temperature'), { kind: 'array' });
|
|
518
520
|
* const data = await get(array, [0, 0, null]);
|
|
519
521
|
* ```
|
|
520
522
|
*/
|
|
@@ -689,7 +691,7 @@ declare class Repository {
|
|
|
689
691
|
* version has the highest filename. Deletion tombstones are checked.
|
|
690
692
|
*
|
|
691
693
|
* When listing is not supported (e.g., HTTP storage), only the legacy
|
|
692
|
-
* ref.json path is
|
|
694
|
+
* ref.json path is returned (caller must handle NotFoundError on read).
|
|
693
695
|
*
|
|
694
696
|
* @param dirPrefix - Directory prefix to search
|
|
695
697
|
* @param legacyPath - Optional legacy ref.json path to try if listing fails
|
|
@@ -698,7 +700,9 @@ declare class Repository {
|
|
|
698
700
|
/**
|
|
699
701
|
* List all branches in the repository.
|
|
700
702
|
*
|
|
701
|
-
*
|
|
703
|
+
* Unlike tags, branches in icechunk v1 have no tombstone mechanism —
|
|
704
|
+
* deletion removes the ref file outright. A branch is present iff it has
|
|
705
|
+
* at least one ref file in its directory.
|
|
702
706
|
*
|
|
703
707
|
* @returns Array of branch names
|
|
704
708
|
*/
|
package/dist/index.js
CHANGED
|
@@ -439,6 +439,70 @@ var Repo = class _Repo {
|
|
|
439
439
|
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
440
440
|
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
441
441
|
}
|
|
442
|
+
config(index) {
|
|
443
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
444
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
445
|
+
}
|
|
446
|
+
configLength() {
|
|
447
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
448
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
449
|
+
}
|
|
450
|
+
configArray() {
|
|
451
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
452
|
+
return offset ? new Uint8Array(
|
|
453
|
+
this.bb.bytes().buffer,
|
|
454
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
455
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
456
|
+
) : null;
|
|
457
|
+
}
|
|
458
|
+
enabledFeatureFlags(index) {
|
|
459
|
+
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
460
|
+
return offset ? this.bb.readUint16(this.bb.__vector(this.bb_pos + offset) + index * 2) : 0;
|
|
461
|
+
}
|
|
462
|
+
enabledFeatureFlagsLength() {
|
|
463
|
+
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
464
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
465
|
+
}
|
|
466
|
+
enabledFeatureFlagsArray() {
|
|
467
|
+
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
468
|
+
return offset ? new Uint16Array(
|
|
469
|
+
this.bb.bytes().buffer,
|
|
470
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
471
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
472
|
+
) : null;
|
|
473
|
+
}
|
|
474
|
+
disabledFeatureFlags(index) {
|
|
475
|
+
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
476
|
+
return offset ? this.bb.readUint16(this.bb.__vector(this.bb_pos + offset) + index * 2) : 0;
|
|
477
|
+
}
|
|
478
|
+
disabledFeatureFlagsLength() {
|
|
479
|
+
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
480
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
481
|
+
}
|
|
482
|
+
disabledFeatureFlagsArray() {
|
|
483
|
+
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
484
|
+
return offset ? new Uint16Array(
|
|
485
|
+
this.bb.bytes().buffer,
|
|
486
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
487
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
488
|
+
) : null;
|
|
489
|
+
}
|
|
490
|
+
extra(index) {
|
|
491
|
+
const offset = this.bb.__offset(this.bb_pos, 28);
|
|
492
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
493
|
+
}
|
|
494
|
+
extraLength() {
|
|
495
|
+
const offset = this.bb.__offset(this.bb_pos, 28);
|
|
496
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
497
|
+
}
|
|
498
|
+
extraArray() {
|
|
499
|
+
const offset = this.bb.__offset(this.bb_pos, 28);
|
|
500
|
+
return offset ? new Uint8Array(
|
|
501
|
+
this.bb.bytes().buffer,
|
|
502
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
503
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
504
|
+
) : null;
|
|
505
|
+
}
|
|
442
506
|
};
|
|
443
507
|
|
|
444
508
|
// src/format/flatbuffers/repo-parser.ts
|
|
@@ -752,6 +816,51 @@ var ManifestFileInfo = class {
|
|
|
752
816
|
}
|
|
753
817
|
};
|
|
754
818
|
|
|
819
|
+
// src/format/flatbuffers/generated/manifest-file-info-v2.ts
|
|
820
|
+
var ManifestFileInfoV2 = class _ManifestFileInfoV2 {
|
|
821
|
+
bb = null;
|
|
822
|
+
bb_pos = 0;
|
|
823
|
+
__init(i, bb) {
|
|
824
|
+
this.bb_pos = i;
|
|
825
|
+
this.bb = bb;
|
|
826
|
+
return this;
|
|
827
|
+
}
|
|
828
|
+
static getRootAsManifestFileInfoV2(bb, obj) {
|
|
829
|
+
return (obj || new _ManifestFileInfoV2()).__init(
|
|
830
|
+
bb.readInt32(bb.position()) + bb.position(),
|
|
831
|
+
bb
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
id(obj) {
|
|
835
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
836
|
+
return offset ? (obj || new ObjectId12()).__init(this.bb_pos + offset, this.bb) : null;
|
|
837
|
+
}
|
|
838
|
+
sizeBytes() {
|
|
839
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
840
|
+
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt("0");
|
|
841
|
+
}
|
|
842
|
+
numChunkRefs() {
|
|
843
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
844
|
+
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
845
|
+
}
|
|
846
|
+
extra(index) {
|
|
847
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
848
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
849
|
+
}
|
|
850
|
+
extraLength() {
|
|
851
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
852
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
853
|
+
}
|
|
854
|
+
extraArray() {
|
|
855
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
856
|
+
return offset ? new Uint8Array(
|
|
857
|
+
this.bb.bytes().buffer,
|
|
858
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
859
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
860
|
+
) : null;
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
|
|
755
864
|
// src/format/flatbuffers/generated/dimension-name.ts
|
|
756
865
|
var DimensionName = class _DimensionName {
|
|
757
866
|
bb = null;
|
|
@@ -793,6 +902,31 @@ var DimensionShape = class {
|
|
|
793
902
|
}
|
|
794
903
|
};
|
|
795
904
|
|
|
905
|
+
// src/format/flatbuffers/generated/dimension-shape-v2.ts
|
|
906
|
+
var DimensionShapeV2 = class _DimensionShapeV2 {
|
|
907
|
+
bb = null;
|
|
908
|
+
bb_pos = 0;
|
|
909
|
+
__init(i, bb) {
|
|
910
|
+
this.bb_pos = i;
|
|
911
|
+
this.bb = bb;
|
|
912
|
+
return this;
|
|
913
|
+
}
|
|
914
|
+
static getRootAsDimensionShapeV2(bb, obj) {
|
|
915
|
+
return (obj || new _DimensionShapeV2()).__init(
|
|
916
|
+
bb.readInt32(bb.position()) + bb.position(),
|
|
917
|
+
bb
|
|
918
|
+
);
|
|
919
|
+
}
|
|
920
|
+
arrayLength() {
|
|
921
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
922
|
+
return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt("0");
|
|
923
|
+
}
|
|
924
|
+
numChunks() {
|
|
925
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
926
|
+
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
|
|
796
930
|
// src/format/flatbuffers/generated/chunk-index-range.ts
|
|
797
931
|
var ChunkIndexRange = class {
|
|
798
932
|
bb = null;
|
|
@@ -897,6 +1031,19 @@ var ArrayNodeData = class _ArrayNodeData {
|
|
|
897
1031
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
898
1032
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
899
1033
|
}
|
|
1034
|
+
shapeV2(index, obj) {
|
|
1035
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
1036
|
+
return offset ? (obj || new DimensionShapeV2()).__init(
|
|
1037
|
+
this.bb.__indirect(
|
|
1038
|
+
this.bb.__vector(this.bb_pos + offset) + index * 4
|
|
1039
|
+
),
|
|
1040
|
+
this.bb
|
|
1041
|
+
) : null;
|
|
1042
|
+
}
|
|
1043
|
+
shapeV2Length() {
|
|
1044
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
1045
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1046
|
+
}
|
|
900
1047
|
};
|
|
901
1048
|
|
|
902
1049
|
// src/format/flatbuffers/generated/object-id8.ts
|
|
@@ -963,6 +1110,22 @@ var NodeSnapshot = class _NodeSnapshot {
|
|
|
963
1110
|
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
964
1111
|
return offset ? this.bb.__union(obj, this.bb_pos + offset) : null;
|
|
965
1112
|
}
|
|
1113
|
+
extra(index) {
|
|
1114
|
+
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
1115
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1116
|
+
}
|
|
1117
|
+
extraLength() {
|
|
1118
|
+
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
1119
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1120
|
+
}
|
|
1121
|
+
extraArray() {
|
|
1122
|
+
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
1123
|
+
return offset ? new Uint8Array(
|
|
1124
|
+
this.bb.bytes().buffer,
|
|
1125
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1126
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1127
|
+
) : null;
|
|
1128
|
+
}
|
|
966
1129
|
};
|
|
967
1130
|
|
|
968
1131
|
// src/format/flatbuffers/generated/snapshot.ts
|
|
@@ -1033,6 +1196,35 @@ var Snapshot = class _Snapshot {
|
|
|
1033
1196
|
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
1034
1197
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1035
1198
|
}
|
|
1199
|
+
manifestFilesV2(index, obj) {
|
|
1200
|
+
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
1201
|
+
return offset ? (obj || new ManifestFileInfoV2()).__init(
|
|
1202
|
+
this.bb.__indirect(
|
|
1203
|
+
this.bb.__vector(this.bb_pos + offset) + index * 4
|
|
1204
|
+
),
|
|
1205
|
+
this.bb
|
|
1206
|
+
) : null;
|
|
1207
|
+
}
|
|
1208
|
+
manifestFilesV2Length() {
|
|
1209
|
+
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
1210
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1211
|
+
}
|
|
1212
|
+
extra(index) {
|
|
1213
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1214
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1215
|
+
}
|
|
1216
|
+
extraLength() {
|
|
1217
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1218
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1219
|
+
}
|
|
1220
|
+
extraArray() {
|
|
1221
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1222
|
+
return offset ? new Uint8Array(
|
|
1223
|
+
this.bb.bytes().buffer,
|
|
1224
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1225
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1226
|
+
) : null;
|
|
1227
|
+
}
|
|
1036
1228
|
};
|
|
1037
1229
|
|
|
1038
1230
|
// src/format/flatbuffers/snapshot-parser.ts
|
|
@@ -1072,18 +1264,34 @@ function parseSnapshot(data) {
|
|
|
1072
1264
|
}
|
|
1073
1265
|
}
|
|
1074
1266
|
}
|
|
1075
|
-
const manifestFilesLength = fbsSnapshot.manifestFilesLength();
|
|
1076
1267
|
const manifestFiles = [];
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1268
|
+
const v2Length = fbsSnapshot.manifestFilesV2Length();
|
|
1269
|
+
if (v2Length > 0) {
|
|
1270
|
+
for (let i = 0; i < v2Length; i++) {
|
|
1271
|
+
const fbsMfi = fbsSnapshot.manifestFilesV2(i);
|
|
1272
|
+
if (fbsMfi) {
|
|
1273
|
+
const mfiIdObj = fbsMfi.id();
|
|
1274
|
+
if (!mfiIdObj) throw new Error("ManifestFileInfoV2 missing id");
|
|
1275
|
+
manifestFiles.push({
|
|
1276
|
+
id: asObjectId12(readId12(mfiIdObj.bb, mfiIdObj.bb_pos)),
|
|
1277
|
+
sizeBytes: Number(fbsMfi.sizeBytes()),
|
|
1278
|
+
numChunkRefs: fbsMfi.numChunkRefs()
|
|
1279
|
+
});
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
} else {
|
|
1283
|
+
const v1Length = fbsSnapshot.manifestFilesLength();
|
|
1284
|
+
for (let i = 0; i < v1Length; i++) {
|
|
1285
|
+
const fbsMfi = fbsSnapshot.manifestFiles(i);
|
|
1286
|
+
if (fbsMfi) {
|
|
1287
|
+
const mfiIdObj = fbsMfi.id();
|
|
1288
|
+
if (!mfiIdObj) throw new Error("ManifestFileInfo missing id");
|
|
1289
|
+
manifestFiles.push({
|
|
1290
|
+
id: asObjectId12(readId12(mfiIdObj.bb, mfiIdObj.bb_pos)),
|
|
1291
|
+
sizeBytes: Number(fbsMfi.sizeBytes()),
|
|
1292
|
+
numChunkRefs: fbsMfi.numChunkRefs()
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1087
1295
|
}
|
|
1088
1296
|
}
|
|
1089
1297
|
return {
|
|
@@ -1120,15 +1328,31 @@ function parseNodeData(fbsNode, unionType) {
|
|
|
1120
1328
|
throw new Error(`Unknown node data union type: ${unionType}`);
|
|
1121
1329
|
}
|
|
1122
1330
|
function parseArrayNodeData(fbsArray) {
|
|
1123
|
-
const shapeLength = fbsArray.shapeLength();
|
|
1124
1331
|
const shape = [];
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1332
|
+
const shapeV2Length = fbsArray.shapeV2Length();
|
|
1333
|
+
if (shapeV2Length > 0) {
|
|
1334
|
+
for (let i = 0; i < shapeV2Length; i++) {
|
|
1335
|
+
const fbsShape = fbsArray.shapeV2(i);
|
|
1336
|
+
if (fbsShape) {
|
|
1337
|
+
const arrayLength = Number(fbsShape.arrayLength());
|
|
1338
|
+
const numChunks = fbsShape.numChunks();
|
|
1339
|
+
shape.push({
|
|
1340
|
+
arrayLength,
|
|
1341
|
+
chunkLength: numChunks > 0 ? Math.ceil(arrayLength / numChunks) : 0,
|
|
1342
|
+
numChunks
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
} else {
|
|
1347
|
+
const shapeLength = fbsArray.shapeLength();
|
|
1348
|
+
for (let i = 0; i < shapeLength; i++) {
|
|
1349
|
+
const fbsShape = fbsArray.shape(i);
|
|
1350
|
+
if (fbsShape) {
|
|
1351
|
+
shape.push({
|
|
1352
|
+
arrayLength: Number(fbsShape.arrayLength()),
|
|
1353
|
+
chunkLength: Number(fbsShape.chunkLength())
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1132
1356
|
}
|
|
1133
1357
|
}
|
|
1134
1358
|
const dimNamesLength = fbsArray.dimensionNamesLength();
|
|
@@ -1245,6 +1469,38 @@ var ChunkRef = class _ChunkRef {
|
|
|
1245
1469
|
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
1246
1470
|
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
1247
1471
|
}
|
|
1472
|
+
compressedLocation(index) {
|
|
1473
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1474
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1475
|
+
}
|
|
1476
|
+
compressedLocationLength() {
|
|
1477
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1478
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1479
|
+
}
|
|
1480
|
+
compressedLocationArray() {
|
|
1481
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1482
|
+
return offset ? new Uint8Array(
|
|
1483
|
+
this.bb.bytes().buffer,
|
|
1484
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1485
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1486
|
+
) : null;
|
|
1487
|
+
}
|
|
1488
|
+
extra(index) {
|
|
1489
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
1490
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1491
|
+
}
|
|
1492
|
+
extraLength() {
|
|
1493
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
1494
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1495
|
+
}
|
|
1496
|
+
extraArray() {
|
|
1497
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
1498
|
+
return offset ? new Uint8Array(
|
|
1499
|
+
this.bb.bytes().buffer,
|
|
1500
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1501
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1502
|
+
) : null;
|
|
1503
|
+
}
|
|
1248
1504
|
};
|
|
1249
1505
|
|
|
1250
1506
|
// src/format/flatbuffers/generated/array-manifest.ts
|
|
@@ -1279,6 +1535,22 @@ var ArrayManifest = class _ArrayManifest {
|
|
|
1279
1535
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
1280
1536
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1281
1537
|
}
|
|
1538
|
+
extra(index) {
|
|
1539
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1540
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1541
|
+
}
|
|
1542
|
+
extraLength() {
|
|
1543
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1544
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1545
|
+
}
|
|
1546
|
+
extraArray() {
|
|
1547
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1548
|
+
return offset ? new Uint8Array(
|
|
1549
|
+
this.bb.bytes().buffer,
|
|
1550
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1551
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1552
|
+
) : null;
|
|
1553
|
+
}
|
|
1282
1554
|
};
|
|
1283
1555
|
|
|
1284
1556
|
// src/format/flatbuffers/generated/manifest.ts
|
|
@@ -1313,6 +1585,42 @@ var Manifest = class _Manifest {
|
|
|
1313
1585
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
1314
1586
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1315
1587
|
}
|
|
1588
|
+
locationDictionary(index) {
|
|
1589
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1590
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1591
|
+
}
|
|
1592
|
+
locationDictionaryLength() {
|
|
1593
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1594
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1595
|
+
}
|
|
1596
|
+
locationDictionaryArray() {
|
|
1597
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1598
|
+
return offset ? new Uint8Array(
|
|
1599
|
+
this.bb.bytes().buffer,
|
|
1600
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1601
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1602
|
+
) : null;
|
|
1603
|
+
}
|
|
1604
|
+
compressionAlgorithm() {
|
|
1605
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
1606
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 1;
|
|
1607
|
+
}
|
|
1608
|
+
extra(index) {
|
|
1609
|
+
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
1610
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1611
|
+
}
|
|
1612
|
+
extraLength() {
|
|
1613
|
+
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
1614
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1615
|
+
}
|
|
1616
|
+
extraArray() {
|
|
1617
|
+
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
1618
|
+
return offset ? new Uint8Array(
|
|
1619
|
+
this.bb.bytes().buffer,
|
|
1620
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
1621
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
1622
|
+
) : null;
|
|
1623
|
+
}
|
|
1316
1624
|
};
|
|
1317
1625
|
|
|
1318
1626
|
// src/format/flatbuffers/manifest-parser.ts
|
|
@@ -1564,6 +1872,14 @@ var MoveOperation = class _MoveOperation {
|
|
|
1564
1872
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
1565
1873
|
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
1566
1874
|
}
|
|
1875
|
+
nodeId(obj) {
|
|
1876
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
1877
|
+
return offset ? (obj || new ObjectId8()).__init(this.bb_pos + offset, this.bb) : null;
|
|
1878
|
+
}
|
|
1879
|
+
nodeType() {
|
|
1880
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
1881
|
+
return offset ? this.bb.readUint8(this.bb_pos + offset) : 0 /* Group */;
|
|
1882
|
+
}
|
|
1567
1883
|
};
|
|
1568
1884
|
|
|
1569
1885
|
// src/format/flatbuffers/generated/transaction-log.ts
|
|
@@ -1677,6 +1993,22 @@ var TransactionLog = class _TransactionLog {
|
|
|
1677
1993
|
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
1678
1994
|
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
1679
1995
|
}
|
|
1996
|
+
extra(index) {
|
|
1997
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
1998
|
+
return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
|
|
1999
|
+
}
|
|
2000
|
+
extraLength() {
|
|
2001
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
2002
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
2003
|
+
}
|
|
2004
|
+
extraArray() {
|
|
2005
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
2006
|
+
return offset ? new Uint8Array(
|
|
2007
|
+
this.bb.bytes().buffer,
|
|
2008
|
+
this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset),
|
|
2009
|
+
this.bb.__vector_len(this.bb_pos + offset)
|
|
2010
|
+
) : null;
|
|
2011
|
+
}
|
|
1680
2012
|
};
|
|
1681
2013
|
|
|
1682
2014
|
// src/format/flatbuffers/transaction-log-parser.ts
|
|
@@ -2411,7 +2743,7 @@ var Repository = class _Repository {
|
|
|
2411
2743
|
* version has the highest filename. Deletion tombstones are checked.
|
|
2412
2744
|
*
|
|
2413
2745
|
* When listing is not supported (e.g., HTTP storage), only the legacy
|
|
2414
|
-
* ref.json path is
|
|
2746
|
+
* ref.json path is returned (caller must handle NotFoundError on read).
|
|
2415
2747
|
*
|
|
2416
2748
|
* @param dirPrefix - Directory prefix to search
|
|
2417
2749
|
* @param legacyPath - Optional legacy ref.json path to try if listing fails
|
|
@@ -2447,7 +2779,9 @@ var Repository = class _Repository {
|
|
|
2447
2779
|
/**
|
|
2448
2780
|
* List all branches in the repository.
|
|
2449
2781
|
*
|
|
2450
|
-
*
|
|
2782
|
+
* Unlike tags, branches in icechunk v1 have no tombstone mechanism —
|
|
2783
|
+
* deletion removes the ref file outright. A branch is present iff it has
|
|
2784
|
+
* at least one ref file in its directory.
|
|
2451
2785
|
*
|
|
2452
2786
|
* @returns Array of branch names
|
|
2453
2787
|
*/
|
|
@@ -2456,49 +2790,23 @@ var Repository = class _Repository {
|
|
|
2456
2790
|
if (repoInfo) {
|
|
2457
2791
|
return listBranchesFromRepo(repoInfo);
|
|
2458
2792
|
}
|
|
2459
|
-
const
|
|
2793
|
+
const branches = /* @__PURE__ */ new Set();
|
|
2460
2794
|
try {
|
|
2461
2795
|
for await (const path of this.storage.listPrefix(
|
|
2462
2796
|
`${PATHS.REFS}/branch.`
|
|
2463
2797
|
)) {
|
|
2464
|
-
const
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
);
|
|
2468
|
-
if (deletedMatch) {
|
|
2469
|
-
const branchName = deletedMatch[1];
|
|
2470
|
-
const refFile = `refs/branch.${branchName}/${deletedMatch[2]}`;
|
|
2471
|
-
if (!branchFiles.has(branchName)) {
|
|
2472
|
-
branchFiles.set(branchName, {
|
|
2473
|
-
jsonFiles: [],
|
|
2474
|
-
deletedFiles: /* @__PURE__ */ new Set()
|
|
2475
|
-
});
|
|
2476
|
-
}
|
|
2477
|
-
branchFiles.get(branchName).deletedFiles.add(refFile);
|
|
2478
|
-
} else if (jsonMatch) {
|
|
2479
|
-
const branchName = jsonMatch[1];
|
|
2480
|
-
if (!branchFiles.has(branchName)) {
|
|
2481
|
-
branchFiles.set(branchName, {
|
|
2482
|
-
jsonFiles: [],
|
|
2483
|
-
deletedFiles: /* @__PURE__ */ new Set()
|
|
2484
|
-
});
|
|
2485
|
-
}
|
|
2486
|
-
branchFiles.get(branchName).jsonFiles.push(path);
|
|
2798
|
+
const match = path.match(/^refs\/branch\.(.+)\/([^/]+\.json)$/);
|
|
2799
|
+
if (match) {
|
|
2800
|
+
branches.add(match[1]);
|
|
2487
2801
|
}
|
|
2488
2802
|
}
|
|
2489
|
-
} catch {
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
const result = [];
|
|
2493
|
-
for (const [branchName, { jsonFiles, deletedFiles }] of branchFiles) {
|
|
2494
|
-
if (jsonFiles.length === 0) continue;
|
|
2495
|
-
jsonFiles.sort();
|
|
2496
|
-
const latestRef = jsonFiles[jsonFiles.length - 1];
|
|
2497
|
-
if (!deletedFiles.has(latestRef)) {
|
|
2498
|
-
result.push(branchName);
|
|
2803
|
+
} catch (error) {
|
|
2804
|
+
if (error instanceof AbortError) {
|
|
2805
|
+
throw error;
|
|
2499
2806
|
}
|
|
2807
|
+
throw new Error("Cannot list branches: storage does not support listing");
|
|
2500
2808
|
}
|
|
2501
|
-
return
|
|
2809
|
+
return [...branches];
|
|
2502
2810
|
}
|
|
2503
2811
|
/**
|
|
2504
2812
|
* List all tags in the repository.
|
|
@@ -2534,7 +2842,10 @@ var Repository = class _Repository {
|
|
|
2534
2842
|
tagFiles.get(tagName).jsonFiles.push(path);
|
|
2535
2843
|
}
|
|
2536
2844
|
}
|
|
2537
|
-
} catch {
|
|
2845
|
+
} catch (error) {
|
|
2846
|
+
if (error instanceof AbortError) {
|
|
2847
|
+
throw error;
|
|
2848
|
+
}
|
|
2538
2849
|
throw new Error("Cannot list tags: storage does not support listing");
|
|
2539
2850
|
}
|
|
2540
2851
|
const result = [];
|