@kraki/head 0.19.4 → 0.20.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/dist/account-api.d.ts +10 -0
- package/dist/account-api.js +67 -15
- package/dist/account-api.js.map +1 -1
- package/dist/auth-backend.d.ts +16 -5
- package/dist/auth.d.ts +0 -1
- package/dist/auth.js +32 -20
- package/dist/auth.js.map +1 -1
- package/dist/cli.js +12 -1
- package/dist/cli.js.map +1 -1
- package/dist/lease-issuer.js +1 -1
- package/dist/lease-issuer.js.map +1 -1
- package/dist/local-auth-backend.d.ts +5 -1
- package/dist/local-auth-backend.js +30 -17
- package/dist/local-auth-backend.js.map +1 -1
- package/dist/pulse-hub.d.ts +8 -0
- package/dist/pulse-hub.js +51 -3
- package/dist/pulse-hub.js.map +1 -1
- package/dist/push/apns.js +19 -1
- package/dist/push/apns.js.map +1 -1
- package/dist/remote-auth-backend.d.ts +2 -1
- package/dist/remote-auth-backend.js +10 -2
- package/dist/remote-auth-backend.js.map +1 -1
- package/dist/server.d.ts +18 -7
- package/dist/server.js +243 -360
- package/dist/server.js.map +1 -1
- package/dist/storage.d.ts +21 -0
- package/dist/storage.js +103 -11
- package/dist/storage.js.map +1 -1
- package/dist/trace.d.ts +0 -1
- package/dist/trace.js +0 -3
- package/dist/trace.js.map +1 -1
- package/dist/voice-vocabulary.d.ts +14 -0
- package/dist/voice-vocabulary.js +102 -0
- package/dist/voice-vocabulary.js.map +1 -0
- package/package.json +3 -4
package/dist/server.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare class HeadServer {
|
|
|
52
52
|
private options;
|
|
53
53
|
private static readonly PING_INTERVAL;
|
|
54
54
|
private connections;
|
|
55
|
-
private
|
|
55
|
+
private authBackend;
|
|
56
56
|
private userByDevice;
|
|
57
57
|
private clients;
|
|
58
58
|
private pingTimer;
|
|
@@ -76,9 +76,6 @@ export declare class HeadServer {
|
|
|
76
76
|
private linkProgressing;
|
|
77
77
|
/** Test hook: force a liveness sweep without waiting for the timer. */
|
|
78
78
|
forceLivenessSweep(): void;
|
|
79
|
-
private getAuthProvider;
|
|
80
|
-
private getAuthProviderForMode;
|
|
81
|
-
private getGitHubClientId;
|
|
82
79
|
private getVapidPublicKey;
|
|
83
80
|
/**
|
|
84
81
|
* Build the voice capability advertisement for `auth_ok` from this head's
|
|
@@ -91,7 +88,6 @@ export declare class HeadServer {
|
|
|
91
88
|
* single helper.
|
|
92
89
|
*/
|
|
93
90
|
private getVoiceCapability;
|
|
94
|
-
private findGitHubProvider;
|
|
95
91
|
attach(server: Server): void;
|
|
96
92
|
acceptConnection(ws: WebSocket): void;
|
|
97
93
|
/** (Re)start the deadline for this socket to authenticate (G1). */
|
|
@@ -126,6 +122,10 @@ export declare class HeadServer {
|
|
|
126
122
|
/** Persist a preferences update and echo the merged result to the sender + the
|
|
127
123
|
* user's other online devices. */
|
|
128
124
|
private handleUpdatePreferences;
|
|
125
|
+
/** Account data, not session data: no tentacle is involved. The sender
|
|
126
|
+
* always gets the resulting list back (its acknowledgement); other online
|
|
127
|
+
* apps of the account get it only when something was applied. */
|
|
128
|
+
private handleUpdateVoiceVocabulary;
|
|
129
129
|
/** Fan-out targets for a pulse broadcast from `fromDevice`: all OTHER
|
|
130
130
|
* ONLINE devices of the same user. Offline devices are excluded because
|
|
131
131
|
* broadcasts (user_message / agent_message / delta / active / idle /
|
|
@@ -146,7 +146,10 @@ export declare class HeadServer {
|
|
|
146
146
|
private removeConnection;
|
|
147
147
|
private sendAuthError;
|
|
148
148
|
private handleAuth;
|
|
149
|
-
|
|
149
|
+
/** After an awaited auth step: is this socket still open, still ours and
|
|
150
|
+
* still unauthenticated? The auth deadline may have closed it meanwhile;
|
|
151
|
+
* registering a dead socket would evict the device's live connection. */
|
|
152
|
+
private socketStillAuthenticating;
|
|
150
153
|
private handleChallengeResponse;
|
|
151
154
|
/**
|
|
152
155
|
* Handle a result from AuthBackend — registers connection state and sends response.
|
|
@@ -184,10 +187,18 @@ export declare class HeadServer {
|
|
|
184
187
|
* Must be called BEFORE `connections.set(deviceId, ws)`.
|
|
185
188
|
*/
|
|
186
189
|
private evictPreviousConnection;
|
|
187
|
-
private completeAuth;
|
|
188
190
|
private handleCreatePairingToken;
|
|
189
191
|
private handleRequestPairingToken;
|
|
190
192
|
private handleRemoveDevice;
|
|
193
|
+
/** Users whose deletion is in flight (a double tap must not run it twice). */
|
|
194
|
+
private deletingAccounts;
|
|
195
|
+
/**
|
|
196
|
+
* Delete the requesting user's account: at the account store (the account
|
|
197
|
+
* service in edge mode) and in this relay's own storage and pulse state.
|
|
198
|
+
* Then tell every connected device and close it. Devices that were offline
|
|
199
|
+
* get `auth_error` code `account_deleted` when they next connect.
|
|
200
|
+
*/
|
|
201
|
+
private handleDeleteAccount;
|
|
191
202
|
private handleRegisterPushToken;
|
|
192
203
|
private handleUnregisterPushToken;
|
|
193
204
|
private broadcastDeviceRemoved;
|