@neilberkman/sidereon 0.38.0 → 0.39.1

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/pkg/sidereon.js CHANGED
@@ -9180,13 +9180,46 @@ export class MmapTerrain {
9180
9180
  wasm.__wbg_mmapterrain_free(ptr, 0);
9181
9181
  }
9182
9182
  /**
9183
- * FNV-1a checksum of the full terrain store byte span.
9183
+ * Internal byte bridge used by the generated Node path adapter.
9184
+ * @param {Uint8Array} bytes
9185
+ * @param {any} claimed_checksum64
9186
+ * @returns {MmapTerrain}
9187
+ */
9188
+ static __fromBytesAttested(bytes, claimed_checksum64) {
9189
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
9190
+ const len0 = WASM_VECTOR_LEN;
9191
+ const ret = wasm.mmapterrain___fromBytesAttested(ptr0, len0, claimed_checksum64);
9192
+ if (ret[2]) {
9193
+ throw takeFromExternrefTable0(ret[1]);
9194
+ }
9195
+ return MmapTerrain.__wrap(ret[0]);
9196
+ }
9197
+ /**
9198
+ * FNV-1a checksum of the full terrain store byte span as a JavaScript
9199
+ * `bigint`. An attested handle returns its caller-supplied claim without
9200
+ * hashing.
9184
9201
  * @returns {bigint}
9185
9202
  */
9186
9203
  checksum64() {
9187
9204
  const ret = wasm.mmapterrain_checksum64(this.__wbg_ptr);
9188
9205
  return BigInt.asUintN(64, ret);
9189
9206
  }
9207
+ /**
9208
+ * Checksum provenance: `"verified"` or `"attested"`.
9209
+ * @returns {string}
9210
+ */
9211
+ get digestProvenance() {
9212
+ let deferred1_0;
9213
+ let deferred1_1;
9214
+ try {
9215
+ const ret = wasm.mmapterrain_digestProvenance(this.__wbg_ptr);
9216
+ deferred1_0 = ret[0];
9217
+ deferred1_1 = ret[1];
9218
+ return getStringFromWasm0(ret[0], ret[1]);
9219
+ } finally {
9220
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
9221
+ }
9222
+ }
9190
9223
  /**
9191
9224
  * Ellipsoidal height `h = H + N` in metres at `(longitudeDeg, latitudeDeg)`
9192
9225
  * using the embedded EGM96 1-degree geoid grid.
@@ -9266,6 +9299,26 @@ export class MmapTerrain {
9266
9299
  }
9267
9300
  return MmapTerrain.__wrap(ret[0]);
9268
9301
  }
9302
+ /**
9303
+ * Read a terrain store file using a caller-attested full-store checksum.
9304
+ *
9305
+ * `claimedChecksum64` is an exact JavaScript `bigint` in the unsigned
9306
+ * 64-bit range. The claim is returned by [`MmapTerrain.checksum64`] until
9307
+ * [`MmapTerrain.verify`] succeeds. Browser runtimes should use an
9308
+ * application-provided host-I/O bridge.
9309
+ * @param {string} path
9310
+ * @param {any} claimed_checksum64
9311
+ * @returns {MmapTerrain}
9312
+ */
9313
+ static fromPathAttested(path, claimed_checksum64) {
9314
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
9315
+ const len0 = WASM_VECTOR_LEN;
9316
+ const ret = wasm.mmapterrain_fromPathAttested(ptr0, len0, claimed_checksum64);
9317
+ if (ret[2]) {
9318
+ throw takeFromExternrefTable0(ret[1]);
9319
+ }
9320
+ return MmapTerrain.__wrap(ret[0]);
9321
+ }
9269
9322
  /**
9270
9323
  * Parse terrain store bytes from an owned `Uint8Array` copy.
9271
9324
  * @param {Uint8Array} bytes
@@ -9394,6 +9447,17 @@ export class MmapTerrain {
9394
9447
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
9395
9448
  return v1;
9396
9449
  }
9450
+ /**
9451
+ * Recompute and verify the store checksums.
9452
+ *
9453
+ * Success changes [`MmapTerrain.digestProvenance`] to `"verified"`.
9454
+ */
9455
+ verify() {
9456
+ const ret = wasm.mmapterrain_verify(this.__wbg_ptr);
9457
+ if (ret[1]) {
9458
+ throw takeFromExternrefTable0(ret[0]);
9459
+ }
9460
+ }
9397
9461
  /**
9398
9462
  * File-level vertical datum for the store's orthometric posting payloads.
9399
9463
  * @returns {VerticalDatum}
@@ -13928,6 +13992,21 @@ export class PreciseInterpolantArtifact {
13928
13992
  const ptr = this.__destroy_into_raw();
13929
13993
  wasm.__wbg_preciseinterpolantartifact_free(ptr, 0);
13930
13994
  }
13995
+ /**
13996
+ * Internal byte bridge used by the generated Node path adapter.
13997
+ * @param {Uint8Array} bytes
13998
+ * @param {any} claimed_checksum64
13999
+ * @returns {PreciseInterpolantArtifact}
14000
+ */
14001
+ static __fromBytesAttested(bytes, claimed_checksum64) {
14002
+ const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
14003
+ const len0 = WASM_VECTOR_LEN;
14004
+ const ret = wasm.preciseinterpolantartifact___fromBytesAttested(ptr0, len0, claimed_checksum64);
14005
+ if (ret[2]) {
14006
+ throw takeFromExternrefTable0(ret[1]);
14007
+ }
14008
+ return PreciseInterpolantArtifact.__wrap(ret[0]);
14009
+ }
13931
14010
  /**
13932
14011
  * Number of bytes retained by this artifact handle.
13933
14012
  * @returns {number}
@@ -13937,13 +14016,30 @@ export class PreciseInterpolantArtifact {
13937
14016
  return ret >>> 0;
13938
14017
  }
13939
14018
  /**
13940
- * File-level artifact checksum.
14019
+ * File-level artifact checksum as a JavaScript `bigint`. An attested
14020
+ * handle returns its caller-supplied claim without hashing.
13941
14021
  * @returns {bigint}
13942
14022
  */
13943
14023
  get checksum64() {
13944
14024
  const ret = wasm.preciseinterpolantartifact_checksum64(this.__wbg_ptr);
13945
14025
  return BigInt.asUintN(64, ret);
13946
14026
  }
14027
+ /**
14028
+ * Checksum provenance: `"verified"` or `"attested"`.
14029
+ * @returns {string}
14030
+ */
14031
+ get digestProvenance() {
14032
+ let deferred1_0;
14033
+ let deferred1_1;
14034
+ try {
14035
+ const ret = wasm.preciseinterpolantartifact_digestProvenance(this.__wbg_ptr);
14036
+ deferred1_0 = ret[0];
14037
+ deferred1_1 = ret[1];
14038
+ return getStringFromWasm0(ret[0], ret[1]);
14039
+ } finally {
14040
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
14041
+ }
14042
+ }
13947
14043
  /**
13948
14044
  * Evaluate one satellite state at a J2000-second epoch.
13949
14045
  * @param {string} satellite
@@ -13959,6 +14055,42 @@ export class PreciseInterpolantArtifact {
13959
14055
  }
13960
14056
  return Sp3State.__wrap(ret[0]);
13961
14057
  }
14058
+ /**
14059
+ * Read a precise-interpolant artifact from host I/O and open it in memory.
14060
+ *
14061
+ * Browser runtimes should use [`openPreciseInterpolantArtifact`] with
14062
+ * fetched bytes.
14063
+ * @param {string} path
14064
+ * @returns {PreciseInterpolantArtifact}
14065
+ */
14066
+ static fromPath(path) {
14067
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14068
+ const len0 = WASM_VECTOR_LEN;
14069
+ const ret = wasm.preciseinterpolantartifact_fromPath(ptr0, len0);
14070
+ if (ret[2]) {
14071
+ throw takeFromExternrefTable0(ret[1]);
14072
+ }
14073
+ return PreciseInterpolantArtifact.__wrap(ret[0]);
14074
+ }
14075
+ /**
14076
+ * Read a precise-interpolant artifact using a caller-attested checksum.
14077
+ *
14078
+ * `claimedChecksum64` is an exact JavaScript `bigint` in the unsigned
14079
+ * 64-bit range. It must equal the checksum declared by the artifact
14080
+ * header; a mismatch fails immediately without hashing the payload.
14081
+ * @param {string} path
14082
+ * @param {any} claimed_checksum64
14083
+ * @returns {PreciseInterpolantArtifact}
14084
+ */
14085
+ static fromPathAttested(path, claimed_checksum64) {
14086
+ const ptr0 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14087
+ const len0 = WASM_VECTOR_LEN;
14088
+ const ret = wasm.preciseinterpolantartifact_fromPathAttested(ptr0, len0, claimed_checksum64);
14089
+ if (ret[2]) {
14090
+ throw takeFromExternrefTable0(ret[1]);
14091
+ }
14092
+ return PreciseInterpolantArtifact.__wrap(ret[0]);
14093
+ }
13962
14094
  /**
13963
14095
  * Satellite tokens present in the artifact, ascending.
13964
14096
  * @returns {string[]}
@@ -13985,12 +14117,24 @@ export class PreciseInterpolantArtifact {
13985
14117
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
13986
14118
  }
13987
14119
  }
14120
+ /**
14121
+ * Recompute and verify the file-level and per-satellite checksums.
14122
+ *
14123
+ * Success changes [`PreciseInterpolantArtifact.digestProvenance`] to
14124
+ * `"verified"`.
14125
+ */
14126
+ verify() {
14127
+ const ret = wasm.preciseinterpolantartifact_verify(this.__wbg_ptr);
14128
+ if (ret[1]) {
14129
+ throw takeFromExternrefTable0(ret[0]);
14130
+ }
14131
+ }
13988
14132
  }
13989
14133
  if (Symbol.dispose) PreciseInterpolantArtifact.prototype[Symbol.dispose] = PreciseInterpolantArtifact.prototype.free;
13990
14134
 
13991
14135
  /**
13992
14136
  * Error category for precise-interpolant artifact open or serialization.
13993
- * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7}
14137
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}
13994
14138
  */
13995
14139
  export const PreciseInterpolantArtifactError = Object.freeze({
13996
14140
  /**
@@ -14025,6 +14169,10 @@ export const PreciseInterpolantArtifactError = Object.freeze({
14025
14169
  * A satellite payload checksum did not match its index record.
14026
14170
  */
14027
14171
  SatelliteChecksum: 7, "7": "SatelliteChecksum",
14172
+ /**
14173
+ * A caller claim did not match the checksum declared by the header.
14174
+ */
14175
+ AttestedChecksumMismatch: 8, "8": "AttestedChecksumMismatch",
14028
14176
  });
14029
14177
 
14030
14178
  /**
@@ -20150,7 +20298,7 @@ if (Symbol.dispose) TerrainGeoidModel.prototype[Symbol.dispose] = TerrainGeoidMo
20150
20298
 
20151
20299
  /**
20152
20300
  * Terrain store conversion, serialization, and parsing error variants.
20153
- * @enum {0 | 1 | 2 | 3 | 4 | 5}
20301
+ * @enum {0 | 1 | 2 | 3 | 4 | 5 | 6}
20154
20302
  */
20155
20303
  export const TerrainStoreError = Object.freeze({
20156
20304
  /**
@@ -20177,6 +20325,10 @@ export const TerrainStoreError = Object.freeze({
20177
20325
  * A tile payload checksum did not match its index record.
20178
20326
  */
20179
20327
  Checksum: 5, "5": "Checksum",
20328
+ /**
20329
+ * A caller-attested full-store checksum did not match the bytes opened.
20330
+ */
20331
+ AttestedChecksumMismatch: 6, "6": "AttestedChecksumMismatch",
20180
20332
  });
20181
20333
 
20182
20334
  /**
Binary file