@siafoundation/sia-storage 0.1.5 → 0.1.6

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.
@@ -479,9 +479,71 @@ export class ObjectEvent {
479
479
  if (Symbol.dispose) ObjectEvent.prototype[Symbol.dispose] = ObjectEvent.prototype.free;
480
480
 
481
481
  /**
482
- * An object listed without its slabs, as `SharedSdk.objectSummaries` returns
483
- * it. It describes the object but cannot be downloaded. Fetch the full
484
- * object with `SharedSdk.object(id)` to download it.
482
+ * An object event from the indexer, without the object's slabs.
483
+ */
484
+ export class ObjectEventSummary {
485
+ static __wrap(ptr) {
486
+ const obj = Object.create(ObjectEventSummary.prototype);
487
+ obj.__wbg_ptr = ptr;
488
+ ObjectEventSummaryFinalization.register(obj, obj.__wbg_ptr, obj);
489
+ return obj;
490
+ }
491
+ __destroy_into_raw() {
492
+ const ptr = this.__wbg_ptr;
493
+ this.__wbg_ptr = 0;
494
+ ObjectEventSummaryFinalization.unregister(this);
495
+ return ptr;
496
+ }
497
+ free() {
498
+ const ptr = this.__destroy_into_raw();
499
+ wasm.__wbg_objecteventsummary_free(ptr, 0);
500
+ }
501
+ /**
502
+ * @returns {boolean}
503
+ */
504
+ get deleted() {
505
+ const ret = wasm.objecteventsummary_deleted(this.__wbg_ptr);
506
+ return ret !== 0;
507
+ }
508
+ /**
509
+ * @returns {string}
510
+ */
511
+ get id() {
512
+ let deferred1_0;
513
+ let deferred1_1;
514
+ try {
515
+ const ret = wasm.objecteventsummary_id(this.__wbg_ptr);
516
+ deferred1_0 = ret[0];
517
+ deferred1_1 = ret[1];
518
+ return getStringFromWasm0(ret[0], ret[1]);
519
+ } finally {
520
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
521
+ }
522
+ }
523
+ /**
524
+ * Returns the object associated with this event, if it exists.
525
+ * @returns {ObjectSummary | undefined}
526
+ */
527
+ get object() {
528
+ const ret = wasm.objecteventsummary_object(this.__wbg_ptr);
529
+ return ret === 0 ? undefined : ObjectSummary.__wrap(ret);
530
+ }
531
+ /**
532
+ * Returns the time the event occurred.
533
+ * @returns {Date}
534
+ */
535
+ get updatedAt() {
536
+ const ret = wasm.objecteventsummary_updatedAt(this.__wbg_ptr);
537
+ return ret;
538
+ }
539
+ }
540
+ if (Symbol.dispose) ObjectEventSummary.prototype[Symbol.dispose] = ObjectEventSummary.prototype.free;
541
+
542
+ /**
543
+ * An object listed without its slabs, as `Sdk.objectEventSummaries` and
544
+ * `SharedSdk.objectSummaries` return it. It describes the object but cannot
545
+ * be downloaded. Fetch the full object with `Sdk.object(id)` or
546
+ * `SharedSdk.object(id)` to download it.
485
547
  */
486
548
  export class ObjectSummary {
487
549
  static __wrap(ptr) {
@@ -915,6 +977,16 @@ export class Sdk {
915
977
  const ret = wasm.sdk_object(this.__wbg_ptr, ptr0, len0);
916
978
  return ret;
917
979
  }
980
+ /**
981
+ * Returns object events from the indexer without the objects' slabs.
982
+ * @param {ObjectsCursor | null | undefined} cursor
983
+ * @param {number} limit
984
+ * @returns {Promise<ObjectEventSummary[]>}
985
+ */
986
+ objectEventSummaries(cursor, limit) {
987
+ const ret = wasm.sdk_objectEventSummaries(this.__wbg_ptr, cursor, limit);
988
+ return ret;
989
+ }
918
990
  /**
919
991
  * Returns object events for syncing local state with the indexer.
920
992
  * @param {ObjectsCursor | null | undefined} cursor
@@ -1445,6 +1517,10 @@ function __wbg_get_imports() {
1445
1517
  __wbg__wbg_cb_unref_fffb441def202758: function(arg0) {
1446
1518
  arg0._wbg_cb_unref();
1447
1519
  },
1520
+ __wbg_abort_807c9d22f53767f5: function(arg0) {
1521
+ const ret = arg0.abort();
1522
+ return ret;
1523
+ },
1448
1524
  __wbg_abort_8bae0f33e7833997: function(arg0) {
1449
1525
  arg0.abort();
1450
1526
  },
@@ -1494,6 +1570,10 @@ function __wbg_get_imports() {
1494
1570
  const ret = arg0.cancel();
1495
1571
  return ret;
1496
1572
  },
1573
+ __wbg_cancel_3ba68e9bb6d68b37: function(arg0) {
1574
+ const ret = arg0.cancel();
1575
+ return ret;
1576
+ },
1497
1577
  __wbg_cancel_70eb325a477a4d18: function(arg0) {
1498
1578
  const ret = arg0.cancel();
1499
1579
  return ret;
@@ -1502,7 +1582,7 @@ function __wbg_get_imports() {
1502
1582
  const ret = arg0.catch(arg1);
1503
1583
  return ret;
1504
1584
  },
1505
- __wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
1585
+ __wbg_clearTimeout_1daad5c6ee4fcd3b: function(arg0) {
1506
1586
  const ret = clearTimeout(arg0);
1507
1587
  return ret;
1508
1588
  },
@@ -1527,7 +1607,7 @@ function __wbg_get_imports() {
1527
1607
  const ret = arg0.createBidirectionalStream();
1528
1608
  return ret;
1529
1609
  },
1530
- __wbg_done_11408d3db12f8f67: function(arg0) {
1610
+ __wbg_done_71c9042440891178: function(arg0) {
1531
1611
  const ret = arg0.done;
1532
1612
  return ret;
1533
1613
  },
@@ -1538,6 +1618,14 @@ function __wbg_get_imports() {
1538
1618
  __wbg_enqueue_6d83b4c6281bafd6: function() { return handleError(function (arg0, arg1) {
1539
1619
  arg0.enqueue(arg1);
1540
1620
  }, arguments); },
1621
+ __wbg_entries_015dc610cd81ede0: function(arg0) {
1622
+ const ret = Object.entries(arg0);
1623
+ return ret;
1624
+ },
1625
+ __wbg_entries_900cefd6f70eb290: function(arg0) {
1626
+ const ret = arg0.entries();
1627
+ return ret;
1628
+ },
1541
1629
  __wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
1542
1630
  let deferred0_0;
1543
1631
  let deferred0_1;
@@ -1549,7 +1637,7 @@ function __wbg_get_imports() {
1549
1637
  wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
1550
1638
  }
1551
1639
  },
1552
- __wbg_fetch_9dad4fe911207b37: function(arg0) {
1640
+ __wbg_fetch_7a37768ab67c5bd8: function(arg0) {
1553
1641
  const ret = fetch(arg0);
1554
1642
  return ret;
1555
1643
  },
@@ -1580,6 +1668,10 @@ function __wbg_get_imports() {
1580
1668
  const ret = arg0.getWriter();
1581
1669
  return ret;
1582
1670
  }, arguments); },
1671
+ __wbg_get_507a50627bffa49b: function(arg0, arg1) {
1672
+ const ret = arg0[arg1 >>> 0];
1673
+ return ret;
1674
+ },
1583
1675
  __wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
1584
1676
  const ret = Reflect.get(arg0, arg1);
1585
1677
  return ret;
@@ -1642,6 +1734,16 @@ function __wbg_get_imports() {
1642
1734
  const ret = result;
1643
1735
  return ret;
1644
1736
  },
1737
+ __wbg_instanceof_Map_e5b5e3db98422fcc: function(arg0) {
1738
+ let result;
1739
+ try {
1740
+ result = arg0 instanceof Map;
1741
+ } catch (_) {
1742
+ result = false;
1743
+ }
1744
+ const ret = result;
1745
+ return ret;
1746
+ },
1645
1747
  __wbg_instanceof_Response_c8b64b2256f01bec: function(arg0) {
1646
1748
  let result;
1647
1749
  try {
@@ -1717,7 +1819,7 @@ function __wbg_get_imports() {
1717
1819
  const a = state0.a;
1718
1820
  state0.a = 0;
1719
1821
  try {
1720
- return wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1822
+ return wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1721
1823
  } finally {
1722
1824
  state0.a = a;
1723
1825
  }
@@ -1755,7 +1857,7 @@ function __wbg_get_imports() {
1755
1857
  const a = state0.a;
1756
1858
  state0.a = 0;
1757
1859
  try {
1758
- return wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1860
+ return wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1759
1861
  } finally {
1760
1862
  state0.a = a;
1761
1863
  }
@@ -1802,6 +1904,10 @@ function __wbg_get_imports() {
1802
1904
  const ret = ObjectEvent.__wrap(arg0);
1803
1905
  return ret;
1804
1906
  },
1907
+ __wbg_objecteventsummary_new: function(arg0) {
1908
+ const ret = ObjectEventSummary.__wrap(arg0);
1909
+ return ret;
1910
+ },
1805
1911
  __wbg_objectsummary_new: function(arg0) {
1806
1912
  const ret = ObjectSummary.__wrap(arg0);
1807
1913
  return ret;
@@ -1857,7 +1963,7 @@ function __wbg_get_imports() {
1857
1963
  const ret = Sdk.__wrap(arg0);
1858
1964
  return ret;
1859
1965
  },
1860
- __wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
1966
+ __wbg_setTimeout_b4a9096784635514: function(arg0, arg1) {
1861
1967
  const ret = setTimeout(arg0, arg1);
1862
1968
  return ret;
1863
1969
  },
@@ -1891,6 +1997,12 @@ function __wbg_get_imports() {
1891
1997
  __wbg_set_mode_f6bfb5131426e6b5: function(arg0, arg1) {
1892
1998
  arg0.mode = __wbindgen_enum_ReadableStreamReaderMode[arg1];
1893
1999
  },
2000
+ __wbg_set_referrer_02890bb2de855af1: function(arg0, arg1, arg2) {
2001
+ arg0.referrer = getStringFromWasm0(arg1, arg2);
2002
+ },
2003
+ __wbg_set_referrer_policy_e49a6d0d7473fd16: function(arg0, arg1) {
2004
+ arg0.referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
2005
+ },
1894
2006
  __wbg_set_signal_c4ef8faddb4c1446: function(arg0, arg1) {
1895
2007
  arg0.signal = arg1;
1896
2008
  },
@@ -1933,10 +2045,6 @@ function __wbg_get_imports() {
1933
2045
  const ret = arg0.status;
1934
2046
  return ret;
1935
2047
  },
1936
- __wbg_stringify_b54333f60f1e4dad: function() { return handleError(function (arg0) {
1937
- const ret = JSON.stringify(arg0);
1938
- return ret;
1939
- }, arguments); },
1940
2048
  __wbg_subarray_3ed232c8a6baee09: function(arg0, arg1, arg2) {
1941
2049
  const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1942
2050
  return ret;
@@ -1964,7 +2072,7 @@ function __wbg_get_imports() {
1964
2072
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1965
2073
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1966
2074
  },
1967
- __wbg_value_015ff34c896f8461: function(arg0) {
2075
+ __wbg_value_41539d323b7919ad: function(arg0) {
1968
2076
  const ret = arg0.value;
1969
2077
  return ret;
1970
2078
  },
@@ -1985,32 +2093,32 @@ function __wbg_get_imports() {
1985
2093
  return ret;
1986
2094
  },
1987
2095
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1988
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1022, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2096
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1041, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1989
2097
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___JsValue__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true_);
1990
2098
  return ret;
1991
2099
  },
1992
2100
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1993
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 481, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2101
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 500, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1994
2102
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___JsValue______true_);
1995
2103
  return ret;
1996
2104
  },
1997
2105
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
1998
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 539, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2106
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 558, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1999
2107
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true_);
2000
2108
  return ret;
2001
2109
  },
2002
2110
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
2003
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 539, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2111
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("WebTransportBidirectionalStream")], shim_idx: 558, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2004
2112
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true__3);
2005
2113
  return ret;
2006
2114
  },
2007
2115
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
2008
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 539, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2116
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("undefined")], shim_idx: 558, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
2009
2117
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true__4);
2010
2118
  return ret;
2011
2119
  },
2012
2120
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
2013
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 829, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2121
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 853, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
2014
2122
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_63576b009277873___convert__closures_____invoke_______true_);
2015
2123
  return ret;
2016
2124
  },
@@ -2019,38 +2127,50 @@ function __wbg_get_imports() {
2019
2127
  const ret = arg0;
2020
2128
  return ret;
2021
2129
  },
2022
- __wbindgen_cast_0000000000000008: function(arg0, arg1) {
2130
+ __wbindgen_cast_0000000000000008: function(arg0) {
2131
+ // Cast intrinsic for `I64 -> Externref`.
2132
+ const ret = arg0;
2133
+ return ret;
2134
+ },
2135
+ __wbindgen_cast_0000000000000009: function(arg0, arg1) {
2023
2136
  // Cast intrinsic for `Ref(String) -> Externref`.
2024
2137
  const ret = getStringFromWasm0(arg0, arg1);
2025
2138
  return ret;
2026
2139
  },
2027
- __wbindgen_cast_0000000000000009: function(arg0) {
2140
+ __wbindgen_cast_000000000000000a: function(arg0) {
2028
2141
  // Cast intrinsic for `U64 -> Externref`.
2029
2142
  const ret = BigInt.asUintN(64, arg0);
2030
2143
  return ret;
2031
2144
  },
2032
- __wbindgen_cast_000000000000000a: function(arg0, arg1) {
2145
+ __wbindgen_cast_000000000000000b: function(arg0, arg1) {
2033
2146
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2034
2147
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
2035
2148
  // Cast intrinsic for `Vector(NamedExternref("KeyRecord")) -> Externref`.
2036
2149
  const ret = v0;
2037
2150
  return ret;
2038
2151
  },
2039
- __wbindgen_cast_000000000000000b: function(arg0, arg1) {
2152
+ __wbindgen_cast_000000000000000c: function(arg0, arg1) {
2040
2153
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2041
2154
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
2042
2155
  // Cast intrinsic for `Vector(NamedExternref("ObjectEvent")) -> Externref`.
2043
2156
  const ret = v0;
2044
2157
  return ret;
2045
2158
  },
2046
- __wbindgen_cast_000000000000000c: function(arg0, arg1) {
2159
+ __wbindgen_cast_000000000000000d: function(arg0, arg1) {
2160
+ var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2161
+ wasm.__wbindgen_free(arg0, arg1 * 4, 4);
2162
+ // Cast intrinsic for `Vector(NamedExternref("ObjectEventSummary")) -> Externref`.
2163
+ const ret = v0;
2164
+ return ret;
2165
+ },
2166
+ __wbindgen_cast_000000000000000e: function(arg0, arg1) {
2047
2167
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2048
2168
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
2049
2169
  // Cast intrinsic for `Vector(NamedExternref("ObjectSummary")) -> Externref`.
2050
2170
  const ret = v0;
2051
2171
  return ret;
2052
2172
  },
2053
- __wbindgen_cast_000000000000000d: function(arg0, arg1) {
2173
+ __wbindgen_cast_000000000000000f: function(arg0, arg1) {
2054
2174
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
2055
2175
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
2056
2176
  // Cast intrinsic for `Vector(NamedExternref("PinnedObject")) -> Externref`.
@@ -2109,8 +2229,8 @@ function wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bind
2109
2229
  }
2110
2230
  }
2111
2231
 
2112
- function wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
2113
- wasm.wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
2232
+ function wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
2233
+ wasm.wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
2114
2234
  }
2115
2235
 
2116
2236
 
@@ -2120,6 +2240,9 @@ const __wbindgen_enum_ReadableStreamReaderMode = ["byob"];
2120
2240
  const __wbindgen_enum_ReadableStreamType = ["bytes"];
2121
2241
 
2122
2242
 
2243
+ const __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
2244
+
2245
+
2123
2246
  const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
2124
2247
 
2125
2248
 
@@ -2148,6 +2271,9 @@ const KeyRecordFinalization = (typeof FinalizationRegistry === 'undefined')
2148
2271
  const ObjectEventFinalization = (typeof FinalizationRegistry === 'undefined')
2149
2272
  ? { register: () => {}, unregister: () => {} }
2150
2273
  : new FinalizationRegistry(ptr => wasm.__wbg_objectevent_free(ptr, 1));
2274
+ const ObjectEventSummaryFinalization = (typeof FinalizationRegistry === 'undefined')
2275
+ ? { register: () => {}, unregister: () => {} }
2276
+ : new FinalizationRegistry(ptr => wasm.__wbg_objecteventsummary_free(ptr, 1));
2151
2277
  const ObjectSummaryFinalization = (typeof FinalizationRegistry === 'undefined')
2152
2278
  ? { register: () => {}, unregister: () => {} }
2153
2279
  : new FinalizationRegistry(ptr => wasm.__wbg_objectsummary_free(ptr, 1));
Binary file
@@ -5,6 +5,7 @@ export const __wbg_appkey_free: (a: number, b: number) => void;
5
5
  export const __wbg_builder_free: (a: number, b: number) => void;
6
6
  export const __wbg_keyrecord_free: (a: number, b: number) => void;
7
7
  export const __wbg_objectevent_free: (a: number, b: number) => void;
8
+ export const __wbg_objecteventsummary_free: (a: number, b: number) => void;
8
9
  export const __wbg_objectsummary_free: (a: number, b: number) => void;
9
10
  export const __wbg_packedupload_free: (a: number, b: number) => void;
10
11
  export const __wbg_pinnedobject_free: (a: number, b: number) => void;
@@ -34,6 +35,10 @@ export const objectevent_deleted: (a: number) => number;
34
35
  export const objectevent_id: (a: number) => [number, number];
35
36
  export const objectevent_object: (a: number) => number;
36
37
  export const objectevent_updatedAt: (a: number) => any;
38
+ export const objecteventsummary_deleted: (a: number) => number;
39
+ export const objecteventsummary_id: (a: number) => [number, number];
40
+ export const objecteventsummary_object: (a: number) => number;
41
+ export const objecteventsummary_updatedAt: (a: number) => any;
37
42
  export const objectsummary_createdAt: (a: number) => any;
38
43
  export const objectsummary_id: (a: number) => [number, number];
39
44
  export const objectsummary_metadata: (a: number) => [number, number];
@@ -65,6 +70,7 @@ export const sdk_deleteObject: (a: number, b: number, c: number) => any;
65
70
  export const sdk_download: (a: number, b: number, c: number) => [number, number, number];
66
71
  export const sdk_hosts: (a: number, b: number) => any;
67
72
  export const sdk_object: (a: number, b: number, c: number) => any;
73
+ export const sdk_objectEventSummaries: (a: number, b: any, c: number) => any;
68
74
  export const sdk_objectEvents: (a: number, b: any, c: number) => any;
69
75
  export const sdk_objectFromShareUrl: (a: number, b: number, c: number) => any;
70
76
  export const sdk_objectShareUrl: (a: number, b: number, c: any) => [number, number, number, number];
@@ -109,7 +115,7 @@ export const wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_
109
115
  export const wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true_: (a: number, b: number, c: any) => [number, number];
110
116
  export const wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true__3: (a: number, b: number, c: any) => [number, number];
111
117
  export const wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___sys__Undefined__core_37ee0ce0c4cd57d5___result__Result_____wasm_bindgen_63576b009277873___JsError___true__4: (a: number, b: number, c: any) => [number, number];
112
- export const wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_eaf17bee0f0de45e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
118
+ export const wasm_bindgen_63576b009277873___convert__closures_____invoke___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined___js_sys_89dff7ebd9bf220e___Function_fn_wasm_bindgen_63576b009277873___JsValue_____wasm_bindgen_63576b009277873___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
113
119
  export const wasm_bindgen_63576b009277873___convert__closures_____invoke___wasm_bindgen_63576b009277873___JsValue______true_: (a: number, b: number, c: any) => void;
114
120
  export const wasm_bindgen_63576b009277873___convert__closures_____invoke_______true_: (a: number, b: number) => void;
115
121
  export const __wbindgen_malloc: (a: number, b: number) => number;
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/stream/errors.ts","../src/stream/protocol.ts"],"sourcesContent":["/** Only sanitized strings cross the diagnostic boundary, never raw SDK objects. */\nexport function streamErrorMessage(error: unknown): string {\n const message =\n error instanceof Error\n ? error.message\n : typeof error === 'string'\n ? error\n : 'Unknown streaming failure'\n return message\n .replace(/\\b(?:https?|wss?|sia):\\/\\/[^\\s\"'<>]+/gi, '[URL redacted]')\n .replace(/(?:bearer\\s+)[^\\s,;]+/gi, 'Bearer [redacted]')\n .replace(\n /((?:seed|share|token|key|authorization)\\s*[=:]\\s*)[^\\s,;]+/gi,\n '$1[redacted]',\n )\n .replace(/[a-f0-9]{64,}/gi, '[redacted]')\n .replace(/[\\r\\n\\t]/g, ' ')\n .slice(0, 1000)\n}\n\nexport function reportStreamError(\n error: unknown,\n name: string,\n range: { offset: number; length: number } | undefined,\n) {\n const message = streamErrorMessage(error)\n // One string rather than an object, so it reads the same in every console.\n const bytes = range\n ? ` bytes ${range.offset}-${range.offset + range.length - 1}`\n : ''\n console.error(`[Sia stream] ${streamErrorMessage(name)}${bytes}: ${message}`)\n return message\n}\n","/**\n * Messages between a page and its streaming service worker.\n *\n * Stream URLs carry only the page's client id and a random token. When the\n * worker meets a token it does not know, it asks the page that made it for the\n * file and the share's credentials. The page and a worker can come from\n * different deployed versions, so the worker checks the page's reply before\n * using it.\n */\nimport type {\n AppMetadata,\n SealedObject,\n ShardProgress,\n} from '../../wasm/sia_storage_wasm.js'\n\n/**\n * What a stream URL is doing. `connecting` is a request waiting for its first\n * bytes, which on the URL's first request includes the worker connecting its\n * SDK and finding the object. `downloading` means bytes are arriving. `idle`\n * means no request for the URL is in flight, after the last one finished, was\n * cancelled or failed.\n */\nexport type StreamStatus = 'connecting' | 'downloading' | 'idle'\n\n/** The reports a page can ask for, one per callback it was given. */\nexport type StreamEvent = 'status' | 'progress' | 'shards'\nconst STREAM_EVENTS: readonly unknown[] = ['status', 'progress', 'shards']\n\n/**\n * What the worker connects its own SDK with. A `SharedSdk` reconnects from its\n * sharing key's seed, and an `Sdk` from its app key, as hex, and app metadata.\n * A `SharedSdk`'s `sealKey` is the hex of the random key the page seals its\n * objects with. A page from before it existed sends none.\n */\nexport type Connection =\n | { kind: 'shared'; indexerUrl: string; seed: string; sealKey?: string }\n | { kind: 'app'; indexerUrl: string; appKey: string; appMeta: AppMetadata }\n\nexport type SourceDetails = {\n // One per opened SDK, so the worker can release it as a whole.\n session: string\n connection: Connection\n objectId: string\n // The object, sealed with its app key or the share's `sealKey`, so the\n // worker can open it without a lookup. Without it the worker looks the\n // object up by `objectId`.\n sealed?: SealedObject\n name: string\n mime: string\n size: number\n // The reports the page wants for this URL. The worker sends no others, and\n // asks the SDK for shard reports only when `shards` is here.\n events?: StreamEvent[]\n}\n\n/** Page to worker. */\nexport type PageMessage =\n | { type: 'sia-client' }\n | { type: 'sia-release'; token: string }\n | { type: 'sia-release-share'; session: string }\n // Sent while the worker reports `sia-streaming` active. The event it raises\n // in the worker is what keeps the worker running.\n | { type: 'sia-keep-alive' }\n\n/** Worker to page. */\nexport type WorkerMessage =\n | { type: 'sia-source'; token: string }\n | {\n type: 'sia-stream-error'\n token: string\n message: string\n offset?: number\n length?: number\n }\n | { type: 'sia-stream-status'; token: string; status: StreamStatus }\n // Whether any request from this page is still being served. Sent when that\n // changes, and in reply to a keep-alive that arrives when none is.\n | { type: 'sia-streaming'; active: boolean }\n | {\n type: 'sia-stream-progress'\n token: string\n // Bytes served since the previous progress message.\n bytes: number\n shards: ShardProgress[]\n }\n\n/** The worker's answer to `sia-client`. */\nexport type ClientReply = { clientId: string; supported: boolean }\n\n/** The page's answer to `sia-source`. */\nexport type SourceReply =\n | ({ type: 'source' } & SourceDetails)\n | { type: 'error' }\n\n// Stream URLs sit under the worker's scope, so a download's navigation, which\n// only a worker whose scope covers the URL can answer, reaches it on sites\n// served from a sub-path too.\nconst STREAM_PATH = /\\/__sia_stream__\\/([^/]+)\\/([^/]+)\\/[^/]+$/\n\n/** `scope` is the worker registration's scope URL, which ends in a slash. */\nexport function streamPath(scope: string, clientId: string, token: string) {\n return `${scope}__sia_stream__/${clientId}/${token}/file`\n}\n\nexport function parseStreamPath(pathname: string) {\n const match = STREAM_PATH.exec(pathname)\n return match ? { clientId: match[1]!, token: match[2]! } : undefined\n}\n\ntype Fields = Record<string, unknown> | null | undefined\n\nconst strings = (data: Fields, fields: string[]) =>\n fields.every((field) => typeof data?.[field] === 'string')\n\n/** Checked on both sides, so bad metadata fails in `openStreams`, not per request. */\nexport function isAppMetadata(value: unknown): value is AppMetadata {\n return strings(value as Fields, ['appId', 'name', 'description', 'serviceUrl'])\n}\n\n// 32 bytes as hex, which is what the worker builds an AppKey from.\nconst isKeyHex = (value: unknown) =>\n typeof value === 'string' && /^[0-9a-f]{64}$/i.test(value)\n\nfunction isConnection(value: unknown): value is Connection {\n const data = value as Fields\n if (data?.kind === 'shared') {\n return (\n strings(data, ['indexerUrl', 'seed']) &&\n (data.sealKey === undefined || isKeyHex(data.sealKey))\n )\n }\n return (\n data?.kind === 'app' &&\n strings(data, ['indexerUrl', 'appKey']) &&\n isAppMetadata(data.appMeta)\n )\n}\n\nexport function isSourceReply(\n reply: unknown,\n): reply is { type: 'source' } & SourceDetails {\n const data = reply as Fields\n return (\n data?.type === 'source' &&\n strings(data, ['session', 'objectId', 'name', 'mime']) &&\n isConnection(data.connection) &&\n (data.connection.kind === 'shared' ||\n (typeof data.sealed === 'object' && data.sealed !== null)) &&\n Number.isSafeInteger(data.size) &&\n (data.size as number) >= 0 &&\n (data.events === undefined ||\n (Array.isArray(data.events) &&\n data.events.every((event) => STREAM_EVENTS.includes(event))))\n )\n}\n\n/**\n * Posts `message` with a reply port and resolves with the first reply. Rejects\n * after `timeout` ms, or when `signal` aborts.\n */\nexport function requestReply(\n target: { postMessage(message: unknown, transfer: Transferable[]): void },\n message: unknown,\n { timeout, signal }: { timeout?: number; signal?: AbortSignal },\n): Promise<unknown> {\n return new Promise((resolve, reject) => {\n const { port1, port2 } = new MessageChannel()\n const timer =\n timeout === undefined\n ? undefined\n : setTimeout(\n () => settle(() => reject(new Error('No reply in time.'))),\n timeout,\n )\n const abort = () => settle(() => reject(signal?.reason))\n function settle(outcome: () => void) {\n clearTimeout(timer)\n signal?.removeEventListener('abort', abort)\n port1.close()\n port2.close()\n outcome()\n }\n if (signal?.aborted) return abort()\n signal?.addEventListener('abort', abort, { once: true })\n port1.onmessage = ({ data }) => settle(() => resolve(data))\n port1.onmessageerror = () =>\n settle(() => reject(new Error('Unreadable reply.')))\n try {\n target.postMessage(message, [port2])\n } catch (error) {\n settle(() => reject(error))\n }\n })\n}\n"],"mappings":";AACO,SAAS,mBAAmB,OAAwB;AACzD,QAAM,UACJ,iBAAiB,QACb,MAAM,UACN,OAAO,UAAU,WACf,QACA;AAC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