@printobserver/sdk 0.10.5 → 0.11.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/contract.d.ts +51 -10
- package/dist/contract.js +66 -3
- package/package.json +2 -2
package/dist/contract.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare const CONTRACT_VERSION: string;
|
|
|
18
18
|
* Every operation this client exposes a method for, which is every operation
|
|
19
19
|
* the server declares and no other.
|
|
20
20
|
*/
|
|
21
|
-
export declare const OPERATION_NAMES: readonly ["prints", "status", "context", "image", "history", "events", "manifest_get", "look", "manifest_set", "spools", "spool", "printer_history", "preflight", "pause", "resume", "cancel", "start_print", "set_feedrate_factor", "set_flowrate_factor", "set_tool_target_c", "set_bed_target_c", "set_fan_percent", "acknowledge_failure", "close_print", "register_spool", "load_spool", "unload_spool", "adjust_spool", "retire_spool", "recover_status", "recover_lift", "recover_cool", "recover_fan", "recover_heat", "recover_park", "recover_home_xy", "recover_home_z"];
|
|
21
|
+
export declare const OPERATION_NAMES: readonly ["prints", "status", "context", "image", "history", "events", "manifest_get", "look", "printer_look", "manifest_set", "spools", "spool", "printer_history", "preflight", "pause", "resume", "cancel", "start_print", "set_feedrate_factor", "set_flowrate_factor", "set_tool_target_c", "set_bed_target_c", "set_fan_percent", "acknowledge_failure", "close_print", "register_spool", "load_spool", "unload_spool", "adjust_spool", "retire_spool", "recover_status", "recover_lift", "recover_cool", "recover_fan", "recover_heat", "recover_park", "recover_home_xy", "recover_home_z"];
|
|
22
22
|
/** What an operator's acknowledgement of a failure event asks for next. */
|
|
23
23
|
export type AcknowledgementDisposition = "continue" | "watch" | "stop";
|
|
24
24
|
/**
|
|
@@ -172,11 +172,15 @@ export interface CameraDegradedPayload {
|
|
|
172
172
|
detail: string;
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
|
-
* Somebody took a fresh look at the print
|
|
175
|
+
* Somebody took a fresh look at the print, or at the printer when no print
|
|
176
|
+
* was named.
|
|
176
177
|
*
|
|
177
|
-
* Written down
|
|
178
|
-
*
|
|
179
|
-
*
|
|
178
|
+
* Written down once the camera has been asked for its frame, together with
|
|
179
|
+
* that frame as this event's image, so that nobody reading the look finds it
|
|
180
|
+
* without the frame it was taken with. A frame the camera would not give is
|
|
181
|
+
* recorded against the look as a port failure. A look at the printer belongs
|
|
182
|
+
* to no print, waits on nothing that arrives for one, and so delivers
|
|
183
|
+
* nothing.
|
|
180
184
|
*/
|
|
181
185
|
export interface CameraLookPayload {
|
|
182
186
|
/**
|
|
@@ -190,6 +194,30 @@ export interface CameraLookPayload {
|
|
|
190
194
|
*/
|
|
191
195
|
waited_s: number;
|
|
192
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* The camera answered a request for a frame with a server error, and is
|
|
199
|
+
* being
|
|
200
|
+
* asked again.
|
|
201
|
+
*
|
|
202
|
+
* A camera server that could not take a frame this time — go2rtc answers
|
|
203
|
+
* `500` with `exit status 69` — is often one that will take the next, so a
|
|
204
|
+
* fetch answered `500` to `599` is made again after a short wait, a bounded
|
|
205
|
+
* number of times. One of these is written down for each such answer, as it
|
|
206
|
+
* happens, before the wait; a fetch whose every attempt was refused is
|
|
207
|
+
* recorded as a port failure only once the attempts run out.
|
|
208
|
+
*/
|
|
209
|
+
export interface CameraRetryPayload {
|
|
210
|
+
/** Which attempt the camera refused, counting from one. */
|
|
211
|
+
attempt: number;
|
|
212
|
+
/** How many attempts the fetch may make in all. */
|
|
213
|
+
attempts: number;
|
|
214
|
+
/** How long the fetch waits before its next attempt, in milliseconds. */
|
|
215
|
+
backoff_ms: number;
|
|
216
|
+
/** The start of what the camera answered with, as text. */
|
|
217
|
+
excerpt: string;
|
|
218
|
+
/** The HTTP status the camera answered. */
|
|
219
|
+
status: number;
|
|
220
|
+
}
|
|
193
221
|
/** The durable identity of one debit, so that a replay can never debit twice. */
|
|
194
222
|
export type ChargeKey = {
|
|
195
223
|
key: "print";
|
|
@@ -542,8 +570,11 @@ export interface ImageRecord {
|
|
|
542
570
|
fetched_at: Timestamp;
|
|
543
571
|
/** This image's identifier, minted by the store. */
|
|
544
572
|
id: ImageId;
|
|
545
|
-
/**
|
|
546
|
-
|
|
573
|
+
/**
|
|
574
|
+
* The print it belongs to, when it belongs to one: a frame taken of the
|
|
575
|
+
* printer with no print named belongs to none.
|
|
576
|
+
*/
|
|
577
|
+
print_id?: PrintId | null;
|
|
547
578
|
/** Where it lives, relative to the configured state directory. */
|
|
548
579
|
relative_path: string;
|
|
549
580
|
/** The SHA-256 of its bytes, lowercase hexadecimal. */
|
|
@@ -719,8 +750,9 @@ export interface Look {
|
|
|
719
750
|
*/
|
|
720
751
|
detector_paused: boolean;
|
|
721
752
|
/**
|
|
722
|
-
* The look itself, as it was written into the print's history
|
|
723
|
-
* the frame as its image
|
|
753
|
+
* The look itself, as it was written into the print's history — or the
|
|
754
|
+
* printer's, for a look at the printer — carrying the frame as its image
|
|
755
|
+
* when there is one.
|
|
724
756
|
*/
|
|
725
757
|
event: EventRecord;
|
|
726
758
|
/**
|
|
@@ -2081,6 +2113,7 @@ export interface EventPayloads {
|
|
|
2081
2113
|
agent_assessment: AgentAssessmentPayload;
|
|
2082
2114
|
camera_degraded: CameraDegradedPayload;
|
|
2083
2115
|
camera_look: CameraLookPayload;
|
|
2116
|
+
camera_retry: CameraRetryPayload;
|
|
2084
2117
|
charge_pended: ChargePendedPayload;
|
|
2085
2118
|
detector_health_changed: DetectorHealthChangedPayload;
|
|
2086
2119
|
filament_change_signalled: FilamentChangeSignalledPayload;
|
|
@@ -2116,7 +2149,7 @@ export interface EventPayloads {
|
|
|
2116
2149
|
unattended_printer_activity: UnattendedPrinterActivityPayload;
|
|
2117
2150
|
}
|
|
2118
2151
|
/** Every kind the server declares a payload type for, in name order. */
|
|
2119
|
-
export declare const EVENT_KINDS: readonly ["action_executed", "action_rejected", "action_requested", "agent_assessment", "camera_degraded", "camera_look", "charge_pended", "detector_health_changed", "filament_change_signalled", "filament_consumed", "file_tally_rebaselined", "intervention_expired", "malformed_external_event", "obico_failure_alert", "obico_printer_notification", "operator_acknowledgement", "periodic_observation", "port_failure", "preflight_checked", "print_ended", "print_started", "print_untracked", "printer_connection_changed", "printer_reset", "recovery_executed", "recovery_rejected", "recovery_requested", "spool_adjusted", "spool_command_rejected", "spool_loaded", "spool_registered", "spool_retired", "spool_unloaded", "spool_unverified", "startup_reconciliation", "supervision_session_closed", "supervision_session_opened", "unaccounted_print", "unattended_printer_activity"];
|
|
2152
|
+
export declare const EVENT_KINDS: readonly ["action_executed", "action_rejected", "action_requested", "agent_assessment", "camera_degraded", "camera_look", "camera_retry", "charge_pended", "detector_health_changed", "filament_change_signalled", "filament_consumed", "file_tally_rebaselined", "intervention_expired", "malformed_external_event", "obico_failure_alert", "obico_printer_notification", "operator_acknowledgement", "periodic_observation", "port_failure", "preflight_checked", "print_ended", "print_started", "print_untracked", "printer_connection_changed", "printer_reset", "recovery_executed", "recovery_rejected", "recovery_requested", "spool_adjusted", "spool_command_rejected", "spool_loaded", "spool_registered", "spool_retired", "spool_unloaded", "spool_unverified", "startup_reconciliation", "supervision_session_closed", "supervision_session_opened", "unaccounted_print", "unattended_printer_activity"];
|
|
2120
2153
|
/**
|
|
2121
2154
|
* The payload of one event as the type its kind declares, or `undefined` for
|
|
2122
2155
|
* an event of any other kind — one this client knows or one it does not. No
|
|
@@ -2202,6 +2235,14 @@ export declare class GeneratedClient extends GeneratedSurface {
|
|
|
2202
2235
|
* said no.
|
|
2203
2236
|
*/
|
|
2204
2237
|
look(printId: string, waitS?: number): Promise<Look>;
|
|
2238
|
+
/**
|
|
2239
|
+
* Call `printer_look` on the configured supervisor.
|
|
2240
|
+
*
|
|
2241
|
+
* Rejects with `Unreachable` when nothing answered, with `Unreadable` when
|
|
2242
|
+
* the answer could not be read, and with `Refused` when the supervisor
|
|
2243
|
+
* said no.
|
|
2244
|
+
*/
|
|
2245
|
+
printerLook(waitS?: number): Promise<Look>;
|
|
2205
2246
|
/**
|
|
2206
2247
|
* Call `manifest_set` on the configured supervisor.
|
|
2207
2248
|
*
|
package/dist/contract.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* generate-clients`, and commit what that writes.
|
|
8
8
|
*/
|
|
9
9
|
import { GeneratedSurface, reasonGiven } from "./surface.js";
|
|
10
|
-
export const CONTRACT_VERSION = "0.
|
|
10
|
+
export const CONTRACT_VERSION = "0.11.1";
|
|
11
11
|
/**
|
|
12
12
|
* Every operation this client exposes a method for, which is every operation
|
|
13
13
|
* the server declares and no other.
|
|
@@ -21,6 +21,7 @@ export const OPERATION_NAMES = [
|
|
|
21
21
|
"events",
|
|
22
22
|
"manifest_get",
|
|
23
23
|
"look",
|
|
24
|
+
"printer_look",
|
|
24
25
|
"manifest_set",
|
|
25
26
|
"spools",
|
|
26
27
|
"spool",
|
|
@@ -59,6 +60,7 @@ export const EVENT_KINDS = [
|
|
|
59
60
|
"agent_assessment",
|
|
60
61
|
"camera_degraded",
|
|
61
62
|
"camera_look",
|
|
63
|
+
"camera_retry",
|
|
62
64
|
"charge_pended",
|
|
63
65
|
"detector_health_changed",
|
|
64
66
|
"filament_change_signalled",
|
|
@@ -558,6 +560,49 @@ export const SHAPES = JSON.parse(`
|
|
|
558
560
|
"variants": {}
|
|
559
561
|
}
|
|
560
562
|
},
|
|
563
|
+
"CameraRetryPayload": {
|
|
564
|
+
"struct": {
|
|
565
|
+
"fields": {
|
|
566
|
+
"attempt": {
|
|
567
|
+
"paired_with": "",
|
|
568
|
+
"required": true,
|
|
569
|
+
"shape": {
|
|
570
|
+
"scalar": "integer"
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
"attempts": {
|
|
574
|
+
"paired_with": "",
|
|
575
|
+
"required": true,
|
|
576
|
+
"shape": {
|
|
577
|
+
"scalar": "integer"
|
|
578
|
+
}
|
|
579
|
+
},
|
|
580
|
+
"backoff_ms": {
|
|
581
|
+
"paired_with": "",
|
|
582
|
+
"required": true,
|
|
583
|
+
"shape": {
|
|
584
|
+
"scalar": "integer"
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
"excerpt": {
|
|
588
|
+
"paired_with": "",
|
|
589
|
+
"required": true,
|
|
590
|
+
"shape": {
|
|
591
|
+
"scalar": "string"
|
|
592
|
+
}
|
|
593
|
+
},
|
|
594
|
+
"status": {
|
|
595
|
+
"paired_with": "",
|
|
596
|
+
"required": true,
|
|
597
|
+
"shape": {
|
|
598
|
+
"scalar": "integer"
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"tag_field": "",
|
|
603
|
+
"variants": {}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
561
606
|
"ChargeKey": {
|
|
562
607
|
"union": {
|
|
563
608
|
"tag_field": "key",
|
|
@@ -1424,9 +1469,11 @@ export const SHAPES = JSON.parse(`
|
|
|
1424
1469
|
},
|
|
1425
1470
|
"print_id": {
|
|
1426
1471
|
"paired_with": "",
|
|
1427
|
-
"required":
|
|
1472
|
+
"required": false,
|
|
1428
1473
|
"shape": {
|
|
1429
|
-
"
|
|
1474
|
+
"nullable": {
|
|
1475
|
+
"ref": "PrintId"
|
|
1476
|
+
}
|
|
1430
1477
|
}
|
|
1431
1478
|
},
|
|
1432
1479
|
"relative_path": {
|
|
@@ -6269,6 +6316,22 @@ export class GeneratedClient extends GeneratedSurface {
|
|
|
6269
6316
|
const sending = undefined;
|
|
6270
6317
|
return await this.call("GET", target, asked, sending, "Look");
|
|
6271
6318
|
}
|
|
6319
|
+
/**
|
|
6320
|
+
* Call `printer_look` on the configured supervisor.
|
|
6321
|
+
*
|
|
6322
|
+
* Rejects with `Unreachable` when nothing answered, with `Unreadable` when
|
|
6323
|
+
* the answer could not be read, and with `Refused` when the supervisor
|
|
6324
|
+
* said no.
|
|
6325
|
+
*/
|
|
6326
|
+
async printerLook(waitS) {
|
|
6327
|
+
const target = `/v1/look`;
|
|
6328
|
+
const asked = [];
|
|
6329
|
+
if (waitS !== undefined) {
|
|
6330
|
+
asked.push(["wait_s", String(waitS)]);
|
|
6331
|
+
}
|
|
6332
|
+
const sending = undefined;
|
|
6333
|
+
return await this.call("GET", target, asked, sending, "Look");
|
|
6334
|
+
}
|
|
6272
6335
|
/**
|
|
6273
6336
|
* Call `manifest_set` on the configured supervisor.
|
|
6274
6337
|
*
|
package/package.json
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"main": "dist/index.js",
|
|
14
14
|
"name": "@printobserver/sdk",
|
|
15
|
-
"printobserverContractVersion": "0.
|
|
15
|
+
"printobserverContractVersion": "0.11.1",
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
18
|
"url": "https://github.com/nickderobertis/printobserver"
|
|
19
19
|
},
|
|
20
20
|
"type": "module",
|
|
21
21
|
"types": "dist/index.d.ts",
|
|
22
|
-
"version": "0.
|
|
22
|
+
"version": "0.11.1"
|
|
23
23
|
}
|