@daytonaio/sdk 0.200.1 → 0.202.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/cjs/CodeInterpreter.js +1 -1
- package/cjs/CodeInterpreter.js.map +1 -1
- package/cjs/Daytona.d.ts +17 -5
- package/cjs/Daytona.js +23 -16
- package/cjs/Daytona.js.map +1 -1
- package/cjs/FileSystem.d.ts +5 -1
- package/cjs/FileSystem.js +1 -1
- package/cjs/FileSystem.js.map +1 -1
- package/cjs/Image.js +14 -14
- package/cjs/Image.js.map +1 -1
- package/cjs/LspServer.js +1 -1
- package/cjs/LspServer.js.map +1 -1
- package/cjs/ObjectStorage.d.ts +2 -1
- package/cjs/ObjectStorage.js +1 -5
- package/cjs/ObjectStorage.js.map +1 -1
- package/cjs/Sandbox.d.ts +74 -10
- package/cjs/Sandbox.js +120 -31
- package/cjs/Sandbox.js.map +1 -1
- package/cjs/Snapshot.js +1 -0
- package/cjs/Snapshot.js.map +1 -1
- package/cjs/errors/DaytonaError.d.ts +152 -128
- package/cjs/errors/DaytonaError.js +276 -150
- package/cjs/errors/DaytonaError.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +44 -6
- package/cjs/index.js.map +1 -1
- package/cjs/utils/FileTransfer.js +5 -2
- package/cjs/utils/FileTransfer.js.map +1 -1
- package/cjs/utils/fileUrlSigning.d.ts +4 -0
- package/cjs/utils/fileUrlSigning.js +47 -0
- package/cjs/utils/fileUrlSigning.js.map +1 -0
- package/esm/CodeInterpreter.js +2 -2
- package/esm/CodeInterpreter.js.map +1 -1
- package/esm/Daytona.d.ts +17 -5
- package/esm/Daytona.js +24 -17
- package/esm/Daytona.js.map +1 -1
- package/esm/FileSystem.d.ts +5 -1
- package/esm/FileSystem.js +1 -1
- package/esm/FileSystem.js.map +1 -1
- package/esm/Image.js +15 -15
- package/esm/Image.js.map +1 -1
- package/esm/LspServer.js +2 -2
- package/esm/LspServer.js.map +1 -1
- package/esm/ObjectStorage.d.ts +2 -1
- package/esm/ObjectStorage.js +1 -5
- package/esm/ObjectStorage.js.map +1 -1
- package/esm/Sandbox.d.ts +74 -10
- package/esm/Sandbox.js +121 -32
- package/esm/Sandbox.js.map +1 -1
- package/esm/Snapshot.js +1 -0
- package/esm/Snapshot.js.map +1 -1
- package/esm/errors/DaytonaError.d.ts +152 -128
- package/esm/errors/DaytonaError.js +242 -144
- package/esm/errors/DaytonaError.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +13 -1
- package/esm/index.js.map +1 -1
- package/esm/utils/FileTransfer.js +5 -2
- package/esm/utils/FileTransfer.js.map +1 -1
- package/esm/utils/Import.js +5 -3
- package/esm/utils/fileUrlSigning.d.ts +4 -0
- package/esm/utils/fileUrlSigning.js +42 -0
- package/esm/utils/fileUrlSigning.js.map +1 -0
- package/package.json +15 -13
|
@@ -4,193 +4,316 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.DaytonaConnectionError = exports.
|
|
7
|
+
exports.DaytonaRecordingFfmpegNotFoundError = exports.DaytonaRecordingStillActiveError = exports.DaytonaA11yUnavailableError = exports.DaytonaCommandAlreadyCompletedError = exports.DaytonaSessionEndedError = exports.DaytonaProcessNotFoundError = exports.DaytonaProcessExecutionTimeoutError = exports.DaytonaLspServerNotInitializedError = exports.DaytonaFileReadFailedError = exports.DaytonaInvalidFilePathError = exports.DaytonaFileAccessDeniedError = exports.DaytonaFileNotFoundError = exports.DaytonaGitMergeConflictError = exports.DaytonaGitDirtyWorktreeError = exports.DaytonaGitPushRejectedError = exports.DaytonaGitBranchExistsError = exports.DaytonaGitBranchNotFoundError = exports.DaytonaGitRepoNotFoundError = exports.DaytonaGitAuthFailedError = exports.DaytonaConnectionTimeoutError = exports.DaytonaConnectionError = exports.DaytonaInvalidArgumentError = exports.DaytonaAuthorizationError = exports.DaytonaValidationError = exports.DaytonaServiceUnavailableError = exports.DaytonaBadGatewayError = exports.DaytonaInternalServerError = exports.DaytonaRateLimitError = exports.DaytonaUnprocessableEntityError = exports.DaytonaGoneError = exports.DaytonaConflictError = exports.DaytonaTimeoutError = exports.DaytonaNotFoundError = exports.DaytonaForbiddenError = exports.DaytonaAuthenticationError = exports.DaytonaBadRequestError = exports.DaytonaError = exports.SOURCE_PROXY = exports.SOURCE_DAEMON = exports.SOURCE_API = void 0;
|
|
8
8
|
exports.errorClassFromStatusCode = errorClassFromStatusCode;
|
|
9
9
|
exports.createDaytonaError = createDaytonaError;
|
|
10
10
|
exports.createAxiosDaytonaError = createAxiosDaytonaError;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
12
|
+
* Wire-format `source` identifiers set by the translation layer when a
|
|
13
|
+
* Daytona service stamps them on the wire envelope. `source = undefined`
|
|
14
|
+
* means the response did not carry a structured envelope (treat as opaque).
|
|
15
|
+
*/
|
|
16
|
+
exports.SOURCE_API = 'DAYTONA_API';
|
|
17
|
+
exports.SOURCE_DAEMON = 'DAYTONA_DAEMON';
|
|
18
|
+
exports.SOURCE_PROXY = 'DAYTONA_PROXY';
|
|
19
|
+
/**
|
|
20
|
+
* Base error for Daytona SDK. `statusCode` and `code` are populated only
|
|
21
|
+
* for errors translated from a server response. `source` is `undefined`
|
|
22
|
+
* unless the caller (or the translation layer) sets it.
|
|
26
23
|
*/
|
|
27
24
|
class DaytonaError extends Error {
|
|
28
|
-
/** HTTP status code if available */
|
|
29
25
|
statusCode;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/** Response headers if available */
|
|
26
|
+
code;
|
|
27
|
+
source;
|
|
33
28
|
headers;
|
|
34
|
-
constructor(message, statusCode, headers,
|
|
29
|
+
constructor(message, statusCode, headers, code, source) {
|
|
35
30
|
super(message);
|
|
36
31
|
this.name = new.target.name;
|
|
37
32
|
this.statusCode = statusCode;
|
|
38
33
|
this.headers = headers;
|
|
39
|
-
this.
|
|
34
|
+
this.code = code;
|
|
35
|
+
this.source = source;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use {@link DaytonaError.code} instead. Kept so existing
|
|
39
|
+
* `err.errorCode` reads keep returning the machine-readable code.
|
|
40
|
+
* @returns the machine-readable error code, or `undefined` when the
|
|
41
|
+
* response did not carry one (same as {@link DaytonaError.code})
|
|
42
|
+
*/
|
|
43
|
+
get errorCode() {
|
|
44
|
+
return this.code;
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
exports.DaytonaError = DaytonaError;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
// HTTP-status classes — one per status code Daytona services emit.
|
|
49
|
+
// Names follow HTTP terminology (BadRequest=400, Forbidden=403).
|
|
50
|
+
/** The request was malformed or invalid (HTTP 400). */
|
|
51
|
+
class DaytonaBadRequestError extends DaytonaError {
|
|
52
|
+
}
|
|
53
|
+
exports.DaytonaBadRequestError = DaytonaBadRequestError;
|
|
54
|
+
/** Authentication failed — missing or invalid credentials (HTTP 401). */
|
|
55
|
+
class DaytonaAuthenticationError extends DaytonaError {
|
|
56
|
+
}
|
|
57
|
+
exports.DaytonaAuthenticationError = DaytonaAuthenticationError;
|
|
58
|
+
/** The authenticated caller lacks permission for the operation (HTTP 403). */
|
|
59
|
+
class DaytonaForbiddenError extends DaytonaError {
|
|
60
|
+
}
|
|
61
|
+
exports.DaytonaForbiddenError = DaytonaForbiddenError;
|
|
62
|
+
/** The requested resource does not exist (HTTP 404). */
|
|
57
63
|
class DaytonaNotFoundError extends DaytonaError {
|
|
58
64
|
}
|
|
59
65
|
exports.DaytonaNotFoundError = DaytonaNotFoundError;
|
|
60
66
|
/**
|
|
61
|
-
*
|
|
67
|
+
* The operation timed out (HTTP 408, or 504 when a gateway timed out).
|
|
62
68
|
*
|
|
63
|
-
* @
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* } catch (error) {
|
|
70
|
-
* if (error instanceof DaytonaRateLimitError) {
|
|
71
|
-
* console.log(error.errorCode)
|
|
72
|
-
* }
|
|
73
|
-
* }
|
|
74
|
-
* ```
|
|
69
|
+
* Also matches {@link DaytonaConnectionTimeoutError} via `instanceof`, even
|
|
70
|
+
* though that class sits under {@link DaytonaConnectionError} in the prototype
|
|
71
|
+
* chain. Transport timeouts were raised as `DaytonaTimeoutError` before
|
|
72
|
+
* `DaytonaConnectionTimeoutError` existed, so this keeps pre-existing
|
|
73
|
+
* `catch (err) { if (err instanceof DaytonaTimeoutError) ... }` blocks working
|
|
74
|
+
* — the same compatibility the Python SDK gets from inheriting both classes.
|
|
75
75
|
*/
|
|
76
|
+
class DaytonaTimeoutError extends DaytonaError {
|
|
77
|
+
static [Symbol.hasInstance](value) {
|
|
78
|
+
// Only the base class widens; subclasses (e.g. ProcessExecutionTimeout)
|
|
79
|
+
// must keep exact prototype-chain semantics.
|
|
80
|
+
if (this === DaytonaTimeoutError && value instanceof DaytonaConnectionTimeoutError) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
return Function.prototype[Symbol.hasInstance].call(this, value);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
exports.DaytonaTimeoutError = DaytonaTimeoutError;
|
|
87
|
+
/** The request conflicts with the current state of the resource (HTTP 409). */
|
|
88
|
+
class DaytonaConflictError extends DaytonaError {
|
|
89
|
+
}
|
|
90
|
+
exports.DaytonaConflictError = DaytonaConflictError;
|
|
91
|
+
/** The resource existed but is permanently gone (HTTP 410). */
|
|
92
|
+
class DaytonaGoneError extends DaytonaError {
|
|
93
|
+
}
|
|
94
|
+
exports.DaytonaGoneError = DaytonaGoneError;
|
|
95
|
+
/** The request was well-formed but semantically invalid (HTTP 422). */
|
|
96
|
+
class DaytonaUnprocessableEntityError extends DaytonaError {
|
|
97
|
+
}
|
|
98
|
+
exports.DaytonaUnprocessableEntityError = DaytonaUnprocessableEntityError;
|
|
99
|
+
/** The caller exceeded a rate limit (HTTP 429). */
|
|
76
100
|
class DaytonaRateLimitError extends DaytonaError {
|
|
77
101
|
}
|
|
78
102
|
exports.DaytonaRateLimitError = DaytonaRateLimitError;
|
|
103
|
+
/** A Daytona service failed unexpectedly (HTTP 500). */
|
|
104
|
+
class DaytonaInternalServerError extends DaytonaError {
|
|
105
|
+
}
|
|
106
|
+
exports.DaytonaInternalServerError = DaytonaInternalServerError;
|
|
107
|
+
/** An upstream gateway returned an invalid response (HTTP 502). */
|
|
108
|
+
class DaytonaBadGatewayError extends DaytonaError {
|
|
109
|
+
}
|
|
110
|
+
exports.DaytonaBadGatewayError = DaytonaBadGatewayError;
|
|
111
|
+
/** The service is temporarily unable to handle the request (HTTP 503). */
|
|
112
|
+
class DaytonaServiceUnavailableError extends DaytonaError {
|
|
113
|
+
}
|
|
114
|
+
exports.DaytonaServiceUnavailableError = DaytonaServiceUnavailableError;
|
|
115
|
+
// ============================================================================
|
|
116
|
+
// Backward-compatibility subclasses. New functionality belongs elsewhere in
|
|
117
|
+
// this file, not here. These are what the 400/403 entries of
|
|
118
|
+
// STATUS_CODE_TO_ERROR throw so pre-rename `instanceof` checks keep matching.
|
|
119
|
+
// They must stay declared BEFORE that map (TDZ) and in this file (import
|
|
120
|
+
// cycle), and can be removed together with those two map entries in a future
|
|
121
|
+
// major release. The deprecated `errorCode` getter on DaytonaError belongs to
|
|
122
|
+
// the same removal set.
|
|
123
|
+
// ============================================================================
|
|
79
124
|
/**
|
|
80
|
-
*
|
|
125
|
+
* Legacy umbrella for validation failures. Kept so existing
|
|
126
|
+
* `catch (err) { if (err instanceof DaytonaValidationError) ... }` blocks keep
|
|
127
|
+
* matching both server-returned HTTP 400s and locally rejected arguments.
|
|
81
128
|
*
|
|
82
|
-
* @
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* if (error instanceof DaytonaAuthenticationError) {
|
|
90
|
-
* console.log(error.statusCode)
|
|
91
|
-
* }
|
|
92
|
-
* }
|
|
93
|
-
* ```
|
|
129
|
+
* @deprecated Do not throw or catch this directly in new code. Branch on the
|
|
130
|
+
* precise class instead:
|
|
131
|
+
* - {@link DaytonaInvalidArgumentError} — the SDK rejected your arguments
|
|
132
|
+
* locally, before any request was sent.
|
|
133
|
+
* - {@link DaytonaBadRequestError} — a Daytona service returned HTTP 400.
|
|
134
|
+
* - {@link DaytonaUnprocessableEntityError} — a Daytona service returned
|
|
135
|
+
* HTTP 422 (well-formed but semantically invalid).
|
|
94
136
|
*/
|
|
95
|
-
class
|
|
137
|
+
class DaytonaValidationError extends DaytonaBadRequestError {
|
|
96
138
|
}
|
|
97
|
-
exports.
|
|
139
|
+
exports.DaytonaValidationError = DaytonaValidationError;
|
|
98
140
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* try {
|
|
104
|
-
* await daytona.get('sandbox-without-access')
|
|
105
|
-
* } catch (error) {
|
|
106
|
-
* if (error instanceof DaytonaAuthorizationError) {
|
|
107
|
-
* console.log(error.message)
|
|
108
|
-
* }
|
|
109
|
-
* }
|
|
110
|
-
* ```
|
|
141
|
+
* @deprecated Use {@link DaytonaForbiddenError} instead.
|
|
111
142
|
*/
|
|
112
|
-
class DaytonaAuthorizationError extends
|
|
143
|
+
class DaytonaAuthorizationError extends DaytonaForbiddenError {
|
|
113
144
|
}
|
|
114
145
|
exports.DaytonaAuthorizationError = DaytonaAuthorizationError;
|
|
146
|
+
// Not part of the deprecated set above. It extends DaytonaValidationError only
|
|
147
|
+
// so pre-existing `instanceof DaytonaValidationError` / `DaytonaBadRequestError`
|
|
148
|
+
// catches keep matching local argument rejections; reparent it directly onto
|
|
149
|
+
// DaytonaError in the next major.
|
|
115
150
|
/**
|
|
116
|
-
*
|
|
151
|
+
* The SDK rejected the caller's arguments locally, before any request was
|
|
152
|
+
* sent. `statusCode`, `code` and `source` are always `undefined` — no Daytona
|
|
153
|
+
* service was contacted, so there is no HTTP status to report.
|
|
117
154
|
*
|
|
118
|
-
* @
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* await daytona.create({ name: 'existing-sandbox' })
|
|
122
|
-
* } catch (error) {
|
|
123
|
-
* if (error instanceof DaytonaConflictError) {
|
|
124
|
-
* console.log(error.errorCode)
|
|
125
|
-
* }
|
|
126
|
-
* }
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
class DaytonaConflictError extends DaytonaError {
|
|
130
|
-
}
|
|
131
|
-
exports.DaytonaConflictError = DaytonaConflictError;
|
|
132
|
-
/**
|
|
133
|
-
* Error thrown when input validation fails (HTTP 400 or client-side validation).
|
|
155
|
+
* Distinct from {@link DaytonaBadRequestError} (a service returned HTTP 400)
|
|
156
|
+
* and {@link DaytonaUnprocessableEntityError} (a service returned HTTP 422).
|
|
157
|
+
* This one always means: fix the arguments at the call site.
|
|
134
158
|
*
|
|
135
159
|
* @example
|
|
136
160
|
* ```ts
|
|
137
161
|
* try {
|
|
138
|
-
*
|
|
139
|
-
* } catch (
|
|
140
|
-
* if (
|
|
141
|
-
*
|
|
162
|
+
* await sandbox.setAutoStopInterval(-1)
|
|
163
|
+
* } catch (err) {
|
|
164
|
+
* if (err instanceof DaytonaInvalidArgumentError) {
|
|
165
|
+
* // never reached the API — the value itself is invalid
|
|
142
166
|
* }
|
|
143
167
|
* }
|
|
144
168
|
* ```
|
|
145
169
|
*/
|
|
146
|
-
class
|
|
170
|
+
class DaytonaInvalidArgumentError extends DaytonaValidationError {
|
|
147
171
|
}
|
|
148
|
-
exports.
|
|
149
|
-
/**
|
|
150
|
-
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* ```ts
|
|
154
|
-
* try {
|
|
155
|
-
* await sandbox.waitUntilStarted(1)
|
|
156
|
-
* } catch (error) {
|
|
157
|
-
* if (error instanceof DaytonaTimeoutError) {
|
|
158
|
-
* console.log(error.message)
|
|
159
|
-
* }
|
|
160
|
-
* }
|
|
161
|
-
* ```
|
|
162
|
-
*/
|
|
163
|
-
class DaytonaTimeoutError extends DaytonaError {
|
|
172
|
+
exports.DaytonaInvalidArgumentError = DaytonaInvalidArgumentError;
|
|
173
|
+
/** Network connection failure (can't connect or mid-request drop). */
|
|
174
|
+
class DaytonaConnectionError extends DaytonaError {
|
|
164
175
|
}
|
|
165
|
-
exports.
|
|
176
|
+
exports.DaytonaConnectionError = DaytonaConnectionError;
|
|
177
|
+
/** Transport-layer timeout (connect / read). Subclass of DaytonaConnectionError. */
|
|
178
|
+
class DaytonaConnectionTimeoutError extends DaytonaConnectionError {
|
|
179
|
+
}
|
|
180
|
+
exports.DaytonaConnectionTimeoutError = DaytonaConnectionTimeoutError;
|
|
181
|
+
// Domain-specific subclasses. Each inherits from the HTTP-status class that
|
|
182
|
+
// matches its server-side status, so callers can catch either level.
|
|
183
|
+
// --- Git (daemon) ---
|
|
184
|
+
/** Git authentication against the remote failed (code `GIT_AUTH_FAILED`). */
|
|
185
|
+
class DaytonaGitAuthFailedError extends DaytonaAuthenticationError {
|
|
186
|
+
}
|
|
187
|
+
exports.DaytonaGitAuthFailedError = DaytonaGitAuthFailedError;
|
|
188
|
+
/** The git remote repository was not found (code `GIT_REPO_NOT_FOUND`). */
|
|
189
|
+
class DaytonaGitRepoNotFoundError extends DaytonaNotFoundError {
|
|
190
|
+
}
|
|
191
|
+
exports.DaytonaGitRepoNotFoundError = DaytonaGitRepoNotFoundError;
|
|
192
|
+
/** The git branch does not exist (code `GIT_BRANCH_NOT_FOUND`). */
|
|
193
|
+
class DaytonaGitBranchNotFoundError extends DaytonaNotFoundError {
|
|
194
|
+
}
|
|
195
|
+
exports.DaytonaGitBranchNotFoundError = DaytonaGitBranchNotFoundError;
|
|
196
|
+
/** The git branch already exists (code `GIT_BRANCH_EXISTS`). */
|
|
197
|
+
class DaytonaGitBranchExistsError extends DaytonaConflictError {
|
|
198
|
+
}
|
|
199
|
+
exports.DaytonaGitBranchExistsError = DaytonaGitBranchExistsError;
|
|
200
|
+
/** The git push was rejected by the remote (code `GIT_PUSH_REJECTED`). */
|
|
201
|
+
class DaytonaGitPushRejectedError extends DaytonaConflictError {
|
|
202
|
+
}
|
|
203
|
+
exports.DaytonaGitPushRejectedError = DaytonaGitPushRejectedError;
|
|
204
|
+
/** The operation requires a clean worktree (code `GIT_DIRTY_WORKTREE`). */
|
|
205
|
+
class DaytonaGitDirtyWorktreeError extends DaytonaConflictError {
|
|
206
|
+
}
|
|
207
|
+
exports.DaytonaGitDirtyWorktreeError = DaytonaGitDirtyWorktreeError;
|
|
208
|
+
/** A git merge produced conflicts (code `GIT_MERGE_CONFLICT`). */
|
|
209
|
+
class DaytonaGitMergeConflictError extends DaytonaConflictError {
|
|
210
|
+
}
|
|
211
|
+
exports.DaytonaGitMergeConflictError = DaytonaGitMergeConflictError;
|
|
212
|
+
// --- Filesystem (daemon) ---
|
|
213
|
+
/** The file does not exist in the sandbox (code `FILE_NOT_FOUND`). */
|
|
214
|
+
class DaytonaFileNotFoundError extends DaytonaNotFoundError {
|
|
215
|
+
}
|
|
216
|
+
exports.DaytonaFileNotFoundError = DaytonaFileNotFoundError;
|
|
217
|
+
/** Access to the sandbox file was denied (code `FILE_ACCESS_DENIED`). */
|
|
218
|
+
class DaytonaFileAccessDeniedError extends DaytonaForbiddenError {
|
|
219
|
+
}
|
|
220
|
+
exports.DaytonaFileAccessDeniedError = DaytonaFileAccessDeniedError;
|
|
221
|
+
/** The supplied file path was rejected by the daemon (code `INVALID_FILE_PATH`). */
|
|
222
|
+
class DaytonaInvalidFilePathError extends DaytonaBadRequestError {
|
|
223
|
+
}
|
|
224
|
+
exports.DaytonaInvalidFilePathError = DaytonaInvalidFilePathError;
|
|
225
|
+
/** The daemon could not read the sandbox file (code `FILE_READ_FAILED`). */
|
|
226
|
+
class DaytonaFileReadFailedError extends DaytonaInternalServerError {
|
|
227
|
+
}
|
|
228
|
+
exports.DaytonaFileReadFailedError = DaytonaFileReadFailedError;
|
|
229
|
+
// --- LSP (daemon) ---
|
|
230
|
+
/** The LSP server must be initialized first (code `LSP_SERVER_NOT_INITIALIZED`). */
|
|
231
|
+
class DaytonaLspServerNotInitializedError extends DaytonaBadRequestError {
|
|
232
|
+
}
|
|
233
|
+
exports.DaytonaLspServerNotInitializedError = DaytonaLspServerNotInitializedError;
|
|
234
|
+
// --- Process / session (daemon) ---
|
|
235
|
+
/** Command execution exceeded its timeout (code `PROCESS_EXECUTION_TIMEOUT`). */
|
|
236
|
+
class DaytonaProcessExecutionTimeoutError extends DaytonaTimeoutError {
|
|
237
|
+
}
|
|
238
|
+
exports.DaytonaProcessExecutionTimeoutError = DaytonaProcessExecutionTimeoutError;
|
|
239
|
+
/** The sandbox process does not exist (code `PROCESS_NOT_FOUND`). */
|
|
240
|
+
class DaytonaProcessNotFoundError extends DaytonaNotFoundError {
|
|
241
|
+
}
|
|
242
|
+
exports.DaytonaProcessNotFoundError = DaytonaProcessNotFoundError;
|
|
243
|
+
/** The session has already ended (code `SESSION_ENDED`). */
|
|
244
|
+
class DaytonaSessionEndedError extends DaytonaGoneError {
|
|
245
|
+
}
|
|
246
|
+
exports.DaytonaSessionEndedError = DaytonaSessionEndedError;
|
|
247
|
+
/** The session command already finished (code `COMMAND_ALREADY_COMPLETED`). */
|
|
248
|
+
class DaytonaCommandAlreadyCompletedError extends DaytonaGoneError {
|
|
249
|
+
}
|
|
250
|
+
exports.DaytonaCommandAlreadyCompletedError = DaytonaCommandAlreadyCompletedError;
|
|
251
|
+
// --- Computer-use (daemon) ---
|
|
252
|
+
/** The accessibility service is unavailable (code `A11Y_UNAVAILABLE`). */
|
|
253
|
+
class DaytonaA11yUnavailableError extends DaytonaServiceUnavailableError {
|
|
254
|
+
}
|
|
255
|
+
exports.DaytonaA11yUnavailableError = DaytonaA11yUnavailableError;
|
|
256
|
+
/** A screen recording is still active (code `RECORDING_STILL_ACTIVE`). */
|
|
257
|
+
class DaytonaRecordingStillActiveError extends DaytonaConflictError {
|
|
258
|
+
}
|
|
259
|
+
exports.DaytonaRecordingStillActiveError = DaytonaRecordingStillActiveError;
|
|
260
|
+
/** ffmpeg is not available for recording (code `RECORDING_FFMPEG_NOT_FOUND`). */
|
|
261
|
+
class DaytonaRecordingFfmpegNotFoundError extends DaytonaServiceUnavailableError {
|
|
262
|
+
}
|
|
263
|
+
exports.DaytonaRecordingFfmpegNotFoundError = DaytonaRecordingFfmpegNotFoundError;
|
|
166
264
|
/**
|
|
167
|
-
*
|
|
265
|
+
* (source, code) → precise DaytonaError subclass. Lookup runs before the
|
|
266
|
+
* HTTP status code fallback, so a domain code wins over the status default.
|
|
168
267
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* if (error instanceof DaytonaConnectionError) {
|
|
175
|
-
* console.log(error.message)
|
|
176
|
-
* }
|
|
177
|
-
* }
|
|
178
|
-
* ```
|
|
268
|
+
* Code strings are kept inline (not imported from the generated clients) so
|
|
269
|
+
* tests that virtual-mock the API client modules don't break module init.
|
|
270
|
+
*
|
|
271
|
+
* There is currently NO automated drift check against the daemon's
|
|
272
|
+
* `DaemonErrorCode` enum — keep this map in sync by hand when codes are added.
|
|
179
273
|
*/
|
|
180
|
-
|
|
274
|
+
const CODE_TO_ERROR_CLASS = {
|
|
275
|
+
// Daemon
|
|
276
|
+
'DAYTONA_DAEMON|GIT_AUTH_FAILED': DaytonaGitAuthFailedError,
|
|
277
|
+
'DAYTONA_DAEMON|GIT_REPO_NOT_FOUND': DaytonaGitRepoNotFoundError,
|
|
278
|
+
'DAYTONA_DAEMON|GIT_BRANCH_NOT_FOUND': DaytonaGitBranchNotFoundError,
|
|
279
|
+
'DAYTONA_DAEMON|GIT_BRANCH_EXISTS': DaytonaGitBranchExistsError,
|
|
280
|
+
'DAYTONA_DAEMON|GIT_PUSH_REJECTED': DaytonaGitPushRejectedError,
|
|
281
|
+
'DAYTONA_DAEMON|GIT_DIRTY_WORKTREE': DaytonaGitDirtyWorktreeError,
|
|
282
|
+
'DAYTONA_DAEMON|GIT_MERGE_CONFLICT': DaytonaGitMergeConflictError,
|
|
283
|
+
'DAYTONA_DAEMON|FILE_NOT_FOUND': DaytonaFileNotFoundError,
|
|
284
|
+
'DAYTONA_DAEMON|FILE_ACCESS_DENIED': DaytonaFileAccessDeniedError,
|
|
285
|
+
'DAYTONA_DAEMON|INVALID_FILE_PATH': DaytonaInvalidFilePathError,
|
|
286
|
+
'DAYTONA_DAEMON|FILE_READ_FAILED': DaytonaFileReadFailedError,
|
|
287
|
+
'DAYTONA_DAEMON|LSP_SERVER_NOT_INITIALIZED': DaytonaLspServerNotInitializedError,
|
|
288
|
+
'DAYTONA_DAEMON|PROCESS_EXECUTION_TIMEOUT': DaytonaProcessExecutionTimeoutError,
|
|
289
|
+
'DAYTONA_DAEMON|PROCESS_NOT_FOUND': DaytonaProcessNotFoundError,
|
|
290
|
+
'DAYTONA_DAEMON|SESSION_ENDED': DaytonaSessionEndedError,
|
|
291
|
+
'DAYTONA_DAEMON|COMMAND_ALREADY_COMPLETED': DaytonaCommandAlreadyCompletedError,
|
|
292
|
+
'DAYTONA_DAEMON|A11Y_UNAVAILABLE': DaytonaA11yUnavailableError,
|
|
293
|
+
'DAYTONA_DAEMON|RECORDING_STILL_ACTIVE': DaytonaRecordingStillActiveError,
|
|
294
|
+
'DAYTONA_DAEMON|RECORDING_FFMPEG_NOT_FOUND': DaytonaRecordingFfmpegNotFoundError,
|
|
295
|
+
};
|
|
296
|
+
function lookupErrorClass(source, code) {
|
|
297
|
+
if (!code || !source)
|
|
298
|
+
return undefined;
|
|
299
|
+
return CODE_TO_ERROR_CLASS[`${source}|${code}`];
|
|
181
300
|
}
|
|
182
|
-
exports.DaytonaConnectionError = DaytonaConnectionError;
|
|
183
301
|
const STATUS_CODE_TO_ERROR = {
|
|
184
302
|
400: DaytonaValidationError,
|
|
185
303
|
401: DaytonaAuthenticationError,
|
|
186
304
|
403: DaytonaAuthorizationError,
|
|
187
305
|
404: DaytonaNotFoundError,
|
|
306
|
+
408: DaytonaTimeoutError,
|
|
188
307
|
409: DaytonaConflictError,
|
|
308
|
+
410: DaytonaGoneError,
|
|
309
|
+
422: DaytonaUnprocessableEntityError,
|
|
189
310
|
429: DaytonaRateLimitError,
|
|
311
|
+
500: DaytonaInternalServerError,
|
|
312
|
+
502: DaytonaBadGatewayError,
|
|
313
|
+
503: DaytonaServiceUnavailableError,
|
|
314
|
+
504: DaytonaTimeoutError,
|
|
190
315
|
};
|
|
191
|
-
/**
|
|
192
|
-
* Maps an HTTP status code to the corresponding Daytona error class.
|
|
193
|
-
*/
|
|
316
|
+
/** Maps an HTTP status code to the corresponding Daytona error class. */
|
|
194
317
|
function errorClassFromStatusCode(statusCode) {
|
|
195
318
|
if (statusCode === undefined) {
|
|
196
319
|
return DaytonaError;
|
|
@@ -199,10 +322,12 @@ function errorClassFromStatusCode(statusCode) {
|
|
|
199
322
|
}
|
|
200
323
|
/**
|
|
201
324
|
* Creates the appropriate Daytona error subclass from structured error metadata.
|
|
325
|
+
*
|
|
326
|
+
* Resolution order: (source, code) override -> HTTP status code -> DaytonaError.
|
|
202
327
|
*/
|
|
203
|
-
function createDaytonaError(message, statusCode, headers,
|
|
204
|
-
const ErrorClass = errorClassFromStatusCode(statusCode);
|
|
205
|
-
return new ErrorClass(message, statusCode, headers,
|
|
328
|
+
function createDaytonaError(message, statusCode, headers, code, source) {
|
|
329
|
+
const ErrorClass = lookupErrorClass(source, code) || errorClassFromStatusCode(statusCode);
|
|
330
|
+
return new ErrorClass(message, statusCode, headers, code, source);
|
|
206
331
|
}
|
|
207
332
|
function isAxiosTimeoutError(error) {
|
|
208
333
|
return error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT' || error.message.includes('timeout of');
|
|
@@ -214,23 +339,20 @@ function getAxiosResponseDataObject(error) {
|
|
|
214
339
|
return error.response.data;
|
|
215
340
|
}
|
|
216
341
|
function extractAxiosErrorCode(responseData) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
if (typeof responseData?.error === 'string') {
|
|
224
|
-
return responseData.error;
|
|
225
|
-
}
|
|
226
|
-
return undefined;
|
|
342
|
+
const code = responseData?.code ?? responseData?.error_code;
|
|
343
|
+
return typeof code === 'string' ? code : undefined;
|
|
344
|
+
}
|
|
345
|
+
function extractAxiosErrorSource(responseData) {
|
|
346
|
+
return typeof responseData?.source === 'string' ? responseData.source : undefined;
|
|
227
347
|
}
|
|
228
348
|
function extractAxiosErrorMessage(error) {
|
|
229
349
|
if (isAxiosTimeoutError(error)) {
|
|
230
350
|
return 'Operation timed out';
|
|
231
351
|
}
|
|
232
352
|
const responseData = getAxiosResponseDataObject(error);
|
|
233
|
-
const responseMessage = responseData?.message
|
|
353
|
+
const responseMessage = (typeof responseData?.message === 'string' ? responseData.message : undefined) ??
|
|
354
|
+
(typeof responseData?.error === 'string' ? responseData.error : undefined) ??
|
|
355
|
+
error.response?.data;
|
|
234
356
|
const message = responseMessage || error.message || String(error);
|
|
235
357
|
if (typeof message === 'object') {
|
|
236
358
|
try {
|
|
@@ -243,20 +365,24 @@ function extractAxiosErrorMessage(error) {
|
|
|
243
365
|
return String(message);
|
|
244
366
|
}
|
|
245
367
|
/**
|
|
246
|
-
* Creates the appropriate Daytona error subclass from an Axios error.
|
|
368
|
+
* Creates the appropriate Daytona error subclass from an Axios error. Maps
|
|
369
|
+
* client-side timeouts to DaytonaConnectionTimeoutError, networking failures
|
|
370
|
+
* (no response received) to DaytonaConnectionError, and HTTP responses to
|
|
371
|
+
* the most specific subclass via `createDaytonaError`.
|
|
247
372
|
*/
|
|
248
373
|
function createAxiosDaytonaError(error) {
|
|
249
374
|
const message = extractAxiosErrorMessage(error);
|
|
250
375
|
const statusCode = error.response?.status;
|
|
251
376
|
const headers = error.response?.headers;
|
|
252
377
|
const responseData = getAxiosResponseDataObject(error);
|
|
253
|
-
const
|
|
378
|
+
const code = extractAxiosErrorCode(responseData);
|
|
379
|
+
const source = extractAxiosErrorSource(responseData);
|
|
254
380
|
if (isAxiosTimeoutError(error)) {
|
|
255
|
-
return new
|
|
381
|
+
return new DaytonaConnectionTimeoutError(message, statusCode, headers, code, source);
|
|
256
382
|
}
|
|
257
383
|
if (!error.response && (error.request || error.code)) {
|
|
258
|
-
return new DaytonaConnectionError(message, statusCode, headers,
|
|
384
|
+
return new DaytonaConnectionError(message, statusCode, headers, code, source);
|
|
259
385
|
}
|
|
260
|
-
return createDaytonaError(message, statusCode, headers,
|
|
386
|
+
return createDaytonaError(message, statusCode, headers, code, source);
|
|
261
387
|
}
|
|
262
388
|
//# sourceMappingURL=DaytonaError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaytonaError.js","sourceRoot":"","sources":["../../../../../sdk-typescript/src/errors/DaytonaError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"DaytonaError.js","sourceRoot":"","sources":["../../../../../sdk-typescript/src/errors/DaytonaError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyQH,4DAMC;AAOD,gDASC;AAoDD,0DAiBC;AAzVD;;;;GAIG;AACU,QAAA,UAAU,GAAG,aAAa,CAAA;AAC1B,QAAA,aAAa,GAAG,gBAAgB,CAAA;AAChC,QAAA,YAAY,GAAG,eAAe,CAAA;AAE3C;;;;GAIG;AACH,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AAE,OAAsC,CAAA;IACtE,MAAM,YAAY,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAA;IACtD,MAAM,IAAI,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAA;IAChD,MAAM,MAAM,GAAG,uBAAuB,CAAC,YAAY,CAAC,CAAA;IAEpD,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,6BAA6B,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IACtF,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,OAAO,IAAI,sBAAsB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IAC/E,CAAC;IAED,OAAO,kBAAkB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;AACvE,CAAC"}
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { CodeLanguage, Daytona } from './Daytona';
|
|
2
|
-
export type { CreateSandboxBaseParams, CreateSandboxFromImageParams, CreateSandboxFromSnapshotParams, DaytonaConfig, Resources, VolumeMount, } from './Daytona';
|
|
2
|
+
export type { CreateSandboxBaseParams, CreateSandboxFromImageParams, CreateSandboxFromSnapshotParams, DaytonaConfig, ForkSandboxParams, Resources, VolumeMount, } from './Daytona';
|
|
3
3
|
export { FileSystem } from './FileSystem';
|
|
4
4
|
export type { DownloadProgress, DownloadMetadata, DownloadStreamOptions, UploadProgress, UploadStreamOptions, UploadSource, FileDownloadErrorDetails, FileDownloadRequest, FileDownloadResponse, FilePermissionsParams, FileUpload, } from './FileSystem';
|
|
5
5
|
export { Git } from './Git';
|
|
6
6
|
export { LspLanguageId } from './LspServer';
|
|
7
7
|
export { Process } from './Process';
|
|
8
|
-
export { DaytonaAuthenticationError, DaytonaAuthorizationError, DaytonaConflictError, DaytonaConnectionError,
|
|
8
|
+
export { SOURCE_API, SOURCE_DAEMON, SOURCE_PROXY, DaytonaError, DaytonaBadRequestError, DaytonaInvalidArgumentError, DaytonaValidationError, DaytonaAuthenticationError, DaytonaForbiddenError, DaytonaAuthorizationError, DaytonaNotFoundError, DaytonaTimeoutError, DaytonaConflictError, DaytonaGoneError, DaytonaUnprocessableEntityError, DaytonaRateLimitError, DaytonaInternalServerError, DaytonaBadGatewayError, DaytonaServiceUnavailableError, DaytonaConnectionError, DaytonaConnectionTimeoutError, DaytonaGitAuthFailedError, DaytonaGitRepoNotFoundError, DaytonaGitBranchNotFoundError, DaytonaGitBranchExistsError, DaytonaGitPushRejectedError, DaytonaGitDirtyWorktreeError, DaytonaGitMergeConflictError, DaytonaFileNotFoundError, DaytonaFileAccessDeniedError, DaytonaInvalidFilePathError, DaytonaFileReadFailedError, DaytonaLspServerNotInitializedError, DaytonaProcessExecutionTimeoutError, DaytonaProcessNotFoundError, DaytonaSessionEndedError, DaytonaCommandAlreadyCompletedError, DaytonaA11yUnavailableError, DaytonaRecordingStillActiveError, DaytonaRecordingFfmpegNotFoundError, } from './errors/DaytonaError';
|
|
9
9
|
export { Image } from './Image';
|
|
10
10
|
export { Sandbox } from './Sandbox';
|
|
11
11
|
export type { ListSandboxesQuery, SandboxMetrics } from './Sandbox';
|