freestyle-sandboxes 0.1.33 → 0.1.34

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 (5) hide show
  1. package/index.cjs +1189 -1341
  2. package/index.d.cts +1209 -2764
  3. package/index.d.mts +1209 -2764
  4. package/index.mjs +1189 -1341
  5. package/package.json +1 -1
package/index.cjs CHANGED
@@ -10,18 +10,6 @@ function errorFromJSON(body) {
10
10
  return new Error(`Unknown error code: ${body.code} - ${body.description}`);
11
11
  }
12
12
  }
13
- class GitErrorError extends Error {
14
- constructor(body) {
15
- super(
16
- `GIT_ERROR: ${body.message}`
17
- );
18
- this.body = body;
19
- this.name = "GitErrorError";
20
- }
21
- static code = "GIT_ERROR";
22
- static statusCode = 500;
23
- static description = `{message}`;
24
- }
25
13
  class BadParseError extends Error {
26
14
  constructor(body) {
27
15
  super(
@@ -82,197 +70,149 @@ class BadKeyError extends Error {
82
70
  static statusCode = 400;
83
71
  static description = `invalid key length`;
84
72
  }
85
- class UserNotFoundError extends Error {
86
- constructor(body) {
87
- super(
88
- `USER_NOT_FOUND: ${body.message}`
89
- );
90
- this.body = body;
91
- this.name = "UserNotFoundError";
92
- }
93
- static code = "USER_NOT_FOUND";
94
- static statusCode = 404;
95
- static description = `User not found: {user_name}`;
96
- }
97
- class UserAlreadyExistsError extends Error {
98
- constructor(body) {
99
- super(
100
- `USER_ALREADY_EXISTS: ${body.message}`
101
- );
102
- this.body = body;
103
- this.name = "UserAlreadyExistsError";
104
- }
105
- static code = "USER_ALREADY_EXISTS";
106
- static statusCode = 409;
107
- static description = `Conflict: User '{user_name}' already exists`;
108
- }
109
- class ValidationErrorError extends Error {
73
+ class GitErrorError extends Error {
110
74
  constructor(body) {
111
75
  super(
112
- `VALIDATION_ERROR: ${body.message}`
76
+ `GIT_ERROR: ${body.message}`
113
77
  );
114
78
  this.body = body;
115
- this.name = "ValidationErrorError";
79
+ this.name = "GitErrorError";
116
80
  }
117
- static code = "VALIDATION_ERROR";
118
- static statusCode = 400;
119
- static description = `Validation error: {message}`;
81
+ static code = "GIT_ERROR";
82
+ static statusCode = 500;
83
+ static description = `{message}`;
120
84
  }
121
- class GroupNotFoundError extends Error {
85
+ class PartitionNotFoundError extends Error {
122
86
  constructor(body) {
123
87
  super(
124
- `GROUP_NOT_FOUND: ${body.message}`
88
+ `PARTITION_NOT_FOUND: ${body.message}`
125
89
  );
126
90
  this.body = body;
127
- this.name = "GroupNotFoundError";
91
+ this.name = "PartitionNotFoundError";
128
92
  }
129
- static code = "GROUP_NOT_FOUND";
93
+ static code = "PARTITION_NOT_FOUND";
130
94
  static statusCode = 404;
131
- static description = `Group not found: {group_name}`;
95
+ static description = `Partition not found: {partition_id}`;
132
96
  }
133
- class GroupAlreadyExistsError extends Error {
97
+ class VmOperationDeniedDuringTransactionError extends Error {
134
98
  constructor(body) {
135
99
  super(
136
- `GROUP_ALREADY_EXISTS: ${body.message}`
100
+ `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
137
101
  );
138
102
  this.body = body;
139
- this.name = "GroupAlreadyExistsError";
103
+ this.name = "VmOperationDeniedDuringTransactionError";
140
104
  }
141
- static code = "GROUP_ALREADY_EXISTS";
105
+ static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
142
106
  static statusCode = 409;
143
- static description = `Conflict: Group '{group_name}' already exists`;
144
- }
145
- class DuplicateUserNameError extends Error {
146
- constructor(body) {
147
- super(
148
- `DUPLICATE_USER_NAME: ${body.message}`
149
- );
150
- this.body = body;
151
- this.name = "DuplicateUserNameError";
152
- }
153
- static code = "DUPLICATE_USER_NAME";
154
- static statusCode = 400;
155
- static description = `Duplicate user name '{name}' found`;
156
- }
157
- class UserGroupEmptyError extends Error {
158
- constructor(body) {
159
- super(
160
- `USER_GROUP_EMPTY: ${body.message}`
161
- );
162
- this.body = body;
163
- this.name = "UserGroupEmptyError";
164
- }
165
- static code = "USER_GROUP_EMPTY";
166
- static statusCode = 400;
167
- static description = `User '{user}' has empty string in groups`;
107
+ static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
168
108
  }
169
- class UserSystemFlagMismatchError extends Error {
109
+ class VmTransactionIdMismatchError extends Error {
170
110
  constructor(body) {
171
111
  super(
172
- `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
112
+ `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
173
113
  );
174
114
  this.body = body;
175
- this.name = "UserSystemFlagMismatchError";
115
+ this.name = "VmTransactionIdMismatchError";
176
116
  }
177
- static code = "USER_SYSTEM_FLAG_MISMATCH";
117
+ static code = "VM_TRANSACTION_ID_MISMATCH";
178
118
  static statusCode = 400;
179
- static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
119
+ static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
180
120
  }
181
- class UserUidOutOfRangeError extends Error {
121
+ class VmNotInTransactionError extends Error {
182
122
  constructor(body) {
183
123
  super(
184
- `USER_UID_OUT_OF_RANGE: ${body.message}`
124
+ `VM_NOT_IN_TRANSACTION: ${body.message}`
185
125
  );
186
126
  this.body = body;
187
- this.name = "UserUidOutOfRangeError";
127
+ this.name = "VmNotInTransactionError";
188
128
  }
189
- static code = "USER_UID_OUT_OF_RANGE";
190
- static statusCode = 400;
191
- static description = `User '{user}' has invalid UID {uid} (must be 0-65535)`;
129
+ static code = "VM_NOT_IN_TRANSACTION";
130
+ static statusCode = 404;
131
+ static description = `VM not in a transaction: {vm_id}`;
192
132
  }
193
- class UserHomeInvalidError extends Error {
133
+ class VmNotRunningError extends Error {
194
134
  constructor(body) {
195
135
  super(
196
- `USER_HOME_INVALID: ${body.message}`
136
+ `VM_NOT_RUNNING: ${body.message}`
197
137
  );
198
138
  this.body = body;
199
- this.name = "UserHomeInvalidError";
139
+ this.name = "VmNotRunningError";
200
140
  }
201
- static code = "USER_HOME_INVALID";
141
+ static code = "VM_NOT_RUNNING";
202
142
  static statusCode = 400;
203
- static description = `User '{user}' has invalid home path '{home}' (must be absolute path starting with /)`;
143
+ static description = `Stopped VM not running`;
204
144
  }
205
- class UserShellInvalidError extends Error {
145
+ class FileNotFoundError extends Error {
206
146
  constructor(body) {
207
147
  super(
208
- `USER_SHELL_INVALID: ${body.message}`
148
+ `FILE_NOT_FOUND: ${body.message}`
209
149
  );
210
150
  this.body = body;
211
- this.name = "UserShellInvalidError";
151
+ this.name = "FileNotFoundError";
212
152
  }
213
- static code = "USER_SHELL_INVALID";
214
- static statusCode = 400;
215
- static description = `User '{user}' has invalid shell path '{shell}' (must be absolute path starting with /)`;
153
+ static code = "FILE_NOT_FOUND";
154
+ static statusCode = 404;
155
+ static description = `File not found: {path}`;
216
156
  }
217
- class DuplicateGroupNameError extends Error {
157
+ class FilesBadRequestError extends Error {
218
158
  constructor(body) {
219
159
  super(
220
- `DUPLICATE_GROUP_NAME: ${body.message}`
160
+ `FILES_BAD_REQUEST: ${body.message}`
221
161
  );
222
162
  this.body = body;
223
- this.name = "DuplicateGroupNameError";
163
+ this.name = "FilesBadRequestError";
224
164
  }
225
- static code = "DUPLICATE_GROUP_NAME";
165
+ static code = "FILES_BAD_REQUEST";
226
166
  static statusCode = 400;
227
- static description = `Duplicate group name '{name}' found`;
167
+ static description = `Bad request: {message}`;
228
168
  }
229
- class GroupNameReservedError extends Error {
169
+ class InvalidGitRepoSpecErrorError extends Error {
230
170
  constructor(body) {
231
171
  super(
232
- `GROUP_NAME_RESERVED: ${body.message}`
172
+ `INVALID_GIT_REPO_SPEC_ERROR: ${body.message}`
233
173
  );
234
174
  this.body = body;
235
- this.name = "GroupNameReservedError";
175
+ this.name = "InvalidGitRepoSpecErrorError";
236
176
  }
237
- static code = "GROUP_NAME_RESERVED";
177
+ static code = "INVALID_GIT_REPO_SPEC_ERROR";
238
178
  static statusCode = 400;
239
- static description = `Group name '{name}' is reserved and cannot be used`;
179
+ static description = `Invalid git repository specification: {message}`;
240
180
  }
241
- class GroupNameInvalidCharsError extends Error {
181
+ class InternalErrorError extends Error {
242
182
  constructor(body) {
243
183
  super(
244
- `GROUP_NAME_INVALID_CHARS: ${body.message}`
184
+ `INTERNAL_ERROR: ${body.message}`
245
185
  );
246
186
  this.body = body;
247
- this.name = "GroupNameInvalidCharsError";
187
+ this.name = "InternalErrorError";
248
188
  }
249
- static code = "GROUP_NAME_INVALID_CHARS";
250
- static statusCode = 400;
251
- static description = `Group name '{name}' contains invalid characters (must match [a-z_][a-z0-9_-]*)`;
189
+ static code = "INTERNAL_ERROR";
190
+ static statusCode = 500;
191
+ static description = `Internal error: {message}`;
252
192
  }
253
- class GroupNameTooLongError extends Error {
193
+ class ForkVmNotFoundError extends Error {
254
194
  constructor(body) {
255
195
  super(
256
- `GROUP_NAME_TOO_LONG: ${body.message}`
196
+ `FORK_VM_NOT_FOUND: ${body.message}`
257
197
  );
258
198
  this.body = body;
259
- this.name = "GroupNameTooLongError";
199
+ this.name = "ForkVmNotFoundError";
260
200
  }
261
- static code = "GROUP_NAME_TOO_LONG";
262
- static statusCode = 400;
263
- static description = `Group name '{name}' is too long (max {max_length} characters)`;
201
+ static code = "FORK_VM_NOT_FOUND";
202
+ static statusCode = 404;
203
+ static description = `Fork VM not found: {fork_vm_id}`;
264
204
  }
265
- class GroupNameEmptyError extends Error {
205
+ class CreateSnapshotBadRequestError extends Error {
266
206
  constructor(body) {
267
207
  super(
268
- `GROUP_NAME_EMPTY: ${body.message}`
208
+ `CREATE_SNAPSHOT_BAD_REQUEST: ${body.message}`
269
209
  );
270
210
  this.body = body;
271
- this.name = "GroupNameEmptyError";
211
+ this.name = "CreateSnapshotBadRequestError";
272
212
  }
273
- static code = "GROUP_NAME_EMPTY";
213
+ static code = "CREATE_SNAPSHOT_BAD_REQUEST";
274
214
  static statusCode = 400;
275
- static description = `Group name cannot be empty`;
215
+ static description = `Bad request: {message}`;
276
216
  }
277
217
  class ActiveTransactionErrorError extends Error {
278
218
  constructor(body) {
@@ -298,18 +238,6 @@ class SwapVmTapError extends Error {
298
238
  static statusCode = 500;
299
239
  static description = `Failed to swap tap device: {details}`;
300
240
  }
301
- class InternalErrorError extends Error {
302
- constructor(body) {
303
- super(
304
- `INTERNAL_ERROR: ${body.message}`
305
- );
306
- this.body = body;
307
- this.name = "InternalErrorError";
308
- }
309
- static code = "INTERNAL_ERROR";
310
- static statusCode = 500;
311
- static description = `Fork failed: {message}`;
312
- }
313
241
  class RootfsCopyErrorError extends Error {
314
242
  constructor(body) {
315
243
  super(
@@ -322,149 +250,245 @@ class RootfsCopyErrorError extends Error {
322
250
  static statusCode = 500;
323
251
  static description = `Failed to copy rootfs from {from} to {to}: {details}`;
324
252
  }
325
- class DockerSnapshotFailedError extends Error {
253
+ class VmNotFoundInFsError extends Error {
326
254
  constructor(body) {
327
255
  super(
328
- `DOCKER_SNAPSHOT_FAILED: ${body.message}`
256
+ `VM_NOT_FOUND_IN_FS: ${body.message}`
329
257
  );
330
258
  this.body = body;
331
- this.name = "DockerSnapshotFailedError";
259
+ this.name = "VmNotFoundInFsError";
332
260
  }
333
- static code = "DOCKER_SNAPSHOT_FAILED";
334
- static statusCode = 500;
335
- static description = `Failed to create snapshot from Docker image {docker_image} for account {account_id}: {details}`;
261
+ static code = "VM_NOT_FOUND_IN_FS";
262
+ static statusCode = 406;
263
+ static description = `Vm Not found in filesystem`;
336
264
  }
337
- class SetDefaultSnapshotFailedError extends Error {
265
+ class DatabaseErrorError extends Error {
338
266
  constructor(body) {
339
267
  super(
340
- `SET_DEFAULT_SNAPSHOT_FAILED: ${body.message}`
268
+ `DATABASE_ERROR: ${body.message}`
341
269
  );
342
270
  this.body = body;
343
- this.name = "SetDefaultSnapshotFailedError";
271
+ this.name = "DatabaseErrorError";
344
272
  }
345
- static code = "SET_DEFAULT_SNAPSHOT_FAILED";
273
+ static code = "DATABASE_ERROR";
346
274
  static statusCode = 500;
347
- static description = `Failed to update default snapshot in database for account {account_id}, snapshot {snapshot_id}: {details}`;
275
+ static description = `Database error occurred while constructing VmRecord, details: {details}`;
348
276
  }
349
- class SnapshotLayerCreationFailedError extends Error {
277
+ class InvalidVmIdError extends Error {
350
278
  constructor(body) {
351
279
  super(
352
- `SNAPSHOT_LAYER_CREATION_FAILED: ${body.message}`
280
+ `INVALID_VM_ID: ${body.message}`
353
281
  );
354
282
  this.body = body;
355
- this.name = "SnapshotLayerCreationFailedError";
283
+ this.name = "InvalidVmIdError";
356
284
  }
357
- static code = "SNAPSHOT_LAYER_CREATION_FAILED";
358
- static statusCode = 500;
359
- static description = `Failed to create snapshot layer for account {account_id} from {source_snapshot_dir}: {details}`;
285
+ static code = "INVALID_VM_ID";
286
+ static statusCode = 400;
287
+ static description = `Invalid VM ID: {vm_id}, details: {details}`;
360
288
  }
361
- class SnapshotDirNotFoundError extends Error {
289
+ class VmNotFoundError extends Error {
362
290
  constructor(body) {
363
291
  super(
364
- `SNAPSHOT_DIR_NOT_FOUND: ${body.message}`
292
+ `VM_NOT_FOUND: ${body.message}`
365
293
  );
366
294
  this.body = body;
367
- this.name = "SnapshotDirNotFoundError";
295
+ this.name = "VmNotFoundError";
368
296
  }
369
- static code = "SNAPSHOT_DIR_NOT_FOUND";
370
- static statusCode = 500;
371
- static description = `Snapshot directory not found at {snapshot_dir} for account {account_id}, snapshot {snapshot_id}`;
297
+ static code = "VM_NOT_FOUND";
298
+ static statusCode = 404;
299
+ static description = `VM not found: {vm_id}`;
372
300
  }
373
- class SubvolumeCreationFailedError extends Error {
301
+ class InternalForkVmNotFoundError extends Error {
374
302
  constructor(body) {
375
303
  super(
376
- `SUBVOLUME_CREATION_FAILED: ${body.message}`
304
+ `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
377
305
  );
378
306
  this.body = body;
379
- this.name = "SubvolumeCreationFailedError";
307
+ this.name = "InternalForkVmNotFoundError";
380
308
  }
381
- static code = "SUBVOLUME_CREATION_FAILED";
382
- static statusCode = 500;
383
- static description = `Failed to create account subvolume for account {account_id} on partition {partition_id}: {details}`;
384
- }
385
- class GetDefaultSnapshotFailedError extends Error {
309
+ static code = "INTERNAL_FORK_VM_NOT_FOUND";
310
+ static statusCode = 404;
311
+ static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
312
+ }
313
+ class BadRequestError extends Error {
386
314
  constructor(body) {
387
315
  super(
388
- `GET_DEFAULT_SNAPSHOT_FAILED: ${body.message}`
316
+ `BAD_REQUEST: ${body.message}`
389
317
  );
390
318
  this.body = body;
391
- this.name = "GetDefaultSnapshotFailedError";
319
+ this.name = "BadRequestError";
392
320
  }
393
- static code = "GET_DEFAULT_SNAPSHOT_FAILED";
321
+ static code = "BAD_REQUEST";
322
+ static statusCode = 400;
323
+ static description = `Bad request: {message}`;
324
+ }
325
+ class InternalVmNotFoundError extends Error {
326
+ constructor(body) {
327
+ super(
328
+ `INTERNAL_VM_NOT_FOUND: ${body.message}`
329
+ );
330
+ this.body = body;
331
+ this.name = "InternalVmNotFoundError";
332
+ }
333
+ static code = "INTERNAL_VM_NOT_FOUND";
334
+ static statusCode = 404;
335
+ static description = `VM not found: {vm_id}`;
336
+ }
337
+ class SnapshotSetupFailedError extends Error {
338
+ constructor(body) {
339
+ super(
340
+ `SNAPSHOT_SETUP_FAILED: ${body.message}`
341
+ );
342
+ this.body = body;
343
+ this.name = "SnapshotSetupFailedError";
344
+ }
345
+ static code = "SNAPSHOT_SETUP_FAILED";
394
346
  static statusCode = 500;
395
- static description = `Failed to query account default snapshot for account {account_id}: {details}`;
347
+ static description = `Snapshot setup failed: {failed_reason}`;
396
348
  }
397
- class VmNotFoundInFsError extends Error {
349
+ class SnapshotVmBadRequestError extends Error {
398
350
  constructor(body) {
399
351
  super(
400
- `VM_NOT_FOUND_IN_FS: ${body.message}`
352
+ `SNAPSHOT_VM_BAD_REQUEST: ${body.message}`
401
353
  );
402
354
  this.body = body;
403
- this.name = "VmNotFoundInFsError";
355
+ this.name = "SnapshotVmBadRequestError";
404
356
  }
405
- static code = "VM_NOT_FOUND_IN_FS";
406
- static statusCode = 406;
407
- static description = `Vm Not found in filesystem`;
357
+ static code = "SNAPSHOT_VM_BAD_REQUEST";
358
+ static statusCode = 400;
359
+ static description = `Bad request: {message}`;
408
360
  }
409
- class DatabaseErrorError extends Error {
361
+ class VmDeletedError extends Error {
410
362
  constructor(body) {
411
363
  super(
412
- `DATABASE_ERROR: ${body.message}`
364
+ `VM_DELETED: ${body.message}`
413
365
  );
414
366
  this.body = body;
415
- this.name = "DatabaseErrorError";
367
+ this.name = "VmDeletedError";
416
368
  }
417
- static code = "DATABASE_ERROR";
369
+ static code = "VM_DELETED";
418
370
  static statusCode = 500;
419
- static description = `Database error occurred while constructing VmRecord, details: {details}`;
371
+ static description = `Vm {vm_id} is marked as deleted but still exists in the database`;
420
372
  }
421
- class PartitionNotFoundError extends Error {
373
+ class NoDefaultSnapshotAvailableError extends Error {
422
374
  constructor(body) {
423
375
  super(
424
- `PARTITION_NOT_FOUND: ${body.message}`
376
+ `NO_DEFAULT_SNAPSHOT_AVAILABLE: ${body.message}`
425
377
  );
426
378
  this.body = body;
427
- this.name = "PartitionNotFoundError";
379
+ this.name = "NoDefaultSnapshotAvailableError";
428
380
  }
429
- static code = "PARTITION_NOT_FOUND";
381
+ static code = "NO_DEFAULT_SNAPSHOT_AVAILABLE";
430
382
  static statusCode = 404;
431
- static description = `Partition not found: {partition_id}`;
383
+ static description = `No default snapshot available for account {account_id}`;
432
384
  }
433
- class InvalidVmIdError extends Error {
385
+ class DockerSnapshotFailedError extends Error {
434
386
  constructor(body) {
435
387
  super(
436
- `INVALID_VM_ID: ${body.message}`
388
+ `DOCKER_SNAPSHOT_FAILED: ${body.message}`
437
389
  );
438
390
  this.body = body;
439
- this.name = "InvalidVmIdError";
391
+ this.name = "DockerSnapshotFailedError";
440
392
  }
441
- static code = "INVALID_VM_ID";
442
- static statusCode = 400;
443
- static description = `Invalid VM ID: {vm_id}, details: {details}`;
393
+ static code = "DOCKER_SNAPSHOT_FAILED";
394
+ static statusCode = 500;
395
+ static description = `Failed to create snapshot from Docker image {docker_image} for account {account_id}: {details}`;
444
396
  }
445
- class FileNotFoundError extends Error {
397
+ class SetDefaultSnapshotFailedError extends Error {
446
398
  constructor(body) {
447
399
  super(
448
- `FILE_NOT_FOUND: ${body.message}`
400
+ `SET_DEFAULT_SNAPSHOT_FAILED: ${body.message}`
449
401
  );
450
402
  this.body = body;
451
- this.name = "FileNotFoundError";
403
+ this.name = "SetDefaultSnapshotFailedError";
452
404
  }
453
- static code = "FILE_NOT_FOUND";
454
- static statusCode = 404;
455
- static description = `File not found: {path}`;
405
+ static code = "SET_DEFAULT_SNAPSHOT_FAILED";
406
+ static statusCode = 500;
407
+ static description = `Failed to update default snapshot in database for account {account_id}, snapshot {snapshot_id}: {details}`;
456
408
  }
457
- class FilesBadRequestError extends Error {
409
+ class SnapshotLayerCreationFailedError extends Error {
458
410
  constructor(body) {
459
411
  super(
460
- `FILES_BAD_REQUEST: ${body.message}`
412
+ `SNAPSHOT_LAYER_CREATION_FAILED: ${body.message}`
461
413
  );
462
414
  this.body = body;
463
- this.name = "FilesBadRequestError";
415
+ this.name = "SnapshotLayerCreationFailedError";
464
416
  }
465
- static code = "FILES_BAD_REQUEST";
466
- static statusCode = 400;
467
- static description = `Bad request: {message}`;
417
+ static code = "SNAPSHOT_LAYER_CREATION_FAILED";
418
+ static statusCode = 500;
419
+ static description = `Failed to create snapshot layer for account {account_id} from {source_snapshot_dir}: {details}`;
420
+ }
421
+ class SnapshotDirNotFoundError extends Error {
422
+ constructor(body) {
423
+ super(
424
+ `SNAPSHOT_DIR_NOT_FOUND: ${body.message}`
425
+ );
426
+ this.body = body;
427
+ this.name = "SnapshotDirNotFoundError";
428
+ }
429
+ static code = "SNAPSHOT_DIR_NOT_FOUND";
430
+ static statusCode = 500;
431
+ static description = `Snapshot directory not found at {snapshot_dir} for account {account_id}, snapshot {snapshot_id}`;
432
+ }
433
+ class SubvolumeCreationFailedError extends Error {
434
+ constructor(body) {
435
+ super(
436
+ `SUBVOLUME_CREATION_FAILED: ${body.message}`
437
+ );
438
+ this.body = body;
439
+ this.name = "SubvolumeCreationFailedError";
440
+ }
441
+ static code = "SUBVOLUME_CREATION_FAILED";
442
+ static statusCode = 500;
443
+ static description = `Failed to create account subvolume for account {account_id}: {details}`;
444
+ }
445
+ class GetDefaultSnapshotFailedError extends Error {
446
+ constructor(body) {
447
+ super(
448
+ `GET_DEFAULT_SNAPSHOT_FAILED: ${body.message}`
449
+ );
450
+ this.body = body;
451
+ this.name = "GetDefaultSnapshotFailedError";
452
+ }
453
+ static code = "GET_DEFAULT_SNAPSHOT_FAILED";
454
+ static statusCode = 500;
455
+ static description = `Failed to query account default snapshot for account {account_id}: {details}`;
456
+ }
457
+ class SuspendFailedAndStopFailedError extends Error {
458
+ constructor(body) {
459
+ super(
460
+ `SUSPEND_FAILED_AND_STOP_FAILED: ${body.message}`
461
+ );
462
+ this.body = body;
463
+ this.name = "SuspendFailedAndStopFailedError";
464
+ }
465
+ static code = "SUSPEND_FAILED_AND_STOP_FAILED";
466
+ static statusCode = 500;
467
+ static description = `Failed to gracefully suspend or stop VM`;
468
+ }
469
+ class SuspendFailedAndStoppedError extends Error {
470
+ constructor(body) {
471
+ super(
472
+ `SUSPEND_FAILED_AND_STOPPED: ${body.message}`
473
+ );
474
+ this.body = body;
475
+ this.name = "SuspendFailedAndStoppedError";
476
+ }
477
+ static code = "SUSPEND_FAILED_AND_STOPPED";
478
+ static statusCode = 500;
479
+ static description = `Failed to gracefully suspend, stopped VM`;
480
+ }
481
+ class SnapshotNotFoundError extends Error {
482
+ constructor(body) {
483
+ super(
484
+ `SNAPSHOT_NOT_FOUND: ${body.message}`
485
+ );
486
+ this.body = body;
487
+ this.name = "SnapshotNotFoundError";
488
+ }
489
+ static code = "SNAPSHOT_NOT_FOUND";
490
+ static statusCode = 404;
491
+ static description = `Snapshot not found: {snapshot_id}`;
468
492
  }
469
493
  class ResumedVmNonResponsiveError extends Error {
470
494
  constructor(body) {
@@ -514,18 +538,6 @@ class KernelPanicError extends Error {
514
538
  static statusCode = 500;
515
539
  static description = `VM kernel panic detected`;
516
540
  }
517
- class VmDeletedError extends Error {
518
- constructor(body) {
519
- super(
520
- `VM_DELETED: ${body.message}`
521
- );
522
- this.body = body;
523
- this.name = "VmDeletedError";
524
- }
525
- static code = "VM_DELETED";
526
- static statusCode = 410;
527
- static description = `Cannot start VM: VM files have been deleted. This VM was ephemeral and its files were removed.`;
528
- }
529
541
  class ReqwestError extends Error {
530
542
  constructor(body) {
531
543
  super(
@@ -622,17 +634,29 @@ class StdIoError extends Error {
622
634
  static statusCode = 500;
623
635
  static description = `Standard IO error`;
624
636
  }
625
- class VmCreateTmuxSessionError extends Error {
637
+ class FailedToSpawnUffdError extends Error {
638
+ constructor(body) {
639
+ super(
640
+ `FAILED_TO_SPAWN_UFFD: ${body.message}`
641
+ );
642
+ this.body = body;
643
+ this.name = "FailedToSpawnUffdError";
644
+ }
645
+ static code = "FAILED_TO_SPAWN_UFFD";
646
+ static statusCode = 500;
647
+ static description = `Failed to spawn UFFD handler '{daemon_name}'`;
648
+ }
649
+ class VmSpawnProcessError extends Error {
626
650
  constructor(body) {
627
651
  super(
628
- `VM_CREATE_TMUX_SESSION: ${body.message}`
652
+ `VM_SPAWN_PROCESS: ${body.message}`
629
653
  );
630
654
  this.body = body;
631
- this.name = "VmCreateTmuxSessionError";
655
+ this.name = "VmSpawnProcessError";
632
656
  }
633
- static code = "VM_CREATE_TMUX_SESSION";
657
+ static code = "VM_SPAWN_PROCESS";
634
658
  static statusCode = 500;
635
- static description = `Failed to create tmux session for VM`;
659
+ static description = `Failed to spawn process for VM`;
636
660
  }
637
661
  class VmSubnetNotFoundError extends Error {
638
662
  constructor(body) {
@@ -646,197 +670,197 @@ class VmSubnetNotFoundError extends Error {
646
670
  static statusCode = 500;
647
671
  static description = `Subnet for VM not found`;
648
672
  }
649
- class InvalidGitRepoSpecErrorError extends Error {
673
+ class UserNotFoundError extends Error {
650
674
  constructor(body) {
651
675
  super(
652
- `INVALID_GIT_REPO_SPEC_ERROR: ${body.message}`
676
+ `USER_NOT_FOUND: ${body.message}`
653
677
  );
654
678
  this.body = body;
655
- this.name = "InvalidGitRepoSpecErrorError";
679
+ this.name = "UserNotFoundError";
656
680
  }
657
- static code = "INVALID_GIT_REPO_SPEC_ERROR";
658
- static statusCode = 400;
659
- static description = `Invalid git repository specification: {message}`;
681
+ static code = "USER_NOT_FOUND";
682
+ static statusCode = 404;
683
+ static description = `User not found: {user_name}`;
660
684
  }
661
- class ForkVmNotFoundError extends Error {
685
+ class UserAlreadyExistsError extends Error {
662
686
  constructor(body) {
663
687
  super(
664
- `FORK_VM_NOT_FOUND: ${body.message}`
688
+ `USER_ALREADY_EXISTS: ${body.message}`
665
689
  );
666
690
  this.body = body;
667
- this.name = "ForkVmNotFoundError";
691
+ this.name = "UserAlreadyExistsError";
668
692
  }
669
- static code = "FORK_VM_NOT_FOUND";
670
- static statusCode = 404;
671
- static description = `Fork VM not found: {fork_vm_id}`;
693
+ static code = "USER_ALREADY_EXISTS";
694
+ static statusCode = 409;
695
+ static description = `Conflict: User '{user_name}' already exists`;
672
696
  }
673
- class CreateSnapshotBadRequestError extends Error {
697
+ class ValidationErrorError extends Error {
674
698
  constructor(body) {
675
699
  super(
676
- `CREATE_SNAPSHOT_BAD_REQUEST: ${body.message}`
700
+ `VALIDATION_ERROR: ${body.message}`
677
701
  );
678
702
  this.body = body;
679
- this.name = "CreateSnapshotBadRequestError";
703
+ this.name = "ValidationErrorError";
680
704
  }
681
- static code = "CREATE_SNAPSHOT_BAD_REQUEST";
705
+ static code = "VALIDATION_ERROR";
682
706
  static statusCode = 400;
683
- static description = `Bad request: {message}`;
707
+ static description = `Validation error: {message}`;
684
708
  }
685
- class VmOperationDeniedDuringTransactionError extends Error {
709
+ class GroupNotFoundError extends Error {
686
710
  constructor(body) {
687
711
  super(
688
- `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
712
+ `GROUP_NOT_FOUND: ${body.message}`
689
713
  );
690
714
  this.body = body;
691
- this.name = "VmOperationDeniedDuringTransactionError";
715
+ this.name = "GroupNotFoundError";
692
716
  }
693
- static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
694
- static statusCode = 409;
695
- static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
717
+ static code = "GROUP_NOT_FOUND";
718
+ static statusCode = 404;
719
+ static description = `Group not found: {group_name}`;
696
720
  }
697
- class VmTransactionIdMismatchError extends Error {
721
+ class GroupAlreadyExistsError extends Error {
698
722
  constructor(body) {
699
723
  super(
700
- `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
724
+ `GROUP_ALREADY_EXISTS: ${body.message}`
701
725
  );
702
726
  this.body = body;
703
- this.name = "VmTransactionIdMismatchError";
727
+ this.name = "GroupAlreadyExistsError";
704
728
  }
705
- static code = "VM_TRANSACTION_ID_MISMATCH";
706
- static statusCode = 400;
707
- static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
729
+ static code = "GROUP_ALREADY_EXISTS";
730
+ static statusCode = 409;
731
+ static description = `Conflict: Group '{group_name}' already exists`;
708
732
  }
709
- class VmNotInTransactionError extends Error {
733
+ class DuplicateUserNameError extends Error {
710
734
  constructor(body) {
711
735
  super(
712
- `VM_NOT_IN_TRANSACTION: ${body.message}`
736
+ `DUPLICATE_USER_NAME: ${body.message}`
713
737
  );
714
738
  this.body = body;
715
- this.name = "VmNotInTransactionError";
739
+ this.name = "DuplicateUserNameError";
716
740
  }
717
- static code = "VM_NOT_IN_TRANSACTION";
718
- static statusCode = 404;
719
- static description = `VM not in a transaction: {vm_id}`;
741
+ static code = "DUPLICATE_USER_NAME";
742
+ static statusCode = 400;
743
+ static description = `Duplicate user name '{name}' found`;
720
744
  }
721
- class VmNotRunningError extends Error {
745
+ class UserGroupEmptyError extends Error {
722
746
  constructor(body) {
723
747
  super(
724
- `VM_NOT_RUNNING: ${body.message}`
748
+ `USER_GROUP_EMPTY: ${body.message}`
725
749
  );
726
750
  this.body = body;
727
- this.name = "VmNotRunningError";
751
+ this.name = "UserGroupEmptyError";
728
752
  }
729
- static code = "VM_NOT_RUNNING";
753
+ static code = "USER_GROUP_EMPTY";
730
754
  static statusCode = 400;
731
- static description = `VM is not running: {vm_id}`;
755
+ static description = `User '{user}' has empty string in groups`;
732
756
  }
733
- class VmNotFoundError extends Error {
757
+ class UserSystemFlagMismatchError extends Error {
734
758
  constructor(body) {
735
759
  super(
736
- `VM_NOT_FOUND: ${body.message}`
760
+ `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
737
761
  );
738
762
  this.body = body;
739
- this.name = "VmNotFoundError";
763
+ this.name = "UserSystemFlagMismatchError";
740
764
  }
741
- static code = "VM_NOT_FOUND";
742
- static statusCode = 404;
743
- static description = `VM not found: {vm_id}`;
765
+ static code = "USER_SYSTEM_FLAG_MISMATCH";
766
+ static statusCode = 400;
767
+ static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
744
768
  }
745
- class InternalForkVmNotFoundError extends Error {
769
+ class UserUidOutOfRangeError extends Error {
746
770
  constructor(body) {
747
771
  super(
748
- `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
772
+ `USER_UID_OUT_OF_RANGE: ${body.message}`
749
773
  );
750
774
  this.body = body;
751
- this.name = "InternalForkVmNotFoundError";
775
+ this.name = "UserUidOutOfRangeError";
752
776
  }
753
- static code = "INTERNAL_FORK_VM_NOT_FOUND";
754
- static statusCode = 404;
755
- static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
777
+ static code = "USER_UID_OUT_OF_RANGE";
778
+ static statusCode = 400;
779
+ static description = `User '{user}' has invalid UID {uid} (must be 0-65535)`;
756
780
  }
757
- class BadRequestError extends Error {
781
+ class UserHomeInvalidError extends Error {
758
782
  constructor(body) {
759
783
  super(
760
- `BAD_REQUEST: ${body.message}`
784
+ `USER_HOME_INVALID: ${body.message}`
761
785
  );
762
786
  this.body = body;
763
- this.name = "BadRequestError";
787
+ this.name = "UserHomeInvalidError";
764
788
  }
765
- static code = "BAD_REQUEST";
789
+ static code = "USER_HOME_INVALID";
766
790
  static statusCode = 400;
767
- static description = `Bad request: {message}`;
791
+ static description = `User '{user}' has invalid home path '{home}' (must be absolute path starting with /)`;
768
792
  }
769
- class InternalVmNotFoundError extends Error {
793
+ class UserShellInvalidError extends Error {
770
794
  constructor(body) {
771
795
  super(
772
- `INTERNAL_VM_NOT_FOUND: ${body.message}`
796
+ `USER_SHELL_INVALID: ${body.message}`
773
797
  );
774
798
  this.body = body;
775
- this.name = "InternalVmNotFoundError";
799
+ this.name = "UserShellInvalidError";
776
800
  }
777
- static code = "INTERNAL_VM_NOT_FOUND";
778
- static statusCode = 404;
779
- static description = `VM not found: {vm_id}`;
801
+ static code = "USER_SHELL_INVALID";
802
+ static statusCode = 400;
803
+ static description = `User '{user}' has invalid shell path '{shell}' (must be absolute path starting with /)`;
780
804
  }
781
- class SnapshotSetupFailedError extends Error {
805
+ class DuplicateGroupNameError extends Error {
782
806
  constructor(body) {
783
807
  super(
784
- `SNAPSHOT_SETUP_FAILED: ${body.message}`
808
+ `DUPLICATE_GROUP_NAME: ${body.message}`
785
809
  );
786
810
  this.body = body;
787
- this.name = "SnapshotSetupFailedError";
811
+ this.name = "DuplicateGroupNameError";
788
812
  }
789
- static code = "SNAPSHOT_SETUP_FAILED";
790
- static statusCode = 500;
791
- static description = `Snapshot setup failed: {failed_reason}`;
813
+ static code = "DUPLICATE_GROUP_NAME";
814
+ static statusCode = 400;
815
+ static description = `Duplicate group name '{name}' found`;
792
816
  }
793
- class SnapshotVmBadRequestError extends Error {
817
+ class GroupNameReservedError extends Error {
794
818
  constructor(body) {
795
819
  super(
796
- `SNAPSHOT_VM_BAD_REQUEST: ${body.message}`
820
+ `GROUP_NAME_RESERVED: ${body.message}`
797
821
  );
798
822
  this.body = body;
799
- this.name = "SnapshotVmBadRequestError";
823
+ this.name = "GroupNameReservedError";
800
824
  }
801
- static code = "SNAPSHOT_VM_BAD_REQUEST";
825
+ static code = "GROUP_NAME_RESERVED";
802
826
  static statusCode = 400;
803
- static description = `Bad request: {message}`;
827
+ static description = `Group name '{name}' is reserved and cannot be used`;
804
828
  }
805
- class VmMustBeStoppedError extends Error {
829
+ class GroupNameInvalidCharsError extends Error {
806
830
  constructor(body) {
807
831
  super(
808
- `VM_MUST_BE_STOPPED: ${body.message}`
832
+ `GROUP_NAME_INVALID_CHARS: ${body.message}`
809
833
  );
810
834
  this.body = body;
811
- this.name = "VmMustBeStoppedError";
835
+ this.name = "GroupNameInvalidCharsError";
812
836
  }
813
- static code = "VM_MUST_BE_STOPPED";
837
+ static code = "GROUP_NAME_INVALID_CHARS";
814
838
  static statusCode = 400;
815
- static description = `VM must be stopped before converting to base`;
839
+ static description = `Group name '{name}' contains invalid characters (must match [a-z_][a-z0-9_-]*)`;
816
840
  }
817
- class AlreadyHasBaseError extends Error {
841
+ class GroupNameTooLongError extends Error {
818
842
  constructor(body) {
819
843
  super(
820
- `ALREADY_HAS_BASE: ${body.message}`
844
+ `GROUP_NAME_TOO_LONG: ${body.message}`
821
845
  );
822
846
  this.body = body;
823
- this.name = "AlreadyHasBaseError";
847
+ this.name = "GroupNameTooLongError";
824
848
  }
825
- static code = "ALREADY_HAS_BASE";
849
+ static code = "GROUP_NAME_TOO_LONG";
826
850
  static statusCode = 400;
827
- static description = `VM already has a base rootfs`;
851
+ static description = `Group name '{name}' is too long (max {max_length} characters)`;
828
852
  }
829
- class NotFoundError extends Error {
853
+ class GroupNameEmptyError extends Error {
830
854
  constructor(body) {
831
855
  super(
832
- `NOT_FOUND: ${body.message}`
856
+ `GROUP_NAME_EMPTY: ${body.message}`
833
857
  );
834
858
  this.body = body;
835
- this.name = "NotFoundError";
859
+ this.name = "GroupNameEmptyError";
836
860
  }
837
- static code = "NOT_FOUND";
838
- static statusCode = 404;
839
- static description = `VM not found`;
861
+ static code = "GROUP_NAME_EMPTY";
862
+ static statusCode = 400;
863
+ static description = `Group name cannot be empty`;
840
864
  }
841
865
  class CreateVmBadRequestError extends Error {
842
866
  constructor(body) {
@@ -1174,53 +1198,65 @@ class ExpiredError extends Error {
1174
1198
  static statusCode = 403;
1175
1199
  static description = `Session has expired`;
1176
1200
  }
1177
- class BranchNotFoundError extends Error {
1201
+ class ForbiddenError extends Error {
1178
1202
  constructor(body) {
1179
1203
  super(
1180
- `BRANCH_NOT_FOUND: ${body.message}`
1204
+ `FORBIDDEN: ${body.message}`
1181
1205
  );
1182
1206
  this.body = body;
1183
- this.name = "BranchNotFoundError";
1207
+ this.name = "ForbiddenError";
1184
1208
  }
1185
- static code = "BRANCH_NOT_FOUND";
1186
- static statusCode = 404;
1187
- static description = `Branch not found: {branch}`;
1209
+ static code = "FORBIDDEN";
1210
+ static statusCode = 403;
1211
+ static description = `Forbidden: {message}`;
1188
1212
  }
1189
- class CommitNotFoundError extends Error {
1213
+ class UnsupportedTransferError extends Error {
1190
1214
  constructor(body) {
1191
1215
  super(
1192
- `COMMIT_NOT_FOUND: ${body.message}`
1216
+ `UNSUPPORTED_TRANSFER: ${body.message}`
1193
1217
  );
1194
1218
  this.body = body;
1195
- this.name = "CommitNotFoundError";
1219
+ this.name = "UnsupportedTransferError";
1196
1220
  }
1197
- static code = "COMMIT_NOT_FOUND";
1221
+ static code = "UNSUPPORTED_TRANSFER";
1222
+ static statusCode = 400;
1223
+ static description = `Unsupported LFS transfer protocol(s)`;
1224
+ }
1225
+ class TreeNotFoundError extends Error {
1226
+ constructor(body) {
1227
+ super(
1228
+ `TREE_NOT_FOUND: ${body.message}`
1229
+ );
1230
+ this.body = body;
1231
+ this.name = "TreeNotFoundError";
1232
+ }
1233
+ static code = "TREE_NOT_FOUND";
1198
1234
  static statusCode = 404;
1199
- static description = `Commit not found: {hash}`;
1235
+ static description = `Tree not found: {hash}`;
1200
1236
  }
1201
- class ParentNotFoundError extends Error {
1237
+ class BranchNotFoundError extends Error {
1202
1238
  constructor(body) {
1203
1239
  super(
1204
- `PARENT_NOT_FOUND: ${body.message}`
1240
+ `BRANCH_NOT_FOUND: ${body.message}`
1205
1241
  );
1206
1242
  this.body = body;
1207
- this.name = "ParentNotFoundError";
1243
+ this.name = "BranchNotFoundError";
1208
1244
  }
1209
- static code = "PARENT_NOT_FOUND";
1245
+ static code = "BRANCH_NOT_FOUND";
1210
1246
  static statusCode = 404;
1211
- static description = `Parent commit not found: {sha}`;
1247
+ static description = `Branch not found: {branch}`;
1212
1248
  }
1213
- class TreeNotFoundError extends Error {
1249
+ class ParentNotFoundError extends Error {
1214
1250
  constructor(body) {
1215
1251
  super(
1216
- `TREE_NOT_FOUND: ${body.message}`
1252
+ `PARENT_NOT_FOUND: ${body.message}`
1217
1253
  );
1218
1254
  this.body = body;
1219
- this.name = "TreeNotFoundError";
1255
+ this.name = "ParentNotFoundError";
1220
1256
  }
1221
- static code = "TREE_NOT_FOUND";
1257
+ static code = "PARENT_NOT_FOUND";
1222
1258
  static statusCode = 404;
1223
- static description = `Tree not found: {sha}`;
1259
+ static description = `Parent commit not found: {sha}`;
1224
1260
  }
1225
1261
  class InvalidServiceError extends Error {
1226
1262
  constructor(body) {
@@ -1246,17 +1282,29 @@ class ExpectedServiceError extends Error {
1246
1282
  static statusCode = 403;
1247
1283
  static description = `Expected 'service' query parameter`;
1248
1284
  }
1249
- class ForbiddenError extends Error {
1285
+ class NotFoundError extends Error {
1250
1286
  constructor(body) {
1251
1287
  super(
1252
- `FORBIDDEN: ${body.message}`
1288
+ `NOT_FOUND: ${body.message}`
1253
1289
  );
1254
1290
  this.body = body;
1255
- this.name = "ForbiddenError";
1291
+ this.name = "NotFoundError";
1256
1292
  }
1257
- static code = "FORBIDDEN";
1258
- static statusCode = 403;
1259
- static description = `Forbidden: {message}`;
1293
+ static code = "NOT_FOUND";
1294
+ static statusCode = 404;
1295
+ static description = `Repository not found`;
1296
+ }
1297
+ class SendErrorError extends Error {
1298
+ constructor(body) {
1299
+ super(
1300
+ `SEND_ERROR: ${body.message}`
1301
+ );
1302
+ this.body = body;
1303
+ this.name = "SendErrorError";
1304
+ }
1305
+ static code = "SEND_ERROR";
1306
+ static statusCode = 500;
1307
+ static description = `Stream receiver dropped`;
1260
1308
  }
1261
1309
  class UnauthorizedError extends Error {
1262
1310
  constructor(body) {
@@ -1268,67 +1316,79 @@ class UnauthorizedError extends Error {
1268
1316
  }
1269
1317
  static code = "UNAUTHORIZED";
1270
1318
  static statusCode = 401;
1271
- static description = `Unauthorized: {message}`;
1319
+ static description = `Unauthorized: admin key and account id are required`;
1272
1320
  }
1273
- class RepoAlreadyExistsError extends Error {
1321
+ class InvalidAccountIdError extends Error {
1274
1322
  constructor(body) {
1275
1323
  super(
1276
- `REPO_ALREADY_EXISTS: ${body.message}`
1324
+ `INVALID_ACCOUNT_ID: ${body.message}`
1277
1325
  );
1278
1326
  this.body = body;
1279
- this.name = "RepoAlreadyExistsError";
1327
+ this.name = "InvalidAccountIdError";
1280
1328
  }
1281
- static code = "REPO_ALREADY_EXISTS";
1282
- static statusCode = 409;
1283
- static description = `Repository {repo_id} already exists`;
1329
+ static code = "INVALID_ACCOUNT_ID";
1330
+ static statusCode = 400;
1331
+ static description = `Invalid account ID: {account_id}`;
1284
1332
  }
1285
- class GitHubSyncConflictError extends Error {
1333
+ class SourceImportConflictError extends Error {
1286
1334
  constructor(body) {
1287
1335
  super(
1288
- `GIT_HUB_SYNC_CONFLICT: ${body.message}`
1336
+ `SOURCE_IMPORT_CONFLICT: ${body.message}`
1289
1337
  );
1290
1338
  this.body = body;
1291
- this.name = "GitHubSyncConflictError";
1339
+ this.name = "SourceImportConflictError";
1292
1340
  }
1293
- static code = "GIT_HUB_SYNC_CONFLICT";
1294
- static statusCode = 409;
1295
- static description = `GitHub Sync Conflict: {message}`;
1341
+ static code = "SOURCE_IMPORT_CONFLICT";
1342
+ static statusCode = 400;
1343
+ static description = `Source and import are mutually exclusive`;
1296
1344
  }
1297
- class InvalidObjectIdError extends Error {
1345
+ class SourceUnauthorizedError extends Error {
1298
1346
  constructor(body) {
1299
1347
  super(
1300
- `INVALID_OBJECT_ID: ${body.message}`
1348
+ `SOURCE_UNAUTHORIZED: ${body.message}`
1301
1349
  );
1302
1350
  this.body = body;
1303
- this.name = "InvalidObjectIdError";
1351
+ this.name = "SourceUnauthorizedError";
1304
1352
  }
1305
- static code = "INVALID_OBJECT_ID";
1353
+ static code = "SOURCE_UNAUTHORIZED";
1306
1354
  static statusCode = 400;
1307
- static description = `Invalid object ID: {hash}`;
1355
+ static description = `Unauthorized to access source repository at {url}`;
1308
1356
  }
1309
- class PathNotFoundError extends Error {
1357
+ class SourceNotFoundError extends Error {
1310
1358
  constructor(body) {
1311
1359
  super(
1312
- `PATH_NOT_FOUND: ${body.message}`
1360
+ `SOURCE_NOT_FOUND: ${body.message}`
1313
1361
  );
1314
1362
  this.body = body;
1315
- this.name = "PathNotFoundError";
1363
+ this.name = "SourceNotFoundError";
1316
1364
  }
1317
- static code = "PATH_NOT_FOUND";
1318
- static statusCode = 404;
1319
- static description = `Path not found: {path}`;
1365
+ static code = "SOURCE_NOT_FOUND";
1366
+ static statusCode = 400;
1367
+ static description = `Source repository not found at {url}`;
1320
1368
  }
1321
- class ReferenceNotFoundError extends Error {
1369
+ class ImportSubdirNotFoundError extends Error {
1322
1370
  constructor(body) {
1323
1371
  super(
1324
- `REFERENCE_NOT_FOUND: ${body.message}`
1372
+ `IMPORT_SUBDIR_NOT_FOUND: ${body.message}`
1325
1373
  );
1326
1374
  this.body = body;
1327
- this.name = "ReferenceNotFoundError";
1375
+ this.name = "ImportSubdirNotFoundError";
1328
1376
  }
1329
- static code = "REFERENCE_NOT_FOUND";
1330
- static statusCode = 404;
1331
- static description = `Reference not found: {reference}`;
1377
+ static code = "IMPORT_SUBDIR_NOT_FOUND";
1378
+ static statusCode = 400;
1379
+ static description = `Directory not found in {source}: {dir}`;
1380
+ }
1381
+ class RepoAlreadyExistsError extends Error {
1382
+ constructor(body) {
1383
+ super(
1384
+ `REPO_ALREADY_EXISTS: ${body.message}`
1385
+ );
1386
+ this.body = body;
1387
+ this.name = "RepoAlreadyExistsError";
1388
+ }
1389
+ static code = "REPO_ALREADY_EXISTS";
1390
+ static statusCode = 409;
1391
+ static description = `Repo '{repo_id}' already exists`;
1332
1392
  }
1333
1393
  class TagNotFoundError extends Error {
1334
1394
  constructor(body) {
@@ -1340,103 +1400,55 @@ class TagNotFoundError extends Error {
1340
1400
  }
1341
1401
  static code = "TAG_NOT_FOUND";
1342
1402
  static statusCode = 404;
1343
- static description = `Tag not found: {hash}`;
1403
+ static description = `Tag not found: {tag}`;
1344
1404
  }
1345
- class InvalidRevisionError extends Error {
1405
+ class InvalidRangeError extends Error {
1346
1406
  constructor(body) {
1347
1407
  super(
1348
- `INVALID_REVISION: ${body.message}`
1408
+ `INVALID_RANGE: ${body.message}`
1349
1409
  );
1350
1410
  this.body = body;
1351
- this.name = "InvalidRevisionError";
1411
+ this.name = "InvalidRangeError";
1352
1412
  }
1353
- static code = "INVALID_REVISION";
1413
+ static code = "INVALID_RANGE";
1354
1414
  static statusCode = 400;
1355
- static description = `Invalid revision: {revision}`;
1415
+ static description = `Invalid range: 'until' commit ({until}) must be a descendant of 'since' commit ({since}). In other words, 'until' must be newer than 'since' in the commit graph.`;
1356
1416
  }
1357
- class BlobNotFoundError extends Error {
1417
+ class OffsetWithSelectorError extends Error {
1358
1418
  constructor(body) {
1359
1419
  super(
1360
- `BLOB_NOT_FOUND: ${body.message}`
1420
+ `OFFSET_WITH_SELECTOR: ${body.message}`
1361
1421
  );
1362
1422
  this.body = body;
1363
- this.name = "BlobNotFoundError";
1423
+ this.name = "OffsetWithSelectorError";
1364
1424
  }
1365
- static code = "BLOB_NOT_FOUND";
1366
- static statusCode = 404;
1367
- static description = `Blob not found: {hash}`;
1425
+ static code = "OFFSET_WITH_SELECTOR";
1426
+ static statusCode = 400;
1427
+ static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
1368
1428
  }
1369
- class AmbiguousError extends Error {
1429
+ class CommitNotInBranchError extends Error {
1370
1430
  constructor(body) {
1371
1431
  super(
1372
- `AMBIGUOUS: ${body.message}`
1432
+ `COMMIT_NOT_IN_BRANCH: ${body.message}`
1373
1433
  );
1374
1434
  this.body = body;
1375
- this.name = "AmbiguousError";
1435
+ this.name = "CommitNotInBranchError";
1376
1436
  }
1377
- static code = "AMBIGUOUS";
1378
- static statusCode = 400;
1379
- static description = `rev is ambiguous: {rev}`;
1380
- }
1381
- class InvalidError extends Error {
1382
- constructor(body) {
1383
- super(
1384
- `INVALID: ${body.message}`
1385
- );
1386
- this.body = body;
1387
- this.name = "InvalidError";
1388
- }
1389
- static code = "INVALID";
1390
- static statusCode = 400;
1391
- static description = `invalid rev syntax: {rev}`;
1392
- }
1393
- class SendErrorError extends Error {
1394
- constructor(body) {
1395
- super(
1396
- `SEND_ERROR: ${body.message}`
1397
- );
1398
- this.body = body;
1399
- this.name = "SendErrorError";
1400
- }
1401
- static code = "SEND_ERROR";
1402
- static statusCode = 500;
1403
- static description = `Stream receiver dropped`;
1404
- }
1405
- class InvalidRangeError extends Error {
1406
- constructor(body) {
1407
- super(
1408
- `INVALID_RANGE: ${body.message}`
1409
- );
1410
- this.body = body;
1411
- this.name = "InvalidRangeError";
1412
- }
1413
- static code = "INVALID_RANGE";
1414
- static statusCode = 400;
1415
- static description = `Invalid range: 'until' commit ({until}) must be a descendant of 'since' commit ({since}). In other words, 'until' must be newer than 'since' in the commit graph.`;
1416
- }
1417
- class OffsetWithSelectorError extends Error {
1418
- constructor(body) {
1419
- super(
1420
- `OFFSET_WITH_SELECTOR: ${body.message}`
1421
- );
1422
- this.body = body;
1423
- this.name = "OffsetWithSelectorError";
1424
- }
1425
- static code = "OFFSET_WITH_SELECTOR";
1437
+ static code = "COMMIT_NOT_IN_BRANCH";
1426
1438
  static statusCode = 400;
1427
- static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
1439
+ static description = `Commit {sha} is not in the history of branch {branch}`;
1428
1440
  }
1429
- class CommitNotInBranchError extends Error {
1441
+ class CommitNotFoundError extends Error {
1430
1442
  constructor(body) {
1431
1443
  super(
1432
- `COMMIT_NOT_IN_BRANCH: ${body.message}`
1444
+ `COMMIT_NOT_FOUND: ${body.message}`
1433
1445
  );
1434
1446
  this.body = body;
1435
- this.name = "CommitNotInBranchError";
1447
+ this.name = "CommitNotFoundError";
1436
1448
  }
1437
- static code = "COMMIT_NOT_IN_BRANCH";
1449
+ static code = "COMMIT_NOT_FOUND";
1438
1450
  static statusCode = 400;
1439
- static description = `Commit {sha} is not in the history of branch {branch}`;
1451
+ static description = `Commit not found: {sha}`;
1440
1452
  }
1441
1453
  class NoDefaultBranchError extends Error {
1442
1454
  constructor(body) {
@@ -1498,41 +1510,65 @@ class ConflictingParentError extends Error {
1498
1510
  static statusCode = 409;
1499
1511
  static description = `Conflict: expected parent SHA {expected} but current is {actual:?}`;
1500
1512
  }
1501
- class UnsupportedTransferError extends Error {
1513
+ class AmbiguousError extends Error {
1502
1514
  constructor(body) {
1503
1515
  super(
1504
- `UNSUPPORTED_TRANSFER: ${body.message}`
1516
+ `AMBIGUOUS: ${body.message}`
1505
1517
  );
1506
1518
  this.body = body;
1507
- this.name = "UnsupportedTransferError";
1519
+ this.name = "AmbiguousError";
1508
1520
  }
1509
- static code = "UNSUPPORTED_TRANSFER";
1521
+ static code = "AMBIGUOUS";
1510
1522
  static statusCode = 400;
1511
- static description = `Unsupported LFS transfer protocol(s)`;
1523
+ static description = `rev is ambiguous: {rev}`;
1512
1524
  }
1513
- class ConflictError extends Error {
1525
+ class InvalidError extends Error {
1514
1526
  constructor(body) {
1515
1527
  super(
1516
- `CONFLICT: ${body.message}`
1528
+ `INVALID: ${body.message}`
1517
1529
  );
1518
1530
  this.body = body;
1519
- this.name = "ConflictError";
1531
+ this.name = "InvalidError";
1520
1532
  }
1521
- static code = "CONFLICT";
1522
- static statusCode = 409;
1523
- static description = `Sync conflict: {message}`;
1533
+ static code = "INVALID";
1534
+ static statusCode = 400;
1535
+ static description = `invalid rev syntax: {rev}`;
1524
1536
  }
1525
- class BranchAlreadyExistsError extends Error {
1537
+ class PathNotFoundError extends Error {
1526
1538
  constructor(body) {
1527
1539
  super(
1528
- `BRANCH_ALREADY_EXISTS: ${body.message}`
1540
+ `PATH_NOT_FOUND: ${body.message}`
1529
1541
  );
1530
1542
  this.body = body;
1531
- this.name = "BranchAlreadyExistsError";
1543
+ this.name = "PathNotFoundError";
1532
1544
  }
1533
- static code = "BRANCH_ALREADY_EXISTS";
1534
- static statusCode = 409;
1535
- static description = `Branch already exists: {branch}`;
1545
+ static code = "PATH_NOT_FOUND";
1546
+ static statusCode = 404;
1547
+ static description = `Path not found: {path}`;
1548
+ }
1549
+ class ReferenceNotFoundError extends Error {
1550
+ constructor(body) {
1551
+ super(
1552
+ `REFERENCE_NOT_FOUND: ${body.message}`
1553
+ );
1554
+ this.body = body;
1555
+ this.name = "ReferenceNotFoundError";
1556
+ }
1557
+ static code = "REFERENCE_NOT_FOUND";
1558
+ static statusCode = 404;
1559
+ static description = `Reference not found: {reference}`;
1560
+ }
1561
+ class BlobNotFoundError extends Error {
1562
+ constructor(body) {
1563
+ super(
1564
+ `BLOB_NOT_FOUND: ${body.message}`
1565
+ );
1566
+ this.body = body;
1567
+ this.name = "BlobNotFoundError";
1568
+ }
1569
+ static code = "BLOB_NOT_FOUND";
1570
+ static statusCode = 404;
1571
+ static description = `Blob not found: {hash}`;
1536
1572
  }
1537
1573
  class PackfileError extends Error {
1538
1574
  constructor(body) {
@@ -1546,65 +1582,65 @@ class PackfileError extends Error {
1546
1582
  static statusCode = 500;
1547
1583
  static description = `Error building packfile`;
1548
1584
  }
1549
- class InvalidAccountIdError extends Error {
1585
+ class InvalidRevisionError extends Error {
1550
1586
  constructor(body) {
1551
1587
  super(
1552
- `INVALID_ACCOUNT_ID: ${body.message}`
1588
+ `INVALID_REVISION: ${body.message}`
1553
1589
  );
1554
1590
  this.body = body;
1555
- this.name = "InvalidAccountIdError";
1591
+ this.name = "InvalidRevisionError";
1556
1592
  }
1557
- static code = "INVALID_ACCOUNT_ID";
1593
+ static code = "INVALID_REVISION";
1558
1594
  static statusCode = 400;
1559
- static description = `Invalid account ID: {account_id}`;
1595
+ static description = `Invalid revision: {revision}`;
1560
1596
  }
1561
- class SourceImportConflictError extends Error {
1597
+ class ConflictError extends Error {
1562
1598
  constructor(body) {
1563
1599
  super(
1564
- `SOURCE_IMPORT_CONFLICT: ${body.message}`
1600
+ `CONFLICT: ${body.message}`
1565
1601
  );
1566
1602
  this.body = body;
1567
- this.name = "SourceImportConflictError";
1603
+ this.name = "ConflictError";
1568
1604
  }
1569
- static code = "SOURCE_IMPORT_CONFLICT";
1570
- static statusCode = 400;
1571
- static description = `Source and import are mutually exclusive`;
1605
+ static code = "CONFLICT";
1606
+ static statusCode = 409;
1607
+ static description = `Sync conflict: {message}`;
1572
1608
  }
1573
- class SourceUnauthorizedError extends Error {
1609
+ class BranchAlreadyExistsError extends Error {
1574
1610
  constructor(body) {
1575
1611
  super(
1576
- `SOURCE_UNAUTHORIZED: ${body.message}`
1612
+ `BRANCH_ALREADY_EXISTS: ${body.message}`
1577
1613
  );
1578
1614
  this.body = body;
1579
- this.name = "SourceUnauthorizedError";
1615
+ this.name = "BranchAlreadyExistsError";
1580
1616
  }
1581
- static code = "SOURCE_UNAUTHORIZED";
1582
- static statusCode = 400;
1583
- static description = `Unauthorized to access source repository at {url}`;
1617
+ static code = "BRANCH_ALREADY_EXISTS";
1618
+ static statusCode = 409;
1619
+ static description = `Branch already exists: {branch}`;
1584
1620
  }
1585
- class SourceNotFoundError extends Error {
1621
+ class GitHubSyncConflictError extends Error {
1586
1622
  constructor(body) {
1587
1623
  super(
1588
- `SOURCE_NOT_FOUND: ${body.message}`
1624
+ `GIT_HUB_SYNC_CONFLICT: ${body.message}`
1589
1625
  );
1590
1626
  this.body = body;
1591
- this.name = "SourceNotFoundError";
1627
+ this.name = "GitHubSyncConflictError";
1592
1628
  }
1593
- static code = "SOURCE_NOT_FOUND";
1594
- static statusCode = 400;
1595
- static description = `Source repository not found at {url}`;
1629
+ static code = "GIT_HUB_SYNC_CONFLICT";
1630
+ static statusCode = 409;
1631
+ static description = `GitHub Sync Conflict: {message}`;
1596
1632
  }
1597
- class ImportSubdirNotFoundError extends Error {
1633
+ class InvalidObjectIdError extends Error {
1598
1634
  constructor(body) {
1599
1635
  super(
1600
- `IMPORT_SUBDIR_NOT_FOUND: ${body.message}`
1636
+ `INVALID_OBJECT_ID: ${body.message}`
1601
1637
  );
1602
1638
  this.body = body;
1603
- this.name = "ImportSubdirNotFoundError";
1639
+ this.name = "InvalidObjectIdError";
1604
1640
  }
1605
- static code = "IMPORT_SUBDIR_NOT_FOUND";
1641
+ static code = "INVALID_OBJECT_ID";
1606
1642
  static statusCode = 400;
1607
- static description = `Directory not found in {source}: {dir}`;
1643
+ static description = `Invalid object ID: {hash}`;
1608
1644
  }
1609
1645
  class UnavailableError extends Error {
1610
1646
  constructor(body) {
@@ -1618,401 +1654,497 @@ class UnavailableError extends Error {
1618
1654
  static statusCode = 503;
1619
1655
  static description = `Cron service unavailable`;
1620
1656
  }
1621
- class DevServerNotFoundError extends Error {
1657
+ class ScheduleNotFoundError extends Error {
1622
1658
  constructor(body) {
1623
1659
  super(
1624
- `DEV_SERVER_NOT_FOUND: ${body.message}`
1660
+ `SCHEDULE_NOT_FOUND: ${body.message}`
1625
1661
  );
1626
1662
  this.body = body;
1627
- this.name = "DevServerNotFoundError";
1663
+ this.name = "ScheduleNotFoundError";
1628
1664
  }
1629
- static code = "DEV_SERVER_NOT_FOUND";
1665
+ static code = "SCHEDULE_NOT_FOUND";
1630
1666
  static statusCode = 404;
1631
- static description = `dev server not found`;
1667
+ static description = `Schedule not found`;
1632
1668
  }
1633
- class BranchNameEmptyError extends Error {
1669
+ class ServiceUnavailableError extends Error {
1634
1670
  constructor(body) {
1635
1671
  super(
1636
- `BRANCH_NAME_EMPTY: ${body.message}`
1672
+ `SERVICE_UNAVAILABLE: ${body.message}`
1637
1673
  );
1638
1674
  this.body = body;
1639
- this.name = "BranchNameEmptyError";
1675
+ this.name = "ServiceUnavailableError";
1640
1676
  }
1641
- static code = "BRANCH_NAME_EMPTY";
1642
- static statusCode = 400;
1643
- static description = `Branch name cannot be empty`;
1677
+ static code = "SERVICE_UNAVAILABLE";
1678
+ static statusCode = 503;
1679
+ static description = `Cron service not configured`;
1644
1680
  }
1645
- class BuildFailedError extends Error {
1681
+ class PermissionAlreadyExistsError extends Error {
1646
1682
  constructor(body) {
1647
1683
  super(
1648
- `BUILD_FAILED: ${body.message}`
1684
+ `PERMISSION_ALREADY_EXISTS: ${body.message}`
1649
1685
  );
1650
1686
  this.body = body;
1651
- this.name = "BuildFailedError";
1687
+ this.name = "PermissionAlreadyExistsError";
1652
1688
  }
1653
- static code = "BUILD_FAILED";
1654
- static statusCode = 500;
1655
- static description = `Build failed on VM {vm_id}`;
1689
+ static code = "PERMISSION_ALREADY_EXISTS";
1690
+ static statusCode = 409;
1691
+ static description = `Permission already exists`;
1656
1692
  }
1657
- class ServerDeploymentFailedError extends Error {
1693
+ class ListTokensFailedError extends Error {
1658
1694
  constructor(body) {
1659
1695
  super(
1660
- `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1696
+ `LIST_TOKENS_FAILED: ${body.message}`
1661
1697
  );
1662
1698
  this.body = body;
1663
- this.name = "ServerDeploymentFailedError";
1699
+ this.name = "ListTokensFailedError";
1664
1700
  }
1665
- static code = "SERVER_DEPLOYMENT_FAILED";
1666
- static statusCode = 502;
1667
- static description = `Failed to deploy to servers`;
1701
+ static code = "LIST_TOKENS_FAILED";
1702
+ static statusCode = 500;
1703
+ static description = `Failed to list tokens: {message}`;
1668
1704
  }
1669
- class LockfileErrorError extends Error {
1705
+ class RevokeTokenFailedError extends Error {
1670
1706
  constructor(body) {
1671
1707
  super(
1672
- `LOCKFILE_ERROR: ${body.message}`
1708
+ `REVOKE_TOKEN_FAILED: ${body.message}`
1673
1709
  );
1674
1710
  this.body = body;
1675
- this.name = "LockfileErrorError";
1711
+ this.name = "RevokeTokenFailedError";
1676
1712
  }
1677
- static code = "LOCKFILE_ERROR";
1713
+ static code = "REVOKE_TOKEN_FAILED";
1678
1714
  static statusCode = 500;
1679
- static description = `Failed to generate dependency lockfile: {message}`;
1715
+ static description = `Failed to revoke token: {message}`;
1680
1716
  }
1681
- class UploadErrorError extends Error {
1717
+ class CreateTokenFailedError extends Error {
1682
1718
  constructor(body) {
1683
1719
  super(
1684
- `UPLOAD_ERROR: ${body.message}`
1720
+ `CREATE_TOKEN_FAILED: ${body.message}`
1685
1721
  );
1686
1722
  this.body = body;
1687
- this.name = "UploadErrorError";
1723
+ this.name = "CreateTokenFailedError";
1688
1724
  }
1689
- static code = "UPLOAD_ERROR";
1725
+ static code = "CREATE_TOKEN_FAILED";
1690
1726
  static statusCode = 500;
1691
- static description = `Failed to upload deployment to storage`;
1727
+ static description = `Failed to create token: {message}`;
1692
1728
  }
1693
- class DomainMappingErrorError extends Error {
1729
+ class ListPermissionsFailedError extends Error {
1694
1730
  constructor(body) {
1695
1731
  super(
1696
- `DOMAIN_MAPPING_ERROR: ${body.message}`
1732
+ `LIST_PERMISSIONS_FAILED: ${body.message}`
1697
1733
  );
1698
1734
  this.body = body;
1699
- this.name = "DomainMappingErrorError";
1735
+ this.name = "ListPermissionsFailedError";
1700
1736
  }
1701
- static code = "DOMAIN_MAPPING_ERROR";
1737
+ static code = "LIST_PERMISSIONS_FAILED";
1702
1738
  static statusCode = 500;
1703
- static description = `Failed to configure domain mapping for: {domain}`;
1739
+ static description = `Failed to list permissions: {message}`;
1704
1740
  }
1705
- class CertificateProvisioningErrorError extends Error {
1741
+ class GetPermissionFailedError extends Error {
1706
1742
  constructor(body) {
1707
1743
  super(
1708
- `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
1744
+ `GET_PERMISSION_FAILED: ${body.message}`
1709
1745
  );
1710
1746
  this.body = body;
1711
- this.name = "CertificateProvisioningErrorError";
1747
+ this.name = "GetPermissionFailedError";
1712
1748
  }
1713
- static code = "CERTIFICATE_PROVISIONING_ERROR";
1714
- static statusCode = 502;
1715
- static description = `Failed to provision certificate for domain: {domain}`;
1716
- }
1717
- class NoEntrypointFoundError extends Error {
1749
+ static code = "GET_PERMISSION_FAILED";
1750
+ static statusCode = 500;
1751
+ static description = `Failed to get permission: {message}`;
1752
+ }
1753
+ class UpdatePermissionFailedError extends Error {
1718
1754
  constructor(body) {
1719
1755
  super(
1720
- `NO_ENTRYPOINT_FOUND: ${body.message}`
1756
+ `UPDATE_PERMISSION_FAILED: ${body.message}`
1721
1757
  );
1722
1758
  this.body = body;
1723
- this.name = "NoEntrypointFoundError";
1759
+ this.name = "UpdatePermissionFailedError";
1724
1760
  }
1725
- static code = "NO_ENTRYPOINT_FOUND";
1726
- static statusCode = 400;
1727
- static description = `No entrypoint found in deployment`;
1761
+ static code = "UPDATE_PERMISSION_FAILED";
1762
+ static statusCode = 500;
1763
+ static description = `Failed to update permission: {message}`;
1728
1764
  }
1729
- class EntrypointNotFoundError extends Error {
1765
+ class RevokePermissionFailedError extends Error {
1730
1766
  constructor(body) {
1731
1767
  super(
1732
- `ENTRYPOINT_NOT_FOUND: ${body.message}`
1768
+ `REVOKE_PERMISSION_FAILED: ${body.message}`
1733
1769
  );
1734
1770
  this.body = body;
1735
- this.name = "EntrypointNotFoundError";
1771
+ this.name = "RevokePermissionFailedError";
1736
1772
  }
1737
- static code = "ENTRYPOINT_NOT_FOUND";
1738
- static statusCode = 400;
1739
- static description = `Entrypoint not found: {entrypoint}`;
1773
+ static code = "REVOKE_PERMISSION_FAILED";
1774
+ static statusCode = 500;
1775
+ static description = `Failed to revoke permission: {message}`;
1740
1776
  }
1741
- class NoDomainOwnershipError extends Error {
1777
+ class GrantPermissionFailedError extends Error {
1742
1778
  constructor(body) {
1743
1779
  super(
1744
- `NO_DOMAIN_OWNERSHIP: ${body.message}`
1780
+ `GRANT_PERMISSION_FAILED: ${body.message}`
1745
1781
  );
1746
1782
  this.body = body;
1747
- this.name = "NoDomainOwnershipError";
1783
+ this.name = "GrantPermissionFailedError";
1748
1784
  }
1749
- static code = "NO_DOMAIN_OWNERSHIP";
1750
- static statusCode = 403;
1751
- static description = `No domain ownership for: {domain}`;
1785
+ static code = "GRANT_PERMISSION_FAILED";
1786
+ static statusCode = 500;
1787
+ static description = `Failed to grant permission: {message}`;
1752
1788
  }
1753
- class InvalidDomainsError extends Error {
1789
+ class ListIdentitiesFailedError extends Error {
1754
1790
  constructor(body) {
1755
1791
  super(
1756
- `INVALID_DOMAINS: ${body.message}`
1792
+ `LIST_IDENTITIES_FAILED: ${body.message}`
1757
1793
  );
1758
1794
  this.body = body;
1759
- this.name = "InvalidDomainsError";
1795
+ this.name = "ListIdentitiesFailedError";
1760
1796
  }
1761
- static code = "INVALID_DOMAINS";
1762
- static statusCode = 400;
1763
- static description = `Invalid domains provided`;
1797
+ static code = "LIST_IDENTITIES_FAILED";
1798
+ static statusCode = 500;
1799
+ static description = `Failed to list identities: {message}`;
1764
1800
  }
1765
- class WebDeploymentBadRequestError extends Error {
1801
+ class DeleteIdentityFailedError extends Error {
1766
1802
  constructor(body) {
1767
1803
  super(
1768
- `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
1804
+ `DELETE_IDENTITY_FAILED: ${body.message}`
1769
1805
  );
1770
1806
  this.body = body;
1771
- this.name = "WebDeploymentBadRequestError";
1807
+ this.name = "DeleteIdentityFailedError";
1772
1808
  }
1773
- static code = "WEB_DEPLOYMENT_BAD_REQUEST";
1774
- static statusCode = 400;
1775
- static description = `Bad request: {message}`;
1809
+ static code = "DELETE_IDENTITY_FAILED";
1810
+ static statusCode = 500;
1811
+ static description = `Failed to delete identity: {message}`;
1776
1812
  }
1777
- class DeploymentLimitExceededError extends Error {
1813
+ class CreateIdentityFailedError extends Error {
1778
1814
  constructor(body) {
1779
1815
  super(
1780
- `DEPLOYMENT_LIMIT_EXCEEDED: ${body.message}`
1816
+ `CREATE_IDENTITY_FAILED: ${body.message}`
1781
1817
  );
1782
1818
  this.body = body;
1783
- this.name = "DeploymentLimitExceededError";
1819
+ this.name = "CreateIdentityFailedError";
1784
1820
  }
1785
- static code = "DEPLOYMENT_LIMIT_EXCEEDED";
1786
- static statusCode = 403;
1787
- static description = `Daily deployment limit exceeded: your plan allows {limit} deployments per day, you have created {current} today`;
1821
+ static code = "CREATE_IDENTITY_FAILED";
1822
+ static statusCode = 500;
1823
+ static description = `Failed to create identity: {message}`;
1788
1824
  }
1789
- class DeploymentNotFoundError extends Error {
1825
+ class VmPermissionNotFoundError extends Error {
1790
1826
  constructor(body) {
1791
1827
  super(
1792
- `DEPLOYMENT_NOT_FOUND: ${body.message}`
1828
+ `VM_PERMISSION_NOT_FOUND: ${body.message}`
1793
1829
  );
1794
1830
  this.body = body;
1795
- this.name = "DeploymentNotFoundError";
1831
+ this.name = "VmPermissionNotFoundError";
1796
1832
  }
1797
- static code = "DEPLOYMENT_NOT_FOUND";
1833
+ static code = "VM_PERMISSION_NOT_FOUND";
1798
1834
  static statusCode = 404;
1799
- static description = `Deployment not found`;
1835
+ static description = `VM permission not found`;
1800
1836
  }
1801
- class ExecuteLimitExceededError extends Error {
1837
+ class PermissionNotFoundError extends Error {
1802
1838
  constructor(body) {
1803
1839
  super(
1804
- `EXECUTE_LIMIT_EXCEEDED: ${body.message}`
1840
+ `PERMISSION_NOT_FOUND: ${body.message}`
1805
1841
  );
1806
1842
  this.body = body;
1807
- this.name = "ExecuteLimitExceededError";
1843
+ this.name = "PermissionNotFoundError";
1808
1844
  }
1809
- static code = "EXECUTE_LIMIT_EXCEEDED";
1845
+ static code = "PERMISSION_NOT_FOUND";
1846
+ static statusCode = 404;
1847
+ static description = `Permission not found`;
1848
+ }
1849
+ class GitRepositoryAccessDeniedError extends Error {
1850
+ constructor(body) {
1851
+ super(
1852
+ `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
1853
+ );
1854
+ this.body = body;
1855
+ this.name = "GitRepositoryAccessDeniedError";
1856
+ }
1857
+ static code = "GIT_REPOSITORY_ACCESS_DENIED";
1810
1858
  static statusCode = 403;
1811
- static description = `Execute runs limit exceeded: your plan allows {limit} runs per month, you have used {current}`;
1859
+ static description = `You are not allowed to access this repository`;
1812
1860
  }
1813
- class EmptyTagError extends Error {
1861
+ class GitRepositoryNotFoundError extends Error {
1814
1862
  constructor(body) {
1815
1863
  super(
1816
- `EMPTY_TAG: ${body.message}`
1864
+ `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
1817
1865
  );
1818
1866
  this.body = body;
1819
- this.name = "EmptyTagError";
1867
+ this.name = "GitRepositoryNotFoundError";
1820
1868
  }
1821
- static code = "EMPTY_TAG";
1822
- static statusCode = 400;
1823
- static description = `Invalid request: tag cannot be empty`;
1869
+ static code = "GIT_REPOSITORY_NOT_FOUND";
1870
+ static statusCode = 404;
1871
+ static description = `Repository not found`;
1824
1872
  }
1825
- class CloudstateInternalErrorError extends Error {
1873
+ class CannotDeleteManagedIdentityError extends Error {
1826
1874
  constructor(body) {
1827
1875
  super(
1828
- `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
1876
+ `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
1829
1877
  );
1830
1878
  this.body = body;
1831
- this.name = "CloudstateInternalErrorError";
1879
+ this.name = "CannotDeleteManagedIdentityError";
1832
1880
  }
1833
- static code = "CLOUDSTATE_INTERNAL_ERROR";
1834
- static statusCode = 500;
1835
- static description = `Internal error: {message}`;
1881
+ static code = "CANNOT_DELETE_MANAGED_IDENTITY";
1882
+ static statusCode = 403;
1883
+ static description = `Cannot delete managed identities`;
1836
1884
  }
1837
- class CloudstateDatabaseErrorError extends Error {
1885
+ class CannotModifyManagedIdentityError extends Error {
1838
1886
  constructor(body) {
1839
1887
  super(
1840
- `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
1888
+ `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
1841
1889
  );
1842
1890
  this.body = body;
1843
- this.name = "CloudstateDatabaseErrorError";
1891
+ this.name = "CannotModifyManagedIdentityError";
1844
1892
  }
1845
- static code = "CLOUDSTATE_DATABASE_ERROR";
1846
- static statusCode = 500;
1847
- static description = `Database operation failed: {message}`;
1893
+ static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
1894
+ static statusCode = 403;
1895
+ static description = `Cannot modify managed identities`;
1848
1896
  }
1849
- class CloudstateAccessDeniedError extends Error {
1897
+ class IdentityAccessDeniedError extends Error {
1850
1898
  constructor(body) {
1851
1899
  super(
1852
- `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
1900
+ `IDENTITY_ACCESS_DENIED: ${body.message}`
1853
1901
  );
1854
1902
  this.body = body;
1855
- this.name = "CloudstateAccessDeniedError";
1903
+ this.name = "IdentityAccessDeniedError";
1856
1904
  }
1857
- static code = "CLOUDSTATE_ACCESS_DENIED";
1905
+ static code = "IDENTITY_ACCESS_DENIED";
1858
1906
  static statusCode = 403;
1859
- static description = `Access denied to project: {project_id}`;
1907
+ static description = `You are not allowed to access this identity`;
1860
1908
  }
1861
- class RestoreFailedError extends Error {
1909
+ class IdentityNotFoundError extends Error {
1862
1910
  constructor(body) {
1863
1911
  super(
1864
- `RESTORE_FAILED: ${body.message}`
1912
+ `IDENTITY_NOT_FOUND: ${body.message}`
1865
1913
  );
1866
1914
  this.body = body;
1867
- this.name = "RestoreFailedError";
1915
+ this.name = "IdentityNotFoundError";
1868
1916
  }
1869
- static code = "RESTORE_FAILED";
1917
+ static code = "IDENTITY_NOT_FOUND";
1918
+ static statusCode = 404;
1919
+ static description = `Identity not found`;
1920
+ }
1921
+ class UnauthorizedErrorError extends Error {
1922
+ constructor(body) {
1923
+ super(
1924
+ `UNAUTHORIZED_ERROR: ${body.message}`
1925
+ );
1926
+ this.body = body;
1927
+ this.name = "UnauthorizedErrorError";
1928
+ }
1929
+ static code = "UNAUTHORIZED_ERROR";
1930
+ static statusCode = 401;
1931
+ static description = `Unauthorized request to {route}`;
1932
+ }
1933
+ class BuildFailedError extends Error {
1934
+ constructor(body) {
1935
+ super(
1936
+ `BUILD_FAILED: ${body.message}`
1937
+ );
1938
+ this.body = body;
1939
+ this.name = "BuildFailedError";
1940
+ }
1941
+ static code = "BUILD_FAILED";
1870
1942
  static statusCode = 500;
1871
- static description = `Failed to restore from backup: {message}`;
1943
+ static description = `Build failed on VM {vm_id}`;
1872
1944
  }
1873
- class CreateBackupFailedError extends Error {
1945
+ class ServerDeploymentFailedError extends Error {
1874
1946
  constructor(body) {
1875
1947
  super(
1876
- `CREATE_BACKUP_FAILED: ${body.message}`
1948
+ `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1877
1949
  );
1878
1950
  this.body = body;
1879
- this.name = "CreateBackupFailedError";
1951
+ this.name = "ServerDeploymentFailedError";
1880
1952
  }
1881
- static code = "CREATE_BACKUP_FAILED";
1953
+ static code = "SERVER_DEPLOYMENT_FAILED";
1954
+ static statusCode = 502;
1955
+ static description = `Failed to deploy to servers`;
1956
+ }
1957
+ class LockfileErrorError extends Error {
1958
+ constructor(body) {
1959
+ super(
1960
+ `LOCKFILE_ERROR: ${body.message}`
1961
+ );
1962
+ this.body = body;
1963
+ this.name = "LockfileErrorError";
1964
+ }
1965
+ static code = "LOCKFILE_ERROR";
1882
1966
  static statusCode = 500;
1883
- static description = `Failed to create backup: {message}`;
1967
+ static description = `Failed to generate dependency lockfile: {message}`;
1884
1968
  }
1885
- class BackupFailedError extends Error {
1969
+ class UploadErrorError extends Error {
1886
1970
  constructor(body) {
1887
1971
  super(
1888
- `BACKUP_FAILED: ${body.message}`
1972
+ `UPLOAD_ERROR: ${body.message}`
1889
1973
  );
1890
1974
  this.body = body;
1891
- this.name = "BackupFailedError";
1975
+ this.name = "UploadErrorError";
1892
1976
  }
1893
- static code = "BACKUP_FAILED";
1977
+ static code = "UPLOAD_ERROR";
1894
1978
  static statusCode = 500;
1895
- static description = `Backup failed: {message}`;
1979
+ static description = `Failed to upload deployment to storage`;
1896
1980
  }
1897
- class DeploymentFailedError extends Error {
1981
+ class DomainMappingErrorError extends Error {
1898
1982
  constructor(body) {
1899
1983
  super(
1900
- `DEPLOYMENT_FAILED: ${body.message}`
1984
+ `DOMAIN_MAPPING_ERROR: ${body.message}`
1901
1985
  );
1902
1986
  this.body = body;
1903
- this.name = "DeploymentFailedError";
1987
+ this.name = "DomainMappingErrorError";
1904
1988
  }
1905
- static code = "DEPLOYMENT_FAILED";
1989
+ static code = "DOMAIN_MAPPING_ERROR";
1906
1990
  static statusCode = 500;
1907
- static description = `Deployment failed: {message}`;
1991
+ static description = `Failed to configure domain mapping for: {domain}`;
1908
1992
  }
1909
- class InvalidDeploymentRequestError extends Error {
1993
+ class CertificateProvisioningErrorError extends Error {
1910
1994
  constructor(body) {
1911
1995
  super(
1912
- `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
1996
+ `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
1913
1997
  );
1914
1998
  this.body = body;
1915
- this.name = "InvalidDeploymentRequestError";
1999
+ this.name = "CertificateProvisioningErrorError";
1916
2000
  }
1917
- static code = "INVALID_DEPLOYMENT_REQUEST";
2001
+ static code = "CERTIFICATE_PROVISIONING_ERROR";
2002
+ static statusCode = 502;
2003
+ static description = `Failed to provision certificate for domain: {domain}`;
2004
+ }
2005
+ class NoEntrypointFoundError extends Error {
2006
+ constructor(body) {
2007
+ super(
2008
+ `NO_ENTRYPOINT_FOUND: ${body.message}`
2009
+ );
2010
+ this.body = body;
2011
+ this.name = "NoEntrypointFoundError";
2012
+ }
2013
+ static code = "NO_ENTRYPOINT_FOUND";
1918
2014
  static statusCode = 400;
1919
- static description = `Invalid deployment request: {message}`;
2015
+ static description = `No entrypoint found in deployment`;
1920
2016
  }
1921
- class ProjectNotFoundError extends Error {
2017
+ class EntrypointNotFoundError extends Error {
1922
2018
  constructor(body) {
1923
2019
  super(
1924
- `PROJECT_NOT_FOUND: ${body.message}`
2020
+ `ENTRYPOINT_NOT_FOUND: ${body.message}`
1925
2021
  );
1926
2022
  this.body = body;
1927
- this.name = "ProjectNotFoundError";
2023
+ this.name = "EntrypointNotFoundError";
2024
+ }
2025
+ static code = "ENTRYPOINT_NOT_FOUND";
2026
+ static statusCode = 400;
2027
+ static description = `Entrypoint not found: {entrypoint}`;
2028
+ }
2029
+ class NoDomainOwnershipError extends Error {
2030
+ constructor(body) {
2031
+ super(
2032
+ `NO_DOMAIN_OWNERSHIP: ${body.message}`
2033
+ );
2034
+ this.body = body;
2035
+ this.name = "NoDomainOwnershipError";
2036
+ }
2037
+ static code = "NO_DOMAIN_OWNERSHIP";
2038
+ static statusCode = 403;
2039
+ static description = `No domain ownership for: {domain}`;
2040
+ }
2041
+ class InvalidDomainsError extends Error {
2042
+ constructor(body) {
2043
+ super(
2044
+ `INVALID_DOMAINS: ${body.message}`
2045
+ );
2046
+ this.body = body;
2047
+ this.name = "InvalidDomainsError";
2048
+ }
2049
+ static code = "INVALID_DOMAINS";
2050
+ static statusCode = 400;
2051
+ static description = `Invalid domains provided`;
2052
+ }
2053
+ class WebDeploymentBadRequestError extends Error {
2054
+ constructor(body) {
2055
+ super(
2056
+ `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
2057
+ );
2058
+ this.body = body;
2059
+ this.name = "WebDeploymentBadRequestError";
1928
2060
  }
1929
- static code = "PROJECT_NOT_FOUND";
1930
- static statusCode = 404;
1931
- static description = `Project not found: {project_id}`;
2061
+ static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2062
+ static statusCode = 400;
2063
+ static description = `Bad request: {message}`;
1932
2064
  }
1933
- class AccessDeniedError extends Error {
2065
+ class DeploymentLimitExceededError extends Error {
1934
2066
  constructor(body) {
1935
2067
  super(
1936
- `ACCESS_DENIED: ${body.message}`
2068
+ `DEPLOYMENT_LIMIT_EXCEEDED: ${body.message}`
1937
2069
  );
1938
2070
  this.body = body;
1939
- this.name = "AccessDeniedError";
2071
+ this.name = "DeploymentLimitExceededError";
1940
2072
  }
1941
- static code = "ACCESS_DENIED";
2073
+ static code = "DEPLOYMENT_LIMIT_EXCEEDED";
1942
2074
  static statusCode = 403;
1943
- static description = `VM access denied`;
2075
+ static description = `Daily deployment limit exceeded: your plan allows {limit} deployments per day, you have created {current} today`;
1944
2076
  }
1945
- class ObservabilityDatabaseErrorError extends Error {
2077
+ class DeploymentNotFoundError extends Error {
1946
2078
  constructor(body) {
1947
2079
  super(
1948
- `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
2080
+ `DEPLOYMENT_NOT_FOUND: ${body.message}`
1949
2081
  );
1950
2082
  this.body = body;
1951
- this.name = "ObservabilityDatabaseErrorError";
2083
+ this.name = "DeploymentNotFoundError";
1952
2084
  }
1953
- static code = "OBSERVABILITY_DATABASE_ERROR";
1954
- static statusCode = 500;
1955
- static description = `Database operation failed: {message}`;
2085
+ static code = "DEPLOYMENT_NOT_FOUND";
2086
+ static statusCode = 404;
2087
+ static description = `Deployment not found`;
1956
2088
  }
1957
- class ObservabilityAccessDeniedError extends Error {
2089
+ class ResizeFailedError extends Error {
1958
2090
  constructor(body) {
1959
2091
  super(
1960
- `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
2092
+ `RESIZE_FAILED: ${body.message}`
1961
2093
  );
1962
2094
  this.body = body;
1963
- this.name = "ObservabilityAccessDeniedError";
2095
+ this.name = "ResizeFailedError";
1964
2096
  }
1965
- static code = "OBSERVABILITY_ACCESS_DENIED";
1966
- static statusCode = 403;
1967
- static description = `Access denied to logs for deployment: {deployment_id}`;
2097
+ static code = "RESIZE_FAILED";
2098
+ static statusCode = 500;
2099
+ static description = `Failed to resize VM: {message}`;
1968
2100
  }
1969
- class ParseLogsFailedError extends Error {
2101
+ class InternalResizeVmNotFoundError extends Error {
1970
2102
  constructor(body) {
1971
2103
  super(
1972
- `PARSE_LOGS_FAILED: ${body.message}`
2104
+ `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
1973
2105
  );
1974
2106
  this.body = body;
1975
- this.name = "ParseLogsFailedError";
2107
+ this.name = "InternalResizeVmNotFoundError";
1976
2108
  }
1977
- static code = "PARSE_LOGS_FAILED";
1978
- static statusCode = 500;
1979
- static description = `Failed to parse logs: {message}`;
2109
+ static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2110
+ static statusCode = 404;
2111
+ static description = `VM not found`;
1980
2112
  }
1981
- class RetrieveLogsFailedError extends Error {
2113
+ class BranchNameEmptyError extends Error {
1982
2114
  constructor(body) {
1983
2115
  super(
1984
- `RETRIEVE_LOGS_FAILED: ${body.message}`
2116
+ `BRANCH_NAME_EMPTY: ${body.message}`
1985
2117
  );
1986
2118
  this.body = body;
1987
- this.name = "RetrieveLogsFailedError";
2119
+ this.name = "BranchNameEmptyError";
1988
2120
  }
1989
- static code = "RETRIEVE_LOGS_FAILED";
1990
- static statusCode = 500;
1991
- static description = `Failed to retrieve logs: {message}`;
2121
+ static code = "BRANCH_NAME_EMPTY";
2122
+ static statusCode = 400;
2123
+ static description = `Branch name cannot be empty`;
1992
2124
  }
1993
- class InvalidQueryError extends Error {
2125
+ class ExecuteLimitExceededError extends Error {
1994
2126
  constructor(body) {
1995
2127
  super(
1996
- `INVALID_QUERY: ${body.message}`
2128
+ `EXECUTE_LIMIT_EXCEEDED: ${body.message}`
1997
2129
  );
1998
2130
  this.body = body;
1999
- this.name = "InvalidQueryError";
2131
+ this.name = "ExecuteLimitExceededError";
2000
2132
  }
2001
- static code = "INVALID_QUERY";
2002
- static statusCode = 400;
2003
- static description = `Invalid log query: {message}`;
2133
+ static code = "EXECUTE_LIMIT_EXCEEDED";
2134
+ static statusCode = 403;
2135
+ static description = `Execute runs limit exceeded: your plan allows {limit} runs per month, you have used {current}`;
2004
2136
  }
2005
- class LogsNotFoundError extends Error {
2137
+ class VmLimitExceededError extends Error {
2006
2138
  constructor(body) {
2007
2139
  super(
2008
- `LOGS_NOT_FOUND: ${body.message}`
2140
+ `VM_LIMIT_EXCEEDED: ${body.message}`
2009
2141
  );
2010
2142
  this.body = body;
2011
- this.name = "LogsNotFoundError";
2143
+ this.name = "VmLimitExceededError";
2012
2144
  }
2013
- static code = "LOGS_NOT_FOUND";
2014
- static statusCode = 404;
2015
- static description = `Logs not found for deployment: {deployment_id}`;
2145
+ static code = "VM_LIMIT_EXCEEDED";
2146
+ static statusCode = 403;
2147
+ static description = `VM limit exceeded: your plan allows {limit} VMs, you currently have {current}`;
2016
2148
  }
2017
2149
  class TriggerErrorError extends Error {
2018
2150
  constructor(body) {
@@ -2166,249 +2298,81 @@ class GetRepositoryInfoFailedError extends Error {
2166
2298
  this.body = body;
2167
2299
  this.name = "GetRepositoryInfoFailedError";
2168
2300
  }
2169
- static code = "GET_REPOSITORY_INFO_FAILED";
2170
- static statusCode = 500;
2171
- static description = `Failed to get repository info: {message}`;
2172
- }
2173
- class ListRepositoriesFailedError extends Error {
2174
- constructor(body) {
2175
- super(
2176
- `LIST_REPOSITORIES_FAILED: ${body.message}`
2177
- );
2178
- this.body = body;
2179
- this.name = "ListRepositoriesFailedError";
2180
- }
2181
- static code = "LIST_REPOSITORIES_FAILED";
2182
- static statusCode = 500;
2183
- static description = `Failed to list repositories: {message}`;
2184
- }
2185
- class DeleteRepositoryFailedError extends Error {
2186
- constructor(body) {
2187
- super(
2188
- `DELETE_REPOSITORY_FAILED: ${body.message}`
2189
- );
2190
- this.body = body;
2191
- this.name = "DeleteRepositoryFailedError";
2192
- }
2193
- static code = "DELETE_REPOSITORY_FAILED";
2194
- static statusCode = 500;
2195
- static description = `Failed to delete repository: {message}`;
2196
- }
2197
- class CreateRepositoryFailedError extends Error {
2198
- constructor(body) {
2199
- super(
2200
- `CREATE_REPOSITORY_FAILED: ${body.message}`
2201
- );
2202
- this.body = body;
2203
- this.name = "CreateRepositoryFailedError";
2204
- }
2205
- static code = "CREATE_REPOSITORY_FAILED";
2206
- static statusCode = 500;
2207
- static description = `Failed to create repository: {message}`;
2208
- }
2209
- class SerializationErrorError extends Error {
2210
- constructor(body) {
2211
- super(
2212
- `SERIALIZATION_ERROR: ${body.message}`
2213
- );
2214
- this.body = body;
2215
- this.name = "SerializationErrorError";
2216
- }
2217
- static code = "SERIALIZATION_ERROR";
2218
- static statusCode = 400;
2219
- static description = `Failed to serialize request: {message}`;
2220
- }
2221
- class GitInvalidRequestError extends Error {
2222
- constructor(body) {
2223
- super(
2224
- `GIT_INVALID_REQUEST: ${body.message}`
2225
- );
2226
- this.body = body;
2227
- this.name = "GitInvalidRequestError";
2228
- }
2229
- static code = "GIT_INVALID_REQUEST";
2230
- static statusCode = 400;
2231
- static description = `Invalid request: {message}`;
2232
- }
2233
- class RepositoryNotFoundError extends Error {
2234
- constructor(body) {
2235
- super(
2236
- `REPOSITORY_NOT_FOUND: ${body.message}`
2237
- );
2238
- this.body = body;
2239
- this.name = "RepositoryNotFoundError";
2240
- }
2241
- static code = "REPOSITORY_NOT_FOUND";
2242
- static statusCode = 404;
2243
- static description = `Repository not found: {repo_id}`;
2244
- }
2245
- class ExecuteInternalErrorError extends Error {
2246
- constructor(body) {
2247
- super(
2248
- `EXECUTE_INTERNAL_ERROR: ${body.message}`
2249
- );
2250
- this.body = body;
2251
- this.name = "ExecuteInternalErrorError";
2252
- }
2253
- static code = "EXECUTE_INTERNAL_ERROR";
2254
- static statusCode = 500;
2255
- static description = `Internal error: {message}`;
2256
- }
2257
- class ExecuteAccessDeniedError extends Error {
2258
- constructor(body) {
2259
- super(
2260
- `EXECUTE_ACCESS_DENIED: ${body.message}`
2261
- );
2262
- this.body = body;
2263
- this.name = "ExecuteAccessDeniedError";
2264
- }
2265
- static code = "EXECUTE_ACCESS_DENIED";
2266
- static statusCode = 403;
2267
- static description = `Access denied to execute run`;
2268
- }
2269
- class ListRunsFailedError extends Error {
2270
- constructor(body) {
2271
- super(
2272
- `LIST_RUNS_FAILED: ${body.message}`
2273
- );
2274
- this.body = body;
2275
- this.name = "ListRunsFailedError";
2276
- }
2277
- static code = "LIST_RUNS_FAILED";
2278
- static statusCode = 500;
2279
- static description = `Failed to list execute runs: {message}`;
2280
- }
2281
- class ExecutionErrorError extends Error {
2282
- constructor(body) {
2283
- super(
2284
- `EXECUTION_ERROR: ${body.message}`
2285
- );
2286
- this.body = body;
2287
- this.name = "ExecutionErrorError";
2288
- }
2289
- static code = "EXECUTION_ERROR";
2290
- static statusCode = 500;
2291
- static description = `Script execution error: {message}`;
2292
- }
2293
- class ConnectionFailedError extends Error {
2294
- constructor(body) {
2295
- super(
2296
- `CONNECTION_FAILED: ${body.message}`
2297
- );
2298
- this.body = body;
2299
- this.name = "ConnectionFailedError";
2300
- }
2301
- static code = "CONNECTION_FAILED";
2302
- static statusCode = 500;
2303
- static description = `Failed to connect to execute server: {message}`;
2304
- }
2305
- class MetadataWriteFailedError extends Error {
2306
- constructor(body) {
2307
- super(
2308
- `METADATA_WRITE_FAILED: ${body.message}`
2309
- );
2310
- this.body = body;
2311
- this.name = "MetadataWriteFailedError";
2312
- }
2313
- static code = "METADATA_WRITE_FAILED";
2314
- static statusCode = 500;
2315
- static description = `Failed to write metadata file: {message}`;
2316
- }
2317
- class NodeModulesInstallFailedError extends Error {
2318
- constructor(body) {
2319
- super(
2320
- `NODE_MODULES_INSTALL_FAILED: ${body.message}`
2321
- );
2322
- this.body = body;
2323
- this.name = "NodeModulesInstallFailedError";
2324
- }
2325
- static code = "NODE_MODULES_INSTALL_FAILED";
2326
- static statusCode = 500;
2327
- static description = `Failed to install node modules: {message}`;
2328
- }
2329
- class NodeModulesDownloadFailedError extends Error {
2330
- constructor(body) {
2331
- super(
2332
- `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
2333
- );
2334
- this.body = body;
2335
- this.name = "NodeModulesDownloadFailedError";
2336
- }
2337
- static code = "NODE_MODULES_DOWNLOAD_FAILED";
2301
+ static code = "GET_REPOSITORY_INFO_FAILED";
2338
2302
  static statusCode = 500;
2339
- static description = `Failed to download node modules: {message}`;
2303
+ static description = `Failed to get repository info: {message}`;
2340
2304
  }
2341
- class LockGenerationFailedError extends Error {
2305
+ class ListRepositoriesFailedError extends Error {
2342
2306
  constructor(body) {
2343
2307
  super(
2344
- `LOCK_GENERATION_FAILED: ${body.message}`
2308
+ `LIST_REPOSITORIES_FAILED: ${body.message}`
2345
2309
  );
2346
2310
  this.body = body;
2347
- this.name = "LockGenerationFailedError";
2311
+ this.name = "ListRepositoriesFailedError";
2348
2312
  }
2349
- static code = "LOCK_GENERATION_FAILED";
2313
+ static code = "LIST_REPOSITORIES_FAILED";
2350
2314
  static statusCode = 500;
2351
- static description = `Failed to generate lock file: {message}`;
2315
+ static description = `Failed to list repositories: {message}`;
2352
2316
  }
2353
- class WriteScriptFailedError extends Error {
2317
+ class DeleteRepositoryFailedError extends Error {
2354
2318
  constructor(body) {
2355
2319
  super(
2356
- `WRITE_SCRIPT_FAILED: ${body.message}`
2320
+ `DELETE_REPOSITORY_FAILED: ${body.message}`
2357
2321
  );
2358
2322
  this.body = body;
2359
- this.name = "WriteScriptFailedError";
2323
+ this.name = "DeleteRepositoryFailedError";
2360
2324
  }
2361
- static code = "WRITE_SCRIPT_FAILED";
2325
+ static code = "DELETE_REPOSITORY_FAILED";
2362
2326
  static statusCode = 500;
2363
- static description = `Failed to write script file: {message}`;
2327
+ static description = `Failed to delete repository: {message}`;
2364
2328
  }
2365
- class DirectoryCreationFailedError extends Error {
2329
+ class CreateRepositoryFailedError extends Error {
2366
2330
  constructor(body) {
2367
2331
  super(
2368
- `DIRECTORY_CREATION_FAILED: ${body.message}`
2332
+ `CREATE_REPOSITORY_FAILED: ${body.message}`
2369
2333
  );
2370
2334
  this.body = body;
2371
- this.name = "DirectoryCreationFailedError";
2335
+ this.name = "CreateRepositoryFailedError";
2372
2336
  }
2373
- static code = "DIRECTORY_CREATION_FAILED";
2337
+ static code = "CREATE_REPOSITORY_FAILED";
2374
2338
  static statusCode = 500;
2375
- static description = `Failed to create script directory: {message}`;
2339
+ static description = `Failed to create repository: {message}`;
2376
2340
  }
2377
- class NetworkPermissionsFailedError extends Error {
2341
+ class SerializationErrorError extends Error {
2378
2342
  constructor(body) {
2379
2343
  super(
2380
- `NETWORK_PERMISSIONS_FAILED: ${body.message}`
2344
+ `SERIALIZATION_ERROR: ${body.message}`
2381
2345
  );
2382
2346
  this.body = body;
2383
- this.name = "NetworkPermissionsFailedError";
2347
+ this.name = "SerializationErrorError";
2384
2348
  }
2385
- static code = "NETWORK_PERMISSIONS_FAILED";
2386
- static statusCode = 500;
2387
- static description = `Failed to insert network permissions: {message}`;
2349
+ static code = "SERIALIZATION_ERROR";
2350
+ static statusCode = 400;
2351
+ static description = `Failed to serialize request: {message}`;
2388
2352
  }
2389
- class LoggingFailedError extends Error {
2353
+ class GitInvalidRequestError extends Error {
2390
2354
  constructor(body) {
2391
2355
  super(
2392
- `LOGGING_FAILED: ${body.message}`
2356
+ `GIT_INVALID_REQUEST: ${body.message}`
2393
2357
  );
2394
2358
  this.body = body;
2395
- this.name = "LoggingFailedError";
2359
+ this.name = "GitInvalidRequestError";
2396
2360
  }
2397
- static code = "LOGGING_FAILED";
2398
- static statusCode = 500;
2399
- static description = `Failed to log execute run: {message}`;
2361
+ static code = "GIT_INVALID_REQUEST";
2362
+ static statusCode = 400;
2363
+ static description = `Invalid request: {message}`;
2400
2364
  }
2401
- class RunNotFoundError extends Error {
2365
+ class RepositoryNotFoundError extends Error {
2402
2366
  constructor(body) {
2403
2367
  super(
2404
- `RUN_NOT_FOUND: ${body.message}`
2368
+ `REPOSITORY_NOT_FOUND: ${body.message}`
2405
2369
  );
2406
2370
  this.body = body;
2407
- this.name = "RunNotFoundError";
2371
+ this.name = "RepositoryNotFoundError";
2408
2372
  }
2409
- static code = "RUN_NOT_FOUND";
2373
+ static code = "REPOSITORY_NOT_FOUND";
2410
2374
  static statusCode = 404;
2411
- static description = `Execute run not found: {run_id}`;
2375
+ static description = `Repository not found: {repo_id}`;
2412
2376
  }
2413
2377
  class DomainOwnershipNotVerifiedError extends Error {
2414
2378
  constructor(body) {
@@ -2530,317 +2494,197 @@ class FailedToCheckDomainMappingPermissionsError extends Error {
2530
2494
  static statusCode = 502;
2531
2495
  static description = `Failed to check permissions: {message}`;
2532
2496
  }
2533
- class UnauthorizedErrorError extends Error {
2534
- constructor(body) {
2535
- super(
2536
- `UNAUTHORIZED_ERROR: ${body.message}`
2537
- );
2538
- this.body = body;
2539
- this.name = "UnauthorizedErrorError";
2540
- }
2541
- static code = "UNAUTHORIZED_ERROR";
2542
- static statusCode = 401;
2543
- static description = `Unauthorized request to {route}`;
2544
- }
2545
- class GitRepoLimitExceededError extends Error {
2497
+ class DomainOwnershipVerificationFailedError extends Error {
2546
2498
  constructor(body) {
2547
2499
  super(
2548
- `GIT_REPO_LIMIT_EXCEEDED: ${body.message}`
2500
+ `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
2549
2501
  );
2550
2502
  this.body = body;
2551
- this.name = "GitRepoLimitExceededError";
2503
+ this.name = "DomainOwnershipVerificationFailedError";
2552
2504
  }
2553
- static code = "GIT_REPO_LIMIT_EXCEEDED";
2505
+ static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
2554
2506
  static statusCode = 403;
2555
- static description = `Repository limit exceeded: your plan allows {limit} repositories, you currently have {current}`;
2556
- }
2557
- class ScheduleNotFoundError extends Error {
2558
- constructor(body) {
2559
- super(
2560
- `SCHEDULE_NOT_FOUND: ${body.message}`
2561
- );
2562
- this.body = body;
2563
- this.name = "ScheduleNotFoundError";
2564
- }
2565
- static code = "SCHEDULE_NOT_FOUND";
2566
- static statusCode = 404;
2567
- static description = `Schedule not found`;
2568
- }
2569
- class ServiceUnavailableError extends Error {
2570
- constructor(body) {
2571
- super(
2572
- `SERVICE_UNAVAILABLE: ${body.message}`
2573
- );
2574
- this.body = body;
2575
- this.name = "ServiceUnavailableError";
2576
- }
2577
- static code = "SERVICE_UNAVAILABLE";
2578
- static statusCode = 503;
2579
- static description = `Cron service not configured`;
2580
- }
2581
- class ResizeFailedError extends Error {
2582
- constructor(body) {
2583
- super(
2584
- `RESIZE_FAILED: ${body.message}`
2585
- );
2586
- this.body = body;
2587
- this.name = "ResizeFailedError";
2588
- }
2589
- static code = "RESIZE_FAILED";
2590
- static statusCode = 500;
2591
- static description = `Failed to resize VM: {message}`;
2592
- }
2593
- class InternalResizeVmNotFoundError extends Error {
2594
- constructor(body) {
2595
- super(
2596
- `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
2597
- );
2598
- this.body = body;
2599
- this.name = "InternalResizeVmNotFoundError";
2600
- }
2601
- static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2602
- static statusCode = 404;
2603
- static description = `VM not found`;
2604
- }
2605
- class PermissionAlreadyExistsError extends Error {
2606
- constructor(body) {
2607
- super(
2608
- `PERMISSION_ALREADY_EXISTS: ${body.message}`
2609
- );
2610
- this.body = body;
2611
- this.name = "PermissionAlreadyExistsError";
2612
- }
2613
- static code = "PERMISSION_ALREADY_EXISTS";
2614
- static statusCode = 409;
2615
- static description = `Permission already exists`;
2616
- }
2617
- class ListTokensFailedError extends Error {
2618
- constructor(body) {
2619
- super(
2620
- `LIST_TOKENS_FAILED: ${body.message}`
2621
- );
2622
- this.body = body;
2623
- this.name = "ListTokensFailedError";
2624
- }
2625
- static code = "LIST_TOKENS_FAILED";
2626
- static statusCode = 500;
2627
- static description = `Failed to list tokens: {message}`;
2628
- }
2629
- class RevokeTokenFailedError extends Error {
2630
- constructor(body) {
2631
- super(
2632
- `REVOKE_TOKEN_FAILED: ${body.message}`
2633
- );
2634
- this.body = body;
2635
- this.name = "RevokeTokenFailedError";
2636
- }
2637
- static code = "REVOKE_TOKEN_FAILED";
2638
- static statusCode = 500;
2639
- static description = `Failed to revoke token: {message}`;
2640
- }
2641
- class CreateTokenFailedError extends Error {
2642
- constructor(body) {
2643
- super(
2644
- `CREATE_TOKEN_FAILED: ${body.message}`
2645
- );
2646
- this.body = body;
2647
- this.name = "CreateTokenFailedError";
2648
- }
2649
- static code = "CREATE_TOKEN_FAILED";
2650
- static statusCode = 500;
2651
- static description = `Failed to create token: {message}`;
2652
- }
2653
- class ListPermissionsFailedError extends Error {
2654
- constructor(body) {
2655
- super(
2656
- `LIST_PERMISSIONS_FAILED: ${body.message}`
2657
- );
2658
- this.body = body;
2659
- this.name = "ListPermissionsFailedError";
2660
- }
2661
- static code = "LIST_PERMISSIONS_FAILED";
2662
- static statusCode = 500;
2663
- static description = `Failed to list permissions: {message}`;
2507
+ static description = `Domain ownership verification failed`;
2664
2508
  }
2665
- class GetPermissionFailedError extends Error {
2509
+ class ErrorDeletingRecordError extends Error {
2666
2510
  constructor(body) {
2667
2511
  super(
2668
- `GET_PERMISSION_FAILED: ${body.message}`
2512
+ `ERROR_DELETING_RECORD: ${body.message}`
2669
2513
  );
2670
2514
  this.body = body;
2671
- this.name = "GetPermissionFailedError";
2515
+ this.name = "ErrorDeletingRecordError";
2672
2516
  }
2673
- static code = "GET_PERMISSION_FAILED";
2517
+ static code = "ERROR_DELETING_RECORD";
2674
2518
  static statusCode = 500;
2675
- static description = `Failed to get permission: {message}`;
2519
+ static description = `Error deleting DNS record for {domain}/{name}: {message}`;
2676
2520
  }
2677
- class UpdatePermissionFailedError extends Error {
2521
+ class RecordOwnershipErrorError extends Error {
2678
2522
  constructor(body) {
2679
2523
  super(
2680
- `UPDATE_PERMISSION_FAILED: ${body.message}`
2524
+ `RECORD_OWNERSHIP_ERROR: ${body.message}`
2681
2525
  );
2682
2526
  this.body = body;
2683
- this.name = "UpdatePermissionFailedError";
2527
+ this.name = "RecordOwnershipErrorError";
2684
2528
  }
2685
- static code = "UPDATE_PERMISSION_FAILED";
2686
- static statusCode = 500;
2687
- static description = `Failed to update permission: {message}`;
2529
+ static code = "RECORD_OWNERSHIP_ERROR";
2530
+ static statusCode = 403;
2531
+ static description = `Account {account_id} does not own record {record_id}`;
2688
2532
  }
2689
- class RevokePermissionFailedError extends Error {
2533
+ class ErrorCreatingRecordError extends Error {
2690
2534
  constructor(body) {
2691
2535
  super(
2692
- `REVOKE_PERMISSION_FAILED: ${body.message}`
2536
+ `ERROR_CREATING_RECORD: ${body.message}`
2693
2537
  );
2694
2538
  this.body = body;
2695
- this.name = "RevokePermissionFailedError";
2539
+ this.name = "ErrorCreatingRecordError";
2696
2540
  }
2697
- static code = "REVOKE_PERMISSION_FAILED";
2541
+ static code = "ERROR_CREATING_RECORD";
2698
2542
  static statusCode = 500;
2699
- static description = `Failed to revoke permission: {message}`;
2543
+ static description = `Error creating DNS record: {message}`;
2700
2544
  }
2701
- class GrantPermissionFailedError extends Error {
2545
+ class DomainOwnershipErrorError extends Error {
2702
2546
  constructor(body) {
2703
2547
  super(
2704
- `GRANT_PERMISSION_FAILED: ${body.message}`
2548
+ `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
2705
2549
  );
2706
2550
  this.body = body;
2707
- this.name = "GrantPermissionFailedError";
2551
+ this.name = "DomainOwnershipErrorError";
2708
2552
  }
2709
- static code = "GRANT_PERMISSION_FAILED";
2710
- static statusCode = 500;
2711
- static description = `Failed to grant permission: {message}`;
2553
+ static code = "DOMAIN_OWNERSHIP_ERROR";
2554
+ static statusCode = 403;
2555
+ static description = `Account {account_id} does not own domain {domain}`;
2712
2556
  }
2713
- class ListIdentitiesFailedError extends Error {
2557
+ class CloudstateInternalErrorError extends Error {
2714
2558
  constructor(body) {
2715
2559
  super(
2716
- `LIST_IDENTITIES_FAILED: ${body.message}`
2560
+ `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2717
2561
  );
2718
2562
  this.body = body;
2719
- this.name = "ListIdentitiesFailedError";
2563
+ this.name = "CloudstateInternalErrorError";
2720
2564
  }
2721
- static code = "LIST_IDENTITIES_FAILED";
2565
+ static code = "CLOUDSTATE_INTERNAL_ERROR";
2722
2566
  static statusCode = 500;
2723
- static description = `Failed to list identities: {message}`;
2567
+ static description = `Internal error: {message}`;
2724
2568
  }
2725
- class DeleteIdentityFailedError extends Error {
2569
+ class CloudstateDatabaseErrorError extends Error {
2726
2570
  constructor(body) {
2727
2571
  super(
2728
- `DELETE_IDENTITY_FAILED: ${body.message}`
2572
+ `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2729
2573
  );
2730
2574
  this.body = body;
2731
- this.name = "DeleteIdentityFailedError";
2575
+ this.name = "CloudstateDatabaseErrorError";
2732
2576
  }
2733
- static code = "DELETE_IDENTITY_FAILED";
2577
+ static code = "CLOUDSTATE_DATABASE_ERROR";
2734
2578
  static statusCode = 500;
2735
- static description = `Failed to delete identity: {message}`;
2579
+ static description = `Database operation failed: {message}`;
2736
2580
  }
2737
- class CreateIdentityFailedError extends Error {
2581
+ class CloudstateAccessDeniedError extends Error {
2738
2582
  constructor(body) {
2739
2583
  super(
2740
- `CREATE_IDENTITY_FAILED: ${body.message}`
2584
+ `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2741
2585
  );
2742
2586
  this.body = body;
2743
- this.name = "CreateIdentityFailedError";
2587
+ this.name = "CloudstateAccessDeniedError";
2744
2588
  }
2745
- static code = "CREATE_IDENTITY_FAILED";
2746
- static statusCode = 500;
2747
- static description = `Failed to create identity: {message}`;
2589
+ static code = "CLOUDSTATE_ACCESS_DENIED";
2590
+ static statusCode = 403;
2591
+ static description = `Access denied to project: {project_id}`;
2748
2592
  }
2749
- class VmPermissionNotFoundError extends Error {
2593
+ class RestoreFailedError extends Error {
2750
2594
  constructor(body) {
2751
2595
  super(
2752
- `VM_PERMISSION_NOT_FOUND: ${body.message}`
2596
+ `RESTORE_FAILED: ${body.message}`
2753
2597
  );
2754
2598
  this.body = body;
2755
- this.name = "VmPermissionNotFoundError";
2599
+ this.name = "RestoreFailedError";
2756
2600
  }
2757
- static code = "VM_PERMISSION_NOT_FOUND";
2758
- static statusCode = 404;
2759
- static description = `VM permission not found`;
2601
+ static code = "RESTORE_FAILED";
2602
+ static statusCode = 500;
2603
+ static description = `Failed to restore from backup: {message}`;
2760
2604
  }
2761
- class PermissionNotFoundError extends Error {
2605
+ class CreateBackupFailedError extends Error {
2762
2606
  constructor(body) {
2763
2607
  super(
2764
- `PERMISSION_NOT_FOUND: ${body.message}`
2608
+ `CREATE_BACKUP_FAILED: ${body.message}`
2765
2609
  );
2766
2610
  this.body = body;
2767
- this.name = "PermissionNotFoundError";
2611
+ this.name = "CreateBackupFailedError";
2768
2612
  }
2769
- static code = "PERMISSION_NOT_FOUND";
2770
- static statusCode = 404;
2771
- static description = `Permission not found`;
2613
+ static code = "CREATE_BACKUP_FAILED";
2614
+ static statusCode = 500;
2615
+ static description = `Failed to create backup: {message}`;
2772
2616
  }
2773
- class GitRepositoryAccessDeniedError extends Error {
2617
+ class BackupFailedError extends Error {
2774
2618
  constructor(body) {
2775
2619
  super(
2776
- `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
2620
+ `BACKUP_FAILED: ${body.message}`
2777
2621
  );
2778
2622
  this.body = body;
2779
- this.name = "GitRepositoryAccessDeniedError";
2623
+ this.name = "BackupFailedError";
2780
2624
  }
2781
- static code = "GIT_REPOSITORY_ACCESS_DENIED";
2782
- static statusCode = 403;
2783
- static description = `You are not allowed to access this repository`;
2625
+ static code = "BACKUP_FAILED";
2626
+ static statusCode = 500;
2627
+ static description = `Backup failed: {message}`;
2784
2628
  }
2785
- class GitRepositoryNotFoundError extends Error {
2629
+ class DeploymentFailedError extends Error {
2786
2630
  constructor(body) {
2787
2631
  super(
2788
- `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
2632
+ `DEPLOYMENT_FAILED: ${body.message}`
2789
2633
  );
2790
2634
  this.body = body;
2791
- this.name = "GitRepositoryNotFoundError";
2635
+ this.name = "DeploymentFailedError";
2792
2636
  }
2793
- static code = "GIT_REPOSITORY_NOT_FOUND";
2794
- static statusCode = 404;
2795
- static description = `Repository not found`;
2637
+ static code = "DEPLOYMENT_FAILED";
2638
+ static statusCode = 500;
2639
+ static description = `Deployment failed: {message}`;
2796
2640
  }
2797
- class CannotDeleteManagedIdentityError extends Error {
2641
+ class InvalidDeploymentRequestError extends Error {
2798
2642
  constructor(body) {
2799
2643
  super(
2800
- `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
2644
+ `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2801
2645
  );
2802
2646
  this.body = body;
2803
- this.name = "CannotDeleteManagedIdentityError";
2647
+ this.name = "InvalidDeploymentRequestError";
2804
2648
  }
2805
- static code = "CANNOT_DELETE_MANAGED_IDENTITY";
2806
- static statusCode = 403;
2807
- static description = `Cannot delete managed identities`;
2649
+ static code = "INVALID_DEPLOYMENT_REQUEST";
2650
+ static statusCode = 400;
2651
+ static description = `Invalid deployment request: {message}`;
2808
2652
  }
2809
- class CannotModifyManagedIdentityError extends Error {
2653
+ class ProjectNotFoundError extends Error {
2810
2654
  constructor(body) {
2811
2655
  super(
2812
- `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
2656
+ `PROJECT_NOT_FOUND: ${body.message}`
2813
2657
  );
2814
2658
  this.body = body;
2815
- this.name = "CannotModifyManagedIdentityError";
2659
+ this.name = "ProjectNotFoundError";
2816
2660
  }
2817
- static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
2818
- static statusCode = 403;
2819
- static description = `Cannot modify managed identities`;
2661
+ static code = "PROJECT_NOT_FOUND";
2662
+ static statusCode = 404;
2663
+ static description = `Project not found: {project_id}`;
2820
2664
  }
2821
- class IdentityAccessDeniedError extends Error {
2665
+ class GitRepoLimitExceededError extends Error {
2822
2666
  constructor(body) {
2823
2667
  super(
2824
- `IDENTITY_ACCESS_DENIED: ${body.message}`
2668
+ `GIT_REPO_LIMIT_EXCEEDED: ${body.message}`
2825
2669
  );
2826
2670
  this.body = body;
2827
- this.name = "IdentityAccessDeniedError";
2671
+ this.name = "GitRepoLimitExceededError";
2828
2672
  }
2829
- static code = "IDENTITY_ACCESS_DENIED";
2673
+ static code = "GIT_REPO_LIMIT_EXCEEDED";
2830
2674
  static statusCode = 403;
2831
- static description = `You are not allowed to access this identity`;
2675
+ static description = `Repository limit exceeded: your plan allows {limit} repositories, you currently have {current}`;
2832
2676
  }
2833
- class IdentityNotFoundError extends Error {
2677
+ class EmptyTagError extends Error {
2834
2678
  constructor(body) {
2835
2679
  super(
2836
- `IDENTITY_NOT_FOUND: ${body.message}`
2680
+ `EMPTY_TAG: ${body.message}`
2837
2681
  );
2838
2682
  this.body = body;
2839
- this.name = "IdentityNotFoundError";
2683
+ this.name = "EmptyTagError";
2840
2684
  }
2841
- static code = "IDENTITY_NOT_FOUND";
2842
- static statusCode = 404;
2843
- static description = `Identity not found`;
2685
+ static code = "EMPTY_TAG";
2686
+ static statusCode = 400;
2687
+ static description = `Invalid request: tag cannot be empty`;
2844
2688
  }
2845
2689
  class LimitExceededError extends Error {
2846
2690
  constructor(body) {
@@ -2998,278 +2842,303 @@ class InvalidDomainError extends Error {
2998
2842
  static statusCode = 400;
2999
2843
  static description = `Invalid domain: {domain}`;
3000
2844
  }
3001
- class DomainOwnershipVerificationFailedError extends Error {
2845
+ class AccessDeniedError extends Error {
3002
2846
  constructor(body) {
3003
2847
  super(
3004
- `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
2848
+ `ACCESS_DENIED: ${body.message}`
3005
2849
  );
3006
2850
  this.body = body;
3007
- this.name = "DomainOwnershipVerificationFailedError";
2851
+ this.name = "AccessDeniedError";
3008
2852
  }
3009
- static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
2853
+ static code = "ACCESS_DENIED";
3010
2854
  static statusCode = 403;
3011
- static description = `Domain ownership verification failed`;
2855
+ static description = `VM access denied`;
3012
2856
  }
3013
- class ErrorDeletingRecordError extends Error {
2857
+ class ObservabilityDatabaseErrorError extends Error {
3014
2858
  constructor(body) {
3015
2859
  super(
3016
- `ERROR_DELETING_RECORD: ${body.message}`
2860
+ `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
3017
2861
  );
3018
2862
  this.body = body;
3019
- this.name = "ErrorDeletingRecordError";
2863
+ this.name = "ObservabilityDatabaseErrorError";
3020
2864
  }
3021
- static code = "ERROR_DELETING_RECORD";
2865
+ static code = "OBSERVABILITY_DATABASE_ERROR";
3022
2866
  static statusCode = 500;
3023
- static description = `Error deleting DNS record for {domain}/{name}: {message}`;
2867
+ static description = `Database operation failed: {message}`;
3024
2868
  }
3025
- class RecordOwnershipErrorError extends Error {
2869
+ class ObservabilityAccessDeniedError extends Error {
3026
2870
  constructor(body) {
3027
2871
  super(
3028
- `RECORD_OWNERSHIP_ERROR: ${body.message}`
2872
+ `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
3029
2873
  );
3030
2874
  this.body = body;
3031
- this.name = "RecordOwnershipErrorError";
2875
+ this.name = "ObservabilityAccessDeniedError";
3032
2876
  }
3033
- static code = "RECORD_OWNERSHIP_ERROR";
2877
+ static code = "OBSERVABILITY_ACCESS_DENIED";
3034
2878
  static statusCode = 403;
3035
- static description = `Account {account_id} does not own record {record_id}`;
2879
+ static description = `Access denied to logs for deployment: {deployment_id}`;
3036
2880
  }
3037
- class ErrorCreatingRecordError extends Error {
2881
+ class ParseLogsFailedError extends Error {
3038
2882
  constructor(body) {
3039
2883
  super(
3040
- `ERROR_CREATING_RECORD: ${body.message}`
2884
+ `PARSE_LOGS_FAILED: ${body.message}`
3041
2885
  );
3042
2886
  this.body = body;
3043
- this.name = "ErrorCreatingRecordError";
2887
+ this.name = "ParseLogsFailedError";
3044
2888
  }
3045
- static code = "ERROR_CREATING_RECORD";
2889
+ static code = "PARSE_LOGS_FAILED";
3046
2890
  static statusCode = 500;
3047
- static description = `Error creating DNS record: {message}`;
2891
+ static description = `Failed to parse logs: {message}`;
3048
2892
  }
3049
- class DomainOwnershipErrorError extends Error {
2893
+ class RetrieveLogsFailedError extends Error {
3050
2894
  constructor(body) {
3051
2895
  super(
3052
- `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
2896
+ `RETRIEVE_LOGS_FAILED: ${body.message}`
3053
2897
  );
3054
2898
  this.body = body;
3055
- this.name = "DomainOwnershipErrorError";
2899
+ this.name = "RetrieveLogsFailedError";
3056
2900
  }
3057
- static code = "DOMAIN_OWNERSHIP_ERROR";
3058
- static statusCode = 403;
3059
- static description = `Account {account_id} does not own domain {domain}`;
2901
+ static code = "RETRIEVE_LOGS_FAILED";
2902
+ static statusCode = 500;
2903
+ static description = `Failed to retrieve logs: {message}`;
3060
2904
  }
3061
- class VmLimitExceededError extends Error {
2905
+ class InvalidQueryError extends Error {
3062
2906
  constructor(body) {
3063
2907
  super(
3064
- `VM_LIMIT_EXCEEDED: ${body.message}`
2908
+ `INVALID_QUERY: ${body.message}`
3065
2909
  );
3066
2910
  this.body = body;
3067
- this.name = "VmLimitExceededError";
2911
+ this.name = "InvalidQueryError";
3068
2912
  }
3069
- static code = "VM_LIMIT_EXCEEDED";
3070
- static statusCode = 403;
3071
- static description = `VM limit exceeded: your plan allows {limit} VMs, you currently have {current}`;
2913
+ static code = "INVALID_QUERY";
2914
+ static statusCode = 400;
2915
+ static description = `Invalid log query: {message}`;
3072
2916
  }
3073
- class BrowserOperationFailedError extends Error {
2917
+ class LogsNotFoundError extends Error {
2918
+ constructor(body) {
2919
+ super(
2920
+ `LOGS_NOT_FOUND: ${body.message}`
2921
+ );
2922
+ this.body = body;
2923
+ this.name = "LogsNotFoundError";
2924
+ }
2925
+ static code = "LOGS_NOT_FOUND";
2926
+ static statusCode = 404;
2927
+ static description = `Logs not found for deployment: {deployment_id}`;
2928
+ }
2929
+ class ExecuteInternalErrorError extends Error {
3074
2930
  constructor(body) {
3075
2931
  super(
3076
- `BROWSER_OPERATION_FAILED: ${body.message}`
2932
+ `EXECUTE_INTERNAL_ERROR: ${body.message}`
3077
2933
  );
3078
2934
  this.body = body;
3079
- this.name = "BrowserOperationFailedError";
2935
+ this.name = "ExecuteInternalErrorError";
3080
2936
  }
3081
- static code = "BROWSER_OPERATION_FAILED";
2937
+ static code = "EXECUTE_INTERNAL_ERROR";
3082
2938
  static statusCode = 500;
3083
- static description = `Browser operation failed: {message}`;
2939
+ static description = `Internal error: {message}`;
2940
+ }
2941
+ class ExecuteAccessDeniedError extends Error {
2942
+ constructor(body) {
2943
+ super(
2944
+ `EXECUTE_ACCESS_DENIED: ${body.message}`
2945
+ );
2946
+ this.body = body;
2947
+ this.name = "ExecuteAccessDeniedError";
2948
+ }
2949
+ static code = "EXECUTE_ACCESS_DENIED";
2950
+ static statusCode = 403;
2951
+ static description = `Access denied to execute run`;
3084
2952
  }
3085
- class WatchFilesFailedError extends Error {
2953
+ class ListRunsFailedError extends Error {
3086
2954
  constructor(body) {
3087
2955
  super(
3088
- `WATCH_FILES_FAILED: ${body.message}`
2956
+ `LIST_RUNS_FAILED: ${body.message}`
3089
2957
  );
3090
2958
  this.body = body;
3091
- this.name = "WatchFilesFailedError";
2959
+ this.name = "ListRunsFailedError";
3092
2960
  }
3093
- static code = "WATCH_FILES_FAILED";
2961
+ static code = "LIST_RUNS_FAILED";
3094
2962
  static statusCode = 500;
3095
- static description = `Failed to watch files: {message}`;
2963
+ static description = `Failed to list execute runs: {message}`;
3096
2964
  }
3097
- class LogsFailedError extends Error {
2965
+ class ExecutionErrorError extends Error {
3098
2966
  constructor(body) {
3099
2967
  super(
3100
- `LOGS_FAILED: ${body.message}`
2968
+ `EXECUTION_ERROR: ${body.message}`
3101
2969
  );
3102
2970
  this.body = body;
3103
- this.name = "LogsFailedError";
2971
+ this.name = "ExecutionErrorError";
3104
2972
  }
3105
- static code = "LOGS_FAILED";
2973
+ static code = "EXECUTION_ERROR";
3106
2974
  static statusCode = 500;
3107
- static description = `Failed to get logs: {message}`;
2975
+ static description = `Script execution error: {message}`;
3108
2976
  }
3109
- class StatusFailedError extends Error {
2977
+ class ConnectionFailedError extends Error {
3110
2978
  constructor(body) {
3111
2979
  super(
3112
- `STATUS_FAILED: ${body.message}`
2980
+ `CONNECTION_FAILED: ${body.message}`
3113
2981
  );
3114
2982
  this.body = body;
3115
- this.name = "StatusFailedError";
2983
+ this.name = "ConnectionFailedError";
3116
2984
  }
3117
- static code = "STATUS_FAILED";
2985
+ static code = "CONNECTION_FAILED";
3118
2986
  static statusCode = 500;
3119
- static description = `Failed to get dev server status: {message}`;
2987
+ static description = `Failed to connect to execute server: {message}`;
3120
2988
  }
3121
- class RestartFailedError extends Error {
2989
+ class MetadataWriteFailedError extends Error {
3122
2990
  constructor(body) {
3123
2991
  super(
3124
- `RESTART_FAILED: ${body.message}`
2992
+ `METADATA_WRITE_FAILED: ${body.message}`
3125
2993
  );
3126
2994
  this.body = body;
3127
- this.name = "RestartFailedError";
2995
+ this.name = "MetadataWriteFailedError";
3128
2996
  }
3129
- static code = "RESTART_FAILED";
2997
+ static code = "METADATA_WRITE_FAILED";
3130
2998
  static statusCode = 500;
3131
- static description = `Failed to restart dev server: {message}`;
2999
+ static description = `Failed to write metadata file: {message}`;
3132
3000
  }
3133
- class ShutdownFailedError extends Error {
3001
+ class NodeModulesInstallFailedError extends Error {
3134
3002
  constructor(body) {
3135
3003
  super(
3136
- `SHUTDOWN_FAILED: ${body.message}`
3004
+ `NODE_MODULES_INSTALL_FAILED: ${body.message}`
3137
3005
  );
3138
3006
  this.body = body;
3139
- this.name = "ShutdownFailedError";
3007
+ this.name = "NodeModulesInstallFailedError";
3140
3008
  }
3141
- static code = "SHUTDOWN_FAILED";
3009
+ static code = "NODE_MODULES_INSTALL_FAILED";
3142
3010
  static statusCode = 500;
3143
- static description = `Failed to shutdown dev server: {message}`;
3011
+ static description = `Failed to install node modules: {message}`;
3144
3012
  }
3145
- class CommitFailedError extends Error {
3013
+ class NodeModulesDownloadFailedError extends Error {
3146
3014
  constructor(body) {
3147
3015
  super(
3148
- `COMMIT_FAILED: ${body.message}`
3016
+ `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
3149
3017
  );
3150
3018
  this.body = body;
3151
- this.name = "CommitFailedError";
3019
+ this.name = "NodeModulesDownloadFailedError";
3152
3020
  }
3153
- static code = "COMMIT_FAILED";
3021
+ static code = "NODE_MODULES_DOWNLOAD_FAILED";
3154
3022
  static statusCode = 500;
3155
- static description = `Failed to commit changes: {message}`;
3023
+ static description = `Failed to download node modules: {message}`;
3156
3024
  }
3157
- class WriteFileFailedError extends Error {
3025
+ class LockGenerationFailedError extends Error {
3158
3026
  constructor(body) {
3159
3027
  super(
3160
- `WRITE_FILE_FAILED: ${body.message}`
3028
+ `LOCK_GENERATION_FAILED: ${body.message}`
3161
3029
  );
3162
3030
  this.body = body;
3163
- this.name = "WriteFileFailedError";
3031
+ this.name = "LockGenerationFailedError";
3164
3032
  }
3165
- static code = "WRITE_FILE_FAILED";
3033
+ static code = "LOCK_GENERATION_FAILED";
3166
3034
  static statusCode = 500;
3167
- static description = `Failed to write file: {message}`;
3035
+ static description = `Failed to generate lock file: {message}`;
3168
3036
  }
3169
- class ReadFileFailedError extends Error {
3037
+ class WriteScriptFailedError extends Error {
3170
3038
  constructor(body) {
3171
3039
  super(
3172
- `READ_FILE_FAILED: ${body.message}`
3040
+ `WRITE_SCRIPT_FAILED: ${body.message}`
3173
3041
  );
3174
3042
  this.body = body;
3175
- this.name = "ReadFileFailedError";
3043
+ this.name = "WriteScriptFailedError";
3176
3044
  }
3177
- static code = "READ_FILE_FAILED";
3045
+ static code = "WRITE_SCRIPT_FAILED";
3178
3046
  static statusCode = 500;
3179
- static description = `Failed to read file: {message}`;
3047
+ static description = `Failed to write script file: {message}`;
3180
3048
  }
3181
- class ExecutionFailedError extends Error {
3049
+ class DirectoryCreationFailedError extends Error {
3182
3050
  constructor(body) {
3183
3051
  super(
3184
- `EXECUTION_FAILED: ${body.message}`
3052
+ `DIRECTORY_CREATION_FAILED: ${body.message}`
3185
3053
  );
3186
3054
  this.body = body;
3187
- this.name = "ExecutionFailedError";
3055
+ this.name = "DirectoryCreationFailedError";
3188
3056
  }
3189
- static code = "EXECUTION_FAILED";
3057
+ static code = "DIRECTORY_CREATION_FAILED";
3190
3058
  static statusCode = 500;
3191
- static description = `Failed to execute command: {message}`;
3059
+ static description = `Failed to create script directory: {message}`;
3192
3060
  }
3193
- class RequestFailedError extends Error {
3061
+ class NetworkPermissionsFailedError extends Error {
3194
3062
  constructor(body) {
3195
3063
  super(
3196
- `REQUEST_FAILED: ${body.message}`
3064
+ `NETWORK_PERMISSIONS_FAILED: ${body.message}`
3197
3065
  );
3198
3066
  this.body = body;
3199
- this.name = "RequestFailedError";
3067
+ this.name = "NetworkPermissionsFailedError";
3200
3068
  }
3201
- static code = "REQUEST_FAILED";
3069
+ static code = "NETWORK_PERMISSIONS_FAILED";
3202
3070
  static statusCode = 500;
3203
- static description = `Failed to request dev server: {message}`;
3071
+ static description = `Failed to insert network permissions: {message}`;
3204
3072
  }
3205
- class DevServerFileNotFoundError extends Error {
3073
+ class LoggingFailedError extends Error {
3206
3074
  constructor(body) {
3207
3075
  super(
3208
- `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
3076
+ `LOGGING_FAILED: ${body.message}`
3209
3077
  );
3210
3078
  this.body = body;
3211
- this.name = "DevServerFileNotFoundError";
3079
+ this.name = "LoggingFailedError";
3212
3080
  }
3213
- static code = "DEV_SERVER_FILE_NOT_FOUND";
3214
- static statusCode = 404;
3215
- static description = `Dev server file not found: {path}`;
3081
+ static code = "LOGGING_FAILED";
3082
+ static statusCode = 500;
3083
+ static description = `Failed to log execute run: {message}`;
3216
3084
  }
3217
- class DevServerInvalidRequestError extends Error {
3085
+ class RunNotFoundError extends Error {
3218
3086
  constructor(body) {
3219
3087
  super(
3220
- `DEV_SERVER_INVALID_REQUEST: ${body.message}`
3088
+ `RUN_NOT_FOUND: ${body.message}`
3221
3089
  );
3222
3090
  this.body = body;
3223
- this.name = "DevServerInvalidRequestError";
3091
+ this.name = "RunNotFoundError";
3224
3092
  }
3225
- static code = "DEV_SERVER_INVALID_REQUEST";
3226
- static statusCode = 400;
3227
- static description = `Invalid dev server request: {message}`;
3093
+ static code = "RUN_NOT_FOUND";
3094
+ static statusCode = 404;
3095
+ static description = `Execute run not found: {run_id}`;
3228
3096
  }
3229
3097
  const FREESTYLE_ERROR_CODE_MAP = {
3230
- "GIT_ERROR": GitErrorError,
3231
3098
  "BAD_PARSE": BadParseError,
3232
3099
  "BAD_TIMESTAMP": BadTimestampError,
3233
3100
  "BAD_SIGNATURE": BadSignatureError,
3234
3101
  "BAD_HEADER": BadHeaderError,
3235
3102
  "BAD_KEY": BadKeyError,
3236
- "USER_NOT_FOUND": UserNotFoundError,
3237
- "USER_ALREADY_EXISTS": UserAlreadyExistsError,
3238
- "VALIDATION_ERROR": ValidationErrorError,
3239
- "GROUP_NOT_FOUND": GroupNotFoundError,
3240
- "GROUP_ALREADY_EXISTS": GroupAlreadyExistsError,
3241
- "DUPLICATE_USER_NAME": DuplicateUserNameError,
3242
- "USER_GROUP_EMPTY": UserGroupEmptyError,
3243
- "USER_SYSTEM_FLAG_MISMATCH": UserSystemFlagMismatchError,
3244
- "USER_UID_OUT_OF_RANGE": UserUidOutOfRangeError,
3245
- "USER_HOME_INVALID": UserHomeInvalidError,
3246
- "USER_SHELL_INVALID": UserShellInvalidError,
3247
- "DUPLICATE_GROUP_NAME": DuplicateGroupNameError,
3248
- "GROUP_NAME_RESERVED": GroupNameReservedError,
3249
- "GROUP_NAME_INVALID_CHARS": GroupNameInvalidCharsError,
3250
- "GROUP_NAME_TOO_LONG": GroupNameTooLongError,
3251
- "GROUP_NAME_EMPTY": GroupNameEmptyError,
3103
+ "GIT_ERROR": GitErrorError,
3104
+ "PARTITION_NOT_FOUND": PartitionNotFoundError,
3105
+ "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
3106
+ "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
3107
+ "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
3108
+ "VM_NOT_RUNNING": VmNotRunningError,
3109
+ "FILE_NOT_FOUND": FileNotFoundError,
3110
+ "FILES_BAD_REQUEST": FilesBadRequestError,
3111
+ "INVALID_GIT_REPO_SPEC_ERROR": InvalidGitRepoSpecErrorError,
3112
+ "INTERNAL_ERROR": InternalErrorError,
3113
+ "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
3114
+ "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
3252
3115
  "ACTIVE_TRANSACTION_ERROR": ActiveTransactionErrorError,
3253
3116
  "SWAP_VM_TAP": SwapVmTapError,
3254
- "INTERNAL_ERROR": InternalErrorError,
3255
3117
  "ROOTFS_COPY_ERROR": RootfsCopyErrorError,
3118
+ "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
3119
+ "DATABASE_ERROR": DatabaseErrorError,
3120
+ "INVALID_VM_ID": InvalidVmIdError,
3121
+ "VM_NOT_FOUND": VmNotFoundError,
3122
+ "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
3123
+ "BAD_REQUEST": BadRequestError,
3124
+ "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
3125
+ "SNAPSHOT_SETUP_FAILED": SnapshotSetupFailedError,
3126
+ "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
3127
+ "VM_DELETED": VmDeletedError,
3128
+ "NO_DEFAULT_SNAPSHOT_AVAILABLE": NoDefaultSnapshotAvailableError,
3256
3129
  "DOCKER_SNAPSHOT_FAILED": DockerSnapshotFailedError,
3257
3130
  "SET_DEFAULT_SNAPSHOT_FAILED": SetDefaultSnapshotFailedError,
3258
3131
  "SNAPSHOT_LAYER_CREATION_FAILED": SnapshotLayerCreationFailedError,
3259
3132
  "SNAPSHOT_DIR_NOT_FOUND": SnapshotDirNotFoundError,
3260
3133
  "SUBVOLUME_CREATION_FAILED": SubvolumeCreationFailedError,
3261
3134
  "GET_DEFAULT_SNAPSHOT_FAILED": GetDefaultSnapshotFailedError,
3262
- "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
3263
- "DATABASE_ERROR": DatabaseErrorError,
3264
- "PARTITION_NOT_FOUND": PartitionNotFoundError,
3265
- "INVALID_VM_ID": InvalidVmIdError,
3266
- "FILE_NOT_FOUND": FileNotFoundError,
3267
- "FILES_BAD_REQUEST": FilesBadRequestError,
3135
+ "SUSPEND_FAILED_AND_STOP_FAILED": SuspendFailedAndStopFailedError,
3136
+ "SUSPEND_FAILED_AND_STOPPED": SuspendFailedAndStoppedError,
3137
+ "SNAPSHOT_NOT_FOUND": SnapshotNotFoundError,
3268
3138
  "RESUMED_VM_NON_RESPONSIVE": ResumedVmNonResponsiveError,
3269
3139
  "SNAPSHOT_LOAD_TIMEOUT": SnapshotLoadTimeoutError,
3270
3140
  "UFFD_TIMEOUT_ERROR": UffdTimeoutErrorError,
3271
3141
  "KERNEL_PANIC": KernelPanicError,
3272
- "VM_DELETED": VmDeletedError,
3273
3142
  "REQWEST": ReqwestError,
3274
3143
  "FIRECRACKER_PID_NOT_FOUND": FirecrackerPidNotFoundError,
3275
3144
  "FIRECRACKER_API_SOCKET_NOT_FOUND": FirecrackerApiSocketNotFoundError,
@@ -3278,24 +3147,25 @@ const FREESTYLE_ERROR_CODE_MAP = {
3278
3147
  "VM_EXIT_DURING_START": VmExitDuringStartError,
3279
3148
  "VM_ACCESS_DENIED": VmAccessDeniedError,
3280
3149
  "STD_IO": StdIoError,
3281
- "VM_CREATE_TMUX_SESSION": VmCreateTmuxSessionError,
3150
+ "FAILED_TO_SPAWN_UFFD": FailedToSpawnUffdError,
3151
+ "VM_SPAWN_PROCESS": VmSpawnProcessError,
3282
3152
  "VM_SUBNET_NOT_FOUND": VmSubnetNotFoundError,
3283
- "INVALID_GIT_REPO_SPEC_ERROR": InvalidGitRepoSpecErrorError,
3284
- "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
3285
- "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
3286
- "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
3287
- "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
3288
- "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
3289
- "VM_NOT_RUNNING": VmNotRunningError,
3290
- "VM_NOT_FOUND": VmNotFoundError,
3291
- "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
3292
- "BAD_REQUEST": BadRequestError,
3293
- "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
3294
- "SNAPSHOT_SETUP_FAILED": SnapshotSetupFailedError,
3295
- "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
3296
- "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
3297
- "ALREADY_HAS_BASE": AlreadyHasBaseError,
3298
- "NOT_FOUND": NotFoundError,
3153
+ "USER_NOT_FOUND": UserNotFoundError,
3154
+ "USER_ALREADY_EXISTS": UserAlreadyExistsError,
3155
+ "VALIDATION_ERROR": ValidationErrorError,
3156
+ "GROUP_NOT_FOUND": GroupNotFoundError,
3157
+ "GROUP_ALREADY_EXISTS": GroupAlreadyExistsError,
3158
+ "DUPLICATE_USER_NAME": DuplicateUserNameError,
3159
+ "USER_GROUP_EMPTY": UserGroupEmptyError,
3160
+ "USER_SYSTEM_FLAG_MISMATCH": UserSystemFlagMismatchError,
3161
+ "USER_UID_OUT_OF_RANGE": UserUidOutOfRangeError,
3162
+ "USER_HOME_INVALID": UserHomeInvalidError,
3163
+ "USER_SHELL_INVALID": UserShellInvalidError,
3164
+ "DUPLICATE_GROUP_NAME": DuplicateGroupNameError,
3165
+ "GROUP_NAME_RESERVED": GroupNameReservedError,
3166
+ "GROUP_NAME_INVALID_CHARS": GroupNameInvalidCharsError,
3167
+ "GROUP_NAME_TOO_LONG": GroupNameTooLongError,
3168
+ "GROUP_NAME_EMPTY": GroupNameEmptyError,
3299
3169
  "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
3300
3170
  "VM_SETUP_FAILED": VmSetupFailedError,
3301
3171
  "WANTED_BY_EMPTY": WantedByEmptyError,
@@ -3324,45 +3194,67 @@ const FREESTYLE_ERROR_CODE_MAP = {
3324
3194
  "INVALID_PARAMETERS": InvalidParametersError,
3325
3195
  "MAX_USES_EXCEEDED": MaxUsesExceededError,
3326
3196
  "EXPIRED": ExpiredError,
3197
+ "FORBIDDEN": ForbiddenError,
3198
+ "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
3199
+ "TREE_NOT_FOUND": TreeNotFoundError,
3327
3200
  "BRANCH_NOT_FOUND": BranchNotFoundError,
3328
- "COMMIT_NOT_FOUND": CommitNotFoundError,
3329
3201
  "PARENT_NOT_FOUND": ParentNotFoundError,
3330
- "TREE_NOT_FOUND": TreeNotFoundError,
3331
3202
  "INVALID_SERVICE": InvalidServiceError,
3332
3203
  "EXPECTED_SERVICE": ExpectedServiceError,
3333
- "FORBIDDEN": ForbiddenError,
3204
+ "NOT_FOUND": NotFoundError,
3205
+ "SEND_ERROR": SendErrorError,
3334
3206
  "UNAUTHORIZED": UnauthorizedError,
3207
+ "INVALID_ACCOUNT_ID": InvalidAccountIdError,
3208
+ "SOURCE_IMPORT_CONFLICT": SourceImportConflictError,
3209
+ "SOURCE_UNAUTHORIZED": SourceUnauthorizedError,
3210
+ "SOURCE_NOT_FOUND": SourceNotFoundError,
3211
+ "IMPORT_SUBDIR_NOT_FOUND": ImportSubdirNotFoundError,
3335
3212
  "REPO_ALREADY_EXISTS": RepoAlreadyExistsError,
3336
- "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
3337
- "INVALID_OBJECT_ID": InvalidObjectIdError,
3338
- "PATH_NOT_FOUND": PathNotFoundError,
3339
- "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
3340
3213
  "TAG_NOT_FOUND": TagNotFoundError,
3341
- "INVALID_REVISION": InvalidRevisionError,
3342
- "BLOB_NOT_FOUND": BlobNotFoundError,
3343
- "AMBIGUOUS": AmbiguousError,
3344
- "INVALID": InvalidError,
3345
- "SEND_ERROR": SendErrorError,
3346
3214
  "INVALID_RANGE": InvalidRangeError,
3347
3215
  "OFFSET_WITH_SELECTOR": OffsetWithSelectorError,
3348
3216
  "COMMIT_NOT_IN_BRANCH": CommitNotInBranchError,
3217
+ "COMMIT_NOT_FOUND": CommitNotFoundError,
3349
3218
  "NO_DEFAULT_BRANCH": NoDefaultBranchError,
3350
3219
  "INVALID_BASE64_CONTENT": InvalidBase64ContentError,
3351
3220
  "INVALID_FILE_CHANGE": InvalidFileChangeError,
3352
3221
  "INVALID_FILE_PATH": InvalidFilePathError,
3353
3222
  "CONFLICTING_PARENT": ConflictingParentError,
3354
- "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
3223
+ "AMBIGUOUS": AmbiguousError,
3224
+ "INVALID": InvalidError,
3225
+ "PATH_NOT_FOUND": PathNotFoundError,
3226
+ "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
3227
+ "BLOB_NOT_FOUND": BlobNotFoundError,
3228
+ "PACKFILE": PackfileError,
3229
+ "INVALID_REVISION": InvalidRevisionError,
3355
3230
  "CONFLICT": ConflictError,
3356
3231
  "BRANCH_ALREADY_EXISTS": BranchAlreadyExistsError,
3357
- "PACKFILE": PackfileError,
3358
- "INVALID_ACCOUNT_ID": InvalidAccountIdError,
3359
- "SOURCE_IMPORT_CONFLICT": SourceImportConflictError,
3360
- "SOURCE_UNAUTHORIZED": SourceUnauthorizedError,
3361
- "SOURCE_NOT_FOUND": SourceNotFoundError,
3362
- "IMPORT_SUBDIR_NOT_FOUND": ImportSubdirNotFoundError,
3232
+ "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
3233
+ "INVALID_OBJECT_ID": InvalidObjectIdError,
3363
3234
  "UNAVAILABLE": UnavailableError,
3364
- "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
3365
- "BRANCH_NAME_EMPTY": BranchNameEmptyError,
3235
+ "SCHEDULE_NOT_FOUND": ScheduleNotFoundError,
3236
+ "SERVICE_UNAVAILABLE": ServiceUnavailableError,
3237
+ "PERMISSION_ALREADY_EXISTS": PermissionAlreadyExistsError,
3238
+ "LIST_TOKENS_FAILED": ListTokensFailedError,
3239
+ "REVOKE_TOKEN_FAILED": RevokeTokenFailedError,
3240
+ "CREATE_TOKEN_FAILED": CreateTokenFailedError,
3241
+ "LIST_PERMISSIONS_FAILED": ListPermissionsFailedError,
3242
+ "GET_PERMISSION_FAILED": GetPermissionFailedError,
3243
+ "UPDATE_PERMISSION_FAILED": UpdatePermissionFailedError,
3244
+ "REVOKE_PERMISSION_FAILED": RevokePermissionFailedError,
3245
+ "GRANT_PERMISSION_FAILED": GrantPermissionFailedError,
3246
+ "LIST_IDENTITIES_FAILED": ListIdentitiesFailedError,
3247
+ "DELETE_IDENTITY_FAILED": DeleteIdentityFailedError,
3248
+ "CREATE_IDENTITY_FAILED": CreateIdentityFailedError,
3249
+ "VM_PERMISSION_NOT_FOUND": VmPermissionNotFoundError,
3250
+ "PERMISSION_NOT_FOUND": PermissionNotFoundError,
3251
+ "GIT_REPOSITORY_ACCESS_DENIED": GitRepositoryAccessDeniedError,
3252
+ "GIT_REPOSITORY_NOT_FOUND": GitRepositoryNotFoundError,
3253
+ "CANNOT_DELETE_MANAGED_IDENTITY": CannotDeleteManagedIdentityError,
3254
+ "CANNOT_MODIFY_MANAGED_IDENTITY": CannotModifyManagedIdentityError,
3255
+ "IDENTITY_ACCESS_DENIED": IdentityAccessDeniedError,
3256
+ "IDENTITY_NOT_FOUND": IdentityNotFoundError,
3257
+ "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
3366
3258
  "BUILD_FAILED": BuildFailedError,
3367
3259
  "SERVER_DEPLOYMENT_FAILED": ServerDeploymentFailedError,
3368
3260
  "LOCKFILE_ERROR": LockfileErrorError,
@@ -3376,24 +3268,11 @@ const FREESTYLE_ERROR_CODE_MAP = {
3376
3268
  "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
3377
3269
  "DEPLOYMENT_LIMIT_EXCEEDED": DeploymentLimitExceededError,
3378
3270
  "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
3271
+ "RESIZE_FAILED": ResizeFailedError,
3272
+ "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
3273
+ "BRANCH_NAME_EMPTY": BranchNameEmptyError,
3379
3274
  "EXECUTE_LIMIT_EXCEEDED": ExecuteLimitExceededError,
3380
- "EMPTY_TAG": EmptyTagError,
3381
- "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
3382
- "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
3383
- "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
3384
- "RESTORE_FAILED": RestoreFailedError,
3385
- "CREATE_BACKUP_FAILED": CreateBackupFailedError,
3386
- "BACKUP_FAILED": BackupFailedError,
3387
- "DEPLOYMENT_FAILED": DeploymentFailedError,
3388
- "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
3389
- "PROJECT_NOT_FOUND": ProjectNotFoundError,
3390
- "ACCESS_DENIED": AccessDeniedError,
3391
- "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
3392
- "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
3393
- "PARSE_LOGS_FAILED": ParseLogsFailedError,
3394
- "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
3395
- "INVALID_QUERY": InvalidQueryError,
3396
- "LOGS_NOT_FOUND": LogsNotFoundError,
3275
+ "VM_LIMIT_EXCEEDED": VmLimitExceededError,
3397
3276
  "TRIGGER_ERROR": TriggerErrorError,
3398
3277
  "TOKEN_ERROR": TokenErrorError,
3399
3278
  "PERMISSION_ERROR": PermissionErrorError,
@@ -3413,20 +3292,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
3413
3292
  "SERIALIZATION_ERROR": SerializationErrorError,
3414
3293
  "GIT_INVALID_REQUEST": GitInvalidRequestError,
3415
3294
  "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
3416
- "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
3417
- "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
3418
- "LIST_RUNS_FAILED": ListRunsFailedError,
3419
- "EXECUTION_ERROR": ExecutionErrorError,
3420
- "CONNECTION_FAILED": ConnectionFailedError,
3421
- "METADATA_WRITE_FAILED": MetadataWriteFailedError,
3422
- "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
3423
- "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
3424
- "LOCK_GENERATION_FAILED": LockGenerationFailedError,
3425
- "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
3426
- "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
3427
- "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
3428
- "LOGGING_FAILED": LoggingFailedError,
3429
- "RUN_NOT_FOUND": RunNotFoundError,
3430
3295
  "DOMAIN_OWNERSHIP_NOT_VERIFIED": DomainOwnershipNotVerifiedError,
3431
3296
  "VM_ACCESS_DENIED_FOR_MAPPING": VmAccessDeniedForMappingError,
3432
3297
  "DEPLOYMENT_ACCESS_DENIED": DeploymentAccessDeniedError,
@@ -3437,32 +3302,22 @@ const FREESTYLE_ERROR_CODE_MAP = {
3437
3302
  "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
3438
3303
  "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
3439
3304
  "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
3440
- "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
3305
+ "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
3306
+ "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
3307
+ "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
3308
+ "ERROR_CREATING_RECORD": ErrorCreatingRecordError,
3309
+ "DOMAIN_OWNERSHIP_ERROR": DomainOwnershipErrorError,
3310
+ "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
3311
+ "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
3312
+ "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
3313
+ "RESTORE_FAILED": RestoreFailedError,
3314
+ "CREATE_BACKUP_FAILED": CreateBackupFailedError,
3315
+ "BACKUP_FAILED": BackupFailedError,
3316
+ "DEPLOYMENT_FAILED": DeploymentFailedError,
3317
+ "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
3318
+ "PROJECT_NOT_FOUND": ProjectNotFoundError,
3441
3319
  "GIT_REPO_LIMIT_EXCEEDED": GitRepoLimitExceededError,
3442
- "SCHEDULE_NOT_FOUND": ScheduleNotFoundError,
3443
- "SERVICE_UNAVAILABLE": ServiceUnavailableError,
3444
- "RESIZE_FAILED": ResizeFailedError,
3445
- "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
3446
- "PERMISSION_ALREADY_EXISTS": PermissionAlreadyExistsError,
3447
- "LIST_TOKENS_FAILED": ListTokensFailedError,
3448
- "REVOKE_TOKEN_FAILED": RevokeTokenFailedError,
3449
- "CREATE_TOKEN_FAILED": CreateTokenFailedError,
3450
- "LIST_PERMISSIONS_FAILED": ListPermissionsFailedError,
3451
- "GET_PERMISSION_FAILED": GetPermissionFailedError,
3452
- "UPDATE_PERMISSION_FAILED": UpdatePermissionFailedError,
3453
- "REVOKE_PERMISSION_FAILED": RevokePermissionFailedError,
3454
- "GRANT_PERMISSION_FAILED": GrantPermissionFailedError,
3455
- "LIST_IDENTITIES_FAILED": ListIdentitiesFailedError,
3456
- "DELETE_IDENTITY_FAILED": DeleteIdentityFailedError,
3457
- "CREATE_IDENTITY_FAILED": CreateIdentityFailedError,
3458
- "VM_PERMISSION_NOT_FOUND": VmPermissionNotFoundError,
3459
- "PERMISSION_NOT_FOUND": PermissionNotFoundError,
3460
- "GIT_REPOSITORY_ACCESS_DENIED": GitRepositoryAccessDeniedError,
3461
- "GIT_REPOSITORY_NOT_FOUND": GitRepositoryNotFoundError,
3462
- "CANNOT_DELETE_MANAGED_IDENTITY": CannotDeleteManagedIdentityError,
3463
- "CANNOT_MODIFY_MANAGED_IDENTITY": CannotModifyManagedIdentityError,
3464
- "IDENTITY_ACCESS_DENIED": IdentityAccessDeniedError,
3465
- "IDENTITY_NOT_FOUND": IdentityNotFoundError,
3320
+ "EMPTY_TAG": EmptyTagError,
3466
3321
  "LIMIT_EXCEEDED": LimitExceededError,
3467
3322
  "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
3468
3323
  "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
@@ -3476,25 +3331,27 @@ const FREESTYLE_ERROR_CODE_MAP = {
3476
3331
  "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
3477
3332
  "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
3478
3333
  "INVALID_DOMAIN": InvalidDomainError,
3479
- "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
3480
- "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
3481
- "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
3482
- "ERROR_CREATING_RECORD": ErrorCreatingRecordError,
3483
- "DOMAIN_OWNERSHIP_ERROR": DomainOwnershipErrorError,
3484
- "VM_LIMIT_EXCEEDED": VmLimitExceededError,
3485
- "BROWSER_OPERATION_FAILED": BrowserOperationFailedError,
3486
- "WATCH_FILES_FAILED": WatchFilesFailedError,
3487
- "LOGS_FAILED": LogsFailedError,
3488
- "STATUS_FAILED": StatusFailedError,
3489
- "RESTART_FAILED": RestartFailedError,
3490
- "SHUTDOWN_FAILED": ShutdownFailedError,
3491
- "COMMIT_FAILED": CommitFailedError,
3492
- "WRITE_FILE_FAILED": WriteFileFailedError,
3493
- "READ_FILE_FAILED": ReadFileFailedError,
3494
- "EXECUTION_FAILED": ExecutionFailedError,
3495
- "REQUEST_FAILED": RequestFailedError,
3496
- "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
3497
- "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError
3334
+ "ACCESS_DENIED": AccessDeniedError,
3335
+ "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
3336
+ "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
3337
+ "PARSE_LOGS_FAILED": ParseLogsFailedError,
3338
+ "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
3339
+ "INVALID_QUERY": InvalidQueryError,
3340
+ "LOGS_NOT_FOUND": LogsNotFoundError,
3341
+ "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
3342
+ "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
3343
+ "LIST_RUNS_FAILED": ListRunsFailedError,
3344
+ "EXECUTION_ERROR": ExecutionErrorError,
3345
+ "CONNECTION_FAILED": ConnectionFailedError,
3346
+ "METADATA_WRITE_FAILED": MetadataWriteFailedError,
3347
+ "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
3348
+ "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
3349
+ "LOCK_GENERATION_FAILED": LockGenerationFailedError,
3350
+ "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
3351
+ "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
3352
+ "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
3353
+ "LOGGING_FAILED": LoggingFailedError,
3354
+ "RUN_NOT_FOUND": RunNotFoundError
3498
3355
  };
3499
3356
 
3500
3357
  var errors = /*#__PURE__*/Object.freeze({
@@ -3502,7 +3359,6 @@ var errors = /*#__PURE__*/Object.freeze({
3502
3359
  AccessDeniedError: AccessDeniedError,
3503
3360
  ActiveTransactionErrorError: ActiveTransactionErrorError,
3504
3361
  AfterArrayContainsEmptyError: AfterArrayContainsEmptyError,
3505
- AlreadyHasBaseError: AlreadyHasBaseError,
3506
3362
  AmbiguousError: AmbiguousError,
3507
3363
  BackupFailedError: BackupFailedError,
3508
3364
  BadHeaderError: BadHeaderError,
@@ -3515,7 +3371,6 @@ var errors = /*#__PURE__*/Object.freeze({
3515
3371
  BranchAlreadyExistsError: BranchAlreadyExistsError,
3516
3372
  BranchNameEmptyError: BranchNameEmptyError,
3517
3373
  BranchNotFoundError: BranchNotFoundError,
3518
- BrowserOperationFailedError: BrowserOperationFailedError,
3519
3374
  BuildFailedError: BuildFailedError,
3520
3375
  CannotDeleteManagedIdentityError: CannotDeleteManagedIdentityError,
3521
3376
  CannotModifyManagedIdentityError: CannotModifyManagedIdentityError,
@@ -3523,7 +3378,6 @@ var errors = /*#__PURE__*/Object.freeze({
3523
3378
  CloudstateAccessDeniedError: CloudstateAccessDeniedError,
3524
3379
  CloudstateDatabaseErrorError: CloudstateDatabaseErrorError,
3525
3380
  CloudstateInternalErrorError: CloudstateInternalErrorError,
3526
- CommitFailedError: CommitFailedError,
3527
3381
  CommitNotFoundError: CommitNotFoundError,
3528
3382
  CommitNotInBranchError: CommitNotInBranchError,
3529
3383
  ConflictError: ConflictError,
@@ -3543,9 +3397,6 @@ var errors = /*#__PURE__*/Object.freeze({
3543
3397
  DeploymentFailedError: DeploymentFailedError,
3544
3398
  DeploymentLimitExceededError: DeploymentLimitExceededError,
3545
3399
  DeploymentNotFoundError: DeploymentNotFoundError,
3546
- DevServerFileNotFoundError: DevServerFileNotFoundError,
3547
- DevServerInvalidRequestError: DevServerInvalidRequestError,
3548
- DevServerNotFoundError: DevServerNotFoundError,
3549
3400
  DirectoryCreationFailedError: DirectoryCreationFailedError,
3550
3401
  DockerSnapshotFailedError: DockerSnapshotFailedError,
3551
3402
  DomainAlreadyExistsError: DomainAlreadyExistsError,
@@ -3567,7 +3418,6 @@ var errors = /*#__PURE__*/Object.freeze({
3567
3418
  ExecuteInternalErrorError: ExecuteInternalErrorError,
3568
3419
  ExecuteLimitExceededError: ExecuteLimitExceededError,
3569
3420
  ExecutionErrorError: ExecutionErrorError,
3570
- ExecutionFailedError: ExecutionFailedError,
3571
3421
  ExpectedServiceError: ExpectedServiceError,
3572
3422
  ExpiredError: ExpiredError,
3573
3423
  FREESTYLE_ERROR_CODE_MAP: FREESTYLE_ERROR_CODE_MAP,
@@ -3584,6 +3434,7 @@ var errors = /*#__PURE__*/Object.freeze({
3584
3434
  FailedToListVerificationsError: FailedToListVerificationsError,
3585
3435
  FailedToProvisionCertificateError: FailedToProvisionCertificateError,
3586
3436
  FailedToProvisionCertificateForMappingError: FailedToProvisionCertificateForMappingError,
3437
+ FailedToSpawnUffdError: FailedToSpawnUffdError,
3587
3438
  FailedToVerifyDomainError: FailedToVerifyDomainError,
3588
3439
  FileNotFoundError: FileNotFoundError,
3589
3440
  FilesBadRequestError: FilesBadRequestError,
@@ -3649,12 +3500,12 @@ var errors = /*#__PURE__*/Object.freeze({
3649
3500
  LockGenerationFailedError: LockGenerationFailedError,
3650
3501
  LockfileErrorError: LockfileErrorError,
3651
3502
  LoggingFailedError: LoggingFailedError,
3652
- LogsFailedError: LogsFailedError,
3653
3503
  LogsNotFoundError: LogsNotFoundError,
3654
3504
  MaxUsesExceededError: MaxUsesExceededError,
3655
3505
  MetadataWriteFailedError: MetadataWriteFailedError,
3656
3506
  NetworkPermissionsFailedError: NetworkPermissionsFailedError,
3657
3507
  NoDefaultBranchError: NoDefaultBranchError,
3508
+ NoDefaultSnapshotAvailableError: NoDefaultSnapshotAvailableError,
3658
3509
  NoDomainOwnershipError: NoDomainOwnershipError,
3659
3510
  NoEntrypointFoundError: NoEntrypointFoundError,
3660
3511
  NodeModulesDownloadFailedError: NodeModulesDownloadFailedError,
@@ -3675,18 +3526,15 @@ var errors = /*#__PURE__*/Object.freeze({
3675
3526
  PermissionErrorError: PermissionErrorError,
3676
3527
  PermissionNotFoundError: PermissionNotFoundError,
3677
3528
  ProjectNotFoundError: ProjectNotFoundError,
3678
- ReadFileFailedError: ReadFileFailedError,
3679
3529
  RecordOwnershipErrorError: RecordOwnershipErrorError,
3680
3530
  ReferenceNotFoundError: ReferenceNotFoundError,
3681
3531
  RepoAlreadyExistsError: RepoAlreadyExistsError,
3682
3532
  RepoNotFoundError: RepoNotFoundError,
3683
3533
  RepositoryAccessDeniedError: RepositoryAccessDeniedError,
3684
3534
  RepositoryNotFoundError: RepositoryNotFoundError,
3685
- RequestFailedError: RequestFailedError,
3686
3535
  RequiresArrayContainsEmptyError: RequiresArrayContainsEmptyError,
3687
3536
  ReqwestError: ReqwestError,
3688
3537
  ResizeFailedError: ResizeFailedError,
3689
- RestartFailedError: RestartFailedError,
3690
3538
  RestoreFailedError: RestoreFailedError,
3691
3539
  ResumedVmNonResponsiveError: ResumedVmNonResponsiveError,
3692
3540
  RetrieveLogsFailedError: RetrieveLogsFailedError,
@@ -3707,19 +3555,20 @@ var errors = /*#__PURE__*/Object.freeze({
3707
3555
  ServiceNotFoundError: ServiceNotFoundError,
3708
3556
  ServiceUnavailableError: ServiceUnavailableError,
3709
3557
  SetDefaultSnapshotFailedError: SetDefaultSnapshotFailedError,
3710
- ShutdownFailedError: ShutdownFailedError,
3711
3558
  SigningError: SigningError,
3712
3559
  SnapshotDirNotFoundError: SnapshotDirNotFoundError,
3713
3560
  SnapshotLayerCreationFailedError: SnapshotLayerCreationFailedError,
3714
3561
  SnapshotLoadTimeoutError: SnapshotLoadTimeoutError,
3562
+ SnapshotNotFoundError: SnapshotNotFoundError,
3715
3563
  SnapshotSetupFailedError: SnapshotSetupFailedError,
3716
3564
  SnapshotVmBadRequestError: SnapshotVmBadRequestError,
3717
3565
  SourceImportConflictError: SourceImportConflictError,
3718
3566
  SourceNotFoundError: SourceNotFoundError,
3719
3567
  SourceUnauthorizedError: SourceUnauthorizedError,
3720
- StatusFailedError: StatusFailedError,
3721
3568
  StdIoError: StdIoError,
3722
3569
  SubvolumeCreationFailedError: SubvolumeCreationFailedError,
3570
+ SuspendFailedAndStopFailedError: SuspendFailedAndStopFailedError,
3571
+ SuspendFailedAndStoppedError: SuspendFailedAndStoppedError,
3723
3572
  SwapVmTapError: SwapVmTapError,
3724
3573
  SyntaxErrorError: SyntaxErrorError,
3725
3574
  TagNotFoundError: TagNotFoundError,
@@ -3747,11 +3596,9 @@ var errors = /*#__PURE__*/Object.freeze({
3747
3596
  VerificationNotFoundError: VerificationNotFoundError,
3748
3597
  VmAccessDeniedError: VmAccessDeniedError,
3749
3598
  VmAccessDeniedForMappingError: VmAccessDeniedForMappingError,
3750
- VmCreateTmuxSessionError: VmCreateTmuxSessionError,
3751
3599
  VmDeletedError: VmDeletedError,
3752
3600
  VmExitDuringStartError: VmExitDuringStartError,
3753
3601
  VmLimitExceededError: VmLimitExceededError,
3754
- VmMustBeStoppedError: VmMustBeStoppedError,
3755
3602
  VmNotFoundError: VmNotFoundError,
3756
3603
  VmNotFoundInFsError: VmNotFoundInFsError,
3757
3604
  VmNotInTransactionError: VmNotInTransactionError,
@@ -3759,14 +3606,13 @@ var errors = /*#__PURE__*/Object.freeze({
3759
3606
  VmOperationDeniedDuringTransactionError: VmOperationDeniedDuringTransactionError,
3760
3607
  VmPermissionNotFoundError: VmPermissionNotFoundError,
3761
3608
  VmSetupFailedError: VmSetupFailedError,
3609
+ VmSpawnProcessError: VmSpawnProcessError,
3762
3610
  VmStartTimeoutError: VmStartTimeoutError,
3763
3611
  VmSubnetNotFoundError: VmSubnetNotFoundError,
3764
3612
  VmTransactionIdMismatchError: VmTransactionIdMismatchError,
3765
3613
  WantedByEmptyError: WantedByEmptyError,
3766
- WatchFilesFailedError: WatchFilesFailedError,
3767
3614
  WebDeploymentBadRequestError: WebDeploymentBadRequestError,
3768
3615
  WorkdirEmptyError: WorkdirEmptyError,
3769
- WriteFileFailedError: WriteFileFailedError,
3770
3616
  WriteScriptFailedError: WriteScriptFailedError,
3771
3617
  errorFromJSON: errorFromJSON
3772
3618
  });
@@ -5303,8 +5149,8 @@ class FileSystem {
5303
5149
  headers: linuxUsernameHeader(this.vm?._linux_username)
5304
5150
  });
5305
5151
  if (response && typeof response === "object" && "content" in response) {
5306
- const content = response.content;
5307
- return Buffer.from(content, "utf-8");
5152
+ const { content, encoding } = response;
5153
+ return Buffer.from(content, encoding === "base64" ? "base64" : "utf-8");
5308
5154
  }
5309
5155
  throw new Error("Unexpected response format from VM file read");
5310
5156
  }
@@ -5314,10 +5160,12 @@ class FileSystem {
5314
5160
  * @param content Buffer containing the content to write
5315
5161
  */
5316
5162
  async writeFile(filepath, content) {
5317
- const textContent = content.toString("utf-8");
5318
5163
  await this.client.put("/v1/vms/{vm_id}/files/{filepath}", {
5319
5164
  params: { vm_id: this.vmId, filepath },
5320
- body: { content: textContent },
5165
+ body: {
5166
+ content: content.toString("base64"),
5167
+ encoding: "base64"
5168
+ },
5321
5169
  headers: linuxUsernameHeader(this.vm?._linux_username)
5322
5170
  });
5323
5171
  }