@tinycloud/node-sdk 3.7.0-beta.2 → 3.7.0-beta.3
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/dist/{TinyCloudNode-CclYdOh4.d.ts → TinyCloudNode-Cw00iiSP.d.ts} +21 -5
- package/dist/{TinyCloudNode-u_PobKS1.d.cts → TinyCloudNode-DD7qjyLU.d.cts} +21 -5
- package/dist/{authority-CI3qRIcu.d.cts → authority-Ck5hZdBn.d.cts} +1 -1
- package/dist/{authority-OZr9meoT.d.ts → authority-DXR6887E.d.ts} +1 -1
- package/dist/core.cjs +27 -6
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +2 -2
- package/dist/core.d.ts +2 -2
- package/dist/core.js +27 -6
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +27 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -6
- package/dist/index.js.map +1 -1
- package/dist/replication/authority.d.cts +2 -2
- package/dist/replication/authority.d.ts +2 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -21681,7 +21681,10 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21681
21681
|
* and remembers whose storage is full so sign-in and listing skip their
|
|
21682
21682
|
* best-effort writes. Lives as long as this instance, across sign-ins.
|
|
21683
21683
|
*/
|
|
21684
|
-
this.storageFull = new import_sdk_core10.StorageFullMonitor(
|
|
21684
|
+
this.storageFull = new import_sdk_core10.StorageFullMonitor(
|
|
21685
|
+
(spaceId) => spaceOwnerKey(spaceId) ?? spaceId,
|
|
21686
|
+
() => this.currentStorageOwner()
|
|
21687
|
+
);
|
|
21685
21688
|
this.invokeWithRuntimePermissions = (session, service, path, action, facts) => {
|
|
21686
21689
|
const operation = {
|
|
21687
21690
|
spaceId: session.spaceId,
|
|
@@ -21837,12 +21840,15 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21837
21840
|
return this._bootstrapStatus;
|
|
21838
21841
|
}
|
|
21839
21842
|
/**
|
|
21840
|
-
* Subscribe to `storage.full`. It fires
|
|
21841
|
-
*
|
|
21843
|
+
* Subscribe to `storage.full`. It fires on the first write any service had
|
|
21844
|
+
* rejected because the owner's TinyCloud storage is full
|
|
21842
21845
|
* (`STORAGE_QUOTA_EXCEEDED` or `STORAGE_LIMIT_REACHED`), so an app can show
|
|
21843
|
-
* one read-only banner. Reads keep working.
|
|
21844
|
-
*
|
|
21845
|
-
*
|
|
21846
|
+
* one read-only banner. Reads keep working. For the signed-in account's own
|
|
21847
|
+
* storage it fires once per episode: the episode ends only when a write to
|
|
21848
|
+
* that storage succeeds, or on sign-out. A `storage.status()` read does not
|
|
21849
|
+
* end it. A rejection on another owner's delegated space fires once per
|
|
21850
|
+
* owner, until that owner's `storage.status()` reports space again. Returns
|
|
21851
|
+
* the unsubscribe function.
|
|
21846
21852
|
*/
|
|
21847
21853
|
on(event, handler) {
|
|
21848
21854
|
if (event !== "storage.full") {
|
|
@@ -21850,6 +21856,21 @@ var _TinyCloudNode = class _TinyCloudNode {
|
|
|
21850
21856
|
}
|
|
21851
21857
|
return this.storageFull.on(handler);
|
|
21852
21858
|
}
|
|
21859
|
+
/**
|
|
21860
|
+
* Storage episode state for the UI mount. @internal
|
|
21861
|
+
*
|
|
21862
|
+
* `current()` returns the own-storage rejection that started the episode, or
|
|
21863
|
+
* undefined. `subscribe` calls its listener when the own episode starts or
|
|
21864
|
+
* ends; read `current()` inside it. `subscribeDelegated` calls its listener
|
|
21865
|
+
* once per delegated owner found full, until that owner is cleared.
|
|
21866
|
+
*/
|
|
21867
|
+
get storageEpisode() {
|
|
21868
|
+
return {
|
|
21869
|
+
current: () => this.storageFull.rejection,
|
|
21870
|
+
subscribe: (listener) => this.storageFull.onEpisode(listener),
|
|
21871
|
+
subscribeDelegated: (listener) => this.storageFull.onDelegated(listener)
|
|
21872
|
+
};
|
|
21873
|
+
}
|
|
21853
21874
|
/** Owner key of the account the current session's own storage belongs to. */
|
|
21854
21875
|
currentStorageOwner() {
|
|
21855
21876
|
return spaceOwnerKey(this._serviceContext?.session?.spaceId ?? this.currentTinyCloudSession()?.spaceId);
|