@cortexkit/claustrum-client 0.3.0 → 0.4.0
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/wire.d.ts +6 -0
- package/dist/wire.js +14 -2
- package/package.json +2 -2
package/dist/wire.d.ts
CHANGED
|
@@ -198,6 +198,12 @@ export interface ScopedInventory {
|
|
|
198
198
|
readonly rows: readonly ScopedInventoryRow[];
|
|
199
199
|
readonly view: string;
|
|
200
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Exported for the golden-reply test only; `index.ts` re-exports by name, so this does not
|
|
203
|
+
* widen the published surface. The test drives THIS function rather than asserting keys,
|
|
204
|
+
* because a key check passes on a decoder that reads the wrong key.
|
|
205
|
+
*/
|
|
206
|
+
export declare function decodeScopedInventory(response: unknown, logUnknownClass: (errorClass: string) => void): ScopedInventory;
|
|
201
207
|
/** What a poll found. `pending` is not an error: the operator has not decided yet. */
|
|
202
208
|
export type EnrollmentPollOutcome = {
|
|
203
209
|
readonly status: 'pending';
|
package/dist/wire.js
CHANGED
|
@@ -286,7 +286,14 @@ export class ClaustrumClient {
|
|
|
286
286
|
error instanceof SubcCallError &&
|
|
287
287
|
error.kind === 'terminal' &&
|
|
288
288
|
error.code !== 'missing_identity' &&
|
|
289
|
-
error.code !== 'invalid_control_body'
|
|
289
|
+
error.code !== 'invalid_control_body' &&
|
|
290
|
+
// The daemon answers unknown_module only when no module with this id is
|
|
291
|
+
// registered or supervised at all; a vault that is restarting or warming up
|
|
292
|
+
// is reported as module_warming or target_unavailable, which the SDK already
|
|
293
|
+
// retries in place. A fresh connection to the same daemon gets the same
|
|
294
|
+
// answer, and the wasted reconnect would also start the reconnect backoff,
|
|
295
|
+
// leaving a genuinely wedged connection unable to recover for a minute.
|
|
296
|
+
error.code !== 'unknown_module');
|
|
290
297
|
}
|
|
291
298
|
async #reconnect() {
|
|
292
299
|
if (this.#closed)
|
|
@@ -318,7 +325,12 @@ export class ClaustrumClient {
|
|
|
318
325
|
await this.#reconnecting;
|
|
319
326
|
}
|
|
320
327
|
}
|
|
321
|
-
|
|
328
|
+
/**
|
|
329
|
+
* Exported for the golden-reply test only; `index.ts` re-exports by name, so this does not
|
|
330
|
+
* widen the published surface. The test drives THIS function rather than asserting keys,
|
|
331
|
+
* because a key check passes on a decoder that reads the wrong key.
|
|
332
|
+
*/
|
|
333
|
+
export function decodeScopedInventory(response, logUnknownClass) {
|
|
322
334
|
if (hasCredentialError(response))
|
|
323
335
|
throw asCredentialError(response, 'invalid_response', logUnknownClass);
|
|
324
336
|
const result = isRecord(response) && isRecord(response.result) ? response.result : undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/claustrum-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,6 +27,6 @@
|
|
|
27
27
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cortexkit/subc-client": "^0.
|
|
30
|
+
"@cortexkit/subc-client": "^0.16.0"
|
|
31
31
|
}
|
|
32
32
|
}
|