@daytonaio/sdk 0.184.0-alpha.1 → 0.185.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/Daytona.d.ts +5 -1
- package/cjs/Daytona.js +10 -7
- package/cjs/Daytona.js.map +1 -1
- package/cjs/FileSystem.d.ts +2 -4
- package/cjs/FileSystem.js +28 -1
- package/cjs/FileSystem.js.map +1 -1
- package/cjs/Git.d.ts +2 -1
- package/cjs/Git.js +3 -1
- package/cjs/Git.js.map +1 -1
- package/cjs/Sandbox.d.ts +15 -16
- package/cjs/Sandbox.js +18 -15
- package/cjs/Sandbox.js.map +1 -1
- package/cjs/Snapshot.d.ts +3 -1
- package/cjs/Snapshot.js +6 -0
- package/cjs/Snapshot.js.map +1 -1
- package/cjs/errors/DaytonaError.d.ts +143 -87
- package/cjs/errors/DaytonaError.js +166 -174
- package/cjs/errors/DaytonaError.js.map +1 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +8 -36
- package/cjs/index.js.map +1 -1
- package/cjs/utils/FileTransfer.js +2 -4
- package/cjs/utils/FileTransfer.js.map +1 -1
- package/cjs/utils/Import.js +2 -4
- package/cjs/utils/Import.js.map +1 -1
- package/cjs/utils/Runtime.js +1 -1
- package/cjs/utils/Runtime.js.map +1 -1
- package/esm/Daytona.d.ts +5 -1
- package/esm/Daytona.js +10 -7
- package/esm/Daytona.js.map +1 -1
- package/esm/FileSystem.d.ts +2 -4
- package/esm/FileSystem.js +28 -1
- package/esm/FileSystem.js.map +1 -1
- package/esm/Git.d.ts +2 -1
- package/esm/Git.js +3 -1
- package/esm/Git.js.map +1 -1
- package/esm/Sandbox.d.ts +15 -16
- package/esm/Sandbox.js +18 -15
- package/esm/Sandbox.js.map +1 -1
- package/esm/Snapshot.d.ts +3 -1
- package/esm/Snapshot.js +6 -0
- package/esm/Snapshot.js.map +1 -1
- package/esm/errors/DaytonaError.d.ts +143 -87
- package/esm/errors/DaytonaError.js +159 -144
- package/esm/errors/DaytonaError.js.map +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +2 -10
- package/esm/index.js.map +1 -1
- package/esm/utils/FileTransfer.js +2 -4
- package/esm/utils/FileTransfer.js.map +1 -1
- package/esm/utils/Import.js +36 -31
- package/esm/utils/Import.js.map +1 -1
- package/esm/utils/Runtime.js +1 -1
- package/esm/utils/Runtime.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,201 +4,193 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.DaytonaConnectionError = exports.DaytonaTimeoutError = exports.DaytonaValidationError = exports.DaytonaConflictError = exports.DaytonaAuthorizationError = exports.DaytonaAuthenticationError = exports.DaytonaRateLimitError = exports.DaytonaNotFoundError = exports.DaytonaError = 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
|
-
*
|
|
12
|
+
* Base error for Daytona SDK.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* try {
|
|
17
|
+
* await daytona.get('missing-sandbox')
|
|
18
|
+
* } catch (error) {
|
|
19
|
+
* if (error instanceof DaytonaError) {
|
|
20
|
+
* console.log(error.statusCode)
|
|
21
|
+
* console.log(error.errorCode)
|
|
22
|
+
* console.log(error.message)
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
23
26
|
*/
|
|
24
27
|
class DaytonaError extends Error {
|
|
28
|
+
/** HTTP status code if available */
|
|
25
29
|
statusCode;
|
|
26
|
-
code
|
|
27
|
-
|
|
30
|
+
/** Machine-readable error code if available */
|
|
31
|
+
errorCode;
|
|
32
|
+
/** Response headers if available */
|
|
28
33
|
headers;
|
|
29
|
-
constructor(message, statusCode, headers,
|
|
34
|
+
constructor(message, statusCode, headers, errorCode) {
|
|
30
35
|
super(message);
|
|
31
36
|
this.name = new.target.name;
|
|
32
37
|
this.statusCode = statusCode;
|
|
33
38
|
this.headers = headers;
|
|
34
|
-
this.
|
|
35
|
-
this.source = source;
|
|
39
|
+
this.errorCode = errorCode;
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
exports.DaytonaError = DaytonaError;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Error thrown when a resource is not found (HTTP 404).
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* try {
|
|
49
|
+
* await sandbox.fs.downloadFile('/workspace/missing.txt')
|
|
50
|
+
* } catch (error) {
|
|
51
|
+
* if (error instanceof DaytonaNotFoundError) {
|
|
52
|
+
* console.log(error.statusCode)
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
50
57
|
class DaytonaNotFoundError extends DaytonaError {
|
|
51
58
|
}
|
|
52
59
|
exports.DaytonaNotFoundError = DaytonaNotFoundError;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Error thrown when rate limit is exceeded.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* try {
|
|
66
|
+
* for await (const sandbox of daytona.list()) {
|
|
67
|
+
* console.log(sandbox.id)
|
|
68
|
+
* }
|
|
69
|
+
* } catch (error) {
|
|
70
|
+
* if (error instanceof DaytonaRateLimitError) {
|
|
71
|
+
* console.log(error.errorCode)
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
65
76
|
class DaytonaRateLimitError extends DaytonaError {
|
|
66
77
|
}
|
|
67
78
|
exports.DaytonaRateLimitError = DaytonaRateLimitError;
|
|
68
|
-
class DaytonaInternalServerError extends DaytonaError {
|
|
69
|
-
}
|
|
70
|
-
exports.DaytonaInternalServerError = DaytonaInternalServerError;
|
|
71
|
-
class DaytonaBadGatewayError extends DaytonaError {
|
|
72
|
-
}
|
|
73
|
-
exports.DaytonaBadGatewayError = DaytonaBadGatewayError;
|
|
74
|
-
class DaytonaServiceUnavailableError extends DaytonaError {
|
|
75
|
-
}
|
|
76
|
-
exports.DaytonaServiceUnavailableError = DaytonaServiceUnavailableError;
|
|
77
79
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
80
|
+
* Error thrown when authentication fails (HTTP 401).
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* try {
|
|
85
|
+
* for await (const sandbox of daytona.list()) {
|
|
86
|
+
* console.log(sandbox.id)
|
|
87
|
+
* }
|
|
88
|
+
* } catch (error) {
|
|
89
|
+
* if (error instanceof DaytonaAuthenticationError) {
|
|
90
|
+
* console.log(error.statusCode)
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* ```
|
|
81
94
|
*/
|
|
82
|
-
|
|
95
|
+
class DaytonaAuthenticationError extends DaytonaError {
|
|
96
|
+
}
|
|
97
|
+
exports.DaytonaAuthenticationError = DaytonaAuthenticationError;
|
|
83
98
|
/**
|
|
84
|
-
*
|
|
99
|
+
* Error thrown when the request is forbidden (HTTP 403).
|
|
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
|
+
* ```
|
|
85
111
|
*/
|
|
86
|
-
|
|
87
|
-
/** Network connection failure (can't connect or mid-request drop). */
|
|
88
|
-
class DaytonaConnectionError extends DaytonaError {
|
|
89
|
-
}
|
|
90
|
-
exports.DaytonaConnectionError = DaytonaConnectionError;
|
|
91
|
-
/** Transport-layer timeout (connect / read). Subclass of DaytonaConnectionError. */
|
|
92
|
-
class DaytonaConnectionTimeoutError extends DaytonaConnectionError {
|
|
93
|
-
}
|
|
94
|
-
exports.DaytonaConnectionTimeoutError = DaytonaConnectionTimeoutError;
|
|
95
|
-
// Domain-specific subclasses. Each inherits from the HTTP-status class that
|
|
96
|
-
// matches its server-side status, so callers can catch either level.
|
|
97
|
-
// --- Git (daemon) ---
|
|
98
|
-
class DaytonaGitAuthFailedError extends DaytonaAuthenticationError {
|
|
99
|
-
}
|
|
100
|
-
exports.DaytonaGitAuthFailedError = DaytonaGitAuthFailedError;
|
|
101
|
-
class DaytonaGitRepoNotFoundError extends DaytonaNotFoundError {
|
|
102
|
-
}
|
|
103
|
-
exports.DaytonaGitRepoNotFoundError = DaytonaGitRepoNotFoundError;
|
|
104
|
-
class DaytonaGitBranchNotFoundError extends DaytonaNotFoundError {
|
|
112
|
+
class DaytonaAuthorizationError extends DaytonaError {
|
|
105
113
|
}
|
|
106
|
-
exports.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
exports.DaytonaFileNotFoundError = DaytonaFileNotFoundError;
|
|
123
|
-
class DaytonaFileAccessDeniedError extends DaytonaForbiddenError {
|
|
124
|
-
}
|
|
125
|
-
exports.DaytonaFileAccessDeniedError = DaytonaFileAccessDeniedError;
|
|
126
|
-
// --- LSP (daemon) ---
|
|
127
|
-
class DaytonaLspServerNotInitializedError extends DaytonaBadRequestError {
|
|
128
|
-
}
|
|
129
|
-
exports.DaytonaLspServerNotInitializedError = DaytonaLspServerNotInitializedError;
|
|
130
|
-
// --- Process / session (daemon) ---
|
|
131
|
-
class DaytonaProcessExecutionTimeoutError extends DaytonaTimeoutError {
|
|
132
|
-
}
|
|
133
|
-
exports.DaytonaProcessExecutionTimeoutError = DaytonaProcessExecutionTimeoutError;
|
|
134
|
-
class DaytonaProcessNotFoundError extends DaytonaNotFoundError {
|
|
135
|
-
}
|
|
136
|
-
exports.DaytonaProcessNotFoundError = DaytonaProcessNotFoundError;
|
|
137
|
-
class DaytonaSessionEndedError extends DaytonaGoneError {
|
|
138
|
-
}
|
|
139
|
-
exports.DaytonaSessionEndedError = DaytonaSessionEndedError;
|
|
140
|
-
class DaytonaCommandAlreadyCompletedError extends DaytonaGoneError {
|
|
141
|
-
}
|
|
142
|
-
exports.DaytonaCommandAlreadyCompletedError = DaytonaCommandAlreadyCompletedError;
|
|
143
|
-
// --- Computer-use (daemon) ---
|
|
144
|
-
class DaytonaA11yUnavailableError extends DaytonaServiceUnavailableError {
|
|
114
|
+
exports.DaytonaAuthorizationError = DaytonaAuthorizationError;
|
|
115
|
+
/**
|
|
116
|
+
* Error thrown when a resource conflict occurs (HTTP 409).
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* try {
|
|
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 {
|
|
145
130
|
}
|
|
146
|
-
exports.
|
|
147
|
-
|
|
131
|
+
exports.DaytonaConflictError = DaytonaConflictError;
|
|
132
|
+
/**
|
|
133
|
+
* Error thrown when input validation fails (HTTP 400 or client-side validation).
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* try {
|
|
138
|
+
* Image.debianSlim('3.8' as never)
|
|
139
|
+
* } catch (error) {
|
|
140
|
+
* if (error instanceof DaytonaValidationError) {
|
|
141
|
+
* console.log(error.message)
|
|
142
|
+
* }
|
|
143
|
+
* }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
class DaytonaValidationError extends DaytonaError {
|
|
148
147
|
}
|
|
149
|
-
exports.
|
|
150
|
-
|
|
148
|
+
exports.DaytonaValidationError = DaytonaValidationError;
|
|
149
|
+
/**
|
|
150
|
+
* Error thrown when a timeout occurs.
|
|
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 {
|
|
151
164
|
}
|
|
152
|
-
exports.
|
|
165
|
+
exports.DaytonaTimeoutError = DaytonaTimeoutError;
|
|
153
166
|
/**
|
|
154
|
-
*
|
|
155
|
-
* HTTP status code fallback, so a domain code wins over the status default.
|
|
167
|
+
* Error thrown when a network connection fails.
|
|
156
168
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts
|
|
171
|
+
* try {
|
|
172
|
+
* await ptyHandle.waitForConnection()
|
|
173
|
+
* } catch (error) {
|
|
174
|
+
* if (error instanceof DaytonaConnectionError) {
|
|
175
|
+
* console.log(error.message)
|
|
176
|
+
* }
|
|
177
|
+
* }
|
|
178
|
+
* ```
|
|
160
179
|
*/
|
|
161
|
-
|
|
162
|
-
// Daemon
|
|
163
|
-
'DAYTONA_DAEMON|GIT_AUTH_FAILED': DaytonaGitAuthFailedError,
|
|
164
|
-
'DAYTONA_DAEMON|GIT_REPO_NOT_FOUND': DaytonaGitRepoNotFoundError,
|
|
165
|
-
'DAYTONA_DAEMON|GIT_BRANCH_NOT_FOUND': DaytonaGitBranchNotFoundError,
|
|
166
|
-
'DAYTONA_DAEMON|GIT_BRANCH_EXISTS': DaytonaGitBranchExistsError,
|
|
167
|
-
'DAYTONA_DAEMON|GIT_PUSH_REJECTED': DaytonaGitPushRejectedError,
|
|
168
|
-
'DAYTONA_DAEMON|GIT_DIRTY_WORKTREE': DaytonaGitDirtyWorktreeError,
|
|
169
|
-
'DAYTONA_DAEMON|GIT_MERGE_CONFLICT': DaytonaGitMergeConflictError,
|
|
170
|
-
'DAYTONA_DAEMON|FILE_NOT_FOUND': DaytonaFileNotFoundError,
|
|
171
|
-
'DAYTONA_DAEMON|FILE_ACCESS_DENIED': DaytonaFileAccessDeniedError,
|
|
172
|
-
'DAYTONA_DAEMON|LSP_SERVER_NOT_INITIALIZED': DaytonaLspServerNotInitializedError,
|
|
173
|
-
'DAYTONA_DAEMON|PROCESS_EXECUTION_TIMEOUT': DaytonaProcessExecutionTimeoutError,
|
|
174
|
-
'DAYTONA_DAEMON|PROCESS_NOT_FOUND': DaytonaProcessNotFoundError,
|
|
175
|
-
'DAYTONA_DAEMON|SESSION_ENDED': DaytonaSessionEndedError,
|
|
176
|
-
'DAYTONA_DAEMON|COMMAND_ALREADY_COMPLETED': DaytonaCommandAlreadyCompletedError,
|
|
177
|
-
'DAYTONA_DAEMON|A11Y_UNAVAILABLE': DaytonaA11yUnavailableError,
|
|
178
|
-
'DAYTONA_DAEMON|RECORDING_STILL_ACTIVE': DaytonaRecordingStillActiveError,
|
|
179
|
-
'DAYTONA_DAEMON|RECORDING_FFMPEG_NOT_FOUND': DaytonaRecordingFfmpegNotFoundError,
|
|
180
|
-
};
|
|
181
|
-
function lookupErrorClass(source, code) {
|
|
182
|
-
if (!code || !source)
|
|
183
|
-
return undefined;
|
|
184
|
-
return CODE_TO_ERROR_CLASS[`${source}|${code}`];
|
|
180
|
+
class DaytonaConnectionError extends DaytonaError {
|
|
185
181
|
}
|
|
182
|
+
exports.DaytonaConnectionError = DaytonaConnectionError;
|
|
186
183
|
const STATUS_CODE_TO_ERROR = {
|
|
187
|
-
400:
|
|
184
|
+
400: DaytonaValidationError,
|
|
188
185
|
401: DaytonaAuthenticationError,
|
|
189
|
-
403:
|
|
186
|
+
403: DaytonaAuthorizationError,
|
|
190
187
|
404: DaytonaNotFoundError,
|
|
191
|
-
408: DaytonaTimeoutError,
|
|
192
188
|
409: DaytonaConflictError,
|
|
193
|
-
410: DaytonaGoneError,
|
|
194
|
-
422: DaytonaUnprocessableEntityError,
|
|
195
189
|
429: DaytonaRateLimitError,
|
|
196
|
-
500: DaytonaInternalServerError,
|
|
197
|
-
502: DaytonaBadGatewayError,
|
|
198
|
-
503: DaytonaServiceUnavailableError,
|
|
199
|
-
504: DaytonaTimeoutError,
|
|
200
190
|
};
|
|
201
|
-
/**
|
|
191
|
+
/**
|
|
192
|
+
* Maps an HTTP status code to the corresponding Daytona error class.
|
|
193
|
+
*/
|
|
202
194
|
function errorClassFromStatusCode(statusCode) {
|
|
203
195
|
if (statusCode === undefined) {
|
|
204
196
|
return DaytonaError;
|
|
@@ -207,12 +199,10 @@ function errorClassFromStatusCode(statusCode) {
|
|
|
207
199
|
}
|
|
208
200
|
/**
|
|
209
201
|
* Creates the appropriate Daytona error subclass from structured error metadata.
|
|
210
|
-
*
|
|
211
|
-
* Resolution order: (source, code) override -> HTTP status code -> DaytonaError.
|
|
212
202
|
*/
|
|
213
|
-
function createDaytonaError(message, statusCode, headers,
|
|
214
|
-
const ErrorClass =
|
|
215
|
-
return new ErrorClass(message, statusCode, headers,
|
|
203
|
+
function createDaytonaError(message, statusCode, headers, errorCode) {
|
|
204
|
+
const ErrorClass = errorClassFromStatusCode(statusCode);
|
|
205
|
+
return new ErrorClass(message, statusCode, headers, errorCode);
|
|
216
206
|
}
|
|
217
207
|
function isAxiosTimeoutError(error) {
|
|
218
208
|
return error.code === 'ECONNABORTED' || error.code === 'ETIMEDOUT' || error.message.includes('timeout of');
|
|
@@ -224,10 +214,16 @@ function getAxiosResponseDataObject(error) {
|
|
|
224
214
|
return error.response.data;
|
|
225
215
|
}
|
|
226
216
|
function extractAxiosErrorCode(responseData) {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
217
|
+
if (typeof responseData?.code === 'string') {
|
|
218
|
+
return responseData.code;
|
|
219
|
+
}
|
|
220
|
+
if (typeof responseData?.error_code === 'string') {
|
|
221
|
+
return responseData.error_code;
|
|
222
|
+
}
|
|
223
|
+
if (typeof responseData?.error === 'string') {
|
|
224
|
+
return responseData.error;
|
|
225
|
+
}
|
|
226
|
+
return undefined;
|
|
231
227
|
}
|
|
232
228
|
function extractAxiosErrorMessage(error) {
|
|
233
229
|
if (isAxiosTimeoutError(error)) {
|
|
@@ -247,24 +243,20 @@ function extractAxiosErrorMessage(error) {
|
|
|
247
243
|
return String(message);
|
|
248
244
|
}
|
|
249
245
|
/**
|
|
250
|
-
* Creates the appropriate Daytona error subclass from an Axios error.
|
|
251
|
-
* client-side timeouts to DaytonaConnectionTimeoutError, networking failures
|
|
252
|
-
* (no response received) to DaytonaConnectionError, and HTTP responses to
|
|
253
|
-
* the most specific subclass via `createDaytonaError`.
|
|
246
|
+
* Creates the appropriate Daytona error subclass from an Axios error.
|
|
254
247
|
*/
|
|
255
248
|
function createAxiosDaytonaError(error) {
|
|
256
249
|
const message = extractAxiosErrorMessage(error);
|
|
257
250
|
const statusCode = error.response?.status;
|
|
258
251
|
const headers = error.response?.headers;
|
|
259
252
|
const responseData = getAxiosResponseDataObject(error);
|
|
260
|
-
const
|
|
261
|
-
const source = extractAxiosErrorSource(responseData);
|
|
253
|
+
const errorCode = extractAxiosErrorCode(responseData);
|
|
262
254
|
if (isAxiosTimeoutError(error)) {
|
|
263
|
-
return new
|
|
255
|
+
return new DaytonaTimeoutError(message, statusCode, headers, errorCode);
|
|
264
256
|
}
|
|
265
257
|
if (!error.response && (error.request || error.code)) {
|
|
266
|
-
return new DaytonaConnectionError(message, statusCode, headers,
|
|
258
|
+
return new DaytonaConnectionError(message, statusCode, headers, errorCode);
|
|
267
259
|
}
|
|
268
|
-
return createDaytonaError(message, statusCode, headers,
|
|
260
|
+
return createDaytonaError(message, statusCode, headers, errorCode);
|
|
269
261
|
}
|
|
270
262
|
//# sourceMappingURL=DaytonaError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaytonaError.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/errors/DaytonaError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"DaytonaError.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/errors/DaytonaError.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA4LH,4DAMC;AAKD,gDAQC;AAqDD,0DAgBC;AAzQD;;;;;;;;;;;;;;;GAeG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,oCAAoC;IAC7B,UAAU,CAAS;IAC1B,+CAA+C;IACxC,SAAS,CAAS;IACzB,oCAAoC;IAC7B,OAAO,CAAkB;IAEhC,YAAY,OAAe,EAAE,UAAmB,EAAE,OAAyB,EAAE,SAAkB;QAC7F,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B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 export type { DownloadProgress, DownloadMetadata, DownloadStreamOptions, UploadP
|
|
|
5
5
|
export { Git } from './Git';
|
|
6
6
|
export { LspLanguageId } from './LspServer';
|
|
7
7
|
export { Process } from './Process';
|
|
8
|
-
export {
|
|
8
|
+
export { DaytonaAuthenticationError, DaytonaAuthorizationError, DaytonaConflictError, DaytonaConnectionError, DaytonaError, DaytonaNotFoundError, DaytonaRateLimitError, DaytonaTimeoutError, DaytonaValidationError, } from './errors/DaytonaError';
|
|
9
9
|
export { Image } from './Image';
|
|
10
10
|
export { Sandbox } from './Sandbox';
|
|
11
11
|
export type { ListSandboxesQuery } from './Sandbox';
|
|
@@ -14,7 +14,7 @@ export { ComputerUse, Mouse, Keyboard, Screenshot, Display, Accessibility } from
|
|
|
14
14
|
export type { BarChart, BarData, BoxAndWhiskerChart, BoxAndWhiskerData, Chart, Chart2D, ChartElement, CompositeChart, LineChart, PieChart, PieData, PointChart, PointData, ScatterChart, } from './types/Charts';
|
|
15
15
|
export { ChartType } from './types/Charts';
|
|
16
16
|
export type { ExecutionError, ExecutionResult, OutputMessage, RunCodeOptions } from './types/CodeInterpreter';
|
|
17
|
-
export { SandboxState, SandboxListSortField, SandboxListSortDirection } from '@daytona/api-client';
|
|
17
|
+
export { GpuType, SandboxState, SandboxListSortField, SandboxListSortDirection, SandboxClass, } from '@daytona/api-client';
|
|
18
18
|
export type { FileInfo, GitStatus, ListBranchResponse, Match, ReplaceResult, SearchFilesResponse, } from '@daytona/toolbox-api-client';
|
|
19
19
|
export type { ScreenshotRegion, ScreenshotOptions, AccessibilityTreeOptions, AccessibilityFindOptions, } from './ComputerUse';
|
|
20
20
|
export * from './Process';
|
package/cjs/index.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
exports.SandboxListSortDirection = exports.SandboxListSortField = void 0;
|
|
7
|
+
exports.SandboxClass = exports.SandboxListSortDirection = exports.SandboxListSortField = exports.SandboxState = exports.GpuType = exports.ChartType = exports.Accessibility = exports.Display = exports.Screenshot = exports.Keyboard = exports.Mouse = exports.ComputerUse = exports.Sandbox = exports.Image = exports.DaytonaValidationError = exports.DaytonaTimeoutError = exports.DaytonaRateLimitError = exports.DaytonaNotFoundError = exports.DaytonaError = exports.DaytonaConnectionError = exports.DaytonaConflictError = exports.DaytonaAuthorizationError = exports.DaytonaAuthenticationError = exports.Process = exports.LspLanguageId = exports.Git = exports.FileSystem = exports.Daytona = exports.CodeLanguage = void 0;
|
|
9
8
|
const tslib_1 = require("tslib");
|
|
10
9
|
var Daytona_1 = require("./Daytona");
|
|
11
10
|
Object.defineProperty(exports, "CodeLanguage", { enumerable: true, get: function () { return Daytona_1.CodeLanguage; } });
|
|
@@ -21,44 +20,15 @@ Object.defineProperty(exports, "Process", { enumerable: true, get: function () {
|
|
|
21
20
|
// export { LspServer } from './LspServer'
|
|
22
21
|
// export type { LspLanguageId, Position } from './LspServer'
|
|
23
22
|
var DaytonaError_1 = require("./errors/DaytonaError");
|
|
24
|
-
// Base + status-code classes
|
|
25
|
-
Object.defineProperty(exports, "DaytonaError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaError; } });
|
|
26
|
-
Object.defineProperty(exports, "DaytonaBadRequestError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaBadRequestError; } });
|
|
27
|
-
// Deprecated aliases
|
|
28
|
-
Object.defineProperty(exports, "DaytonaValidationError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaValidationError; } });
|
|
29
23
|
Object.defineProperty(exports, "DaytonaAuthenticationError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaAuthenticationError; } });
|
|
30
|
-
Object.defineProperty(exports, "DaytonaForbiddenError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaForbiddenError; } });
|
|
31
|
-
// Deprecated alias
|
|
32
24
|
Object.defineProperty(exports, "DaytonaAuthorizationError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaAuthorizationError; } });
|
|
33
|
-
Object.defineProperty(exports, "DaytonaNotFoundError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaNotFoundError; } });
|
|
34
|
-
Object.defineProperty(exports, "DaytonaTimeoutError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaTimeoutError; } });
|
|
35
25
|
Object.defineProperty(exports, "DaytonaConflictError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaConflictError; } });
|
|
36
|
-
Object.defineProperty(exports, "DaytonaGoneError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaGoneError; } });
|
|
37
|
-
Object.defineProperty(exports, "DaytonaUnprocessableEntityError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaUnprocessableEntityError; } });
|
|
38
|
-
Object.defineProperty(exports, "DaytonaRateLimitError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaRateLimitError; } });
|
|
39
|
-
Object.defineProperty(exports, "DaytonaInternalServerError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaInternalServerError; } });
|
|
40
|
-
Object.defineProperty(exports, "DaytonaBadGatewayError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaBadGatewayError; } });
|
|
41
|
-
Object.defineProperty(exports, "DaytonaServiceUnavailableError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaServiceUnavailableError; } });
|
|
42
26
|
Object.defineProperty(exports, "DaytonaConnectionError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaConnectionError; } });
|
|
43
|
-
Object.defineProperty(exports, "
|
|
44
|
-
|
|
45
|
-
Object.defineProperty(exports, "
|
|
46
|
-
Object.defineProperty(exports, "
|
|
47
|
-
Object.defineProperty(exports, "
|
|
48
|
-
Object.defineProperty(exports, "DaytonaGitBranchExistsError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaGitBranchExistsError; } });
|
|
49
|
-
Object.defineProperty(exports, "DaytonaGitPushRejectedError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaGitPushRejectedError; } });
|
|
50
|
-
Object.defineProperty(exports, "DaytonaGitDirtyWorktreeError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaGitDirtyWorktreeError; } });
|
|
51
|
-
Object.defineProperty(exports, "DaytonaGitMergeConflictError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaGitMergeConflictError; } });
|
|
52
|
-
Object.defineProperty(exports, "DaytonaFileNotFoundError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaFileNotFoundError; } });
|
|
53
|
-
Object.defineProperty(exports, "DaytonaFileAccessDeniedError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaFileAccessDeniedError; } });
|
|
54
|
-
Object.defineProperty(exports, "DaytonaLspServerNotInitializedError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaLspServerNotInitializedError; } });
|
|
55
|
-
Object.defineProperty(exports, "DaytonaProcessExecutionTimeoutError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaProcessExecutionTimeoutError; } });
|
|
56
|
-
Object.defineProperty(exports, "DaytonaProcessNotFoundError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaProcessNotFoundError; } });
|
|
57
|
-
Object.defineProperty(exports, "DaytonaSessionEndedError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaSessionEndedError; } });
|
|
58
|
-
Object.defineProperty(exports, "DaytonaCommandAlreadyCompletedError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaCommandAlreadyCompletedError; } });
|
|
59
|
-
Object.defineProperty(exports, "DaytonaA11yUnavailableError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaA11yUnavailableError; } });
|
|
60
|
-
Object.defineProperty(exports, "DaytonaRecordingStillActiveError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaRecordingStillActiveError; } });
|
|
61
|
-
Object.defineProperty(exports, "DaytonaRecordingFfmpegNotFoundError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaRecordingFfmpegNotFoundError; } });
|
|
27
|
+
Object.defineProperty(exports, "DaytonaError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaError; } });
|
|
28
|
+
Object.defineProperty(exports, "DaytonaNotFoundError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaNotFoundError; } });
|
|
29
|
+
Object.defineProperty(exports, "DaytonaRateLimitError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaRateLimitError; } });
|
|
30
|
+
Object.defineProperty(exports, "DaytonaTimeoutError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaTimeoutError; } });
|
|
31
|
+
Object.defineProperty(exports, "DaytonaValidationError", { enumerable: true, get: function () { return DaytonaError_1.DaytonaValidationError; } });
|
|
62
32
|
var Image_1 = require("./Image");
|
|
63
33
|
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return Image_1.Image; } });
|
|
64
34
|
var Sandbox_1 = require("./Sandbox");
|
|
@@ -73,9 +43,11 @@ Object.defineProperty(exports, "Accessibility", { enumerable: true, get: functio
|
|
|
73
43
|
var Charts_1 = require("./types/Charts");
|
|
74
44
|
Object.defineProperty(exports, "ChartType", { enumerable: true, get: function () { return Charts_1.ChartType; } });
|
|
75
45
|
var api_client_1 = require("@daytona/api-client");
|
|
46
|
+
Object.defineProperty(exports, "GpuType", { enumerable: true, get: function () { return api_client_1.GpuType; } });
|
|
76
47
|
Object.defineProperty(exports, "SandboxState", { enumerable: true, get: function () { return api_client_1.SandboxState; } });
|
|
77
48
|
Object.defineProperty(exports, "SandboxListSortField", { enumerable: true, get: function () { return api_client_1.SandboxListSortField; } });
|
|
78
49
|
Object.defineProperty(exports, "SandboxListSortDirection", { enumerable: true, get: function () { return api_client_1.SandboxListSortDirection; } });
|
|
50
|
+
Object.defineProperty(exports, "SandboxClass", { enumerable: true, get: function () { return api_client_1.SandboxClass; } });
|
|
79
51
|
tslib_1.__exportStar(require("./Process"), exports);
|
|
80
52
|
tslib_1.__exportStar(require("./PtyHandle"), exports);
|
|
81
53
|
tslib_1.__exportStar(require("./types/Pty"), exports);
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAEH,qCAAiD;AAAxC,uGAAA,YAAY,OAAA;AAAE,kGAAA,OAAO,OAAA;AAS9B,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAcnB,6BAA2B;AAAlB,0FAAA,GAAG,OAAA;AACZ,yCAA2C;AAAlC,0GAAA,aAAa,OAAA;AACtB,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,0CAA0C;AAC1C,6DAA6D;AAC7D,sDAU8B;AAT5B,0HAAA,0BAA0B,OAAA;AAC1B,yHAAA,yBAAyB,OAAA;AACzB,oHAAA,oBAAoB,OAAA;AACpB,sHAAA,sBAAsB,OAAA;AACtB,4GAAA,YAAY,OAAA;AACZ,oHAAA,oBAAoB,OAAA;AACpB,qHAAA,qBAAqB,OAAA;AACrB,mHAAA,mBAAmB,OAAA;AACnB,sHAAA,sBAAsB,OAAA;AAExB,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAGhB,6CAAgG;AAAvF,0GAAA,WAAW,OAAA;AAAE,oGAAA,KAAK,OAAA;AAAE,uGAAA,QAAQ,OAAA;AAAE,yGAAA,UAAU,OAAA;AAAE,sGAAA,OAAO,OAAA;AAAE,4GAAA,aAAa,OAAA;AAiBzE,yCAA0C;AAAjC,mGAAA,SAAS,OAAA;AAGlB,kDAM4B;AAL1B,qGAAA,OAAO,OAAA;AACP,0GAAA,YAAY,OAAA;AACZ,kHAAA,oBAAoB,OAAA;AACpB,sHAAA,wBAAwB,OAAA;AACxB,0GAAA,YAAY,OAAA;AAkBd,oDAAyB;AACzB,sDAA2B;AAC3B,sDAA2B"}
|
|
@@ -32,8 +32,7 @@ function parseDownloadErrorPart(data, contentType) {
|
|
|
32
32
|
const payloadObject = payload;
|
|
33
33
|
const structuredMessage = payloadObject.message;
|
|
34
34
|
const statusCode = payloadObject.statusCode ?? payloadObject.status_code;
|
|
35
|
-
const
|
|
36
|
-
const source = payloadObject.source;
|
|
35
|
+
const errorCode = payloadObject.code ?? payloadObject.error_code;
|
|
37
36
|
if (typeof structuredMessage === 'string') {
|
|
38
37
|
message = structuredMessage;
|
|
39
38
|
}
|
|
@@ -42,8 +41,7 @@ function parseDownloadErrorPart(data, contentType) {
|
|
|
42
41
|
errorDetails: {
|
|
43
42
|
message,
|
|
44
43
|
statusCode: typeof statusCode === 'number' ? statusCode : undefined,
|
|
45
|
-
|
|
46
|
-
source: typeof source === 'string' ? source : undefined,
|
|
44
|
+
errorCode: typeof errorCode === 'string' ? errorCode : undefined,
|
|
47
45
|
},
|
|
48
46
|
};
|
|
49
47
|
}
|