@fungi.computer/computer 0.8.6 → 0.8.7
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/index.d.ts +6 -0
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,12 @@ declare class ContainerComputer extends ContainerComputerBase {
|
|
|
88
88
|
* name-addressed wake has reached this Computer yet.
|
|
89
89
|
*/
|
|
90
90
|
protected computerName(): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Learn this Computer's name from a call's own claim of it (a grant's
|
|
93
|
+
* computerId). The namespace must derive this object's id from the claim,
|
|
94
|
+
* or it is refused and never stored.
|
|
95
|
+
*/
|
|
96
|
+
protected claimComputerName(claimed: string): void;
|
|
91
97
|
/** Names this host knows this Computer may have; each is verified, not trusted. */
|
|
92
98
|
protected nameCandidates(): readonly string[];
|
|
93
99
|
getWorkspaceContainer(): import("@fungi.computer/cloudflare-computer/backends/container").WorkspaceContainerAPI;
|
package/dist/index.js
CHANGED
|
@@ -256,6 +256,14 @@ class ContainerComputer extends ContainerComputerBase {
|
|
|
256
256
|
// host already knows, verified against this object's id.
|
|
257
257
|
return learnComputerName(this.state.storage.sql, this.state.id, this.bindings.COMPUTER, this.nameCandidates());
|
|
258
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Learn this Computer's name from a call's own claim of it (a grant's
|
|
261
|
+
* computerId). The namespace must derive this object's id from the claim,
|
|
262
|
+
* or it is refused and never stored.
|
|
263
|
+
*/
|
|
264
|
+
claimComputerName(claimed) {
|
|
265
|
+
learnComputerName(this.state.storage.sql, this.state.id, this.bindings.COMPUTER, [claimed]);
|
|
266
|
+
}
|
|
259
267
|
/** Names this host knows this Computer may have; each is verified, not trusted. */
|
|
260
268
|
nameCandidates() {
|
|
261
269
|
return [];
|