@boatdev/sdk 1.2.0 → 1.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.
Files changed (65) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/dist/apis/BoatApi.d.ts +2 -2
  3. package/dist/apis/BoatApi.js +2 -2
  4. package/dist/boat-helpers.d.ts +17 -1
  5. package/dist/boat-helpers.js +61 -0
  6. package/dist/esm/apis/BoatApi.d.ts +2 -2
  7. package/dist/esm/apis/BoatApi.js +2 -2
  8. package/dist/esm/boat-helpers.d.ts +17 -1
  9. package/dist/esm/boat-helpers.js +60 -0
  10. package/dist/esm/models/CommandRequest.d.ts +6 -0
  11. package/dist/esm/models/CommandRequest.js +2 -0
  12. package/dist/esm/models/CommandStreamFrame.d.ts +85 -0
  13. package/dist/esm/models/CommandStreamFrame.js +67 -0
  14. package/dist/esm/models/CreateSandboxRequest.d.ts +6 -0
  15. package/dist/esm/models/CreateSandboxRequest.js +2 -0
  16. package/dist/esm/models/ForkRequest.d.ts +6 -0
  17. package/dist/esm/models/ForkRequest.js +2 -0
  18. package/dist/esm/models/ResumeRequest.d.ts +6 -0
  19. package/dist/esm/models/ResumeRequest.js +2 -0
  20. package/dist/esm/models/Sandbox.d.ts +26 -0
  21. package/dist/esm/models/Sandbox.js +13 -0
  22. package/dist/esm/models/WebhookEventData.d.ts +10 -4
  23. package/dist/esm/models/WebhookEventData.js +4 -6
  24. package/dist/esm/models/WebhookEventType.d.ts +2 -0
  25. package/dist/esm/models/WebhookEventType.js +3 -1
  26. package/dist/esm/models/index.d.ts +1 -0
  27. package/dist/esm/models/index.js +1 -0
  28. package/dist/models/CommandRequest.d.ts +6 -0
  29. package/dist/models/CommandRequest.js +2 -0
  30. package/dist/models/CommandStreamFrame.d.ts +85 -0
  31. package/dist/models/CommandStreamFrame.js +75 -0
  32. package/dist/models/CreateSandboxRequest.d.ts +6 -0
  33. package/dist/models/CreateSandboxRequest.js +2 -0
  34. package/dist/models/ForkRequest.d.ts +6 -0
  35. package/dist/models/ForkRequest.js +2 -0
  36. package/dist/models/ResumeRequest.d.ts +6 -0
  37. package/dist/models/ResumeRequest.js +2 -0
  38. package/dist/models/Sandbox.d.ts +26 -0
  39. package/dist/models/Sandbox.js +14 -1
  40. package/dist/models/WebhookEventData.d.ts +10 -4
  41. package/dist/models/WebhookEventData.js +4 -6
  42. package/dist/models/WebhookEventType.d.ts +2 -0
  43. package/dist/models/WebhookEventType.js +3 -1
  44. package/dist/models/index.d.ts +1 -0
  45. package/dist/models/index.js +1 -0
  46. package/docs/BoatApi.md +6 -3
  47. package/docs/CommandRequest.md +2 -0
  48. package/docs/CommandStreamFrame.md +47 -0
  49. package/docs/CreateSandboxRequest.md +2 -0
  50. package/docs/ForkRequest.md +2 -0
  51. package/docs/ResumeRequest.md +2 -0
  52. package/docs/Sandbox.md +6 -0
  53. package/docs/WebhookEventData.md +2 -0
  54. package/package.json +1 -1
  55. package/src/apis/BoatApi.ts +7 -2
  56. package/src/boat-helpers.ts +75 -1
  57. package/src/models/CommandRequest.ts +8 -0
  58. package/src/models/CommandStreamFrame.ts +136 -0
  59. package/src/models/CreateSandboxRequest.ts +8 -0
  60. package/src/models/ForkRequest.ts +8 -0
  61. package/src/models/ResumeRequest.ts +8 -0
  62. package/src/models/Sandbox.ts +33 -0
  63. package/src/models/WebhookEventData.ts +14 -8
  64. package/src/models/WebhookEventType.ts +3 -1
  65. package/src/models/index.ts +1 -0
@@ -28,6 +28,13 @@ export const SandboxStateEnum = {
28
28
  Error: 'error',
29
29
  Cancelled: 'cancelled'
30
30
  };
31
+ /**
32
+ * @export
33
+ */
34
+ export const SandboxHealthEnum = {
35
+ Ok: 'ok',
36
+ Degraded: 'degraded'
37
+ };
31
38
  /**
32
39
  * @export
33
40
  */
@@ -90,6 +97,9 @@ export function SandboxFromJSONTyped(json, ignoreDiscriminator) {
90
97
  'name': json['name'],
91
98
  'state': json['state'],
92
99
  'error': json['error'] == null ? undefined : json['error'],
100
+ 'health': json['health'] == null ? undefined : json['health'],
101
+ 'healthReason': json['healthReason'] == null ? undefined : json['healthReason'],
102
+ 'degradedSince': json['degradedSince'] == null ? undefined : (new Date(json['degradedSince'])),
93
103
  'type': json['type'] == null ? undefined : json['type'],
94
104
  'vcpu': json['vcpu'] == null ? undefined : json['vcpu'],
95
105
  'memoryGB': json['memoryGB'] == null ? undefined : json['memoryGB'],
@@ -129,6 +139,9 @@ export function SandboxToJSONTyped(value, ignoreDiscriminator = false) {
129
139
  'name': value['name'],
130
140
  'state': value['state'],
131
141
  'error': value['error'],
142
+ 'health': value['health'],
143
+ 'healthReason': value['healthReason'],
144
+ 'degradedSince': value['degradedSince'] == null ? value['degradedSince'] : value['degradedSince'].toISOString(),
132
145
  'type': value['type'],
133
146
  'vcpu': value['vcpu'],
134
147
  'memoryGB': value['memoryGB'],
@@ -23,17 +23,23 @@ export interface WebhookEventData {
23
23
  */
24
24
  sandbox: WebhookEventDataSandbox;
25
25
  /**
26
- *
26
+ * On sandbox.ready, sandbox.error and sandbox.archived only.
27
27
  * @type {string}
28
28
  * @memberof WebhookEventData
29
29
  */
30
- previousState: string;
30
+ previousState?: string;
31
31
  /**
32
- *
32
+ * Absent on sandbox.hydrated.
33
+ * @type {string}
34
+ * @memberof WebhookEventData
35
+ */
36
+ state?: string;
37
+ /**
38
+ * On sandbox.degraded and sandbox.recovered. Why the sandbox is degraded (null on recovered).
33
39
  * @type {string}
34
40
  * @memberof WebhookEventData
35
41
  */
36
- state: string;
42
+ reason?: string | null;
37
43
  }
38
44
  /**
39
45
  * Check if a given object implements the WebhookEventData interface.
@@ -18,10 +18,6 @@ import { WebhookEventDataSandboxFromJSON, WebhookEventDataSandboxToJSON, } from
18
18
  export function instanceOfWebhookEventData(value) {
19
19
  if (!('sandbox' in value) || value['sandbox'] === undefined)
20
20
  return false;
21
- if (!('previousState' in value) || value['previousState'] === undefined)
22
- return false;
23
- if (!('state' in value) || value['state'] === undefined)
24
- return false;
25
21
  return true;
26
22
  }
27
23
  export function WebhookEventDataFromJSON(json) {
@@ -33,8 +29,9 @@ export function WebhookEventDataFromJSONTyped(json, ignoreDiscriminator) {
33
29
  }
34
30
  return {
35
31
  'sandbox': WebhookEventDataSandboxFromJSON(json['sandbox']),
36
- 'previousState': json['previousState'],
37
- 'state': json['state'],
32
+ 'previousState': json['previousState'] == null ? undefined : json['previousState'],
33
+ 'state': json['state'] == null ? undefined : json['state'],
34
+ 'reason': json['reason'] == null ? undefined : json['reason'],
38
35
  };
39
36
  }
40
37
  export function WebhookEventDataToJSON(json) {
@@ -48,5 +45,6 @@ export function WebhookEventDataToJSONTyped(value, ignoreDiscriminator = false)
48
45
  'sandbox': WebhookEventDataSandboxToJSON(value['sandbox']),
49
46
  'previousState': value['previousState'],
50
47
  'state': value['state'],
48
+ 'reason': value['reason'],
51
49
  };
52
50
  }
@@ -18,6 +18,8 @@ export declare const WebhookEventType: {
18
18
  readonly SandboxError: 'sandbox.error';
19
19
  readonly SandboxArchived: 'sandbox.archived';
20
20
  readonly SandboxHydrated: 'sandbox.hydrated';
21
+ readonly SandboxDegraded: 'sandbox.degraded';
22
+ readonly SandboxRecovered: 'sandbox.recovered';
21
23
  };
22
24
  export type WebhookEventType = typeof WebhookEventType[keyof typeof WebhookEventType];
23
25
  export declare function instanceOfWebhookEventType(value: any): boolean;
@@ -19,7 +19,9 @@ export const WebhookEventType = {
19
19
  SandboxReady: 'sandbox.ready',
20
20
  SandboxError: 'sandbox.error',
21
21
  SandboxArchived: 'sandbox.archived',
22
- SandboxHydrated: 'sandbox.hydrated'
22
+ SandboxHydrated: 'sandbox.hydrated',
23
+ SandboxDegraded: 'sandbox.degraded',
24
+ SandboxRecovered: 'sandbox.recovered'
23
25
  };
24
26
  export function instanceOfWebhookEventType(value) {
25
27
  for (const key in WebhookEventType) {
@@ -20,6 +20,7 @@ export * from './CommandRequest';
20
20
  export * from './CommandResponse';
21
21
  export * from './CommandStartedResponse';
22
22
  export * from './CommandStatusResponse';
23
+ export * from './CommandStreamFrame';
23
24
  export * from './CompletionEvent';
24
25
  export * from './Conversation';
25
26
  export * from './ConversationsResponse';
@@ -22,6 +22,7 @@ export * from './CommandRequest';
22
22
  export * from './CommandResponse';
23
23
  export * from './CommandStartedResponse';
24
24
  export * from './CommandStatusResponse';
25
+ export * from './CommandStreamFrame';
25
26
  export * from './CompletionEvent';
26
27
  export * from './Conversation';
27
28
  export * from './ConversationsResponse';
@@ -39,6 +39,12 @@ export interface CommandRequest {
39
39
  * @memberof CommandRequest
40
40
  */
41
41
  detached?: boolean;
42
+ /**
43
+ * Stream the output as the command writes it: the response is newline-delimited JSON (application/x-ndjson), one CommandStreamFrame per line. Ignored with detached.
44
+ * @type {boolean}
45
+ * @memberof CommandRequest
46
+ */
47
+ stream?: boolean;
42
48
  }
43
49
  /**
44
50
  * Check if a given object implements the CommandRequest interface.
@@ -38,6 +38,7 @@ function CommandRequestFromJSONTyped(json, ignoreDiscriminator) {
38
38
  'cwd': json['cwd'] == null ? undefined : json['cwd'],
39
39
  'timeoutSeconds': json['timeoutSeconds'] == null ? undefined : json['timeoutSeconds'],
40
40
  'detached': json['detached'] == null ? undefined : json['detached'],
41
+ 'stream': json['stream'] == null ? undefined : json['stream'],
41
42
  };
42
43
  }
43
44
  function CommandRequestToJSON(json) {
@@ -52,5 +53,6 @@ function CommandRequestToJSONTyped(value, ignoreDiscriminator = false) {
52
53
  'cwd': value['cwd'],
53
54
  'timeoutSeconds': value['timeoutSeconds'],
54
55
  'detached': value['detached'],
56
+ 'stream': value['stream'],
55
57
  };
56
58
  }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Boat Public API v1
3
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * One line of a streamed command. `started` first, then `stdout`/`stderr` chunks, then exactly one `exit` (the synchronous result, without stdout/stderr) or `error`.
14
+ * @export
15
+ * @interface CommandStreamFrame
16
+ */
17
+ export interface CommandStreamFrame {
18
+ /**
19
+ *
20
+ * @type {CommandStreamFrameTypeEnum}
21
+ * @memberof CommandStreamFrame
22
+ */
23
+ type: CommandStreamFrameTypeEnum;
24
+ /**
25
+ * stdout/stderr: the chunk of output, UTF-8.
26
+ * @type {string}
27
+ * @memberof CommandStreamFrame
28
+ */
29
+ data?: string;
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof CommandStreamFrame
34
+ */
35
+ exitCode?: number | null;
36
+ /**
37
+ *
38
+ * @type {boolean}
39
+ * @memberof CommandStreamFrame
40
+ */
41
+ success?: boolean;
42
+ /**
43
+ *
44
+ * @type {boolean}
45
+ * @memberof CommandStreamFrame
46
+ */
47
+ timedOut?: boolean;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof CommandStreamFrame
52
+ */
53
+ error?: string;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof CommandStreamFrame
58
+ */
59
+ message?: string;
60
+ /**
61
+ * error: true when the command provably never ran (the sandbox is still restoring its disk), so sending it again is safe.
62
+ * @type {boolean}
63
+ * @memberof CommandStreamFrame
64
+ */
65
+ retryable?: boolean;
66
+ }
67
+ /**
68
+ * @export
69
+ */
70
+ export declare const CommandStreamFrameTypeEnum: {
71
+ readonly Started: 'started';
72
+ readonly Stdout: 'stdout';
73
+ readonly Stderr: 'stderr';
74
+ readonly Exit: 'exit';
75
+ readonly Error: 'error';
76
+ };
77
+ export type CommandStreamFrameTypeEnum = typeof CommandStreamFrameTypeEnum[keyof typeof CommandStreamFrameTypeEnum];
78
+ /**
79
+ * Check if a given object implements the CommandStreamFrame interface.
80
+ */
81
+ export declare function instanceOfCommandStreamFrame(value: object): value is CommandStreamFrame;
82
+ export declare function CommandStreamFrameFromJSON(json: any): CommandStreamFrame;
83
+ export declare function CommandStreamFrameFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommandStreamFrame;
84
+ export declare function CommandStreamFrameToJSON(json: any): CommandStreamFrame;
85
+ export declare function CommandStreamFrameToJSONTyped(value?: CommandStreamFrame | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Boat Public API v1
6
+ * Public JSON API for creating, operating, prompting, observing, and exposing sandboxes from backend services, CI jobs, hosted workers, and Boat automation products. The v1 reference intentionally documents the developer integration surface only. Dashboard billing actions are not part of v1.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CommandStreamFrameTypeEnum = void 0;
17
+ exports.instanceOfCommandStreamFrame = instanceOfCommandStreamFrame;
18
+ exports.CommandStreamFrameFromJSON = CommandStreamFrameFromJSON;
19
+ exports.CommandStreamFrameFromJSONTyped = CommandStreamFrameFromJSONTyped;
20
+ exports.CommandStreamFrameToJSON = CommandStreamFrameToJSON;
21
+ exports.CommandStreamFrameToJSONTyped = CommandStreamFrameToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.CommandStreamFrameTypeEnum = {
26
+ Started: 'started',
27
+ Stdout: 'stdout',
28
+ Stderr: 'stderr',
29
+ Exit: 'exit',
30
+ Error: 'error'
31
+ };
32
+ /**
33
+ * Check if a given object implements the CommandStreamFrame interface.
34
+ */
35
+ function instanceOfCommandStreamFrame(value) {
36
+ if (!('type' in value) || value['type'] === undefined)
37
+ return false;
38
+ return true;
39
+ }
40
+ function CommandStreamFrameFromJSON(json) {
41
+ return CommandStreamFrameFromJSONTyped(json, false);
42
+ }
43
+ function CommandStreamFrameFromJSONTyped(json, ignoreDiscriminator) {
44
+ if (json == null) {
45
+ return json;
46
+ }
47
+ return {
48
+ 'type': json['type'],
49
+ 'data': json['data'] == null ? undefined : json['data'],
50
+ 'exitCode': json['exitCode'] == null ? undefined : json['exitCode'],
51
+ 'success': json['success'] == null ? undefined : json['success'],
52
+ 'timedOut': json['timedOut'] == null ? undefined : json['timedOut'],
53
+ 'error': json['error'] == null ? undefined : json['error'],
54
+ 'message': json['message'] == null ? undefined : json['message'],
55
+ 'retryable': json['retryable'] == null ? undefined : json['retryable'],
56
+ };
57
+ }
58
+ function CommandStreamFrameToJSON(json) {
59
+ return CommandStreamFrameToJSONTyped(json, false);
60
+ }
61
+ function CommandStreamFrameToJSONTyped(value, ignoreDiscriminator = false) {
62
+ if (value == null) {
63
+ return value;
64
+ }
65
+ return {
66
+ 'type': value['type'],
67
+ 'data': value['data'],
68
+ 'exitCode': value['exitCode'],
69
+ 'success': value['success'],
70
+ 'timedOut': value['timedOut'],
71
+ 'error': value['error'],
72
+ 'message': value['message'],
73
+ 'retryable': value['retryable'],
74
+ };
75
+ }
@@ -53,6 +53,12 @@ export interface CreateSandboxRequest {
53
53
  * @memberof CreateSandboxRequest
54
54
  */
55
55
  snapshots?: boolean;
56
+ /**
57
+ * Pass `true` to get a sandbox only if a machine of this type is ready right now. The call answers within about 1.5 s: either the usual `202` with the sandbox, or `503` `no_ready_machine` with nothing created, billed, or counted against your start limits, so you can retry or fall back at once. Without it, a create waits for a machine to be built when none is ready. Works with `from`; fork and resume take it too.
58
+ * @type {boolean}
59
+ * @memberof CreateSandboxRequest
60
+ */
61
+ failFast?: boolean;
56
62
  /**
57
63
  * Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user via `bash`, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as `setupStatus` (pending/running/done/failed) and `setupError` on the sandbox. Rejected with a 400 `invalid_setup_script` error when it is not a string or exceeds 64KB.
58
64
  * @type {string}
@@ -47,6 +47,7 @@ function CreateSandboxRequestFromJSONTyped(json, ignoreDiscriminator) {
47
47
  'environment': json['environment'] == null ? undefined : json['environment'],
48
48
  'noEnv': json['noEnv'] == null ? undefined : json['noEnv'],
49
49
  'snapshots': json['snapshots'] == null ? undefined : json['snapshots'],
50
+ 'failFast': json['failFast'] == null ? undefined : json['failFast'],
50
51
  'setupScript': json['setupScript'] == null ? undefined : json['setupScript'],
51
52
  'org': json['org'] == null ? undefined : json['org'],
52
53
  'teamId': json['teamId'] == null ? undefined : json['teamId'],
@@ -67,6 +68,7 @@ function CreateSandboxRequestToJSONTyped(value, ignoreDiscriminator = false) {
67
68
  'environment': value['environment'],
68
69
  'noEnv': value['noEnv'],
69
70
  'snapshots': value['snapshots'],
71
+ 'failFast': value['failFast'],
70
72
  'setupScript': value['setupScript'],
71
73
  'org': value['org'],
72
74
  'teamId': value['teamId'],
@@ -15,6 +15,12 @@
15
15
  * @interface ForkRequest
16
16
  */
17
17
  export interface ForkRequest {
18
+ /**
19
+ * Pass `true` to fork only if a machine is ready right now. Within about 1.5 s you get the usual `202`, or `503` `no_ready_machine` with no fork created and nothing counted against your start limits.
20
+ * @type {boolean}
21
+ * @memberof ForkRequest
22
+ */
23
+ failFast?: boolean;
18
24
  /**
19
25
  * Replaces the env the fork would otherwise inherit from the source sandbox. Same validation rules as `CreateSandboxRequest.env`.
20
26
  * @type {{ [key: string]: string; }}
@@ -41,6 +41,7 @@ function ForkRequestFromJSONTyped(json, ignoreDiscriminator) {
41
41
  return json;
42
42
  }
43
43
  return {
44
+ 'failFast': json['failFast'] == null ? undefined : json['failFast'],
44
45
  'env': json['env'] == null ? undefined : json['env'],
45
46
  'environment': json['environment'] == null ? undefined : json['environment'],
46
47
  'noEnv': json['noEnv'] == null ? undefined : json['noEnv'],
@@ -56,6 +57,7 @@ function ForkRequestToJSONTyped(value, ignoreDiscriminator = false) {
56
57
  return value;
57
58
  }
58
59
  return {
60
+ 'failFast': value['failFast'],
59
61
  'env': value['env'],
60
62
  'environment': value['environment'],
61
63
  'noEnv': value['noEnv'],
@@ -15,6 +15,12 @@
15
15
  * @interface ResumeRequest
16
16
  */
17
17
  export interface ResumeRequest {
18
+ /**
19
+ * Pass `true` to resume only if a machine is ready right now. Within about 1.5 s you get the usual `202`, or `503` `no_ready_machine` with the sandbox left stopped and nothing counted against your start limits.
20
+ * @type {boolean}
21
+ * @memberof ResumeRequest
22
+ */
23
+ failFast?: boolean;
18
24
  /**
19
25
  * Resume onto a different machine size. Omit to keep the sandbox's current type. A resume already restores onto a fresh machine, so changing size costs nothing extra. Shrinking is rejected with `type_too_small` when the sandbox's data would not fit the smaller disk.
20
26
  * @type {ResumeRequestTypeEnum}
@@ -41,6 +41,7 @@ function ResumeRequestFromJSONTyped(json, ignoreDiscriminator) {
41
41
  return json;
42
42
  }
43
43
  return {
44
+ 'failFast': json['failFast'] == null ? undefined : json['failFast'],
44
45
  'type': json['type'] == null ? undefined : json['type'],
45
46
  'env': json['env'] == null ? undefined : json['env'],
46
47
  'environment': json['environment'] == null ? undefined : json['environment'],
@@ -56,6 +57,7 @@ function ResumeRequestToJSONTyped(value, ignoreDiscriminator = false) {
56
57
  return value;
57
58
  }
58
59
  return {
60
+ 'failFast': value['failFast'],
59
61
  'type': value['type'],
60
62
  'env': value['env'],
61
63
  'environment': value['environment'],
@@ -40,6 +40,24 @@ export interface Sandbox {
40
40
  * @memberof Sandbox
41
41
  */
42
42
  error?: string | null;
43
+ /**
44
+ * `degraded` when the machine is alive but Boat cannot fully reach it (for example a firewall rule inside the sandbox blocks the tunnel). The sandbox keeps running.
45
+ * @type {SandboxHealthEnum}
46
+ * @memberof Sandbox
47
+ */
48
+ health?: SandboxHealthEnum;
49
+ /**
50
+ * Why the sandbox is degraded, or null.
51
+ * @type {string}
52
+ * @memberof Sandbox
53
+ */
54
+ healthReason?: string | null;
55
+ /**
56
+ * When the sandbox became degraded, or null.
57
+ * @type {Date}
58
+ * @memberof Sandbox
59
+ */
60
+ degradedSince?: Date | null;
43
61
  /**
44
62
  * Current machine size: what the sandbox was created with, or the size it was last resumed or forked onto.
45
63
  * @type {SandboxTypeEnum}
@@ -208,6 +226,14 @@ export declare const SandboxStateEnum: {
208
226
  readonly Cancelled: 'cancelled';
209
227
  };
210
228
  export type SandboxStateEnum = typeof SandboxStateEnum[keyof typeof SandboxStateEnum];
229
+ /**
230
+ * @export
231
+ */
232
+ export declare const SandboxHealthEnum: {
233
+ readonly Ok: 'ok';
234
+ readonly Degraded: 'degraded';
235
+ };
236
+ export type SandboxHealthEnum = typeof SandboxHealthEnum[keyof typeof SandboxHealthEnum];
211
237
  /**
212
238
  * @export
213
239
  */
@@ -13,7 +13,7 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.SandboxSetupStatusEnum = exports.SandboxLastSnapshotStatusEnum = exports.SandboxMachineProviderEnum = exports.SandboxTypeEnum = exports.SandboxStateEnum = void 0;
16
+ exports.SandboxSetupStatusEnum = exports.SandboxLastSnapshotStatusEnum = exports.SandboxMachineProviderEnum = exports.SandboxTypeEnum = exports.SandboxHealthEnum = exports.SandboxStateEnum = void 0;
17
17
  exports.instanceOfSandbox = instanceOfSandbox;
18
18
  exports.SandboxFromJSON = SandboxFromJSON;
19
19
  exports.SandboxFromJSONTyped = SandboxFromJSONTyped;
@@ -36,6 +36,13 @@ exports.SandboxStateEnum = {
36
36
  Error: 'error',
37
37
  Cancelled: 'cancelled'
38
38
  };
39
+ /**
40
+ * @export
41
+ */
42
+ exports.SandboxHealthEnum = {
43
+ Ok: 'ok',
44
+ Degraded: 'degraded'
45
+ };
39
46
  /**
40
47
  * @export
41
48
  */
@@ -98,6 +105,9 @@ function SandboxFromJSONTyped(json, ignoreDiscriminator) {
98
105
  'name': json['name'],
99
106
  'state': json['state'],
100
107
  'error': json['error'] == null ? undefined : json['error'],
108
+ 'health': json['health'] == null ? undefined : json['health'],
109
+ 'healthReason': json['healthReason'] == null ? undefined : json['healthReason'],
110
+ 'degradedSince': json['degradedSince'] == null ? undefined : (new Date(json['degradedSince'])),
101
111
  'type': json['type'] == null ? undefined : json['type'],
102
112
  'vcpu': json['vcpu'] == null ? undefined : json['vcpu'],
103
113
  'memoryGB': json['memoryGB'] == null ? undefined : json['memoryGB'],
@@ -137,6 +147,9 @@ function SandboxToJSONTyped(value, ignoreDiscriminator = false) {
137
147
  'name': value['name'],
138
148
  'state': value['state'],
139
149
  'error': value['error'],
150
+ 'health': value['health'],
151
+ 'healthReason': value['healthReason'],
152
+ 'degradedSince': value['degradedSince'] == null ? value['degradedSince'] : value['degradedSince'].toISOString(),
140
153
  'type': value['type'],
141
154
  'vcpu': value['vcpu'],
142
155
  'memoryGB': value['memoryGB'],
@@ -23,17 +23,23 @@ export interface WebhookEventData {
23
23
  */
24
24
  sandbox: WebhookEventDataSandbox;
25
25
  /**
26
- *
26
+ * On sandbox.ready, sandbox.error and sandbox.archived only.
27
27
  * @type {string}
28
28
  * @memberof WebhookEventData
29
29
  */
30
- previousState: string;
30
+ previousState?: string;
31
31
  /**
32
- *
32
+ * Absent on sandbox.hydrated.
33
+ * @type {string}
34
+ * @memberof WebhookEventData
35
+ */
36
+ state?: string;
37
+ /**
38
+ * On sandbox.degraded and sandbox.recovered. Why the sandbox is degraded (null on recovered).
33
39
  * @type {string}
34
40
  * @memberof WebhookEventData
35
41
  */
36
- state: string;
42
+ reason?: string | null;
37
43
  }
38
44
  /**
39
45
  * Check if a given object implements the WebhookEventData interface.
@@ -25,10 +25,6 @@ const WebhookEventDataSandbox_1 = require("./WebhookEventDataSandbox");
25
25
  function instanceOfWebhookEventData(value) {
26
26
  if (!('sandbox' in value) || value['sandbox'] === undefined)
27
27
  return false;
28
- if (!('previousState' in value) || value['previousState'] === undefined)
29
- return false;
30
- if (!('state' in value) || value['state'] === undefined)
31
- return false;
32
28
  return true;
33
29
  }
34
30
  function WebhookEventDataFromJSON(json) {
@@ -40,8 +36,9 @@ function WebhookEventDataFromJSONTyped(json, ignoreDiscriminator) {
40
36
  }
41
37
  return {
42
38
  'sandbox': (0, WebhookEventDataSandbox_1.WebhookEventDataSandboxFromJSON)(json['sandbox']),
43
- 'previousState': json['previousState'],
44
- 'state': json['state'],
39
+ 'previousState': json['previousState'] == null ? undefined : json['previousState'],
40
+ 'state': json['state'] == null ? undefined : json['state'],
41
+ 'reason': json['reason'] == null ? undefined : json['reason'],
45
42
  };
46
43
  }
47
44
  function WebhookEventDataToJSON(json) {
@@ -55,5 +52,6 @@ function WebhookEventDataToJSONTyped(value, ignoreDiscriminator = false) {
55
52
  'sandbox': (0, WebhookEventDataSandbox_1.WebhookEventDataSandboxToJSON)(value['sandbox']),
56
53
  'previousState': value['previousState'],
57
54
  'state': value['state'],
55
+ 'reason': value['reason'],
58
56
  };
59
57
  }
@@ -18,6 +18,8 @@ export declare const WebhookEventType: {
18
18
  readonly SandboxError: 'sandbox.error';
19
19
  readonly SandboxArchived: 'sandbox.archived';
20
20
  readonly SandboxHydrated: 'sandbox.hydrated';
21
+ readonly SandboxDegraded: 'sandbox.degraded';
22
+ readonly SandboxRecovered: 'sandbox.recovered';
21
23
  };
22
24
  export type WebhookEventType = typeof WebhookEventType[keyof typeof WebhookEventType];
23
25
  export declare function instanceOfWebhookEventType(value: any): boolean;
@@ -27,7 +27,9 @@ exports.WebhookEventType = {
27
27
  SandboxReady: 'sandbox.ready',
28
28
  SandboxError: 'sandbox.error',
29
29
  SandboxArchived: 'sandbox.archived',
30
- SandboxHydrated: 'sandbox.hydrated'
30
+ SandboxHydrated: 'sandbox.hydrated',
31
+ SandboxDegraded: 'sandbox.degraded',
32
+ SandboxRecovered: 'sandbox.recovered'
31
33
  };
32
34
  function instanceOfWebhookEventType(value) {
33
35
  for (const key in exports.WebhookEventType) {
@@ -20,6 +20,7 @@ export * from './CommandRequest';
20
20
  export * from './CommandResponse';
21
21
  export * from './CommandStartedResponse';
22
22
  export * from './CommandStatusResponse';
23
+ export * from './CommandStreamFrame';
23
24
  export * from './CompletionEvent';
24
25
  export * from './Conversation';
25
26
  export * from './ConversationsResponse';
@@ -38,6 +38,7 @@ __exportStar(require("./CommandRequest"), exports);
38
38
  __exportStar(require("./CommandResponse"), exports);
39
39
  __exportStar(require("./CommandStartedResponse"), exports);
40
40
  __exportStar(require("./CommandStatusResponse"), exports);
41
+ __exportStar(require("./CommandStreamFrame"), exports);
41
42
  __exportStar(require("./CompletionEvent"), exports);
42
43
  __exportStar(require("./Conversation"), exports);
43
44
  __exportStar(require("./ConversationsResponse"), exports);