freestyle-sandboxes 0.1.21 → 0.1.23

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 (7) hide show
  1. package/README.md +17 -0
  2. package/cli.mjs +453 -31
  3. package/index.cjs +1662 -1328
  4. package/index.d.cts +1835 -1043
  5. package/index.d.mts +1835 -1043
  6. package/index.mjs +1662 -1328
  7. package/package.json +3 -2
package/index.cjs CHANGED
@@ -82,41 +82,29 @@ class BadKeyError extends Error {
82
82
  static statusCode = 400;
83
83
  static description = `invalid key length`;
84
84
  }
85
- class ActiveTransactionErrorError extends Error {
86
- constructor(body) {
87
- super(
88
- `ACTIVE_TRANSACTION_ERROR: ${body.message}`
89
- );
90
- this.body = body;
91
- this.name = "ActiveTransactionErrorError";
92
- }
93
- static code = "ACTIVE_TRANSACTION_ERROR";
94
- static statusCode = 500;
95
- static description = `Active transaction error: {details}`;
96
- }
97
- class InternalErrorError extends Error {
85
+ class FileNotFoundError extends Error {
98
86
  constructor(body) {
99
87
  super(
100
- `INTERNAL_ERROR: ${body.message}`
88
+ `FILE_NOT_FOUND: ${body.message}`
101
89
  );
102
90
  this.body = body;
103
- this.name = "InternalErrorError";
91
+ this.name = "FileNotFoundError";
104
92
  }
105
- static code = "INTERNAL_ERROR";
106
- static statusCode = 500;
107
- static description = `Fork failed: {message}`;
93
+ static code = "FILE_NOT_FOUND";
94
+ static statusCode = 404;
95
+ static description = `File not found: {path}`;
108
96
  }
109
- class RootfsCopyErrorError extends Error {
97
+ class FilesBadRequestError extends Error {
110
98
  constructor(body) {
111
99
  super(
112
- `ROOTFS_COPY_ERROR: ${body.message}`
100
+ `FILES_BAD_REQUEST: ${body.message}`
113
101
  );
114
102
  this.body = body;
115
- this.name = "RootfsCopyErrorError";
103
+ this.name = "FilesBadRequestError";
116
104
  }
117
- static code = "ROOTFS_COPY_ERROR";
118
- static statusCode = 500;
119
- static description = `Failed to copy rootfs from {from} to {to}: {details}`;
105
+ static code = "FILES_BAD_REQUEST";
106
+ static statusCode = 400;
107
+ static description = `Bad request: {message}`;
120
108
  }
121
109
  class VmNotFoundInFsError extends Error {
122
110
  constructor(body) {
@@ -130,65 +118,77 @@ class VmNotFoundInFsError extends Error {
130
118
  static statusCode = 406;
131
119
  static description = `Vm Not found in filesystem`;
132
120
  }
133
- class VmNotRunningError extends Error {
121
+ class DatabaseErrorError extends Error {
134
122
  constructor(body) {
135
123
  super(
136
- `VM_NOT_RUNNING: ${body.message}`
124
+ `DATABASE_ERROR: ${body.message}`
137
125
  );
138
126
  this.body = body;
139
- this.name = "VmNotRunningError";
127
+ this.name = "DatabaseErrorError";
140
128
  }
141
- static code = "VM_NOT_RUNNING";
142
- static statusCode = 400;
143
- static description = `VM is not running: {vm_id}`;
129
+ static code = "DATABASE_ERROR";
130
+ static statusCode = 500;
131
+ static description = `Database error occurred while constructing VmRecord, details: {details}`;
144
132
  }
145
- class VmNotFoundError extends Error {
133
+ class PartitionNotFoundError extends Error {
146
134
  constructor(body) {
147
135
  super(
148
- `VM_NOT_FOUND: ${body.message}`
136
+ `PARTITION_NOT_FOUND: ${body.message}`
149
137
  );
150
138
  this.body = body;
151
- this.name = "VmNotFoundError";
139
+ this.name = "PartitionNotFoundError";
152
140
  }
153
- static code = "VM_NOT_FOUND";
141
+ static code = "PARTITION_NOT_FOUND";
154
142
  static statusCode = 404;
155
- static description = `VM not found: {vm_id}`;
143
+ static description = `Partition not found: {partition_id}`;
156
144
  }
157
- class InternalForkVmNotFoundError extends Error {
145
+ class InvalidVmIdError extends Error {
158
146
  constructor(body) {
159
147
  super(
160
- `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
148
+ `INVALID_VM_ID: ${body.message}`
161
149
  );
162
150
  this.body = body;
163
- this.name = "InternalForkVmNotFoundError";
151
+ this.name = "InvalidVmIdError";
164
152
  }
165
- static code = "INTERNAL_FORK_VM_NOT_FOUND";
166
- static statusCode = 404;
167
- static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
153
+ static code = "INVALID_VM_ID";
154
+ static statusCode = 400;
155
+ static description = `Invalid VM ID: {vm_id}, details: {details}`;
168
156
  }
169
- class BadRequestError extends Error {
157
+ class VmMustBeStoppedError extends Error {
170
158
  constructor(body) {
171
159
  super(
172
- `BAD_REQUEST: ${body.message}`
160
+ `VM_MUST_BE_STOPPED: ${body.message}`
173
161
  );
174
162
  this.body = body;
175
- this.name = "BadRequestError";
163
+ this.name = "VmMustBeStoppedError";
176
164
  }
177
- static code = "BAD_REQUEST";
165
+ static code = "VM_MUST_BE_STOPPED";
178
166
  static statusCode = 400;
179
- static description = `Bad request: {message}`;
167
+ static description = `VM must be stopped before converting to base`;
180
168
  }
181
- class InternalVmNotFoundError extends Error {
169
+ class AlreadyHasBaseError extends Error {
182
170
  constructor(body) {
183
171
  super(
184
- `INTERNAL_VM_NOT_FOUND: ${body.message}`
172
+ `ALREADY_HAS_BASE: ${body.message}`
185
173
  );
186
174
  this.body = body;
187
- this.name = "InternalVmNotFoundError";
175
+ this.name = "AlreadyHasBaseError";
188
176
  }
189
- static code = "INTERNAL_VM_NOT_FOUND";
177
+ static code = "ALREADY_HAS_BASE";
178
+ static statusCode = 400;
179
+ static description = `VM already has a base rootfs`;
180
+ }
181
+ class NotFoundError extends Error {
182
+ constructor(body) {
183
+ super(
184
+ `NOT_FOUND: ${body.message}`
185
+ );
186
+ this.body = body;
187
+ this.name = "NotFoundError";
188
+ }
189
+ static code = "NOT_FOUND";
190
190
  static statusCode = 404;
191
- static description = `VM not found: {vm_id}`;
191
+ static description = `VM not found`;
192
192
  }
193
193
  class SnapshotSetupFailedError extends Error {
194
194
  constructor(body) {
@@ -214,545 +214,545 @@ class SnapshotVmBadRequestError extends Error {
214
214
  static statusCode = 400;
215
215
  static description = `Bad request: {message}`;
216
216
  }
217
- class ResumedVmNonResponsiveError extends Error {
217
+ class UserNotFoundError extends Error {
218
218
  constructor(body) {
219
219
  super(
220
- `RESUMED_VM_NON_RESPONSIVE: ${body.message}`
220
+ `USER_NOT_FOUND: ${body.message}`
221
221
  );
222
222
  this.body = body;
223
- this.name = "ResumedVmNonResponsiveError";
223
+ this.name = "UserNotFoundError";
224
224
  }
225
- static code = "RESUMED_VM_NON_RESPONSIVE";
226
- static statusCode = 500;
227
- static description = `Resumed VM {vm_id} is not responsive after {timeout_seconds}s`;
225
+ static code = "USER_NOT_FOUND";
226
+ static statusCode = 404;
227
+ static description = `User not found: {user_name}`;
228
228
  }
229
- class SnapshotLoadTimeoutError extends Error {
229
+ class UserAlreadyExistsError extends Error {
230
230
  constructor(body) {
231
231
  super(
232
- `SNAPSHOT_LOAD_TIMEOUT: ${body.message}`
232
+ `USER_ALREADY_EXISTS: ${body.message}`
233
233
  );
234
234
  this.body = body;
235
- this.name = "SnapshotLoadTimeoutError";
235
+ this.name = "UserAlreadyExistsError";
236
236
  }
237
- static code = "SNAPSHOT_LOAD_TIMEOUT";
238
- static statusCode = 500;
239
- static description = `Snapshot load timed out after {elapsed_seconds}s for instance {vm_instance_id}, logs: {log_path}`;
237
+ static code = "USER_ALREADY_EXISTS";
238
+ static statusCode = 409;
239
+ static description = `Conflict: User '{user_name}' already exists`;
240
240
  }
241
- class UffdTimeoutErrorError extends Error {
241
+ class ValidationErrorError extends Error {
242
242
  constructor(body) {
243
243
  super(
244
- `UFFD_TIMEOUT_ERROR: ${body.message}`
244
+ `VALIDATION_ERROR: ${body.message}`
245
245
  );
246
246
  this.body = body;
247
- this.name = "UffdTimeoutErrorError";
247
+ this.name = "ValidationErrorError";
248
248
  }
249
- static code = "UFFD_TIMEOUT_ERROR";
250
- static statusCode = 500;
251
- static description = `UFFD socket timeout: {report_socket_path}, logs: {log_path}`;
249
+ static code = "VALIDATION_ERROR";
250
+ static statusCode = 400;
251
+ static description = `Validation error: {message}`;
252
252
  }
253
- class KernelPanicError extends Error {
253
+ class GroupNotFoundError extends Error {
254
254
  constructor(body) {
255
255
  super(
256
- `KERNEL_PANIC: ${body.message}`
256
+ `GROUP_NOT_FOUND: ${body.message}`
257
257
  );
258
258
  this.body = body;
259
- this.name = "KernelPanicError";
259
+ this.name = "GroupNotFoundError";
260
260
  }
261
- static code = "KERNEL_PANIC";
262
- static statusCode = 500;
263
- static description = `VM kernel panic detected`;
261
+ static code = "GROUP_NOT_FOUND";
262
+ static statusCode = 404;
263
+ static description = `Group not found: {group_name}`;
264
264
  }
265
- class VmDeletedError extends Error {
265
+ class GroupAlreadyExistsError extends Error {
266
266
  constructor(body) {
267
267
  super(
268
- `VM_DELETED: ${body.message}`
268
+ `GROUP_ALREADY_EXISTS: ${body.message}`
269
269
  );
270
270
  this.body = body;
271
- this.name = "VmDeletedError";
271
+ this.name = "GroupAlreadyExistsError";
272
272
  }
273
- static code = "VM_DELETED";
274
- static statusCode = 410;
275
- static description = `Cannot start VM: VM files have been deleted. This VM was ephemeral and its files were removed.`;
273
+ static code = "GROUP_ALREADY_EXISTS";
274
+ static statusCode = 409;
275
+ static description = `Conflict: Group '{group_name}' already exists`;
276
276
  }
277
- class ReqwestError extends Error {
277
+ class DuplicateUserNameError extends Error {
278
278
  constructor(body) {
279
279
  super(
280
- `REQWEST: ${body.message}`
280
+ `DUPLICATE_USER_NAME: ${body.message}`
281
281
  );
282
282
  this.body = body;
283
- this.name = "ReqwestError";
283
+ this.name = "DuplicateUserNameError";
284
284
  }
285
- static code = "REQWEST";
286
- static statusCode = 500;
287
- static description = `Reqwest error: {details}`;
285
+ static code = "DUPLICATE_USER_NAME";
286
+ static statusCode = 400;
287
+ static description = `Duplicate user name '{name}' found`;
288
288
  }
289
- class FirecrackerPidNotFoundError extends Error {
289
+ class UserGroupEmptyError extends Error {
290
290
  constructor(body) {
291
291
  super(
292
- `FIRECRACKER_PID_NOT_FOUND: ${body.message}`
292
+ `USER_GROUP_EMPTY: ${body.message}`
293
293
  );
294
294
  this.body = body;
295
- this.name = "FirecrackerPidNotFoundError";
295
+ this.name = "UserGroupEmptyError";
296
296
  }
297
- static code = "FIRECRACKER_PID_NOT_FOUND";
298
- static statusCode = 500;
299
- static description = `Firecracker PID not found`;
297
+ static code = "USER_GROUP_EMPTY";
298
+ static statusCode = 400;
299
+ static description = `User '{user}' has empty string in groups`;
300
300
  }
301
- class FirecrackerApiSocketNotFoundError extends Error {
301
+ class UserSystemFlagMismatchError extends Error {
302
302
  constructor(body) {
303
303
  super(
304
- `FIRECRACKER_API_SOCKET_NOT_FOUND: ${body.message}`
304
+ `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
305
305
  );
306
306
  this.body = body;
307
- this.name = "FirecrackerApiSocketNotFoundError";
307
+ this.name = "UserSystemFlagMismatchError";
308
308
  }
309
- static code = "FIRECRACKER_API_SOCKET_NOT_FOUND";
310
- static statusCode = 500;
311
- static description = `Firecracker API socket not found`;
309
+ static code = "USER_SYSTEM_FLAG_MISMATCH";
310
+ static statusCode = 400;
311
+ static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
312
312
  }
313
- class InvalidSnapshotIdError extends Error {
313
+ class UserUidOutOfRangeError extends Error {
314
314
  constructor(body) {
315
315
  super(
316
- `INVALID_SNAPSHOT_ID: ${body.message}`
316
+ `USER_UID_OUT_OF_RANGE: ${body.message}`
317
317
  );
318
318
  this.body = body;
319
- this.name = "InvalidSnapshotIdError";
319
+ this.name = "UserUidOutOfRangeError";
320
320
  }
321
- static code = "INVALID_SNAPSHOT_ID";
321
+ static code = "USER_UID_OUT_OF_RANGE";
322
322
  static statusCode = 400;
323
- static description = `Invalid snapshot id: {id}`;
323
+ static description = `User '{user}' has invalid UID {uid} (must be 0-65535)`;
324
324
  }
325
- class VmStartTimeoutError extends Error {
325
+ class UserHomeInvalidError extends Error {
326
326
  constructor(body) {
327
327
  super(
328
- `VM_START_TIMEOUT: ${body.message}`
328
+ `USER_HOME_INVALID: ${body.message}`
329
329
  );
330
330
  this.body = body;
331
- this.name = "VmStartTimeoutError";
331
+ this.name = "UserHomeInvalidError";
332
332
  }
333
- static code = "VM_START_TIMEOUT";
334
- static statusCode = 504;
335
- static description = `VM did not become ready within the specified timeout`;
333
+ static code = "USER_HOME_INVALID";
334
+ static statusCode = 400;
335
+ static description = `User '{user}' has invalid home path '{home}' (must be absolute path starting with /)`;
336
336
  }
337
- class VmExitDuringStartError extends Error {
337
+ class UserShellInvalidError extends Error {
338
338
  constructor(body) {
339
339
  super(
340
- `VM_EXIT_DURING_START: ${body.message}`
340
+ `USER_SHELL_INVALID: ${body.message}`
341
341
  );
342
342
  this.body = body;
343
- this.name = "VmExitDuringStartError";
343
+ this.name = "UserShellInvalidError";
344
344
  }
345
- static code = "VM_EXIT_DURING_START";
346
- static statusCode = 500;
347
- static description = `VM process exited unexpectedly during start`;
345
+ static code = "USER_SHELL_INVALID";
346
+ static statusCode = 400;
347
+ static description = `User '{user}' has invalid shell path '{shell}' (must be absolute path starting with /)`;
348
348
  }
349
- class VmAccessDeniedError extends Error {
349
+ class DuplicateGroupNameError extends Error {
350
350
  constructor(body) {
351
351
  super(
352
- `VM_ACCESS_DENIED: ${body.message}`
352
+ `DUPLICATE_GROUP_NAME: ${body.message}`
353
353
  );
354
354
  this.body = body;
355
- this.name = "VmAccessDeniedError";
355
+ this.name = "DuplicateGroupNameError";
356
356
  }
357
- static code = "VM_ACCESS_DENIED";
358
- static statusCode = 403;
359
- static description = `You do not have access to this VM`;
357
+ static code = "DUPLICATE_GROUP_NAME";
358
+ static statusCode = 400;
359
+ static description = `Duplicate group name '{name}' found`;
360
360
  }
361
- class StdIoError extends Error {
361
+ class GroupNameReservedError extends Error {
362
362
  constructor(body) {
363
363
  super(
364
- `STD_IO: ${body.message}`
364
+ `GROUP_NAME_RESERVED: ${body.message}`
365
365
  );
366
366
  this.body = body;
367
- this.name = "StdIoError";
367
+ this.name = "GroupNameReservedError";
368
368
  }
369
- static code = "STD_IO";
370
- static statusCode = 500;
371
- static description = `Standard IO error`;
369
+ static code = "GROUP_NAME_RESERVED";
370
+ static statusCode = 400;
371
+ static description = `Group name '{name}' is reserved and cannot be used`;
372
372
  }
373
- class VmCreateTmuxSessionError extends Error {
373
+ class GroupNameInvalidCharsError extends Error {
374
374
  constructor(body) {
375
375
  super(
376
- `VM_CREATE_TMUX_SESSION: ${body.message}`
376
+ `GROUP_NAME_INVALID_CHARS: ${body.message}`
377
377
  );
378
378
  this.body = body;
379
- this.name = "VmCreateTmuxSessionError";
379
+ this.name = "GroupNameInvalidCharsError";
380
380
  }
381
- static code = "VM_CREATE_TMUX_SESSION";
382
- static statusCode = 500;
383
- static description = `Failed to create tmux session for VM`;
381
+ static code = "GROUP_NAME_INVALID_CHARS";
382
+ static statusCode = 400;
383
+ static description = `Group name '{name}' contains invalid characters (must match [a-z_][a-z0-9_-]*)`;
384
384
  }
385
- class VmSubnetNotFoundError extends Error {
385
+ class GroupNameTooLongError extends Error {
386
386
  constructor(body) {
387
387
  super(
388
- `VM_SUBNET_NOT_FOUND: ${body.message}`
388
+ `GROUP_NAME_TOO_LONG: ${body.message}`
389
389
  );
390
390
  this.body = body;
391
- this.name = "VmSubnetNotFoundError";
391
+ this.name = "GroupNameTooLongError";
392
392
  }
393
- static code = "VM_SUBNET_NOT_FOUND";
394
- static statusCode = 500;
395
- static description = `Subnet for VM not found`;
393
+ static code = "GROUP_NAME_TOO_LONG";
394
+ static statusCode = 400;
395
+ static description = `Group name '{name}' is too long (max {max_length} characters)`;
396
396
  }
397
- class FileNotFoundError extends Error {
397
+ class GroupNameEmptyError extends Error {
398
398
  constructor(body) {
399
399
  super(
400
- `FILE_NOT_FOUND: ${body.message}`
400
+ `GROUP_NAME_EMPTY: ${body.message}`
401
401
  );
402
402
  this.body = body;
403
- this.name = "FileNotFoundError";
403
+ this.name = "GroupNameEmptyError";
404
404
  }
405
- static code = "FILE_NOT_FOUND";
406
- static statusCode = 404;
407
- static description = `File not found: {path}`;
405
+ static code = "GROUP_NAME_EMPTY";
406
+ static statusCode = 400;
407
+ static description = `Group name cannot be empty`;
408
408
  }
409
- class FilesBadRequestError extends Error {
409
+ class InvalidGitRepoSpecErrorError extends Error {
410
410
  constructor(body) {
411
411
  super(
412
- `FILES_BAD_REQUEST: ${body.message}`
412
+ `INVALID_GIT_REPO_SPEC_ERROR: ${body.message}`
413
413
  );
414
414
  this.body = body;
415
- this.name = "FilesBadRequestError";
415
+ this.name = "InvalidGitRepoSpecErrorError";
416
416
  }
417
- static code = "FILES_BAD_REQUEST";
417
+ static code = "INVALID_GIT_REPO_SPEC_ERROR";
418
418
  static statusCode = 400;
419
- static description = `Bad request: {message}`;
419
+ static description = `Invalid git repository specification: {message}`;
420
420
  }
421
- class VmMustBeStoppedError extends Error {
421
+ class InternalErrorError extends Error {
422
422
  constructor(body) {
423
423
  super(
424
- `VM_MUST_BE_STOPPED: ${body.message}`
424
+ `INTERNAL_ERROR: ${body.message}`
425
425
  );
426
426
  this.body = body;
427
- this.name = "VmMustBeStoppedError";
427
+ this.name = "InternalErrorError";
428
428
  }
429
- static code = "VM_MUST_BE_STOPPED";
430
- static statusCode = 400;
431
- static description = `VM must be stopped before converting to base`;
429
+ static code = "INTERNAL_ERROR";
430
+ static statusCode = 500;
431
+ static description = `Internal error: {message}`;
432
432
  }
433
- class AlreadyHasBaseError extends Error {
433
+ class ForkVmNotFoundError extends Error {
434
434
  constructor(body) {
435
435
  super(
436
- `ALREADY_HAS_BASE: ${body.message}`
436
+ `FORK_VM_NOT_FOUND: ${body.message}`
437
437
  );
438
438
  this.body = body;
439
- this.name = "AlreadyHasBaseError";
439
+ this.name = "ForkVmNotFoundError";
440
440
  }
441
- static code = "ALREADY_HAS_BASE";
442
- static statusCode = 400;
443
- static description = `VM already has a base rootfs`;
441
+ static code = "FORK_VM_NOT_FOUND";
442
+ static statusCode = 404;
443
+ static description = `Fork VM not found: {fork_vm_id}`;
444
444
  }
445
- class NotFoundError extends Error {
445
+ class CreateSnapshotBadRequestError extends Error {
446
446
  constructor(body) {
447
447
  super(
448
- `NOT_FOUND: ${body.message}`
448
+ `CREATE_SNAPSHOT_BAD_REQUEST: ${body.message}`
449
449
  );
450
450
  this.body = body;
451
- this.name = "NotFoundError";
451
+ this.name = "CreateSnapshotBadRequestError";
452
452
  }
453
- static code = "NOT_FOUND";
454
- static statusCode = 404;
455
- static description = `VM not found`;
453
+ static code = "CREATE_SNAPSHOT_BAD_REQUEST";
454
+ static statusCode = 400;
455
+ static description = `Bad request: {message}`;
456
456
  }
457
- class DatabaseErrorError extends Error {
457
+ class ResumedVmNonResponsiveError extends Error {
458
458
  constructor(body) {
459
459
  super(
460
- `DATABASE_ERROR: ${body.message}`
460
+ `RESUMED_VM_NON_RESPONSIVE: ${body.message}`
461
461
  );
462
462
  this.body = body;
463
- this.name = "DatabaseErrorError";
463
+ this.name = "ResumedVmNonResponsiveError";
464
464
  }
465
- static code = "DATABASE_ERROR";
465
+ static code = "RESUMED_VM_NON_RESPONSIVE";
466
466
  static statusCode = 500;
467
- static description = `Database error occurred while constructing VmRecord, details: {details}`;
467
+ static description = `Resumed VM {vm_id} is not responsive after {timeout_seconds}s`;
468
468
  }
469
- class PartitionNotFoundError extends Error {
469
+ class SnapshotLoadTimeoutError extends Error {
470
470
  constructor(body) {
471
471
  super(
472
- `PARTITION_NOT_FOUND: ${body.message}`
472
+ `SNAPSHOT_LOAD_TIMEOUT: ${body.message}`
473
473
  );
474
474
  this.body = body;
475
- this.name = "PartitionNotFoundError";
475
+ this.name = "SnapshotLoadTimeoutError";
476
476
  }
477
- static code = "PARTITION_NOT_FOUND";
478
- static statusCode = 404;
479
- static description = `Partition not found: {partition_id}`;
477
+ static code = "SNAPSHOT_LOAD_TIMEOUT";
478
+ static statusCode = 500;
479
+ static description = `Snapshot load timed out after {elapsed_seconds}s for instance {vm_instance_id}, logs: {log_path}`;
480
480
  }
481
- class InvalidVmIdError extends Error {
481
+ class UffdTimeoutErrorError extends Error {
482
482
  constructor(body) {
483
483
  super(
484
- `INVALID_VM_ID: ${body.message}`
484
+ `UFFD_TIMEOUT_ERROR: ${body.message}`
485
485
  );
486
486
  this.body = body;
487
- this.name = "InvalidVmIdError";
487
+ this.name = "UffdTimeoutErrorError";
488
488
  }
489
- static code = "INVALID_VM_ID";
490
- static statusCode = 400;
491
- static description = `Invalid VM ID: {vm_id}, details: {details}`;
489
+ static code = "UFFD_TIMEOUT_ERROR";
490
+ static statusCode = 500;
491
+ static description = `UFFD socket timeout: {report_socket_path}, logs: {log_path}`;
492
492
  }
493
- class InvalidGitRepoSpecErrorError extends Error {
493
+ class KernelPanicError extends Error {
494
494
  constructor(body) {
495
495
  super(
496
- `INVALID_GIT_REPO_SPEC_ERROR: ${body.message}`
496
+ `KERNEL_PANIC: ${body.message}`
497
497
  );
498
498
  this.body = body;
499
- this.name = "InvalidGitRepoSpecErrorError";
499
+ this.name = "KernelPanicError";
500
500
  }
501
- static code = "INVALID_GIT_REPO_SPEC_ERROR";
502
- static statusCode = 400;
503
- static description = `Invalid git repository specification: {message}`;
501
+ static code = "KERNEL_PANIC";
502
+ static statusCode = 500;
503
+ static description = `VM kernel panic detected`;
504
504
  }
505
- class ForkVmNotFoundError extends Error {
505
+ class VmDeletedError extends Error {
506
506
  constructor(body) {
507
507
  super(
508
- `FORK_VM_NOT_FOUND: ${body.message}`
508
+ `VM_DELETED: ${body.message}`
509
509
  );
510
510
  this.body = body;
511
- this.name = "ForkVmNotFoundError";
511
+ this.name = "VmDeletedError";
512
512
  }
513
- static code = "FORK_VM_NOT_FOUND";
514
- static statusCode = 404;
515
- static description = `Fork VM not found: {fork_vm_id}`;
513
+ static code = "VM_DELETED";
514
+ static statusCode = 410;
515
+ static description = `Cannot start VM: VM files have been deleted. This VM was ephemeral and its files were removed.`;
516
516
  }
517
- class CreateSnapshotBadRequestError extends Error {
517
+ class ReqwestError extends Error {
518
518
  constructor(body) {
519
519
  super(
520
- `CREATE_SNAPSHOT_BAD_REQUEST: ${body.message}`
520
+ `REQWEST: ${body.message}`
521
521
  );
522
522
  this.body = body;
523
- this.name = "CreateSnapshotBadRequestError";
523
+ this.name = "ReqwestError";
524
524
  }
525
- static code = "CREATE_SNAPSHOT_BAD_REQUEST";
526
- static statusCode = 400;
527
- static description = `Bad request: {message}`;
525
+ static code = "REQWEST";
526
+ static statusCode = 500;
527
+ static description = `Reqwest error: {details}`;
528
528
  }
529
- class UserNotFoundError extends Error {
529
+ class FirecrackerPidNotFoundError extends Error {
530
530
  constructor(body) {
531
531
  super(
532
- `USER_NOT_FOUND: ${body.message}`
532
+ `FIRECRACKER_PID_NOT_FOUND: ${body.message}`
533
533
  );
534
534
  this.body = body;
535
- this.name = "UserNotFoundError";
535
+ this.name = "FirecrackerPidNotFoundError";
536
536
  }
537
- static code = "USER_NOT_FOUND";
538
- static statusCode = 404;
539
- static description = `User not found: {user_name}`;
537
+ static code = "FIRECRACKER_PID_NOT_FOUND";
538
+ static statusCode = 500;
539
+ static description = `Firecracker PID not found`;
540
540
  }
541
- class UserAlreadyExistsError extends Error {
541
+ class FirecrackerApiSocketNotFoundError extends Error {
542
542
  constructor(body) {
543
543
  super(
544
- `USER_ALREADY_EXISTS: ${body.message}`
544
+ `FIRECRACKER_API_SOCKET_NOT_FOUND: ${body.message}`
545
545
  );
546
546
  this.body = body;
547
- this.name = "UserAlreadyExistsError";
547
+ this.name = "FirecrackerApiSocketNotFoundError";
548
548
  }
549
- static code = "USER_ALREADY_EXISTS";
550
- static statusCode = 409;
551
- static description = `Conflict: User '{user_name}' already exists`;
549
+ static code = "FIRECRACKER_API_SOCKET_NOT_FOUND";
550
+ static statusCode = 500;
551
+ static description = `Firecracker API socket not found`;
552
552
  }
553
- class ValidationErrorError extends Error {
553
+ class InvalidSnapshotIdError extends Error {
554
554
  constructor(body) {
555
555
  super(
556
- `VALIDATION_ERROR: ${body.message}`
556
+ `INVALID_SNAPSHOT_ID: ${body.message}`
557
557
  );
558
558
  this.body = body;
559
- this.name = "ValidationErrorError";
559
+ this.name = "InvalidSnapshotIdError";
560
560
  }
561
- static code = "VALIDATION_ERROR";
561
+ static code = "INVALID_SNAPSHOT_ID";
562
562
  static statusCode = 400;
563
- static description = `Validation error: {message}`;
563
+ static description = `Invalid snapshot id: {id}`;
564
564
  }
565
- class GroupNotFoundError extends Error {
565
+ class VmStartTimeoutError extends Error {
566
566
  constructor(body) {
567
567
  super(
568
- `GROUP_NOT_FOUND: ${body.message}`
568
+ `VM_START_TIMEOUT: ${body.message}`
569
569
  );
570
570
  this.body = body;
571
- this.name = "GroupNotFoundError";
571
+ this.name = "VmStartTimeoutError";
572
572
  }
573
- static code = "GROUP_NOT_FOUND";
574
- static statusCode = 404;
575
- static description = `Group not found: {group_name}`;
573
+ static code = "VM_START_TIMEOUT";
574
+ static statusCode = 504;
575
+ static description = `VM did not become ready within the specified timeout`;
576
576
  }
577
- class GroupAlreadyExistsError extends Error {
577
+ class VmExitDuringStartError extends Error {
578
578
  constructor(body) {
579
579
  super(
580
- `GROUP_ALREADY_EXISTS: ${body.message}`
580
+ `VM_EXIT_DURING_START: ${body.message}`
581
581
  );
582
582
  this.body = body;
583
- this.name = "GroupAlreadyExistsError";
583
+ this.name = "VmExitDuringStartError";
584
584
  }
585
- static code = "GROUP_ALREADY_EXISTS";
586
- static statusCode = 409;
587
- static description = `Conflict: Group '{group_name}' already exists`;
585
+ static code = "VM_EXIT_DURING_START";
586
+ static statusCode = 500;
587
+ static description = `VM process exited unexpectedly during start`;
588
588
  }
589
- class DuplicateUserNameError extends Error {
589
+ class VmAccessDeniedError extends Error {
590
590
  constructor(body) {
591
591
  super(
592
- `DUPLICATE_USER_NAME: ${body.message}`
592
+ `VM_ACCESS_DENIED: ${body.message}`
593
593
  );
594
594
  this.body = body;
595
- this.name = "DuplicateUserNameError";
595
+ this.name = "VmAccessDeniedError";
596
596
  }
597
- static code = "DUPLICATE_USER_NAME";
598
- static statusCode = 400;
599
- static description = `Duplicate user name '{name}' found`;
597
+ static code = "VM_ACCESS_DENIED";
598
+ static statusCode = 403;
599
+ static description = `You do not have access to this VM`;
600
600
  }
601
- class UserGroupEmptyError extends Error {
601
+ class StdIoError extends Error {
602
602
  constructor(body) {
603
603
  super(
604
- `USER_GROUP_EMPTY: ${body.message}`
604
+ `STD_IO: ${body.message}`
605
605
  );
606
606
  this.body = body;
607
- this.name = "UserGroupEmptyError";
607
+ this.name = "StdIoError";
608
608
  }
609
- static code = "USER_GROUP_EMPTY";
610
- static statusCode = 400;
611
- static description = `User '{user}' has empty string in groups`;
609
+ static code = "STD_IO";
610
+ static statusCode = 500;
611
+ static description = `Standard IO error`;
612
612
  }
613
- class UserSystemFlagMismatchError extends Error {
613
+ class VmCreateTmuxSessionError extends Error {
614
614
  constructor(body) {
615
615
  super(
616
- `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
616
+ `VM_CREATE_TMUX_SESSION: ${body.message}`
617
617
  );
618
618
  this.body = body;
619
- this.name = "UserSystemFlagMismatchError";
619
+ this.name = "VmCreateTmuxSessionError";
620
620
  }
621
- static code = "USER_SYSTEM_FLAG_MISMATCH";
622
- static statusCode = 400;
623
- static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
621
+ static code = "VM_CREATE_TMUX_SESSION";
622
+ static statusCode = 500;
623
+ static description = `Failed to create tmux session for VM`;
624
624
  }
625
- class UserUidOutOfRangeError extends Error {
625
+ class VmSubnetNotFoundError extends Error {
626
626
  constructor(body) {
627
627
  super(
628
- `USER_UID_OUT_OF_RANGE: ${body.message}`
628
+ `VM_SUBNET_NOT_FOUND: ${body.message}`
629
629
  );
630
630
  this.body = body;
631
- this.name = "UserUidOutOfRangeError";
631
+ this.name = "VmSubnetNotFoundError";
632
632
  }
633
- static code = "USER_UID_OUT_OF_RANGE";
634
- static statusCode = 400;
635
- static description = `User '{user}' has invalid UID {uid} (must be 0-65535)`;
633
+ static code = "VM_SUBNET_NOT_FOUND";
634
+ static statusCode = 500;
635
+ static description = `Subnet for VM not found`;
636
636
  }
637
- class UserHomeInvalidError extends Error {
637
+ class VmOperationDeniedDuringTransactionError extends Error {
638
638
  constructor(body) {
639
639
  super(
640
- `USER_HOME_INVALID: ${body.message}`
640
+ `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
641
641
  );
642
642
  this.body = body;
643
- this.name = "UserHomeInvalidError";
643
+ this.name = "VmOperationDeniedDuringTransactionError";
644
644
  }
645
- static code = "USER_HOME_INVALID";
646
- static statusCode = 400;
647
- static description = `User '{user}' has invalid home path '{home}' (must be absolute path starting with /)`;
645
+ static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
646
+ static statusCode = 409;
647
+ static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
648
648
  }
649
- class UserShellInvalidError extends Error {
649
+ class VmTransactionIdMismatchError extends Error {
650
650
  constructor(body) {
651
651
  super(
652
- `USER_SHELL_INVALID: ${body.message}`
652
+ `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
653
653
  );
654
654
  this.body = body;
655
- this.name = "UserShellInvalidError";
655
+ this.name = "VmTransactionIdMismatchError";
656
656
  }
657
- static code = "USER_SHELL_INVALID";
657
+ static code = "VM_TRANSACTION_ID_MISMATCH";
658
658
  static statusCode = 400;
659
- static description = `User '{user}' has invalid shell path '{shell}' (must be absolute path starting with /)`;
659
+ static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
660
660
  }
661
- class DuplicateGroupNameError extends Error {
661
+ class VmNotInTransactionError extends Error {
662
662
  constructor(body) {
663
663
  super(
664
- `DUPLICATE_GROUP_NAME: ${body.message}`
664
+ `VM_NOT_IN_TRANSACTION: ${body.message}`
665
665
  );
666
666
  this.body = body;
667
- this.name = "DuplicateGroupNameError";
667
+ this.name = "VmNotInTransactionError";
668
668
  }
669
- static code = "DUPLICATE_GROUP_NAME";
670
- static statusCode = 400;
671
- static description = `Duplicate group name '{name}' found`;
669
+ static code = "VM_NOT_IN_TRANSACTION";
670
+ static statusCode = 404;
671
+ static description = `VM not in a transaction: {vm_id}`;
672
672
  }
673
- class GroupNameReservedError extends Error {
673
+ class ActiveTransactionErrorError extends Error {
674
674
  constructor(body) {
675
675
  super(
676
- `GROUP_NAME_RESERVED: ${body.message}`
676
+ `ACTIVE_TRANSACTION_ERROR: ${body.message}`
677
677
  );
678
678
  this.body = body;
679
- this.name = "GroupNameReservedError";
679
+ this.name = "ActiveTransactionErrorError";
680
680
  }
681
- static code = "GROUP_NAME_RESERVED";
682
- static statusCode = 400;
683
- static description = `Group name '{name}' is reserved and cannot be used`;
681
+ static code = "ACTIVE_TRANSACTION_ERROR";
682
+ static statusCode = 500;
683
+ static description = `Active transaction error: {details}`;
684
684
  }
685
- class GroupNameInvalidCharsError extends Error {
685
+ class RootfsCopyErrorError extends Error {
686
686
  constructor(body) {
687
687
  super(
688
- `GROUP_NAME_INVALID_CHARS: ${body.message}`
688
+ `ROOTFS_COPY_ERROR: ${body.message}`
689
689
  );
690
690
  this.body = body;
691
- this.name = "GroupNameInvalidCharsError";
691
+ this.name = "RootfsCopyErrorError";
692
692
  }
693
- static code = "GROUP_NAME_INVALID_CHARS";
694
- static statusCode = 400;
695
- static description = `Group name '{name}' contains invalid characters (must match [a-z_][a-z0-9_-]*)`;
693
+ static code = "ROOTFS_COPY_ERROR";
694
+ static statusCode = 500;
695
+ static description = `Failed to copy rootfs from {from} to {to}: {details}`;
696
696
  }
697
- class GroupNameTooLongError extends Error {
697
+ class VmNotRunningError extends Error {
698
698
  constructor(body) {
699
699
  super(
700
- `GROUP_NAME_TOO_LONG: ${body.message}`
700
+ `VM_NOT_RUNNING: ${body.message}`
701
701
  );
702
702
  this.body = body;
703
- this.name = "GroupNameTooLongError";
703
+ this.name = "VmNotRunningError";
704
704
  }
705
- static code = "GROUP_NAME_TOO_LONG";
705
+ static code = "VM_NOT_RUNNING";
706
706
  static statusCode = 400;
707
- static description = `Group name '{name}' is too long (max {max_length} characters)`;
707
+ static description = `VM is not running: {vm_id}`;
708
708
  }
709
- class GroupNameEmptyError extends Error {
709
+ class VmNotFoundError extends Error {
710
710
  constructor(body) {
711
711
  super(
712
- `GROUP_NAME_EMPTY: ${body.message}`
712
+ `VM_NOT_FOUND: ${body.message}`
713
713
  );
714
714
  this.body = body;
715
- this.name = "GroupNameEmptyError";
715
+ this.name = "VmNotFoundError";
716
716
  }
717
- static code = "GROUP_NAME_EMPTY";
718
- static statusCode = 400;
719
- static description = `Group name cannot be empty`;
717
+ static code = "VM_NOT_FOUND";
718
+ static statusCode = 404;
719
+ static description = `VM not found: {vm_id}`;
720
720
  }
721
- class VmOperationDeniedDuringTransactionError extends Error {
721
+ class InternalForkVmNotFoundError extends Error {
722
722
  constructor(body) {
723
723
  super(
724
- `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
724
+ `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
725
725
  );
726
726
  this.body = body;
727
- this.name = "VmOperationDeniedDuringTransactionError";
727
+ this.name = "InternalForkVmNotFoundError";
728
728
  }
729
- static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
730
- static statusCode = 409;
731
- static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
729
+ static code = "INTERNAL_FORK_VM_NOT_FOUND";
730
+ static statusCode = 404;
731
+ static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
732
732
  }
733
- class VmTransactionIdMismatchError extends Error {
733
+ class BadRequestError extends Error {
734
734
  constructor(body) {
735
735
  super(
736
- `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
736
+ `BAD_REQUEST: ${body.message}`
737
737
  );
738
738
  this.body = body;
739
- this.name = "VmTransactionIdMismatchError";
739
+ this.name = "BadRequestError";
740
740
  }
741
- static code = "VM_TRANSACTION_ID_MISMATCH";
741
+ static code = "BAD_REQUEST";
742
742
  static statusCode = 400;
743
- static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
743
+ static description = `Bad request: {message}`;
744
744
  }
745
- class VmNotInTransactionError extends Error {
745
+ class InternalVmNotFoundError extends Error {
746
746
  constructor(body) {
747
747
  super(
748
- `VM_NOT_IN_TRANSACTION: ${body.message}`
748
+ `INTERNAL_VM_NOT_FOUND: ${body.message}`
749
749
  );
750
750
  this.body = body;
751
- this.name = "VmNotInTransactionError";
751
+ this.name = "InternalVmNotFoundError";
752
752
  }
753
- static code = "VM_NOT_IN_TRANSACTION";
753
+ static code = "INTERNAL_VM_NOT_FOUND";
754
754
  static statusCode = 404;
755
- static description = `VM not in a transaction: {vm_id}`;
755
+ static description = `VM not found: {vm_id}`;
756
756
  }
757
757
  class DockerSnapshotFailedError extends Error {
758
758
  constructor(body) {
@@ -1150,149 +1150,221 @@ class MaxUsesExceededError extends Error {
1150
1150
  static statusCode = 403;
1151
1151
  static description = `Session maximum uses exceeded`;
1152
1152
  }
1153
- class ExpiredError extends Error {
1153
+ class ExpiredError extends Error {
1154
+ constructor(body) {
1155
+ super(
1156
+ `EXPIRED: ${body.message}`
1157
+ );
1158
+ this.body = body;
1159
+ this.name = "ExpiredError";
1160
+ }
1161
+ static code = "EXPIRED";
1162
+ static statusCode = 403;
1163
+ static description = `Session has expired`;
1164
+ }
1165
+ class InvalidRangeError extends Error {
1166
+ constructor(body) {
1167
+ super(
1168
+ `INVALID_RANGE: ${body.message}`
1169
+ );
1170
+ this.body = body;
1171
+ this.name = "InvalidRangeError";
1172
+ }
1173
+ static code = "INVALID_RANGE";
1174
+ static statusCode = 400;
1175
+ 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.`;
1176
+ }
1177
+ class OffsetWithSelectorError extends Error {
1178
+ constructor(body) {
1179
+ super(
1180
+ `OFFSET_WITH_SELECTOR: ${body.message}`
1181
+ );
1182
+ this.body = body;
1183
+ this.name = "OffsetWithSelectorError";
1184
+ }
1185
+ static code = "OFFSET_WITH_SELECTOR";
1186
+ static statusCode = 400;
1187
+ static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
1188
+ }
1189
+ class CommitNotInBranchError extends Error {
1190
+ constructor(body) {
1191
+ super(
1192
+ `COMMIT_NOT_IN_BRANCH: ${body.message}`
1193
+ );
1194
+ this.body = body;
1195
+ this.name = "CommitNotInBranchError";
1196
+ }
1197
+ static code = "COMMIT_NOT_IN_BRANCH";
1198
+ static statusCode = 400;
1199
+ static description = `Commit {sha} is not in the history of branch {branch}`;
1200
+ }
1201
+ class CommitNotFoundError extends Error {
1202
+ constructor(body) {
1203
+ super(
1204
+ `COMMIT_NOT_FOUND: ${body.message}`
1205
+ );
1206
+ this.body = body;
1207
+ this.name = "CommitNotFoundError";
1208
+ }
1209
+ static code = "COMMIT_NOT_FOUND";
1210
+ static statusCode = 400;
1211
+ static description = `Commit not found: {sha}`;
1212
+ }
1213
+ class BranchNotFoundError extends Error {
1214
+ constructor(body) {
1215
+ super(
1216
+ `BRANCH_NOT_FOUND: ${body.message}`
1217
+ );
1218
+ this.body = body;
1219
+ this.name = "BranchNotFoundError";
1220
+ }
1221
+ static code = "BRANCH_NOT_FOUND";
1222
+ static statusCode = 404;
1223
+ static description = `Branch not found: {branch}`;
1224
+ }
1225
+ class NoDefaultBranchError extends Error {
1154
1226
  constructor(body) {
1155
1227
  super(
1156
- `EXPIRED: ${body.message}`
1228
+ `NO_DEFAULT_BRANCH: ${body.message}`
1157
1229
  );
1158
1230
  this.body = body;
1159
- this.name = "ExpiredError";
1231
+ this.name = "NoDefaultBranchError";
1160
1232
  }
1161
- static code = "EXPIRED";
1162
- static statusCode = 403;
1163
- static description = `Session has expired`;
1233
+ static code = "NO_DEFAULT_BRANCH";
1234
+ static statusCode = 404;
1235
+ static description = `Repository has no default branch configured`;
1164
1236
  }
1165
- class PackfileError extends Error {
1237
+ class InvalidBase64ContentError extends Error {
1166
1238
  constructor(body) {
1167
1239
  super(
1168
- `PACKFILE: ${body.message}`
1240
+ `INVALID_BASE64_CONTENT: ${body.message}`
1169
1241
  );
1170
1242
  this.body = body;
1171
- this.name = "PackfileError";
1243
+ this.name = "InvalidBase64ContentError";
1172
1244
  }
1173
- static code = "PACKFILE";
1174
- static statusCode = 500;
1175
- static description = `Error building packfile`;
1245
+ static code = "INVALID_BASE64_CONTENT";
1246
+ static statusCode = 400;
1247
+ static description = `Invalid base64 content for file: {path}`;
1176
1248
  }
1177
- class TreeNotFoundError extends Error {
1249
+ class InvalidFileChangeError extends Error {
1178
1250
  constructor(body) {
1179
1251
  super(
1180
- `TREE_NOT_FOUND: ${body.message}`
1252
+ `INVALID_FILE_CHANGE: ${body.message}`
1181
1253
  );
1182
1254
  this.body = body;
1183
- this.name = "TreeNotFoundError";
1255
+ this.name = "InvalidFileChangeError";
1184
1256
  }
1185
- static code = "TREE_NOT_FOUND";
1186
- static statusCode = 404;
1187
- static description = `Tree not found: {hash}`;
1257
+ static code = "INVALID_FILE_CHANGE";
1258
+ static statusCode = 400;
1259
+ static description = `File change must have either content or deleted flag, not both: {path}`;
1188
1260
  }
1189
- class BranchNotFoundError extends Error {
1261
+ class InvalidFilePathError extends Error {
1190
1262
  constructor(body) {
1191
1263
  super(
1192
- `BRANCH_NOT_FOUND: ${body.message}`
1264
+ `INVALID_FILE_PATH: ${body.message}`
1193
1265
  );
1194
1266
  this.body = body;
1195
- this.name = "BranchNotFoundError";
1267
+ this.name = "InvalidFilePathError";
1196
1268
  }
1197
- static code = "BRANCH_NOT_FOUND";
1198
- static statusCode = 404;
1199
- static description = `Branch not found: {branch}`;
1269
+ static code = "INVALID_FILE_PATH";
1270
+ static statusCode = 400;
1271
+ static description = `Invalid file path: {path}`;
1200
1272
  }
1201
- class ForbiddenError extends Error {
1273
+ class ConflictingParentError extends Error {
1202
1274
  constructor(body) {
1203
1275
  super(
1204
- `FORBIDDEN: ${body.message}`
1276
+ `CONFLICTING_PARENT: ${body.message}`
1205
1277
  );
1206
1278
  this.body = body;
1207
- this.name = "ForbiddenError";
1279
+ this.name = "ConflictingParentError";
1208
1280
  }
1209
- static code = "FORBIDDEN";
1210
- static statusCode = 403;
1211
- static description = `Forbidden: {message}`;
1281
+ static code = "CONFLICTING_PARENT";
1282
+ static statusCode = 409;
1283
+ static description = `Conflict: expected parent SHA {expected} but current is {actual:?}`;
1212
1284
  }
1213
- class UnauthorizedError extends Error {
1285
+ class InvalidServiceError extends Error {
1214
1286
  constructor(body) {
1215
1287
  super(
1216
- `UNAUTHORIZED: ${body.message}`
1288
+ `INVALID_SERVICE: ${body.message}`
1217
1289
  );
1218
1290
  this.body = body;
1219
- this.name = "UnauthorizedError";
1291
+ this.name = "InvalidServiceError";
1220
1292
  }
1221
- static code = "UNAUTHORIZED";
1222
- static statusCode = 401;
1223
- static description = `Unauthorized: {message}`;
1293
+ static code = "INVALID_SERVICE";
1294
+ static statusCode = 403;
1295
+ static description = `Invalid service '{invalid}', expected 'git-upload-pack' or 'git-receive-pack'`;
1224
1296
  }
1225
- class RepoAlreadyExistsError extends Error {
1297
+ class ExpectedServiceError extends Error {
1226
1298
  constructor(body) {
1227
1299
  super(
1228
- `REPO_ALREADY_EXISTS: ${body.message}`
1300
+ `EXPECTED_SERVICE: ${body.message}`
1229
1301
  );
1230
1302
  this.body = body;
1231
- this.name = "RepoAlreadyExistsError";
1303
+ this.name = "ExpectedServiceError";
1232
1304
  }
1233
- static code = "REPO_ALREADY_EXISTS";
1234
- static statusCode = 409;
1235
- static description = `Repository {repo_id} already exists`;
1305
+ static code = "EXPECTED_SERVICE";
1306
+ static statusCode = 403;
1307
+ static description = `Expected 'service' query parameter`;
1236
1308
  }
1237
- class GitHubSyncConflictError extends Error {
1309
+ class TagNotFoundError extends Error {
1238
1310
  constructor(body) {
1239
1311
  super(
1240
- `GIT_HUB_SYNC_CONFLICT: ${body.message}`
1312
+ `TAG_NOT_FOUND: ${body.message}`
1241
1313
  );
1242
1314
  this.body = body;
1243
- this.name = "GitHubSyncConflictError";
1315
+ this.name = "TagNotFoundError";
1244
1316
  }
1245
- static code = "GIT_HUB_SYNC_CONFLICT";
1246
- static statusCode = 409;
1247
- static description = `GitHub Sync Conflict: {message}`;
1317
+ static code = "TAG_NOT_FOUND";
1318
+ static statusCode = 404;
1319
+ static description = `Tag not found: {hash}`;
1248
1320
  }
1249
- class InvalidObjectIdError extends Error {
1321
+ class InvalidRevisionError extends Error {
1250
1322
  constructor(body) {
1251
1323
  super(
1252
- `INVALID_OBJECT_ID: ${body.message}`
1324
+ `INVALID_REVISION: ${body.message}`
1253
1325
  );
1254
1326
  this.body = body;
1255
- this.name = "InvalidObjectIdError";
1327
+ this.name = "InvalidRevisionError";
1256
1328
  }
1257
- static code = "INVALID_OBJECT_ID";
1329
+ static code = "INVALID_REVISION";
1258
1330
  static statusCode = 400;
1259
- static description = `Invalid object ID: {hash}`;
1331
+ static description = `Invalid revision: {revision}`;
1260
1332
  }
1261
- class CommitNotFoundError extends Error {
1333
+ class ForbiddenError extends Error {
1262
1334
  constructor(body) {
1263
1335
  super(
1264
- `COMMIT_NOT_FOUND: ${body.message}`
1336
+ `FORBIDDEN: ${body.message}`
1265
1337
  );
1266
1338
  this.body = body;
1267
- this.name = "CommitNotFoundError";
1339
+ this.name = "ForbiddenError";
1268
1340
  }
1269
- static code = "COMMIT_NOT_FOUND";
1270
- static statusCode = 404;
1271
- static description = `Commit {commit_hash} not found in repository {repo_id}`;
1341
+ static code = "FORBIDDEN";
1342
+ static statusCode = 403;
1343
+ static description = `Forbidden`;
1272
1344
  }
1273
- class PathNotFoundError extends Error {
1345
+ class UnauthorizedError extends Error {
1274
1346
  constructor(body) {
1275
1347
  super(
1276
- `PATH_NOT_FOUND: ${body.message}`
1348
+ `UNAUTHORIZED: ${body.message}`
1277
1349
  );
1278
1350
  this.body = body;
1279
- this.name = "PathNotFoundError";
1351
+ this.name = "UnauthorizedError";
1280
1352
  }
1281
- static code = "PATH_NOT_FOUND";
1282
- static statusCode = 404;
1283
- static description = `Path not found: {path}`;
1353
+ static code = "UNAUTHORIZED";
1354
+ static statusCode = 401;
1355
+ static description = `Unauthorized`;
1284
1356
  }
1285
- class ReferenceNotFoundError extends Error {
1357
+ class BlobNotFoundError extends Error {
1286
1358
  constructor(body) {
1287
1359
  super(
1288
- `REFERENCE_NOT_FOUND: ${body.message}`
1360
+ `BLOB_NOT_FOUND: ${body.message}`
1289
1361
  );
1290
1362
  this.body = body;
1291
- this.name = "ReferenceNotFoundError";
1363
+ this.name = "BlobNotFoundError";
1292
1364
  }
1293
- static code = "REFERENCE_NOT_FOUND";
1365
+ static code = "BLOB_NOT_FOUND";
1294
1366
  static statusCode = 404;
1295
- static description = `Reference not found: {reference}`;
1367
+ static description = `Blob not found: {hash}`;
1296
1368
  }
1297
1369
  class AmbiguousError extends Error {
1298
1370
  constructor(body) {
@@ -1378,137 +1450,149 @@ class ImportSubdirNotFoundError extends Error {
1378
1450
  static statusCode = 400;
1379
1451
  static description = `Directory not found in {source}: {dir}`;
1380
1452
  }
1381
- class TagNotFoundError extends Error {
1453
+ class RepoAlreadyExistsError extends Error {
1382
1454
  constructor(body) {
1383
1455
  super(
1384
- `TAG_NOT_FOUND: ${body.message}`
1456
+ `REPO_ALREADY_EXISTS: ${body.message}`
1385
1457
  );
1386
1458
  this.body = body;
1387
- this.name = "TagNotFoundError";
1459
+ this.name = "RepoAlreadyExistsError";
1388
1460
  }
1389
- static code = "TAG_NOT_FOUND";
1461
+ static code = "REPO_ALREADY_EXISTS";
1462
+ static statusCode = 409;
1463
+ static description = `Repo '{repo_id}' already exists`;
1464
+ }
1465
+ class TreeNotFoundError extends Error {
1466
+ constructor(body) {
1467
+ super(
1468
+ `TREE_NOT_FOUND: ${body.message}`
1469
+ );
1470
+ this.body = body;
1471
+ this.name = "TreeNotFoundError";
1472
+ }
1473
+ static code = "TREE_NOT_FOUND";
1390
1474
  static statusCode = 404;
1391
- static description = `Tag not found: {tag}`;
1475
+ static description = `Tree not found: {hash}`;
1392
1476
  }
1393
- class UnsupportedTransferError extends Error {
1477
+ class PathNotFoundError extends Error {
1394
1478
  constructor(body) {
1395
1479
  super(
1396
- `UNSUPPORTED_TRANSFER: ${body.message}`
1480
+ `PATH_NOT_FOUND: ${body.message}`
1397
1481
  );
1398
1482
  this.body = body;
1399
- this.name = "UnsupportedTransferError";
1483
+ this.name = "PathNotFoundError";
1400
1484
  }
1401
- static code = "UNSUPPORTED_TRANSFER";
1402
- static statusCode = 400;
1403
- static description = `Unsupported LFS transfer protocol(s)`;
1485
+ static code = "PATH_NOT_FOUND";
1486
+ static statusCode = 404;
1487
+ static description = `Path not found: {path}`;
1404
1488
  }
1405
- class SendErrorError extends Error {
1489
+ class ReferenceNotFoundError extends Error {
1406
1490
  constructor(body) {
1407
1491
  super(
1408
- `SEND_ERROR: ${body.message}`
1492
+ `REFERENCE_NOT_FOUND: ${body.message}`
1409
1493
  );
1410
1494
  this.body = body;
1411
- this.name = "SendErrorError";
1495
+ this.name = "ReferenceNotFoundError";
1412
1496
  }
1413
- static code = "SEND_ERROR";
1414
- static statusCode = 500;
1415
- static description = `Stream receiver dropped`;
1497
+ static code = "REFERENCE_NOT_FOUND";
1498
+ static statusCode = 404;
1499
+ static description = `Reference not found: {reference}`;
1416
1500
  }
1417
- class InvalidServiceError extends Error {
1501
+ class ConflictError extends Error {
1418
1502
  constructor(body) {
1419
1503
  super(
1420
- `INVALID_SERVICE: ${body.message}`
1504
+ `CONFLICT: ${body.message}`
1421
1505
  );
1422
1506
  this.body = body;
1423
- this.name = "InvalidServiceError";
1507
+ this.name = "ConflictError";
1424
1508
  }
1425
- static code = "INVALID_SERVICE";
1426
- static statusCode = 403;
1427
- static description = `Invalid service '{invalid}', expected 'git-upload-pack' or 'git-receive-pack'`;
1509
+ static code = "CONFLICT";
1510
+ static statusCode = 409;
1511
+ static description = `Sync conflict: {message}`;
1428
1512
  }
1429
- class ExpectedServiceError extends Error {
1513
+ class BranchAlreadyExistsError extends Error {
1430
1514
  constructor(body) {
1431
1515
  super(
1432
- `EXPECTED_SERVICE: ${body.message}`
1516
+ `BRANCH_ALREADY_EXISTS: ${body.message}`
1433
1517
  );
1434
1518
  this.body = body;
1435
- this.name = "ExpectedServiceError";
1519
+ this.name = "BranchAlreadyExistsError";
1436
1520
  }
1437
- static code = "EXPECTED_SERVICE";
1438
- static statusCode = 403;
1439
- static description = `Expected 'service' query parameter`;
1521
+ static code = "BRANCH_ALREADY_EXISTS";
1522
+ static statusCode = 409;
1523
+ static description = `Branch already exists: {branch}`;
1440
1524
  }
1441
- class InvalidRangeError extends Error {
1525
+ class ParentNotFoundError extends Error {
1442
1526
  constructor(body) {
1443
1527
  super(
1444
- `INVALID_RANGE: ${body.message}`
1528
+ `PARENT_NOT_FOUND: ${body.message}`
1445
1529
  );
1446
1530
  this.body = body;
1447
- this.name = "InvalidRangeError";
1531
+ this.name = "ParentNotFoundError";
1448
1532
  }
1449
- static code = "INVALID_RANGE";
1450
- static statusCode = 400;
1451
- 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.`;
1533
+ static code = "PARENT_NOT_FOUND";
1534
+ static statusCode = 404;
1535
+ static description = `Parent commit not found: {sha}`;
1452
1536
  }
1453
- class OffsetWithSelectorError extends Error {
1537
+ class GitHubSyncConflictError extends Error {
1454
1538
  constructor(body) {
1455
1539
  super(
1456
- `OFFSET_WITH_SELECTOR: ${body.message}`
1540
+ `GIT_HUB_SYNC_CONFLICT: ${body.message}`
1457
1541
  );
1458
1542
  this.body = body;
1459
- this.name = "OffsetWithSelectorError";
1543
+ this.name = "GitHubSyncConflictError";
1460
1544
  }
1461
- static code = "OFFSET_WITH_SELECTOR";
1462
- static statusCode = 400;
1463
- static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
1545
+ static code = "GIT_HUB_SYNC_CONFLICT";
1546
+ static statusCode = 409;
1547
+ static description = `GitHub Sync Conflict: {message}`;
1464
1548
  }
1465
- class CommitNotInBranchError extends Error {
1549
+ class InvalidObjectIdError extends Error {
1466
1550
  constructor(body) {
1467
1551
  super(
1468
- `COMMIT_NOT_IN_BRANCH: ${body.message}`
1552
+ `INVALID_OBJECT_ID: ${body.message}`
1469
1553
  );
1470
1554
  this.body = body;
1471
- this.name = "CommitNotInBranchError";
1555
+ this.name = "InvalidObjectIdError";
1472
1556
  }
1473
- static code = "COMMIT_NOT_IN_BRANCH";
1557
+ static code = "INVALID_OBJECT_ID";
1474
1558
  static statusCode = 400;
1475
- static description = `Commit {sha} is not in the history of branch {branch}`;
1559
+ static description = `Invalid object ID: {hash}`;
1476
1560
  }
1477
- class BlobNotFoundError extends Error {
1561
+ class UnsupportedTransferError extends Error {
1478
1562
  constructor(body) {
1479
1563
  super(
1480
- `BLOB_NOT_FOUND: ${body.message}`
1564
+ `UNSUPPORTED_TRANSFER: ${body.message}`
1481
1565
  );
1482
1566
  this.body = body;
1483
- this.name = "BlobNotFoundError";
1567
+ this.name = "UnsupportedTransferError";
1484
1568
  }
1485
- static code = "BLOB_NOT_FOUND";
1486
- static statusCode = 404;
1487
- static description = `Blob not found: {hash}`;
1569
+ static code = "UNSUPPORTED_TRANSFER";
1570
+ static statusCode = 400;
1571
+ static description = `Unsupported LFS transfer protocol(s)`;
1488
1572
  }
1489
- class InvalidRevisionError extends Error {
1573
+ class PackfileError extends Error {
1490
1574
  constructor(body) {
1491
1575
  super(
1492
- `INVALID_REVISION: ${body.message}`
1576
+ `PACKFILE: ${body.message}`
1493
1577
  );
1494
1578
  this.body = body;
1495
- this.name = "InvalidRevisionError";
1579
+ this.name = "PackfileError";
1496
1580
  }
1497
- static code = "INVALID_REVISION";
1498
- static statusCode = 400;
1499
- static description = `Invalid revision: {revision}`;
1581
+ static code = "PACKFILE";
1582
+ static statusCode = 500;
1583
+ static description = `Error building packfile`;
1500
1584
  }
1501
- class ConflictError extends Error {
1585
+ class SendErrorError extends Error {
1502
1586
  constructor(body) {
1503
1587
  super(
1504
- `CONFLICT: ${body.message}`
1588
+ `SEND_ERROR: ${body.message}`
1505
1589
  );
1506
1590
  this.body = body;
1507
- this.name = "ConflictError";
1591
+ this.name = "SendErrorError";
1508
1592
  }
1509
- static code = "CONFLICT";
1510
- static statusCode = 409;
1511
- static description = `Sync conflict: {message}`;
1593
+ static code = "SEND_ERROR";
1594
+ static statusCode = 500;
1595
+ static description = `Stream receiver dropped`;
1512
1596
  }
1513
1597
  class UnavailableError extends Error {
1514
1598
  constructor(body) {
@@ -1530,21 +1614,9 @@ class DevServerNotFoundError extends Error {
1530
1614
  this.body = body;
1531
1615
  this.name = "DevServerNotFoundError";
1532
1616
  }
1533
- static code = "DEV_SERVER_NOT_FOUND";
1534
- static statusCode = 404;
1535
- static description = `dev server not found`;
1536
- }
1537
- class GitRepoLimitExceededError extends Error {
1538
- constructor(body) {
1539
- super(
1540
- `GIT_REPO_LIMIT_EXCEEDED: ${body.message}`
1541
- );
1542
- this.body = body;
1543
- this.name = "GitRepoLimitExceededError";
1544
- }
1545
- static code = "GIT_REPO_LIMIT_EXCEEDED";
1546
- static statusCode = 403;
1547
- static description = `Repository limit exceeded: your plan allows {limit} repositories, you currently have {current}`;
1617
+ static code = "DEV_SERVER_NOT_FOUND";
1618
+ static statusCode = 404;
1619
+ static description = `dev server not found`;
1548
1620
  }
1549
1621
  class EmptyTagError extends Error {
1550
1622
  constructor(body) {
@@ -1558,1553 +1630,1565 @@ class EmptyTagError extends Error {
1558
1630
  static statusCode = 400;
1559
1631
  static description = `Invalid request: tag cannot be empty`;
1560
1632
  }
1561
- class BranchNameEmptyError extends Error {
1633
+ class BrowserOperationFailedError extends Error {
1562
1634
  constructor(body) {
1563
1635
  super(
1564
- `BRANCH_NAME_EMPTY: ${body.message}`
1636
+ `BROWSER_OPERATION_FAILED: ${body.message}`
1565
1637
  );
1566
1638
  this.body = body;
1567
- this.name = "BranchNameEmptyError";
1639
+ this.name = "BrowserOperationFailedError";
1568
1640
  }
1569
- static code = "BRANCH_NAME_EMPTY";
1570
- static statusCode = 400;
1571
- static description = `Branch name cannot be empty`;
1641
+ static code = "BROWSER_OPERATION_FAILED";
1642
+ static statusCode = 500;
1643
+ static description = `Browser operation failed: {message}`;
1572
1644
  }
1573
- class VmLimitExceededError extends Error {
1645
+ class WatchFilesFailedError extends Error {
1574
1646
  constructor(body) {
1575
1647
  super(
1576
- `VM_LIMIT_EXCEEDED: ${body.message}`
1648
+ `WATCH_FILES_FAILED: ${body.message}`
1577
1649
  );
1578
1650
  this.body = body;
1579
- this.name = "VmLimitExceededError";
1651
+ this.name = "WatchFilesFailedError";
1580
1652
  }
1581
- static code = "VM_LIMIT_EXCEEDED";
1582
- static statusCode = 403;
1583
- static description = `VM limit exceeded: your plan allows {limit} VMs, you currently have {current}`;
1653
+ static code = "WATCH_FILES_FAILED";
1654
+ static statusCode = 500;
1655
+ static description = `Failed to watch files: {message}`;
1584
1656
  }
1585
- class ScheduleNotFoundError extends Error {
1657
+ class LogsFailedError extends Error {
1586
1658
  constructor(body) {
1587
1659
  super(
1588
- `SCHEDULE_NOT_FOUND: ${body.message}`
1660
+ `LOGS_FAILED: ${body.message}`
1589
1661
  );
1590
1662
  this.body = body;
1591
- this.name = "ScheduleNotFoundError";
1663
+ this.name = "LogsFailedError";
1592
1664
  }
1593
- static code = "SCHEDULE_NOT_FOUND";
1594
- static statusCode = 404;
1595
- static description = `Schedule not found`;
1665
+ static code = "LOGS_FAILED";
1666
+ static statusCode = 500;
1667
+ static description = `Failed to get logs: {message}`;
1596
1668
  }
1597
- class ServiceUnavailableError extends Error {
1669
+ class StatusFailedError extends Error {
1598
1670
  constructor(body) {
1599
1671
  super(
1600
- `SERVICE_UNAVAILABLE: ${body.message}`
1672
+ `STATUS_FAILED: ${body.message}`
1601
1673
  );
1602
1674
  this.body = body;
1603
- this.name = "ServiceUnavailableError";
1675
+ this.name = "StatusFailedError";
1604
1676
  }
1605
- static code = "SERVICE_UNAVAILABLE";
1606
- static statusCode = 503;
1607
- static description = `Cron service not configured`;
1677
+ static code = "STATUS_FAILED";
1678
+ static statusCode = 500;
1679
+ static description = `Failed to get dev server status: {message}`;
1608
1680
  }
1609
- class ExecuteLimitExceededError extends Error {
1681
+ class RestartFailedError extends Error {
1610
1682
  constructor(body) {
1611
1683
  super(
1612
- `EXECUTE_LIMIT_EXCEEDED: ${body.message}`
1684
+ `RESTART_FAILED: ${body.message}`
1613
1685
  );
1614
1686
  this.body = body;
1615
- this.name = "ExecuteLimitExceededError";
1687
+ this.name = "RestartFailedError";
1616
1688
  }
1617
- static code = "EXECUTE_LIMIT_EXCEEDED";
1618
- static statusCode = 403;
1619
- static description = `Execute runs limit exceeded: your plan allows {limit} runs per month, you have used {current}`;
1689
+ static code = "RESTART_FAILED";
1690
+ static statusCode = 500;
1691
+ static description = `Failed to restart dev server: {message}`;
1620
1692
  }
1621
- class TriggerErrorError extends Error {
1693
+ class ShutdownFailedError extends Error {
1622
1694
  constructor(body) {
1623
1695
  super(
1624
- `TRIGGER_ERROR: ${body.message}`
1696
+ `SHUTDOWN_FAILED: ${body.message}`
1625
1697
  );
1626
1698
  this.body = body;
1627
- this.name = "TriggerErrorError";
1699
+ this.name = "ShutdownFailedError";
1628
1700
  }
1629
- static code = "TRIGGER_ERROR";
1701
+ static code = "SHUTDOWN_FAILED";
1630
1702
  static statusCode = 500;
1631
- static description = `Failed to manage triggers: {message}`;
1703
+ static description = `Failed to shutdown dev server: {message}`;
1632
1704
  }
1633
- class TokenErrorError extends Error {
1705
+ class CommitFailedError extends Error {
1634
1706
  constructor(body) {
1635
1707
  super(
1636
- `TOKEN_ERROR: ${body.message}`
1708
+ `COMMIT_FAILED: ${body.message}`
1637
1709
  );
1638
1710
  this.body = body;
1639
- this.name = "TokenErrorError";
1711
+ this.name = "CommitFailedError";
1640
1712
  }
1641
- static code = "TOKEN_ERROR";
1713
+ static code = "COMMIT_FAILED";
1642
1714
  static statusCode = 500;
1643
- static description = `Failed to manage tokens: {message}`;
1715
+ static description = `Failed to commit changes: {message}`;
1644
1716
  }
1645
- class PermissionErrorError extends Error {
1717
+ class WriteFileFailedError extends Error {
1646
1718
  constructor(body) {
1647
1719
  super(
1648
- `PERMISSION_ERROR: ${body.message}`
1720
+ `WRITE_FILE_FAILED: ${body.message}`
1649
1721
  );
1650
1722
  this.body = body;
1651
- this.name = "PermissionErrorError";
1723
+ this.name = "WriteFileFailedError";
1652
1724
  }
1653
- static code = "PERMISSION_ERROR";
1725
+ static code = "WRITE_FILE_FAILED";
1654
1726
  static statusCode = 500;
1655
- static description = `Failed to manage permissions: {message}`;
1727
+ static description = `Failed to write file: {message}`;
1656
1728
  }
1657
- class IdentityErrorError extends Error {
1729
+ class ReadFileFailedError extends Error {
1658
1730
  constructor(body) {
1659
1731
  super(
1660
- `IDENTITY_ERROR: ${body.message}`
1732
+ `READ_FILE_FAILED: ${body.message}`
1661
1733
  );
1662
1734
  this.body = body;
1663
- this.name = "IdentityErrorError";
1735
+ this.name = "ReadFileFailedError";
1664
1736
  }
1665
- static code = "IDENTITY_ERROR";
1737
+ static code = "READ_FILE_FAILED";
1666
1738
  static statusCode = 500;
1667
- static description = `Failed to manage identity: {message}`;
1739
+ static description = `Failed to read file: {message}`;
1668
1740
  }
1669
- class GetContentFailedError extends Error {
1741
+ class ExecutionFailedError extends Error {
1670
1742
  constructor(body) {
1671
1743
  super(
1672
- `GET_CONTENT_FAILED: ${body.message}`
1744
+ `EXECUTION_FAILED: ${body.message}`
1673
1745
  );
1674
1746
  this.body = body;
1675
- this.name = "GetContentFailedError";
1747
+ this.name = "ExecutionFailedError";
1676
1748
  }
1677
- static code = "GET_CONTENT_FAILED";
1749
+ static code = "EXECUTION_FAILED";
1678
1750
  static statusCode = 500;
1679
- static description = `Failed to get content: {message}`;
1751
+ static description = `Failed to execute command: {message}`;
1680
1752
  }
1681
- class ContentNotFoundError extends Error {
1753
+ class RequestFailedError extends Error {
1682
1754
  constructor(body) {
1683
1755
  super(
1684
- `CONTENT_NOT_FOUND: ${body.message}`
1756
+ `REQUEST_FAILED: ${body.message}`
1685
1757
  );
1686
1758
  this.body = body;
1687
- this.name = "ContentNotFoundError";
1759
+ this.name = "RequestFailedError";
1688
1760
  }
1689
- static code = "CONTENT_NOT_FOUND";
1690
- static statusCode = 404;
1691
- static description = `Content not found: {path}`;
1761
+ static code = "REQUEST_FAILED";
1762
+ static statusCode = 500;
1763
+ static description = `Failed to request dev server: {message}`;
1692
1764
  }
1693
- class DownloadFailedError extends Error {
1765
+ class DevServerFileNotFoundError extends Error {
1694
1766
  constructor(body) {
1695
1767
  super(
1696
- `DOWNLOAD_FAILED: ${body.message}`
1768
+ `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
1697
1769
  );
1698
1770
  this.body = body;
1699
- this.name = "DownloadFailedError";
1771
+ this.name = "DevServerFileNotFoundError";
1700
1772
  }
1701
- static code = "DOWNLOAD_FAILED";
1702
- static statusCode = 500;
1703
- static description = `Failed to download repository: {message}`;
1773
+ static code = "DEV_SERVER_FILE_NOT_FOUND";
1774
+ static statusCode = 404;
1775
+ static description = `Dev server file not found: {path}`;
1704
1776
  }
1705
- class GitServerErrorError extends Error {
1777
+ class DevServerInvalidRequestError extends Error {
1706
1778
  constructor(body) {
1707
1779
  super(
1708
- `GIT_SERVER_ERROR: ${body.message}`
1780
+ `DEV_SERVER_INVALID_REQUEST: ${body.message}`
1709
1781
  );
1710
1782
  this.body = body;
1711
- this.name = "GitServerErrorError";
1783
+ this.name = "DevServerInvalidRequestError";
1712
1784
  }
1713
- static code = "GIT_SERVER_ERROR";
1714
- static statusCode = 500;
1715
- static description = `Git server error: {message}`;
1785
+ static code = "DEV_SERVER_INVALID_REQUEST";
1786
+ static statusCode = 400;
1787
+ static description = `Invalid dev server request: {message}`;
1716
1788
  }
1717
- class ParseResponseErrorError extends Error {
1789
+ class CloudstateInternalErrorError extends Error {
1718
1790
  constructor(body) {
1719
1791
  super(
1720
- `PARSE_RESPONSE_ERROR: ${body.message}`
1792
+ `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
1721
1793
  );
1722
1794
  this.body = body;
1723
- this.name = "ParseResponseErrorError";
1795
+ this.name = "CloudstateInternalErrorError";
1724
1796
  }
1725
- static code = "PARSE_RESPONSE_ERROR";
1797
+ static code = "CLOUDSTATE_INTERNAL_ERROR";
1726
1798
  static statusCode = 500;
1727
- static description = `Failed to parse response from Git server: {message}`;
1799
+ static description = `Internal error: {message}`;
1728
1800
  }
1729
- class RepositoryAccessDeniedError extends Error {
1801
+ class CloudstateDatabaseErrorError extends Error {
1730
1802
  constructor(body) {
1731
1803
  super(
1732
- `REPOSITORY_ACCESS_DENIED: ${body.message}`
1804
+ `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
1733
1805
  );
1734
1806
  this.body = body;
1735
- this.name = "RepositoryAccessDeniedError";
1807
+ this.name = "CloudstateDatabaseErrorError";
1736
1808
  }
1737
- static code = "REPOSITORY_ACCESS_DENIED";
1738
- static statusCode = 403;
1739
- static description = `Repository does not belong to account`;
1809
+ static code = "CLOUDSTATE_DATABASE_ERROR";
1810
+ static statusCode = 500;
1811
+ static description = `Database operation failed: {message}`;
1740
1812
  }
1741
- class GitHubSyncFailedError extends Error {
1813
+ class CloudstateAccessDeniedError extends Error {
1742
1814
  constructor(body) {
1743
1815
  super(
1744
- `GIT_HUB_SYNC_FAILED: ${body.message}`
1816
+ `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
1745
1817
  );
1746
1818
  this.body = body;
1747
- this.name = "GitHubSyncFailedError";
1819
+ this.name = "CloudstateAccessDeniedError";
1748
1820
  }
1749
- static code = "GIT_HUB_SYNC_FAILED";
1750
- static statusCode = 500;
1751
- static description = `Failed to configure GitHub sync: {message}`;
1821
+ static code = "CLOUDSTATE_ACCESS_DENIED";
1822
+ static statusCode = 403;
1823
+ static description = `Access denied to project: {project_id}`;
1752
1824
  }
1753
- class UpdateDefaultBranchFailedError extends Error {
1825
+ class RestoreFailedError extends Error {
1754
1826
  constructor(body) {
1755
1827
  super(
1756
- `UPDATE_DEFAULT_BRANCH_FAILED: ${body.message}`
1828
+ `RESTORE_FAILED: ${body.message}`
1757
1829
  );
1758
1830
  this.body = body;
1759
- this.name = "UpdateDefaultBranchFailedError";
1831
+ this.name = "RestoreFailedError";
1760
1832
  }
1761
- static code = "UPDATE_DEFAULT_BRANCH_FAILED";
1833
+ static code = "RESTORE_FAILED";
1762
1834
  static statusCode = 500;
1763
- static description = `Failed to update default branch: {message}`;
1835
+ static description = `Failed to restore from backup: {message}`;
1764
1836
  }
1765
- class GetRepositoryInfoFailedError extends Error {
1837
+ class CreateBackupFailedError extends Error {
1766
1838
  constructor(body) {
1767
1839
  super(
1768
- `GET_REPOSITORY_INFO_FAILED: ${body.message}`
1840
+ `CREATE_BACKUP_FAILED: ${body.message}`
1769
1841
  );
1770
1842
  this.body = body;
1771
- this.name = "GetRepositoryInfoFailedError";
1843
+ this.name = "CreateBackupFailedError";
1772
1844
  }
1773
- static code = "GET_REPOSITORY_INFO_FAILED";
1845
+ static code = "CREATE_BACKUP_FAILED";
1774
1846
  static statusCode = 500;
1775
- static description = `Failed to get repository info: {message}`;
1847
+ static description = `Failed to create backup: {message}`;
1776
1848
  }
1777
- class ListRepositoriesFailedError extends Error {
1849
+ class BackupFailedError extends Error {
1778
1850
  constructor(body) {
1779
1851
  super(
1780
- `LIST_REPOSITORIES_FAILED: ${body.message}`
1852
+ `BACKUP_FAILED: ${body.message}`
1781
1853
  );
1782
1854
  this.body = body;
1783
- this.name = "ListRepositoriesFailedError";
1855
+ this.name = "BackupFailedError";
1784
1856
  }
1785
- static code = "LIST_REPOSITORIES_FAILED";
1857
+ static code = "BACKUP_FAILED";
1786
1858
  static statusCode = 500;
1787
- static description = `Failed to list repositories: {message}`;
1859
+ static description = `Backup failed: {message}`;
1788
1860
  }
1789
- class DeleteRepositoryFailedError extends Error {
1861
+ class DeploymentFailedError extends Error {
1790
1862
  constructor(body) {
1791
1863
  super(
1792
- `DELETE_REPOSITORY_FAILED: ${body.message}`
1864
+ `DEPLOYMENT_FAILED: ${body.message}`
1793
1865
  );
1794
1866
  this.body = body;
1795
- this.name = "DeleteRepositoryFailedError";
1867
+ this.name = "DeploymentFailedError";
1796
1868
  }
1797
- static code = "DELETE_REPOSITORY_FAILED";
1869
+ static code = "DEPLOYMENT_FAILED";
1798
1870
  static statusCode = 500;
1799
- static description = `Failed to delete repository: {message}`;
1871
+ static description = `Deployment failed: {message}`;
1800
1872
  }
1801
- class CreateRepositoryFailedError extends Error {
1873
+ class InvalidDeploymentRequestError extends Error {
1802
1874
  constructor(body) {
1803
1875
  super(
1804
- `CREATE_REPOSITORY_FAILED: ${body.message}`
1876
+ `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
1805
1877
  );
1806
1878
  this.body = body;
1807
- this.name = "CreateRepositoryFailedError";
1879
+ this.name = "InvalidDeploymentRequestError";
1808
1880
  }
1809
- static code = "CREATE_REPOSITORY_FAILED";
1810
- static statusCode = 500;
1811
- static description = `Failed to create repository: {message}`;
1881
+ static code = "INVALID_DEPLOYMENT_REQUEST";
1882
+ static statusCode = 400;
1883
+ static description = `Invalid deployment request: {message}`;
1812
1884
  }
1813
- class SerializationErrorError extends Error {
1885
+ class ProjectNotFoundError extends Error {
1814
1886
  constructor(body) {
1815
1887
  super(
1816
- `SERIALIZATION_ERROR: ${body.message}`
1888
+ `PROJECT_NOT_FOUND: ${body.message}`
1817
1889
  );
1818
1890
  this.body = body;
1819
- this.name = "SerializationErrorError";
1891
+ this.name = "ProjectNotFoundError";
1820
1892
  }
1821
- static code = "SERIALIZATION_ERROR";
1822
- static statusCode = 400;
1823
- static description = `Failed to serialize request: {message}`;
1893
+ static code = "PROJECT_NOT_FOUND";
1894
+ static statusCode = 404;
1895
+ static description = `Project not found: {project_id}`;
1824
1896
  }
1825
- class GitInvalidRequestError extends Error {
1897
+ class BuildFailedError extends Error {
1826
1898
  constructor(body) {
1827
1899
  super(
1828
- `GIT_INVALID_REQUEST: ${body.message}`
1900
+ `BUILD_FAILED: ${body.message}`
1829
1901
  );
1830
1902
  this.body = body;
1831
- this.name = "GitInvalidRequestError";
1832
- }
1833
- static code = "GIT_INVALID_REQUEST";
1834
- static statusCode = 400;
1835
- static description = `Invalid request: {message}`;
1903
+ this.name = "BuildFailedError";
1904
+ }
1905
+ static code = "BUILD_FAILED";
1906
+ static statusCode = 500;
1907
+ static description = `Build failed on VM {vm_id}`;
1836
1908
  }
1837
- class RepositoryNotFoundError extends Error {
1909
+ class ServerDeploymentFailedError extends Error {
1838
1910
  constructor(body) {
1839
1911
  super(
1840
- `REPOSITORY_NOT_FOUND: ${body.message}`
1912
+ `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1841
1913
  );
1842
1914
  this.body = body;
1843
- this.name = "RepositoryNotFoundError";
1915
+ this.name = "ServerDeploymentFailedError";
1844
1916
  }
1845
- static code = "REPOSITORY_NOT_FOUND";
1846
- static statusCode = 404;
1847
- static description = `Repository not found: {repo_id}`;
1917
+ static code = "SERVER_DEPLOYMENT_FAILED";
1918
+ static statusCode = 502;
1919
+ static description = `Failed to deploy to servers`;
1848
1920
  }
1849
- class ExecuteInternalErrorError extends Error {
1921
+ class LockfileErrorError extends Error {
1850
1922
  constructor(body) {
1851
1923
  super(
1852
- `EXECUTE_INTERNAL_ERROR: ${body.message}`
1924
+ `LOCKFILE_ERROR: ${body.message}`
1853
1925
  );
1854
1926
  this.body = body;
1855
- this.name = "ExecuteInternalErrorError";
1927
+ this.name = "LockfileErrorError";
1856
1928
  }
1857
- static code = "EXECUTE_INTERNAL_ERROR";
1929
+ static code = "LOCKFILE_ERROR";
1858
1930
  static statusCode = 500;
1859
- static description = `Internal error: {message}`;
1931
+ static description = `Failed to generate dependency lockfile: {message}`;
1860
1932
  }
1861
- class ExecuteAccessDeniedError extends Error {
1933
+ class UploadErrorError extends Error {
1862
1934
  constructor(body) {
1863
1935
  super(
1864
- `EXECUTE_ACCESS_DENIED: ${body.message}`
1936
+ `UPLOAD_ERROR: ${body.message}`
1865
1937
  );
1866
1938
  this.body = body;
1867
- this.name = "ExecuteAccessDeniedError";
1939
+ this.name = "UploadErrorError";
1868
1940
  }
1869
- static code = "EXECUTE_ACCESS_DENIED";
1870
- static statusCode = 403;
1871
- static description = `Access denied to execute run`;
1941
+ static code = "UPLOAD_ERROR";
1942
+ static statusCode = 500;
1943
+ static description = `Failed to upload deployment to storage`;
1872
1944
  }
1873
- class ListRunsFailedError extends Error {
1945
+ class DomainMappingErrorError extends Error {
1874
1946
  constructor(body) {
1875
1947
  super(
1876
- `LIST_RUNS_FAILED: ${body.message}`
1948
+ `DOMAIN_MAPPING_ERROR: ${body.message}`
1877
1949
  );
1878
1950
  this.body = body;
1879
- this.name = "ListRunsFailedError";
1951
+ this.name = "DomainMappingErrorError";
1880
1952
  }
1881
- static code = "LIST_RUNS_FAILED";
1953
+ static code = "DOMAIN_MAPPING_ERROR";
1882
1954
  static statusCode = 500;
1883
- static description = `Failed to list execute runs: {message}`;
1955
+ static description = `Failed to configure domain mapping for: {domain}`;
1884
1956
  }
1885
- class ExecutionErrorError extends Error {
1957
+ class CertificateProvisioningErrorError extends Error {
1886
1958
  constructor(body) {
1887
1959
  super(
1888
- `EXECUTION_ERROR: ${body.message}`
1960
+ `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
1889
1961
  );
1890
1962
  this.body = body;
1891
- this.name = "ExecutionErrorError";
1963
+ this.name = "CertificateProvisioningErrorError";
1892
1964
  }
1893
- static code = "EXECUTION_ERROR";
1894
- static statusCode = 500;
1895
- static description = `Script execution error: {message}`;
1965
+ static code = "CERTIFICATE_PROVISIONING_ERROR";
1966
+ static statusCode = 502;
1967
+ static description = `Failed to provision certificate for domain: {domain}`;
1896
1968
  }
1897
- class ConnectionFailedError extends Error {
1969
+ class NoEntrypointFoundError extends Error {
1898
1970
  constructor(body) {
1899
1971
  super(
1900
- `CONNECTION_FAILED: ${body.message}`
1972
+ `NO_ENTRYPOINT_FOUND: ${body.message}`
1901
1973
  );
1902
1974
  this.body = body;
1903
- this.name = "ConnectionFailedError";
1975
+ this.name = "NoEntrypointFoundError";
1904
1976
  }
1905
- static code = "CONNECTION_FAILED";
1906
- static statusCode = 500;
1907
- static description = `Failed to connect to execute server: {message}`;
1977
+ static code = "NO_ENTRYPOINT_FOUND";
1978
+ static statusCode = 400;
1979
+ static description = `No entrypoint found in deployment`;
1908
1980
  }
1909
- class MetadataWriteFailedError extends Error {
1981
+ class EntrypointNotFoundError extends Error {
1910
1982
  constructor(body) {
1911
1983
  super(
1912
- `METADATA_WRITE_FAILED: ${body.message}`
1984
+ `ENTRYPOINT_NOT_FOUND: ${body.message}`
1913
1985
  );
1914
1986
  this.body = body;
1915
- this.name = "MetadataWriteFailedError";
1987
+ this.name = "EntrypointNotFoundError";
1916
1988
  }
1917
- static code = "METADATA_WRITE_FAILED";
1918
- static statusCode = 500;
1919
- static description = `Failed to write metadata file: {message}`;
1989
+ static code = "ENTRYPOINT_NOT_FOUND";
1990
+ static statusCode = 400;
1991
+ static description = `Entrypoint not found: {entrypoint}`;
1920
1992
  }
1921
- class NodeModulesInstallFailedError extends Error {
1993
+ class NoDomainOwnershipError extends Error {
1922
1994
  constructor(body) {
1923
1995
  super(
1924
- `NODE_MODULES_INSTALL_FAILED: ${body.message}`
1996
+ `NO_DOMAIN_OWNERSHIP: ${body.message}`
1925
1997
  );
1926
1998
  this.body = body;
1927
- this.name = "NodeModulesInstallFailedError";
1999
+ this.name = "NoDomainOwnershipError";
1928
2000
  }
1929
- static code = "NODE_MODULES_INSTALL_FAILED";
1930
- static statusCode = 500;
1931
- static description = `Failed to install node modules: {message}`;
2001
+ static code = "NO_DOMAIN_OWNERSHIP";
2002
+ static statusCode = 403;
2003
+ static description = `No domain ownership for: {domain}`;
1932
2004
  }
1933
- class NodeModulesDownloadFailedError extends Error {
2005
+ class InvalidDomainsError extends Error {
1934
2006
  constructor(body) {
1935
2007
  super(
1936
- `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
2008
+ `INVALID_DOMAINS: ${body.message}`
1937
2009
  );
1938
2010
  this.body = body;
1939
- this.name = "NodeModulesDownloadFailedError";
2011
+ this.name = "InvalidDomainsError";
1940
2012
  }
1941
- static code = "NODE_MODULES_DOWNLOAD_FAILED";
1942
- static statusCode = 500;
1943
- static description = `Failed to download node modules: {message}`;
2013
+ static code = "INVALID_DOMAINS";
2014
+ static statusCode = 400;
2015
+ static description = `Invalid domains provided`;
1944
2016
  }
1945
- class LockGenerationFailedError extends Error {
2017
+ class WebDeploymentBadRequestError extends Error {
1946
2018
  constructor(body) {
1947
2019
  super(
1948
- `LOCK_GENERATION_FAILED: ${body.message}`
2020
+ `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
1949
2021
  );
1950
2022
  this.body = body;
1951
- this.name = "LockGenerationFailedError";
2023
+ this.name = "WebDeploymentBadRequestError";
1952
2024
  }
1953
- static code = "LOCK_GENERATION_FAILED";
1954
- static statusCode = 500;
1955
- static description = `Failed to generate lock file: {message}`;
2025
+ static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2026
+ static statusCode = 400;
2027
+ static description = `Bad request: {message}`;
1956
2028
  }
1957
- class WriteScriptFailedError extends Error {
2029
+ class DeploymentNotFoundError extends Error {
1958
2030
  constructor(body) {
1959
2031
  super(
1960
- `WRITE_SCRIPT_FAILED: ${body.message}`
2032
+ `DEPLOYMENT_NOT_FOUND: ${body.message}`
1961
2033
  );
1962
2034
  this.body = body;
1963
- this.name = "WriteScriptFailedError";
2035
+ this.name = "DeploymentNotFoundError";
1964
2036
  }
1965
- static code = "WRITE_SCRIPT_FAILED";
1966
- static statusCode = 500;
1967
- static description = `Failed to write script file: {message}`;
2037
+ static code = "DEPLOYMENT_NOT_FOUND";
2038
+ static statusCode = 404;
2039
+ static description = `Deployment not found`;
1968
2040
  }
1969
- class DirectoryCreationFailedError extends Error {
2041
+ class PermissionAlreadyExistsError extends Error {
1970
2042
  constructor(body) {
1971
2043
  super(
1972
- `DIRECTORY_CREATION_FAILED: ${body.message}`
2044
+ `PERMISSION_ALREADY_EXISTS: ${body.message}`
1973
2045
  );
1974
2046
  this.body = body;
1975
- this.name = "DirectoryCreationFailedError";
2047
+ this.name = "PermissionAlreadyExistsError";
1976
2048
  }
1977
- static code = "DIRECTORY_CREATION_FAILED";
1978
- static statusCode = 500;
1979
- static description = `Failed to create script directory: {message}`;
2049
+ static code = "PERMISSION_ALREADY_EXISTS";
2050
+ static statusCode = 409;
2051
+ static description = `Permission already exists`;
1980
2052
  }
1981
- class NetworkPermissionsFailedError extends Error {
2053
+ class ListTokensFailedError extends Error {
1982
2054
  constructor(body) {
1983
2055
  super(
1984
- `NETWORK_PERMISSIONS_FAILED: ${body.message}`
2056
+ `LIST_TOKENS_FAILED: ${body.message}`
1985
2057
  );
1986
2058
  this.body = body;
1987
- this.name = "NetworkPermissionsFailedError";
2059
+ this.name = "ListTokensFailedError";
1988
2060
  }
1989
- static code = "NETWORK_PERMISSIONS_FAILED";
2061
+ static code = "LIST_TOKENS_FAILED";
1990
2062
  static statusCode = 500;
1991
- static description = `Failed to insert network permissions: {message}`;
2063
+ static description = `Failed to list tokens: {message}`;
1992
2064
  }
1993
- class LoggingFailedError extends Error {
2065
+ class RevokeTokenFailedError extends Error {
1994
2066
  constructor(body) {
1995
2067
  super(
1996
- `LOGGING_FAILED: ${body.message}`
2068
+ `REVOKE_TOKEN_FAILED: ${body.message}`
1997
2069
  );
1998
2070
  this.body = body;
1999
- this.name = "LoggingFailedError";
2071
+ this.name = "RevokeTokenFailedError";
2000
2072
  }
2001
- static code = "LOGGING_FAILED";
2073
+ static code = "REVOKE_TOKEN_FAILED";
2002
2074
  static statusCode = 500;
2003
- static description = `Failed to log execute run: {message}`;
2075
+ static description = `Failed to revoke token: {message}`;
2004
2076
  }
2005
- class RunNotFoundError extends Error {
2077
+ class CreateTokenFailedError extends Error {
2006
2078
  constructor(body) {
2007
2079
  super(
2008
- `RUN_NOT_FOUND: ${body.message}`
2080
+ `CREATE_TOKEN_FAILED: ${body.message}`
2009
2081
  );
2010
2082
  this.body = body;
2011
- this.name = "RunNotFoundError";
2083
+ this.name = "CreateTokenFailedError";
2012
2084
  }
2013
- static code = "RUN_NOT_FOUND";
2014
- static statusCode = 404;
2015
- static description = `Execute run not found: {run_id}`;
2085
+ static code = "CREATE_TOKEN_FAILED";
2086
+ static statusCode = 500;
2087
+ static description = `Failed to create token: {message}`;
2016
2088
  }
2017
- class FailedToProvisionCertificateError extends Error {
2089
+ class ListPermissionsFailedError extends Error {
2018
2090
  constructor(body) {
2019
2091
  super(
2020
- `FAILED_TO_PROVISION_CERTIFICATE: ${body.message}`
2092
+ `LIST_PERMISSIONS_FAILED: ${body.message}`
2021
2093
  );
2022
2094
  this.body = body;
2023
- this.name = "FailedToProvisionCertificateError";
2095
+ this.name = "ListPermissionsFailedError";
2024
2096
  }
2025
- static code = "FAILED_TO_PROVISION_CERTIFICATE";
2026
- static statusCode = 422;
2027
- static description = `Failed to provision certificate: {message}`;
2097
+ static code = "LIST_PERMISSIONS_FAILED";
2098
+ static statusCode = 500;
2099
+ static description = `Failed to list permissions: {message}`;
2028
2100
  }
2029
- class FailedToInsertDomainMappingError extends Error {
2101
+ class GetPermissionFailedError extends Error {
2030
2102
  constructor(body) {
2031
2103
  super(
2032
- `FAILED_TO_INSERT_DOMAIN_MAPPING: ${body.message}`
2104
+ `GET_PERMISSION_FAILED: ${body.message}`
2033
2105
  );
2034
2106
  this.body = body;
2035
- this.name = "FailedToInsertDomainMappingError";
2107
+ this.name = "GetPermissionFailedError";
2036
2108
  }
2037
- static code = "FAILED_TO_INSERT_DOMAIN_MAPPING";
2109
+ static code = "GET_PERMISSION_FAILED";
2038
2110
  static statusCode = 500;
2039
- static description = `Failed to insert domain mapping: {message}`;
2111
+ static description = `Failed to get permission: {message}`;
2040
2112
  }
2041
- class PermissionDeniedError extends Error {
2113
+ class UpdatePermissionFailedError extends Error {
2042
2114
  constructor(body) {
2043
2115
  super(
2044
- `PERMISSION_DENIED: ${body.message}`
2116
+ `UPDATE_PERMISSION_FAILED: ${body.message}`
2045
2117
  );
2046
2118
  this.body = body;
2047
- this.name = "PermissionDeniedError";
2119
+ this.name = "UpdatePermissionFailedError";
2048
2120
  }
2049
- static code = "PERMISSION_DENIED";
2050
- static statusCode = 401;
2051
- static description = `Permission denied: {message}`;
2121
+ static code = "UPDATE_PERMISSION_FAILED";
2122
+ static statusCode = 500;
2123
+ static description = `Failed to update permission: {message}`;
2052
2124
  }
2053
- class FailedToCheckPermissionsError extends Error {
2125
+ class RevokePermissionFailedError extends Error {
2054
2126
  constructor(body) {
2055
2127
  super(
2056
- `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
2128
+ `REVOKE_PERMISSION_FAILED: ${body.message}`
2057
2129
  );
2058
2130
  this.body = body;
2059
- this.name = "FailedToCheckPermissionsError";
2131
+ this.name = "RevokePermissionFailedError";
2060
2132
  }
2061
- static code = "FAILED_TO_CHECK_PERMISSIONS";
2062
- static statusCode = 502;
2063
- static description = `Failed to check permissions: {message}`;
2133
+ static code = "REVOKE_PERMISSION_FAILED";
2134
+ static statusCode = 500;
2135
+ static description = `Failed to revoke permission: {message}`;
2064
2136
  }
2065
- class FailedToListDomainsError extends Error {
2137
+ class GrantPermissionFailedError extends Error {
2066
2138
  constructor(body) {
2067
2139
  super(
2068
- `FAILED_TO_LIST_DOMAINS: ${body.message}`
2140
+ `GRANT_PERMISSION_FAILED: ${body.message}`
2069
2141
  );
2070
2142
  this.body = body;
2071
- this.name = "FailedToListDomainsError";
2143
+ this.name = "GrantPermissionFailedError";
2072
2144
  }
2073
- static code = "FAILED_TO_LIST_DOMAINS";
2145
+ static code = "GRANT_PERMISSION_FAILED";
2074
2146
  static statusCode = 500;
2075
- static description = `Failed to list domains: {message}`;
2147
+ static description = `Failed to grant permission: {message}`;
2076
2148
  }
2077
- class FailedToListVerificationsError extends Error {
2149
+ class ListIdentitiesFailedError extends Error {
2078
2150
  constructor(body) {
2079
2151
  super(
2080
- `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
2152
+ `LIST_IDENTITIES_FAILED: ${body.message}`
2081
2153
  );
2082
2154
  this.body = body;
2083
- this.name = "FailedToListVerificationsError";
2155
+ this.name = "ListIdentitiesFailedError";
2084
2156
  }
2085
- static code = "FAILED_TO_LIST_VERIFICATIONS";
2157
+ static code = "LIST_IDENTITIES_FAILED";
2086
2158
  static statusCode = 500;
2087
- static description = `Failed to list verifications: {message}`;
2159
+ static description = `Failed to list identities: {message}`;
2088
2160
  }
2089
- class FailedToVerifyDomainError extends Error {
2161
+ class DeleteIdentityFailedError extends Error {
2090
2162
  constructor(body) {
2091
2163
  super(
2092
- `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
2164
+ `DELETE_IDENTITY_FAILED: ${body.message}`
2093
2165
  );
2094
2166
  this.body = body;
2095
- this.name = "FailedToVerifyDomainError";
2167
+ this.name = "DeleteIdentityFailedError";
2096
2168
  }
2097
- static code = "FAILED_TO_VERIFY_DOMAIN";
2169
+ static code = "DELETE_IDENTITY_FAILED";
2098
2170
  static statusCode = 500;
2099
- static description = `Failed to verify domain: {message}`;
2171
+ static description = `Failed to delete identity: {message}`;
2100
2172
  }
2101
- class VerificationFailedError extends Error {
2173
+ class CreateIdentityFailedError extends Error {
2102
2174
  constructor(body) {
2103
2175
  super(
2104
- `VERIFICATION_FAILED: ${body.message}`
2176
+ `CREATE_IDENTITY_FAILED: ${body.message}`
2105
2177
  );
2106
2178
  this.body = body;
2107
- this.name = "VerificationFailedError";
2179
+ this.name = "CreateIdentityFailedError";
2108
2180
  }
2109
- static code = "VERIFICATION_FAILED";
2110
- static statusCode = 400;
2111
- static description = `Domain verification failed: {message}`;
2181
+ static code = "CREATE_IDENTITY_FAILED";
2182
+ static statusCode = 500;
2183
+ static description = `Failed to create identity: {message}`;
2112
2184
  }
2113
- class FailedToDeleteVerificationError extends Error {
2185
+ class VmPermissionNotFoundError extends Error {
2114
2186
  constructor(body) {
2115
2187
  super(
2116
- `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
2188
+ `VM_PERMISSION_NOT_FOUND: ${body.message}`
2117
2189
  );
2118
2190
  this.body = body;
2119
- this.name = "FailedToDeleteVerificationError";
2191
+ this.name = "VmPermissionNotFoundError";
2120
2192
  }
2121
- static code = "FAILED_TO_DELETE_VERIFICATION";
2122
- static statusCode = 400;
2123
- static description = `Failed to delete verification: {message}`;
2193
+ static code = "VM_PERMISSION_NOT_FOUND";
2194
+ static statusCode = 404;
2195
+ static description = `VM permission not found`;
2124
2196
  }
2125
- class VerificationNotFoundError extends Error {
2197
+ class PermissionNotFoundError extends Error {
2126
2198
  constructor(body) {
2127
2199
  super(
2128
- `VERIFICATION_NOT_FOUND: ${body.message}`
2200
+ `PERMISSION_NOT_FOUND: ${body.message}`
2129
2201
  );
2130
2202
  this.body = body;
2131
- this.name = "VerificationNotFoundError";
2203
+ this.name = "PermissionNotFoundError";
2132
2204
  }
2133
- static code = "VERIFICATION_NOT_FOUND";
2205
+ static code = "PERMISSION_NOT_FOUND";
2134
2206
  static statusCode = 404;
2135
- static description = `Verification request not found for domain: {domain}`;
2207
+ static description = `Permission not found`;
2136
2208
  }
2137
- class FailedToCreateVerificationCodeError extends Error {
2209
+ class GitRepositoryAccessDeniedError extends Error {
2138
2210
  constructor(body) {
2139
2211
  super(
2140
- `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
2212
+ `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
2141
2213
  );
2142
2214
  this.body = body;
2143
- this.name = "FailedToCreateVerificationCodeError";
2215
+ this.name = "GitRepositoryAccessDeniedError";
2144
2216
  }
2145
- static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
2146
- static statusCode = 400;
2147
- static description = `Failed to create verification code: {message}`;
2217
+ static code = "GIT_REPOSITORY_ACCESS_DENIED";
2218
+ static statusCode = 403;
2219
+ static description = `You are not allowed to access this repository`;
2148
2220
  }
2149
- class InvalidDomainError extends Error {
2221
+ class GitRepositoryNotFoundError extends Error {
2150
2222
  constructor(body) {
2151
2223
  super(
2152
- `INVALID_DOMAIN: ${body.message}`
2224
+ `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
2153
2225
  );
2154
2226
  this.body = body;
2155
- this.name = "InvalidDomainError";
2227
+ this.name = "GitRepositoryNotFoundError";
2156
2228
  }
2157
- static code = "INVALID_DOMAIN";
2158
- static statusCode = 400;
2159
- static description = `Invalid domain: {domain}`;
2229
+ static code = "GIT_REPOSITORY_NOT_FOUND";
2230
+ static statusCode = 404;
2231
+ static description = `Repository not found`;
2160
2232
  }
2161
- class LimitExceededError extends Error {
2233
+ class CannotDeleteManagedIdentityError extends Error {
2162
2234
  constructor(body) {
2163
2235
  super(
2164
- `LIMIT_EXCEEDED: ${body.message}`
2236
+ `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
2165
2237
  );
2166
2238
  this.body = body;
2167
- this.name = "LimitExceededError";
2239
+ this.name = "CannotDeleteManagedIdentityError";
2168
2240
  }
2169
- static code = "LIMIT_EXCEEDED";
2241
+ static code = "CANNOT_DELETE_MANAGED_IDENTITY";
2170
2242
  static statusCode = 403;
2171
- static description = `Domain limit exceeded: your plan allows {limit} domains, you currently have {current}`;
2243
+ static description = `Cannot delete managed identities`;
2172
2244
  }
2173
- class DomainOwnershipNotVerifiedError extends Error {
2245
+ class CannotModifyManagedIdentityError extends Error {
2174
2246
  constructor(body) {
2175
2247
  super(
2176
- `DOMAIN_OWNERSHIP_NOT_VERIFIED: ${body.message}`
2248
+ `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
2177
2249
  );
2178
2250
  this.body = body;
2179
- this.name = "DomainOwnershipNotVerifiedError";
2251
+ this.name = "CannotModifyManagedIdentityError";
2180
2252
  }
2181
- static code = "DOMAIN_OWNERSHIP_NOT_VERIFIED";
2182
- static statusCode = 401;
2183
- static description = `You have not verified ownership of domain: {domain}`;
2253
+ static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
2254
+ static statusCode = 403;
2255
+ static description = `Cannot modify managed identities`;
2184
2256
  }
2185
- class VmAccessDeniedForMappingError extends Error {
2257
+ class IdentityAccessDeniedError extends Error {
2186
2258
  constructor(body) {
2187
2259
  super(
2188
- `VM_ACCESS_DENIED_FOR_MAPPING: ${body.message}`
2260
+ `IDENTITY_ACCESS_DENIED: ${body.message}`
2189
2261
  );
2190
2262
  this.body = body;
2191
- this.name = "VmAccessDeniedForMappingError";
2263
+ this.name = "IdentityAccessDeniedError";
2192
2264
  }
2193
- static code = "VM_ACCESS_DENIED_FOR_MAPPING";
2194
- static statusCode = 401;
2195
- static description = `You do not have permission to map to this VM: {vm_id}`;
2265
+ static code = "IDENTITY_ACCESS_DENIED";
2266
+ static statusCode = 403;
2267
+ static description = `You are not allowed to access this identity`;
2196
2268
  }
2197
- class DeploymentAccessDeniedError extends Error {
2269
+ class IdentityNotFoundError extends Error {
2198
2270
  constructor(body) {
2199
2271
  super(
2200
- `DEPLOYMENT_ACCESS_DENIED: ${body.message}`
2272
+ `IDENTITY_NOT_FOUND: ${body.message}`
2201
2273
  );
2202
2274
  this.body = body;
2203
- this.name = "DeploymentAccessDeniedError";
2275
+ this.name = "IdentityNotFoundError";
2204
2276
  }
2205
- static code = "DEPLOYMENT_ACCESS_DENIED";
2206
- static statusCode = 401;
2207
- static description = `You do not have permission to map to this deployment: {deployment_id}`;
2277
+ static code = "IDENTITY_NOT_FOUND";
2278
+ static statusCode = 404;
2279
+ static description = `Identity not found`;
2208
2280
  }
2209
- class FailedToProvisionCertificateForMappingError extends Error {
2281
+ class ExecuteInternalErrorError extends Error {
2210
2282
  constructor(body) {
2211
2283
  super(
2212
- `FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING: ${body.message}`
2284
+ `EXECUTE_INTERNAL_ERROR: ${body.message}`
2213
2285
  );
2214
2286
  this.body = body;
2215
- this.name = "FailedToProvisionCertificateForMappingError";
2287
+ this.name = "ExecuteInternalErrorError";
2216
2288
  }
2217
- static code = "FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING";
2218
- static statusCode = 422;
2219
- static description = `Failed to provision certificate for mapping: {message}`;
2289
+ static code = "EXECUTE_INTERNAL_ERROR";
2290
+ static statusCode = 500;
2291
+ static description = `Internal error: {message}`;
2220
2292
  }
2221
- class FailedInsertDomainMappingError extends Error {
2293
+ class ExecuteAccessDeniedError extends Error {
2222
2294
  constructor(body) {
2223
2295
  super(
2224
- `FAILED_INSERT_DOMAIN_MAPPING: ${body.message}`
2296
+ `EXECUTE_ACCESS_DENIED: ${body.message}`
2225
2297
  );
2226
2298
  this.body = body;
2227
- this.name = "FailedInsertDomainMappingError";
2299
+ this.name = "ExecuteAccessDeniedError";
2228
2300
  }
2229
- static code = "FAILED_INSERT_DOMAIN_MAPPING";
2230
- static statusCode = 500;
2231
- static description = `Failed to insert domain mapping: {message}`;
2301
+ static code = "EXECUTE_ACCESS_DENIED";
2302
+ static statusCode = 403;
2303
+ static description = `Access denied to execute run`;
2232
2304
  }
2233
- class DomainAlreadyExistsError extends Error {
2305
+ class ListRunsFailedError extends Error {
2234
2306
  constructor(body) {
2235
2307
  super(
2236
- `DOMAIN_ALREADY_EXISTS: ${body.message}`
2308
+ `LIST_RUNS_FAILED: ${body.message}`
2237
2309
  );
2238
2310
  this.body = body;
2239
- this.name = "DomainAlreadyExistsError";
2311
+ this.name = "ListRunsFailedError";
2240
2312
  }
2241
- static code = "DOMAIN_ALREADY_EXISTS";
2242
- static statusCode = 400;
2243
- static description = `Domain already exists: {domain}`;
2313
+ static code = "LIST_RUNS_FAILED";
2314
+ static statusCode = 500;
2315
+ static description = `Failed to list execute runs: {message}`;
2244
2316
  }
2245
- class FailedToInsertOwnershipError extends Error {
2317
+ class ExecutionErrorError extends Error {
2246
2318
  constructor(body) {
2247
2319
  super(
2248
- `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
2320
+ `EXECUTION_ERROR: ${body.message}`
2249
2321
  );
2250
2322
  this.body = body;
2251
- this.name = "FailedToInsertOwnershipError";
2323
+ this.name = "ExecutionErrorError";
2252
2324
  }
2253
- static code = "FAILED_TO_INSERT_OWNERSHIP";
2325
+ static code = "EXECUTION_ERROR";
2254
2326
  static statusCode = 500;
2255
- static description = `Failed to insert domain ownership: {message}`;
2327
+ static description = `Script execution error: {message}`;
2256
2328
  }
2257
- class FailedRemoveDomainMappingError extends Error {
2329
+ class ConnectionFailedError extends Error {
2258
2330
  constructor(body) {
2259
2331
  super(
2260
- `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
2332
+ `CONNECTION_FAILED: ${body.message}`
2261
2333
  );
2262
2334
  this.body = body;
2263
- this.name = "FailedRemoveDomainMappingError";
2335
+ this.name = "ConnectionFailedError";
2264
2336
  }
2265
- static code = "FAILED_REMOVE_DOMAIN_MAPPING";
2337
+ static code = "CONNECTION_FAILED";
2266
2338
  static statusCode = 500;
2267
- static description = `Failed to remove domain mapping: {message}`;
2339
+ static description = `Failed to connect to execute server: {message}`;
2268
2340
  }
2269
- class FailedPermissionsCheckError extends Error {
2341
+ class MetadataWriteFailedError extends Error {
2270
2342
  constructor(body) {
2271
2343
  super(
2272
- `FAILED_PERMISSIONS_CHECK: ${body.message}`
2344
+ `METADATA_WRITE_FAILED: ${body.message}`
2273
2345
  );
2274
2346
  this.body = body;
2275
- this.name = "FailedPermissionsCheckError";
2347
+ this.name = "MetadataWriteFailedError";
2276
2348
  }
2277
- static code = "FAILED_PERMISSIONS_CHECK";
2278
- static statusCode = 401;
2279
- static description = `You do not have permission to delete the domain mapping for: {domain}`;
2349
+ static code = "METADATA_WRITE_FAILED";
2350
+ static statusCode = 500;
2351
+ static description = `Failed to write metadata file: {message}`;
2280
2352
  }
2281
- class FailedToCheckDomainMappingPermissionsError extends Error {
2353
+ class NodeModulesInstallFailedError extends Error {
2282
2354
  constructor(body) {
2283
2355
  super(
2284
- `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
2356
+ `NODE_MODULES_INSTALL_FAILED: ${body.message}`
2285
2357
  );
2286
2358
  this.body = body;
2287
- this.name = "FailedToCheckDomainMappingPermissionsError";
2359
+ this.name = "NodeModulesInstallFailedError";
2288
2360
  }
2289
- static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
2290
- static statusCode = 502;
2291
- static description = `Failed to check permissions: {message}`;
2361
+ static code = "NODE_MODULES_INSTALL_FAILED";
2362
+ static statusCode = 500;
2363
+ static description = `Failed to install node modules: {message}`;
2292
2364
  }
2293
- class CloudstateInternalErrorError extends Error {
2365
+ class NodeModulesDownloadFailedError extends Error {
2294
2366
  constructor(body) {
2295
2367
  super(
2296
- `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2368
+ `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
2297
2369
  );
2298
2370
  this.body = body;
2299
- this.name = "CloudstateInternalErrorError";
2371
+ this.name = "NodeModulesDownloadFailedError";
2300
2372
  }
2301
- static code = "CLOUDSTATE_INTERNAL_ERROR";
2373
+ static code = "NODE_MODULES_DOWNLOAD_FAILED";
2302
2374
  static statusCode = 500;
2303
- static description = `Internal error: {message}`;
2375
+ static description = `Failed to download node modules: {message}`;
2304
2376
  }
2305
- class CloudstateDatabaseErrorError extends Error {
2377
+ class LockGenerationFailedError extends Error {
2306
2378
  constructor(body) {
2307
2379
  super(
2308
- `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2380
+ `LOCK_GENERATION_FAILED: ${body.message}`
2309
2381
  );
2310
2382
  this.body = body;
2311
- this.name = "CloudstateDatabaseErrorError";
2383
+ this.name = "LockGenerationFailedError";
2312
2384
  }
2313
- static code = "CLOUDSTATE_DATABASE_ERROR";
2385
+ static code = "LOCK_GENERATION_FAILED";
2314
2386
  static statusCode = 500;
2315
- static description = `Database operation failed: {message}`;
2387
+ static description = `Failed to generate lock file: {message}`;
2316
2388
  }
2317
- class CloudstateAccessDeniedError extends Error {
2389
+ class WriteScriptFailedError extends Error {
2318
2390
  constructor(body) {
2319
2391
  super(
2320
- `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2392
+ `WRITE_SCRIPT_FAILED: ${body.message}`
2321
2393
  );
2322
2394
  this.body = body;
2323
- this.name = "CloudstateAccessDeniedError";
2395
+ this.name = "WriteScriptFailedError";
2324
2396
  }
2325
- static code = "CLOUDSTATE_ACCESS_DENIED";
2326
- static statusCode = 403;
2327
- static description = `Access denied to project: {project_id}`;
2397
+ static code = "WRITE_SCRIPT_FAILED";
2398
+ static statusCode = 500;
2399
+ static description = `Failed to write script file: {message}`;
2328
2400
  }
2329
- class RestoreFailedError extends Error {
2401
+ class DirectoryCreationFailedError extends Error {
2330
2402
  constructor(body) {
2331
2403
  super(
2332
- `RESTORE_FAILED: ${body.message}`
2404
+ `DIRECTORY_CREATION_FAILED: ${body.message}`
2333
2405
  );
2334
2406
  this.body = body;
2335
- this.name = "RestoreFailedError";
2407
+ this.name = "DirectoryCreationFailedError";
2336
2408
  }
2337
- static code = "RESTORE_FAILED";
2409
+ static code = "DIRECTORY_CREATION_FAILED";
2338
2410
  static statusCode = 500;
2339
- static description = `Failed to restore from backup: {message}`;
2411
+ static description = `Failed to create script directory: {message}`;
2340
2412
  }
2341
- class CreateBackupFailedError extends Error {
2413
+ class NetworkPermissionsFailedError extends Error {
2342
2414
  constructor(body) {
2343
2415
  super(
2344
- `CREATE_BACKUP_FAILED: ${body.message}`
2416
+ `NETWORK_PERMISSIONS_FAILED: ${body.message}`
2345
2417
  );
2346
2418
  this.body = body;
2347
- this.name = "CreateBackupFailedError";
2419
+ this.name = "NetworkPermissionsFailedError";
2348
2420
  }
2349
- static code = "CREATE_BACKUP_FAILED";
2421
+ static code = "NETWORK_PERMISSIONS_FAILED";
2350
2422
  static statusCode = 500;
2351
- static description = `Failed to create backup: {message}`;
2423
+ static description = `Failed to insert network permissions: {message}`;
2352
2424
  }
2353
- class BackupFailedError extends Error {
2425
+ class LoggingFailedError extends Error {
2354
2426
  constructor(body) {
2355
2427
  super(
2356
- `BACKUP_FAILED: ${body.message}`
2428
+ `LOGGING_FAILED: ${body.message}`
2357
2429
  );
2358
2430
  this.body = body;
2359
- this.name = "BackupFailedError";
2431
+ this.name = "LoggingFailedError";
2360
2432
  }
2361
- static code = "BACKUP_FAILED";
2433
+ static code = "LOGGING_FAILED";
2362
2434
  static statusCode = 500;
2363
- static description = `Backup failed: {message}`;
2435
+ static description = `Failed to log execute run: {message}`;
2364
2436
  }
2365
- class DeploymentFailedError extends Error {
2437
+ class RunNotFoundError extends Error {
2366
2438
  constructor(body) {
2367
2439
  super(
2368
- `DEPLOYMENT_FAILED: ${body.message}`
2440
+ `RUN_NOT_FOUND: ${body.message}`
2369
2441
  );
2370
2442
  this.body = body;
2371
- this.name = "DeploymentFailedError";
2443
+ this.name = "RunNotFoundError";
2372
2444
  }
2373
- static code = "DEPLOYMENT_FAILED";
2374
- static statusCode = 500;
2375
- static description = `Deployment failed: {message}`;
2445
+ static code = "RUN_NOT_FOUND";
2446
+ static statusCode = 404;
2447
+ static description = `Execute run not found: {run_id}`;
2376
2448
  }
2377
- class InvalidDeploymentRequestError extends Error {
2449
+ class FailedToProvisionCertificateError extends Error {
2378
2450
  constructor(body) {
2379
2451
  super(
2380
- `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2452
+ `FAILED_TO_PROVISION_CERTIFICATE: ${body.message}`
2381
2453
  );
2382
2454
  this.body = body;
2383
- this.name = "InvalidDeploymentRequestError";
2455
+ this.name = "FailedToProvisionCertificateError";
2384
2456
  }
2385
- static code = "INVALID_DEPLOYMENT_REQUEST";
2386
- static statusCode = 400;
2387
- static description = `Invalid deployment request: {message}`;
2457
+ static code = "FAILED_TO_PROVISION_CERTIFICATE";
2458
+ static statusCode = 422;
2459
+ static description = `Failed to provision certificate: {message}`;
2388
2460
  }
2389
- class ProjectNotFoundError extends Error {
2461
+ class FailedToInsertDomainMappingError extends Error {
2390
2462
  constructor(body) {
2391
2463
  super(
2392
- `PROJECT_NOT_FOUND: ${body.message}`
2464
+ `FAILED_TO_INSERT_DOMAIN_MAPPING: ${body.message}`
2393
2465
  );
2394
2466
  this.body = body;
2395
- this.name = "ProjectNotFoundError";
2467
+ this.name = "FailedToInsertDomainMappingError";
2396
2468
  }
2397
- static code = "PROJECT_NOT_FOUND";
2398
- static statusCode = 404;
2399
- static description = `Project not found: {project_id}`;
2469
+ static code = "FAILED_TO_INSERT_DOMAIN_MAPPING";
2470
+ static statusCode = 500;
2471
+ static description = `Failed to insert domain mapping: {message}`;
2400
2472
  }
2401
- class BuildFailedError extends Error {
2473
+ class PermissionDeniedError extends Error {
2402
2474
  constructor(body) {
2403
2475
  super(
2404
- `BUILD_FAILED: ${body.message}`
2476
+ `PERMISSION_DENIED: ${body.message}`
2405
2477
  );
2406
2478
  this.body = body;
2407
- this.name = "BuildFailedError";
2479
+ this.name = "PermissionDeniedError";
2408
2480
  }
2409
- static code = "BUILD_FAILED";
2410
- static statusCode = 500;
2411
- static description = `Build failed on VM {vm_id}`;
2481
+ static code = "PERMISSION_DENIED";
2482
+ static statusCode = 401;
2483
+ static description = `Permission denied: {message}`;
2412
2484
  }
2413
- class ServerDeploymentFailedError extends Error {
2485
+ class FailedToCheckPermissionsError extends Error {
2414
2486
  constructor(body) {
2415
2487
  super(
2416
- `SERVER_DEPLOYMENT_FAILED: ${body.message}`
2488
+ `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
2417
2489
  );
2418
2490
  this.body = body;
2419
- this.name = "ServerDeploymentFailedError";
2491
+ this.name = "FailedToCheckPermissionsError";
2420
2492
  }
2421
- static code = "SERVER_DEPLOYMENT_FAILED";
2493
+ static code = "FAILED_TO_CHECK_PERMISSIONS";
2422
2494
  static statusCode = 502;
2423
- static description = `Failed to deploy to servers`;
2495
+ static description = `Failed to check permissions: {message}`;
2424
2496
  }
2425
- class LockfileErrorError extends Error {
2497
+ class FailedToListDomainsError extends Error {
2426
2498
  constructor(body) {
2427
2499
  super(
2428
- `LOCKFILE_ERROR: ${body.message}`
2500
+ `FAILED_TO_LIST_DOMAINS: ${body.message}`
2429
2501
  );
2430
2502
  this.body = body;
2431
- this.name = "LockfileErrorError";
2503
+ this.name = "FailedToListDomainsError";
2432
2504
  }
2433
- static code = "LOCKFILE_ERROR";
2505
+ static code = "FAILED_TO_LIST_DOMAINS";
2434
2506
  static statusCode = 500;
2435
- static description = `Failed to generate dependency lockfile: {message}`;
2507
+ static description = `Failed to list domains: {message}`;
2436
2508
  }
2437
- class UploadErrorError extends Error {
2509
+ class FailedToListVerificationsError extends Error {
2438
2510
  constructor(body) {
2439
2511
  super(
2440
- `UPLOAD_ERROR: ${body.message}`
2512
+ `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
2441
2513
  );
2442
2514
  this.body = body;
2443
- this.name = "UploadErrorError";
2515
+ this.name = "FailedToListVerificationsError";
2444
2516
  }
2445
- static code = "UPLOAD_ERROR";
2517
+ static code = "FAILED_TO_LIST_VERIFICATIONS";
2446
2518
  static statusCode = 500;
2447
- static description = `Failed to upload deployment to storage`;
2519
+ static description = `Failed to list verifications: {message}`;
2448
2520
  }
2449
- class DomainMappingErrorError extends Error {
2521
+ class FailedToVerifyDomainError extends Error {
2450
2522
  constructor(body) {
2451
2523
  super(
2452
- `DOMAIN_MAPPING_ERROR: ${body.message}`
2524
+ `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
2453
2525
  );
2454
2526
  this.body = body;
2455
- this.name = "DomainMappingErrorError";
2527
+ this.name = "FailedToVerifyDomainError";
2456
2528
  }
2457
- static code = "DOMAIN_MAPPING_ERROR";
2529
+ static code = "FAILED_TO_VERIFY_DOMAIN";
2458
2530
  static statusCode = 500;
2459
- static description = `Failed to configure domain mapping for: {domain}`;
2531
+ static description = `Failed to verify domain: {message}`;
2460
2532
  }
2461
- class CertificateProvisioningErrorError extends Error {
2533
+ class VerificationFailedError extends Error {
2462
2534
  constructor(body) {
2463
2535
  super(
2464
- `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
2536
+ `VERIFICATION_FAILED: ${body.message}`
2465
2537
  );
2466
2538
  this.body = body;
2467
- this.name = "CertificateProvisioningErrorError";
2539
+ this.name = "VerificationFailedError";
2468
2540
  }
2469
- static code = "CERTIFICATE_PROVISIONING_ERROR";
2470
- static statusCode = 502;
2471
- static description = `Failed to provision certificate for domain: {domain}`;
2541
+ static code = "VERIFICATION_FAILED";
2542
+ static statusCode = 400;
2543
+ static description = `Domain verification failed: {message}`;
2472
2544
  }
2473
- class NoEntrypointFoundError extends Error {
2545
+ class FailedToDeleteVerificationError extends Error {
2474
2546
  constructor(body) {
2475
2547
  super(
2476
- `NO_ENTRYPOINT_FOUND: ${body.message}`
2548
+ `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
2477
2549
  );
2478
2550
  this.body = body;
2479
- this.name = "NoEntrypointFoundError";
2551
+ this.name = "FailedToDeleteVerificationError";
2480
2552
  }
2481
- static code = "NO_ENTRYPOINT_FOUND";
2553
+ static code = "FAILED_TO_DELETE_VERIFICATION";
2482
2554
  static statusCode = 400;
2483
- static description = `No entrypoint found in deployment`;
2555
+ static description = `Failed to delete verification: {message}`;
2484
2556
  }
2485
- class EntrypointNotFoundError extends Error {
2557
+ class VerificationNotFoundError extends Error {
2486
2558
  constructor(body) {
2487
2559
  super(
2488
- `ENTRYPOINT_NOT_FOUND: ${body.message}`
2560
+ `VERIFICATION_NOT_FOUND: ${body.message}`
2489
2561
  );
2490
2562
  this.body = body;
2491
- this.name = "EntrypointNotFoundError";
2563
+ this.name = "VerificationNotFoundError";
2492
2564
  }
2493
- static code = "ENTRYPOINT_NOT_FOUND";
2494
- static statusCode = 400;
2495
- static description = `Entrypoint not found: {entrypoint}`;
2565
+ static code = "VERIFICATION_NOT_FOUND";
2566
+ static statusCode = 404;
2567
+ static description = `Verification request not found for domain: {domain}`;
2496
2568
  }
2497
- class NoDomainOwnershipError extends Error {
2569
+ class FailedToCreateVerificationCodeError extends Error {
2498
2570
  constructor(body) {
2499
2571
  super(
2500
- `NO_DOMAIN_OWNERSHIP: ${body.message}`
2572
+ `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
2501
2573
  );
2502
2574
  this.body = body;
2503
- this.name = "NoDomainOwnershipError";
2575
+ this.name = "FailedToCreateVerificationCodeError";
2504
2576
  }
2505
- static code = "NO_DOMAIN_OWNERSHIP";
2506
- static statusCode = 403;
2507
- static description = `No domain ownership for: {domain}`;
2577
+ static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
2578
+ static statusCode = 400;
2579
+ static description = `Failed to create verification code: {message}`;
2508
2580
  }
2509
- class InvalidDomainsError extends Error {
2581
+ class InvalidDomainError extends Error {
2510
2582
  constructor(body) {
2511
2583
  super(
2512
- `INVALID_DOMAINS: ${body.message}`
2584
+ `INVALID_DOMAIN: ${body.message}`
2513
2585
  );
2514
2586
  this.body = body;
2515
- this.name = "InvalidDomainsError";
2587
+ this.name = "InvalidDomainError";
2516
2588
  }
2517
- static code = "INVALID_DOMAINS";
2589
+ static code = "INVALID_DOMAIN";
2518
2590
  static statusCode = 400;
2519
- static description = `Invalid domains provided`;
2591
+ static description = `Invalid domain: {domain}`;
2520
2592
  }
2521
- class WebDeploymentBadRequestError extends Error {
2593
+ class DomainOwnershipVerificationFailedError extends Error {
2522
2594
  constructor(body) {
2523
2595
  super(
2524
- `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
2596
+ `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
2525
2597
  );
2526
2598
  this.body = body;
2527
- this.name = "WebDeploymentBadRequestError";
2599
+ this.name = "DomainOwnershipVerificationFailedError";
2528
2600
  }
2529
- static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2530
- static statusCode = 400;
2531
- static description = `Bad request: {message}`;
2601
+ static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
2602
+ static statusCode = 403;
2603
+ static description = `Domain ownership verification failed`;
2532
2604
  }
2533
- class DeploymentNotFoundError extends Error {
2605
+ class ErrorDeletingRecordError extends Error {
2534
2606
  constructor(body) {
2535
2607
  super(
2536
- `DEPLOYMENT_NOT_FOUND: ${body.message}`
2608
+ `ERROR_DELETING_RECORD: ${body.message}`
2537
2609
  );
2538
2610
  this.body = body;
2539
- this.name = "DeploymentNotFoundError";
2611
+ this.name = "ErrorDeletingRecordError";
2540
2612
  }
2541
- static code = "DEPLOYMENT_NOT_FOUND";
2542
- static statusCode = 404;
2543
- static description = `Deployment not found`;
2613
+ static code = "ERROR_DELETING_RECORD";
2614
+ static statusCode = 500;
2615
+ static description = `Error deleting DNS record for {domain}/{name}: {message}`;
2544
2616
  }
2545
- class ObservabilityDatabaseErrorError extends Error {
2617
+ class RecordOwnershipErrorError extends Error {
2546
2618
  constructor(body) {
2547
2619
  super(
2548
- `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
2620
+ `RECORD_OWNERSHIP_ERROR: ${body.message}`
2549
2621
  );
2550
2622
  this.body = body;
2551
- this.name = "ObservabilityDatabaseErrorError";
2623
+ this.name = "RecordOwnershipErrorError";
2552
2624
  }
2553
- static code = "OBSERVABILITY_DATABASE_ERROR";
2625
+ static code = "RECORD_OWNERSHIP_ERROR";
2626
+ static statusCode = 403;
2627
+ static description = `Account {account_id} does not own record {record_id}`;
2628
+ }
2629
+ class ErrorCreatingRecordError extends Error {
2630
+ constructor(body) {
2631
+ super(
2632
+ `ERROR_CREATING_RECORD: ${body.message}`
2633
+ );
2634
+ this.body = body;
2635
+ this.name = "ErrorCreatingRecordError";
2636
+ }
2637
+ static code = "ERROR_CREATING_RECORD";
2554
2638
  static statusCode = 500;
2555
- static description = `Database operation failed: {message}`;
2639
+ static description = `Error creating DNS record: {message}`;
2556
2640
  }
2557
- class ObservabilityAccessDeniedError extends Error {
2641
+ class DomainOwnershipErrorError extends Error {
2558
2642
  constructor(body) {
2559
2643
  super(
2560
- `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
2644
+ `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
2561
2645
  );
2562
2646
  this.body = body;
2563
- this.name = "ObservabilityAccessDeniedError";
2647
+ this.name = "DomainOwnershipErrorError";
2564
2648
  }
2565
- static code = "OBSERVABILITY_ACCESS_DENIED";
2649
+ static code = "DOMAIN_OWNERSHIP_ERROR";
2566
2650
  static statusCode = 403;
2567
- static description = `Access denied to logs for deployment: {deployment_id}`;
2651
+ static description = `Account {account_id} does not own domain {domain}`;
2568
2652
  }
2569
- class ParseLogsFailedError extends Error {
2653
+ class UnauthorizedErrorError extends Error {
2570
2654
  constructor(body) {
2571
2655
  super(
2572
- `PARSE_LOGS_FAILED: ${body.message}`
2656
+ `UNAUTHORIZED_ERROR: ${body.message}`
2573
2657
  );
2574
2658
  this.body = body;
2575
- this.name = "ParseLogsFailedError";
2659
+ this.name = "UnauthorizedErrorError";
2576
2660
  }
2577
- static code = "PARSE_LOGS_FAILED";
2578
- static statusCode = 500;
2579
- static description = `Failed to parse logs: {message}`;
2661
+ static code = "UNAUTHORIZED_ERROR";
2662
+ static statusCode = 401;
2663
+ static description = `Unauthorized request to {route}`;
2580
2664
  }
2581
- class RetrieveLogsFailedError extends Error {
2665
+ class ExecuteLimitExceededError extends Error {
2582
2666
  constructor(body) {
2583
2667
  super(
2584
- `RETRIEVE_LOGS_FAILED: ${body.message}`
2668
+ `EXECUTE_LIMIT_EXCEEDED: ${body.message}`
2585
2669
  );
2586
2670
  this.body = body;
2587
- this.name = "RetrieveLogsFailedError";
2671
+ this.name = "ExecuteLimitExceededError";
2588
2672
  }
2589
- static code = "RETRIEVE_LOGS_FAILED";
2590
- static statusCode = 500;
2591
- static description = `Failed to retrieve logs: {message}`;
2673
+ static code = "EXECUTE_LIMIT_EXCEEDED";
2674
+ static statusCode = 403;
2675
+ static description = `Execute runs limit exceeded: your plan allows {limit} runs per month, you have used {current}`;
2592
2676
  }
2593
- class InvalidQueryError extends Error {
2677
+ class VmLimitExceededError extends Error {
2594
2678
  constructor(body) {
2595
2679
  super(
2596
- `INVALID_QUERY: ${body.message}`
2680
+ `VM_LIMIT_EXCEEDED: ${body.message}`
2597
2681
  );
2598
2682
  this.body = body;
2599
- this.name = "InvalidQueryError";
2683
+ this.name = "VmLimitExceededError";
2600
2684
  }
2601
- static code = "INVALID_QUERY";
2602
- static statusCode = 400;
2603
- static description = `Invalid log query: {message}`;
2685
+ static code = "VM_LIMIT_EXCEEDED";
2686
+ static statusCode = 403;
2687
+ static description = `VM limit exceeded: your plan allows {limit} VMs, you currently have {current}`;
2604
2688
  }
2605
- class LogsNotFoundError extends Error {
2689
+ class ScheduleNotFoundError extends Error {
2606
2690
  constructor(body) {
2607
2691
  super(
2608
- `LOGS_NOT_FOUND: ${body.message}`
2692
+ `SCHEDULE_NOT_FOUND: ${body.message}`
2609
2693
  );
2610
2694
  this.body = body;
2611
- this.name = "LogsNotFoundError";
2695
+ this.name = "ScheduleNotFoundError";
2612
2696
  }
2613
- static code = "LOGS_NOT_FOUND";
2697
+ static code = "SCHEDULE_NOT_FOUND";
2614
2698
  static statusCode = 404;
2615
- static description = `Logs not found for deployment: {deployment_id}`;
2699
+ static description = `Schedule not found`;
2616
2700
  }
2617
- class BrowserOperationFailedError extends Error {
2701
+ class ServiceUnavailableError extends Error {
2618
2702
  constructor(body) {
2619
2703
  super(
2620
- `BROWSER_OPERATION_FAILED: ${body.message}`
2704
+ `SERVICE_UNAVAILABLE: ${body.message}`
2621
2705
  );
2622
2706
  this.body = body;
2623
- this.name = "BrowserOperationFailedError";
2707
+ this.name = "ServiceUnavailableError";
2624
2708
  }
2625
- static code = "BROWSER_OPERATION_FAILED";
2626
- static statusCode = 500;
2627
- static description = `Browser operation failed: {message}`;
2709
+ static code = "SERVICE_UNAVAILABLE";
2710
+ static statusCode = 503;
2711
+ static description = `Cron service not configured`;
2628
2712
  }
2629
- class WatchFilesFailedError extends Error {
2713
+ class ResizeFailedError extends Error {
2630
2714
  constructor(body) {
2631
2715
  super(
2632
- `WATCH_FILES_FAILED: ${body.message}`
2716
+ `RESIZE_FAILED: ${body.message}`
2633
2717
  );
2634
2718
  this.body = body;
2635
- this.name = "WatchFilesFailedError";
2719
+ this.name = "ResizeFailedError";
2636
2720
  }
2637
- static code = "WATCH_FILES_FAILED";
2721
+ static code = "RESIZE_FAILED";
2638
2722
  static statusCode = 500;
2639
- static description = `Failed to watch files: {message}`;
2723
+ static description = `Failed to resize VM: {message}`;
2640
2724
  }
2641
- class LogsFailedError extends Error {
2725
+ class InternalResizeVmNotFoundError extends Error {
2642
2726
  constructor(body) {
2643
2727
  super(
2644
- `LOGS_FAILED: ${body.message}`
2728
+ `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
2645
2729
  );
2646
2730
  this.body = body;
2647
- this.name = "LogsFailedError";
2731
+ this.name = "InternalResizeVmNotFoundError";
2648
2732
  }
2649
- static code = "LOGS_FAILED";
2650
- static statusCode = 500;
2651
- static description = `Failed to get logs: {message}`;
2733
+ static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2734
+ static statusCode = 404;
2735
+ static description = `VM not found`;
2652
2736
  }
2653
- class StatusFailedError extends Error {
2737
+ class ObservabilityDatabaseErrorError extends Error {
2654
2738
  constructor(body) {
2655
2739
  super(
2656
- `STATUS_FAILED: ${body.message}`
2740
+ `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
2657
2741
  );
2658
2742
  this.body = body;
2659
- this.name = "StatusFailedError";
2743
+ this.name = "ObservabilityDatabaseErrorError";
2660
2744
  }
2661
- static code = "STATUS_FAILED";
2745
+ static code = "OBSERVABILITY_DATABASE_ERROR";
2662
2746
  static statusCode = 500;
2663
- static description = `Failed to get dev server status: {message}`;
2747
+ static description = `Database operation failed: {message}`;
2664
2748
  }
2665
- class RestartFailedError extends Error {
2749
+ class ObservabilityAccessDeniedError extends Error {
2666
2750
  constructor(body) {
2667
2751
  super(
2668
- `RESTART_FAILED: ${body.message}`
2752
+ `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
2669
2753
  );
2670
2754
  this.body = body;
2671
- this.name = "RestartFailedError";
2755
+ this.name = "ObservabilityAccessDeniedError";
2672
2756
  }
2673
- static code = "RESTART_FAILED";
2674
- static statusCode = 500;
2675
- static description = `Failed to restart dev server: {message}`;
2757
+ static code = "OBSERVABILITY_ACCESS_DENIED";
2758
+ static statusCode = 403;
2759
+ static description = `Access denied to logs for deployment: {deployment_id}`;
2676
2760
  }
2677
- class ShutdownFailedError extends Error {
2761
+ class ParseLogsFailedError extends Error {
2678
2762
  constructor(body) {
2679
2763
  super(
2680
- `SHUTDOWN_FAILED: ${body.message}`
2764
+ `PARSE_LOGS_FAILED: ${body.message}`
2681
2765
  );
2682
2766
  this.body = body;
2683
- this.name = "ShutdownFailedError";
2767
+ this.name = "ParseLogsFailedError";
2684
2768
  }
2685
- static code = "SHUTDOWN_FAILED";
2769
+ static code = "PARSE_LOGS_FAILED";
2686
2770
  static statusCode = 500;
2687
- static description = `Failed to shutdown dev server: {message}`;
2771
+ static description = `Failed to parse logs: {message}`;
2688
2772
  }
2689
- class CommitFailedError extends Error {
2773
+ class RetrieveLogsFailedError extends Error {
2690
2774
  constructor(body) {
2691
2775
  super(
2692
- `COMMIT_FAILED: ${body.message}`
2776
+ `RETRIEVE_LOGS_FAILED: ${body.message}`
2693
2777
  );
2694
2778
  this.body = body;
2695
- this.name = "CommitFailedError";
2779
+ this.name = "RetrieveLogsFailedError";
2696
2780
  }
2697
- static code = "COMMIT_FAILED";
2781
+ static code = "RETRIEVE_LOGS_FAILED";
2698
2782
  static statusCode = 500;
2699
- static description = `Failed to commit changes: {message}`;
2783
+ static description = `Failed to retrieve logs: {message}`;
2700
2784
  }
2701
- class WriteFileFailedError extends Error {
2785
+ class InvalidQueryError extends Error {
2702
2786
  constructor(body) {
2703
2787
  super(
2704
- `WRITE_FILE_FAILED: ${body.message}`
2788
+ `INVALID_QUERY: ${body.message}`
2705
2789
  );
2706
2790
  this.body = body;
2707
- this.name = "WriteFileFailedError";
2791
+ this.name = "InvalidQueryError";
2708
2792
  }
2709
- static code = "WRITE_FILE_FAILED";
2710
- static statusCode = 500;
2711
- static description = `Failed to write file: {message}`;
2793
+ static code = "INVALID_QUERY";
2794
+ static statusCode = 400;
2795
+ static description = `Invalid log query: {message}`;
2712
2796
  }
2713
- class ReadFileFailedError extends Error {
2797
+ class LogsNotFoundError extends Error {
2714
2798
  constructor(body) {
2715
2799
  super(
2716
- `READ_FILE_FAILED: ${body.message}`
2800
+ `LOGS_NOT_FOUND: ${body.message}`
2717
2801
  );
2718
2802
  this.body = body;
2719
- this.name = "ReadFileFailedError";
2803
+ this.name = "LogsNotFoundError";
2720
2804
  }
2721
- static code = "READ_FILE_FAILED";
2722
- static statusCode = 500;
2723
- static description = `Failed to read file: {message}`;
2805
+ static code = "LOGS_NOT_FOUND";
2806
+ static statusCode = 404;
2807
+ static description = `Logs not found for deployment: {deployment_id}`;
2724
2808
  }
2725
- class ExecutionFailedError extends Error {
2809
+ class TriggerErrorError extends Error {
2726
2810
  constructor(body) {
2727
2811
  super(
2728
- `EXECUTION_FAILED: ${body.message}`
2812
+ `TRIGGER_ERROR: ${body.message}`
2729
2813
  );
2730
2814
  this.body = body;
2731
- this.name = "ExecutionFailedError";
2815
+ this.name = "TriggerErrorError";
2732
2816
  }
2733
- static code = "EXECUTION_FAILED";
2817
+ static code = "TRIGGER_ERROR";
2734
2818
  static statusCode = 500;
2735
- static description = `Failed to execute command: {message}`;
2819
+ static description = `Failed to manage triggers: {message}`;
2736
2820
  }
2737
- class RequestFailedError extends Error {
2821
+ class TokenErrorError extends Error {
2738
2822
  constructor(body) {
2739
2823
  super(
2740
- `REQUEST_FAILED: ${body.message}`
2824
+ `TOKEN_ERROR: ${body.message}`
2741
2825
  );
2742
2826
  this.body = body;
2743
- this.name = "RequestFailedError";
2827
+ this.name = "TokenErrorError";
2744
2828
  }
2745
- static code = "REQUEST_FAILED";
2829
+ static code = "TOKEN_ERROR";
2746
2830
  static statusCode = 500;
2747
- static description = `Failed to request dev server: {message}`;
2831
+ static description = `Failed to manage tokens: {message}`;
2748
2832
  }
2749
- class DevServerFileNotFoundError extends Error {
2833
+ class PermissionErrorError extends Error {
2750
2834
  constructor(body) {
2751
2835
  super(
2752
- `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
2836
+ `PERMISSION_ERROR: ${body.message}`
2753
2837
  );
2754
2838
  this.body = body;
2755
- this.name = "DevServerFileNotFoundError";
2839
+ this.name = "PermissionErrorError";
2756
2840
  }
2757
- static code = "DEV_SERVER_FILE_NOT_FOUND";
2758
- static statusCode = 404;
2759
- static description = `Dev server file not found: {path}`;
2841
+ static code = "PERMISSION_ERROR";
2842
+ static statusCode = 500;
2843
+ static description = `Failed to manage permissions: {message}`;
2760
2844
  }
2761
- class DevServerInvalidRequestError extends Error {
2845
+ class IdentityErrorError extends Error {
2762
2846
  constructor(body) {
2763
2847
  super(
2764
- `DEV_SERVER_INVALID_REQUEST: ${body.message}`
2848
+ `IDENTITY_ERROR: ${body.message}`
2765
2849
  );
2766
2850
  this.body = body;
2767
- this.name = "DevServerInvalidRequestError";
2851
+ this.name = "IdentityErrorError";
2768
2852
  }
2769
- static code = "DEV_SERVER_INVALID_REQUEST";
2770
- static statusCode = 400;
2771
- static description = `Invalid dev server request: {message}`;
2853
+ static code = "IDENTITY_ERROR";
2854
+ static statusCode = 500;
2855
+ static description = `Failed to manage identity: {message}`;
2772
2856
  }
2773
- class ResizeFailedError extends Error {
2857
+ class GetContentFailedError extends Error {
2774
2858
  constructor(body) {
2775
2859
  super(
2776
- `RESIZE_FAILED: ${body.message}`
2860
+ `GET_CONTENT_FAILED: ${body.message}`
2777
2861
  );
2778
2862
  this.body = body;
2779
- this.name = "ResizeFailedError";
2863
+ this.name = "GetContentFailedError";
2780
2864
  }
2781
- static code = "RESIZE_FAILED";
2865
+ static code = "GET_CONTENT_FAILED";
2782
2866
  static statusCode = 500;
2783
- static description = `Failed to resize VM: {message}`;
2867
+ static description = `Failed to get content: {message}`;
2784
2868
  }
2785
- class InternalResizeVmNotFoundError extends Error {
2869
+ class ContentNotFoundError extends Error {
2786
2870
  constructor(body) {
2787
2871
  super(
2788
- `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
2872
+ `CONTENT_NOT_FOUND: ${body.message}`
2789
2873
  );
2790
2874
  this.body = body;
2791
- this.name = "InternalResizeVmNotFoundError";
2875
+ this.name = "ContentNotFoundError";
2792
2876
  }
2793
- static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2877
+ static code = "CONTENT_NOT_FOUND";
2794
2878
  static statusCode = 404;
2795
- static description = `VM not found`;
2879
+ static description = `Content not found: {path}`;
2796
2880
  }
2797
- class PermissionAlreadyExistsError extends Error {
2881
+ class DownloadFailedError extends Error {
2798
2882
  constructor(body) {
2799
2883
  super(
2800
- `PERMISSION_ALREADY_EXISTS: ${body.message}`
2884
+ `DOWNLOAD_FAILED: ${body.message}`
2801
2885
  );
2802
2886
  this.body = body;
2803
- this.name = "PermissionAlreadyExistsError";
2887
+ this.name = "DownloadFailedError";
2804
2888
  }
2805
- static code = "PERMISSION_ALREADY_EXISTS";
2806
- static statusCode = 409;
2807
- static description = `Permission already exists`;
2889
+ static code = "DOWNLOAD_FAILED";
2890
+ static statusCode = 500;
2891
+ static description = `Failed to download repository: {message}`;
2808
2892
  }
2809
- class ListTokensFailedError extends Error {
2893
+ class GitServerErrorError extends Error {
2810
2894
  constructor(body) {
2811
2895
  super(
2812
- `LIST_TOKENS_FAILED: ${body.message}`
2896
+ `GIT_SERVER_ERROR: ${body.message}`
2813
2897
  );
2814
2898
  this.body = body;
2815
- this.name = "ListTokensFailedError";
2899
+ this.name = "GitServerErrorError";
2816
2900
  }
2817
- static code = "LIST_TOKENS_FAILED";
2901
+ static code = "GIT_SERVER_ERROR";
2818
2902
  static statusCode = 500;
2819
- static description = `Failed to list tokens: {message}`;
2903
+ static description = `Git server error: {message}`;
2820
2904
  }
2821
- class RevokeTokenFailedError extends Error {
2905
+ class ParseResponseErrorError extends Error {
2822
2906
  constructor(body) {
2823
2907
  super(
2824
- `REVOKE_TOKEN_FAILED: ${body.message}`
2908
+ `PARSE_RESPONSE_ERROR: ${body.message}`
2825
2909
  );
2826
2910
  this.body = body;
2827
- this.name = "RevokeTokenFailedError";
2911
+ this.name = "ParseResponseErrorError";
2828
2912
  }
2829
- static code = "REVOKE_TOKEN_FAILED";
2913
+ static code = "PARSE_RESPONSE_ERROR";
2830
2914
  static statusCode = 500;
2831
- static description = `Failed to revoke token: {message}`;
2915
+ static description = `Failed to parse response from Git server: {message}`;
2832
2916
  }
2833
- class CreateTokenFailedError extends Error {
2917
+ class RepositoryAccessDeniedError extends Error {
2834
2918
  constructor(body) {
2835
2919
  super(
2836
- `CREATE_TOKEN_FAILED: ${body.message}`
2920
+ `REPOSITORY_ACCESS_DENIED: ${body.message}`
2837
2921
  );
2838
2922
  this.body = body;
2839
- this.name = "CreateTokenFailedError";
2923
+ this.name = "RepositoryAccessDeniedError";
2840
2924
  }
2841
- static code = "CREATE_TOKEN_FAILED";
2842
- static statusCode = 500;
2843
- static description = `Failed to create token: {message}`;
2925
+ static code = "REPOSITORY_ACCESS_DENIED";
2926
+ static statusCode = 403;
2927
+ static description = `Repository does not belong to account`;
2844
2928
  }
2845
- class ListPermissionsFailedError extends Error {
2929
+ class GitHubSyncFailedError extends Error {
2846
2930
  constructor(body) {
2847
2931
  super(
2848
- `LIST_PERMISSIONS_FAILED: ${body.message}`
2932
+ `GIT_HUB_SYNC_FAILED: ${body.message}`
2849
2933
  );
2850
2934
  this.body = body;
2851
- this.name = "ListPermissionsFailedError";
2935
+ this.name = "GitHubSyncFailedError";
2852
2936
  }
2853
- static code = "LIST_PERMISSIONS_FAILED";
2937
+ static code = "GIT_HUB_SYNC_FAILED";
2854
2938
  static statusCode = 500;
2855
- static description = `Failed to list permissions: {message}`;
2939
+ static description = `Failed to configure GitHub sync: {message}`;
2856
2940
  }
2857
- class GetPermissionFailedError extends Error {
2941
+ class UpdateDefaultBranchFailedError extends Error {
2858
2942
  constructor(body) {
2859
2943
  super(
2860
- `GET_PERMISSION_FAILED: ${body.message}`
2944
+ `UPDATE_DEFAULT_BRANCH_FAILED: ${body.message}`
2861
2945
  );
2862
2946
  this.body = body;
2863
- this.name = "GetPermissionFailedError";
2947
+ this.name = "UpdateDefaultBranchFailedError";
2864
2948
  }
2865
- static code = "GET_PERMISSION_FAILED";
2949
+ static code = "UPDATE_DEFAULT_BRANCH_FAILED";
2866
2950
  static statusCode = 500;
2867
- static description = `Failed to get permission: {message}`;
2951
+ static description = `Failed to update default branch: {message}`;
2868
2952
  }
2869
- class UpdatePermissionFailedError extends Error {
2953
+ class GetRepositoryInfoFailedError extends Error {
2870
2954
  constructor(body) {
2871
2955
  super(
2872
- `UPDATE_PERMISSION_FAILED: ${body.message}`
2956
+ `GET_REPOSITORY_INFO_FAILED: ${body.message}`
2873
2957
  );
2874
2958
  this.body = body;
2875
- this.name = "UpdatePermissionFailedError";
2959
+ this.name = "GetRepositoryInfoFailedError";
2876
2960
  }
2877
- static code = "UPDATE_PERMISSION_FAILED";
2961
+ static code = "GET_REPOSITORY_INFO_FAILED";
2878
2962
  static statusCode = 500;
2879
- static description = `Failed to update permission: {message}`;
2963
+ static description = `Failed to get repository info: {message}`;
2880
2964
  }
2881
- class RevokePermissionFailedError extends Error {
2965
+ class ListRepositoriesFailedError extends Error {
2882
2966
  constructor(body) {
2883
2967
  super(
2884
- `REVOKE_PERMISSION_FAILED: ${body.message}`
2968
+ `LIST_REPOSITORIES_FAILED: ${body.message}`
2885
2969
  );
2886
2970
  this.body = body;
2887
- this.name = "RevokePermissionFailedError";
2971
+ this.name = "ListRepositoriesFailedError";
2888
2972
  }
2889
- static code = "REVOKE_PERMISSION_FAILED";
2973
+ static code = "LIST_REPOSITORIES_FAILED";
2890
2974
  static statusCode = 500;
2891
- static description = `Failed to revoke permission: {message}`;
2975
+ static description = `Failed to list repositories: {message}`;
2892
2976
  }
2893
- class GrantPermissionFailedError extends Error {
2977
+ class DeleteRepositoryFailedError extends Error {
2894
2978
  constructor(body) {
2895
2979
  super(
2896
- `GRANT_PERMISSION_FAILED: ${body.message}`
2980
+ `DELETE_REPOSITORY_FAILED: ${body.message}`
2897
2981
  );
2898
2982
  this.body = body;
2899
- this.name = "GrantPermissionFailedError";
2983
+ this.name = "DeleteRepositoryFailedError";
2900
2984
  }
2901
- static code = "GRANT_PERMISSION_FAILED";
2985
+ static code = "DELETE_REPOSITORY_FAILED";
2902
2986
  static statusCode = 500;
2903
- static description = `Failed to grant permission: {message}`;
2987
+ static description = `Failed to delete repository: {message}`;
2904
2988
  }
2905
- class ListIdentitiesFailedError extends Error {
2989
+ class CreateRepositoryFailedError extends Error {
2906
2990
  constructor(body) {
2907
2991
  super(
2908
- `LIST_IDENTITIES_FAILED: ${body.message}`
2992
+ `CREATE_REPOSITORY_FAILED: ${body.message}`
2909
2993
  );
2910
2994
  this.body = body;
2911
- this.name = "ListIdentitiesFailedError";
2995
+ this.name = "CreateRepositoryFailedError";
2912
2996
  }
2913
- static code = "LIST_IDENTITIES_FAILED";
2997
+ static code = "CREATE_REPOSITORY_FAILED";
2914
2998
  static statusCode = 500;
2915
- static description = `Failed to list identities: {message}`;
2999
+ static description = `Failed to create repository: {message}`;
2916
3000
  }
2917
- class DeleteIdentityFailedError extends Error {
3001
+ class SerializationErrorError extends Error {
2918
3002
  constructor(body) {
2919
3003
  super(
2920
- `DELETE_IDENTITY_FAILED: ${body.message}`
3004
+ `SERIALIZATION_ERROR: ${body.message}`
2921
3005
  );
2922
3006
  this.body = body;
2923
- this.name = "DeleteIdentityFailedError";
3007
+ this.name = "SerializationErrorError";
2924
3008
  }
2925
- static code = "DELETE_IDENTITY_FAILED";
2926
- static statusCode = 500;
2927
- static description = `Failed to delete identity: {message}`;
3009
+ static code = "SERIALIZATION_ERROR";
3010
+ static statusCode = 400;
3011
+ static description = `Failed to serialize request: {message}`;
2928
3012
  }
2929
- class CreateIdentityFailedError extends Error {
3013
+ class GitInvalidRequestError extends Error {
2930
3014
  constructor(body) {
2931
3015
  super(
2932
- `CREATE_IDENTITY_FAILED: ${body.message}`
3016
+ `GIT_INVALID_REQUEST: ${body.message}`
2933
3017
  );
2934
3018
  this.body = body;
2935
- this.name = "CreateIdentityFailedError";
3019
+ this.name = "GitInvalidRequestError";
2936
3020
  }
2937
- static code = "CREATE_IDENTITY_FAILED";
2938
- static statusCode = 500;
2939
- static description = `Failed to create identity: {message}`;
3021
+ static code = "GIT_INVALID_REQUEST";
3022
+ static statusCode = 400;
3023
+ static description = `Invalid request: {message}`;
2940
3024
  }
2941
- class VmPermissionNotFoundError extends Error {
3025
+ class RepositoryNotFoundError extends Error {
2942
3026
  constructor(body) {
2943
3027
  super(
2944
- `VM_PERMISSION_NOT_FOUND: ${body.message}`
3028
+ `REPOSITORY_NOT_FOUND: ${body.message}`
2945
3029
  );
2946
3030
  this.body = body;
2947
- this.name = "VmPermissionNotFoundError";
3031
+ this.name = "RepositoryNotFoundError";
2948
3032
  }
2949
- static code = "VM_PERMISSION_NOT_FOUND";
3033
+ static code = "REPOSITORY_NOT_FOUND";
2950
3034
  static statusCode = 404;
2951
- static description = `VM permission not found`;
3035
+ static description = `Repository not found: {repo_id}`;
2952
3036
  }
2953
- class PermissionNotFoundError extends Error {
3037
+ class LimitExceededError extends Error {
2954
3038
  constructor(body) {
2955
3039
  super(
2956
- `PERMISSION_NOT_FOUND: ${body.message}`
3040
+ `LIMIT_EXCEEDED: ${body.message}`
2957
3041
  );
2958
3042
  this.body = body;
2959
- this.name = "PermissionNotFoundError";
3043
+ this.name = "LimitExceededError";
2960
3044
  }
2961
- static code = "PERMISSION_NOT_FOUND";
2962
- static statusCode = 404;
2963
- static description = `Permission not found`;
3045
+ static code = "LIMIT_EXCEEDED";
3046
+ static statusCode = 403;
3047
+ static description = `Domain limit exceeded: your plan allows {limit} domains, you currently have {current}`;
2964
3048
  }
2965
- class GitRepositoryAccessDeniedError extends Error {
3049
+ class DomainOwnershipNotVerifiedError extends Error {
2966
3050
  constructor(body) {
2967
3051
  super(
2968
- `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
3052
+ `DOMAIN_OWNERSHIP_NOT_VERIFIED: ${body.message}`
2969
3053
  );
2970
3054
  this.body = body;
2971
- this.name = "GitRepositoryAccessDeniedError";
3055
+ this.name = "DomainOwnershipNotVerifiedError";
2972
3056
  }
2973
- static code = "GIT_REPOSITORY_ACCESS_DENIED";
2974
- static statusCode = 403;
2975
- static description = `You are not allowed to access this repository`;
3057
+ static code = "DOMAIN_OWNERSHIP_NOT_VERIFIED";
3058
+ static statusCode = 401;
3059
+ static description = `You have not verified ownership of domain: {domain}`;
2976
3060
  }
2977
- class GitRepositoryNotFoundError extends Error {
3061
+ class VmAccessDeniedForMappingError extends Error {
2978
3062
  constructor(body) {
2979
3063
  super(
2980
- `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
3064
+ `VM_ACCESS_DENIED_FOR_MAPPING: ${body.message}`
2981
3065
  );
2982
3066
  this.body = body;
2983
- this.name = "GitRepositoryNotFoundError";
3067
+ this.name = "VmAccessDeniedForMappingError";
2984
3068
  }
2985
- static code = "GIT_REPOSITORY_NOT_FOUND";
2986
- static statusCode = 404;
2987
- static description = `Repository not found`;
3069
+ static code = "VM_ACCESS_DENIED_FOR_MAPPING";
3070
+ static statusCode = 401;
3071
+ static description = `You do not have permission to map to this VM: {vm_id}`;
2988
3072
  }
2989
- class CannotDeleteManagedIdentityError extends Error {
3073
+ class DeploymentAccessDeniedError extends Error {
2990
3074
  constructor(body) {
2991
3075
  super(
2992
- `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
3076
+ `DEPLOYMENT_ACCESS_DENIED: ${body.message}`
2993
3077
  );
2994
3078
  this.body = body;
2995
- this.name = "CannotDeleteManagedIdentityError";
3079
+ this.name = "DeploymentAccessDeniedError";
2996
3080
  }
2997
- static code = "CANNOT_DELETE_MANAGED_IDENTITY";
2998
- static statusCode = 403;
2999
- static description = `Cannot delete managed identities`;
3081
+ static code = "DEPLOYMENT_ACCESS_DENIED";
3082
+ static statusCode = 401;
3083
+ static description = `You do not have permission to map to this deployment: {deployment_id}`;
3000
3084
  }
3001
- class CannotModifyManagedIdentityError extends Error {
3085
+ class FailedToProvisionCertificateForMappingError extends Error {
3002
3086
  constructor(body) {
3003
3087
  super(
3004
- `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
3088
+ `FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING: ${body.message}`
3005
3089
  );
3006
3090
  this.body = body;
3007
- this.name = "CannotModifyManagedIdentityError";
3091
+ this.name = "FailedToProvisionCertificateForMappingError";
3008
3092
  }
3009
- static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
3010
- static statusCode = 403;
3011
- static description = `Cannot modify managed identities`;
3093
+ static code = "FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING";
3094
+ static statusCode = 422;
3095
+ static description = `Failed to provision certificate for mapping: {message}`;
3012
3096
  }
3013
- class IdentityAccessDeniedError extends Error {
3097
+ class FailedInsertDomainMappingError extends Error {
3014
3098
  constructor(body) {
3015
3099
  super(
3016
- `IDENTITY_ACCESS_DENIED: ${body.message}`
3100
+ `FAILED_INSERT_DOMAIN_MAPPING: ${body.message}`
3017
3101
  );
3018
3102
  this.body = body;
3019
- this.name = "IdentityAccessDeniedError";
3103
+ this.name = "FailedInsertDomainMappingError";
3020
3104
  }
3021
- static code = "IDENTITY_ACCESS_DENIED";
3022
- static statusCode = 403;
3023
- static description = `You are not allowed to access this identity`;
3105
+ static code = "FAILED_INSERT_DOMAIN_MAPPING";
3106
+ static statusCode = 500;
3107
+ static description = `Failed to insert domain mapping: {message}`;
3024
3108
  }
3025
- class IdentityNotFoundError extends Error {
3109
+ class DomainAlreadyExistsError extends Error {
3026
3110
  constructor(body) {
3027
3111
  super(
3028
- `IDENTITY_NOT_FOUND: ${body.message}`
3112
+ `DOMAIN_ALREADY_EXISTS: ${body.message}`
3029
3113
  );
3030
3114
  this.body = body;
3031
- this.name = "IdentityNotFoundError";
3115
+ this.name = "DomainAlreadyExistsError";
3032
3116
  }
3033
- static code = "IDENTITY_NOT_FOUND";
3034
- static statusCode = 404;
3035
- static description = `Identity not found`;
3117
+ static code = "DOMAIN_ALREADY_EXISTS";
3118
+ static statusCode = 400;
3119
+ static description = `Domain already exists: {domain}`;
3036
3120
  }
3037
- class DomainOwnershipVerificationFailedError extends Error {
3121
+ class FailedToInsertOwnershipError extends Error {
3038
3122
  constructor(body) {
3039
3123
  super(
3040
- `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
3124
+ `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
3041
3125
  );
3042
3126
  this.body = body;
3043
- this.name = "DomainOwnershipVerificationFailedError";
3127
+ this.name = "FailedToInsertOwnershipError";
3044
3128
  }
3045
- static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
3046
- static statusCode = 403;
3047
- static description = `Domain ownership verification failed`;
3129
+ static code = "FAILED_TO_INSERT_OWNERSHIP";
3130
+ static statusCode = 500;
3131
+ static description = `Failed to insert domain ownership: {message}`;
3048
3132
  }
3049
- class ErrorDeletingRecordError extends Error {
3133
+ class FailedRemoveDomainMappingError extends Error {
3050
3134
  constructor(body) {
3051
3135
  super(
3052
- `ERROR_DELETING_RECORD: ${body.message}`
3136
+ `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
3053
3137
  );
3054
3138
  this.body = body;
3055
- this.name = "ErrorDeletingRecordError";
3139
+ this.name = "FailedRemoveDomainMappingError";
3056
3140
  }
3057
- static code = "ERROR_DELETING_RECORD";
3141
+ static code = "FAILED_REMOVE_DOMAIN_MAPPING";
3058
3142
  static statusCode = 500;
3059
- static description = `Error deleting DNS record for {domain}/{name}: {message}`;
3143
+ static description = `Failed to remove domain mapping: {message}`;
3060
3144
  }
3061
- class RecordOwnershipErrorError extends Error {
3145
+ class FailedPermissionsCheckError extends Error {
3062
3146
  constructor(body) {
3063
3147
  super(
3064
- `RECORD_OWNERSHIP_ERROR: ${body.message}`
3148
+ `FAILED_PERMISSIONS_CHECK: ${body.message}`
3065
3149
  );
3066
3150
  this.body = body;
3067
- this.name = "RecordOwnershipErrorError";
3151
+ this.name = "FailedPermissionsCheckError";
3068
3152
  }
3069
- static code = "RECORD_OWNERSHIP_ERROR";
3070
- static statusCode = 403;
3071
- static description = `Account {account_id} does not own record {record_id}`;
3153
+ static code = "FAILED_PERMISSIONS_CHECK";
3154
+ static statusCode = 401;
3155
+ static description = `You do not have permission to delete the domain mapping for: {domain}`;
3072
3156
  }
3073
- class ErrorCreatingRecordError extends Error {
3157
+ class FailedToCheckDomainMappingPermissionsError extends Error {
3074
3158
  constructor(body) {
3075
3159
  super(
3076
- `ERROR_CREATING_RECORD: ${body.message}`
3160
+ `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
3077
3161
  );
3078
3162
  this.body = body;
3079
- this.name = "ErrorCreatingRecordError";
3163
+ this.name = "FailedToCheckDomainMappingPermissionsError";
3080
3164
  }
3081
- static code = "ERROR_CREATING_RECORD";
3082
- static statusCode = 500;
3083
- static description = `Error creating DNS record: {message}`;
3165
+ static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
3166
+ static statusCode = 502;
3167
+ static description = `Failed to check permissions: {message}`;
3084
3168
  }
3085
- class DomainOwnershipErrorError extends Error {
3169
+ class GitRepoLimitExceededError extends Error {
3086
3170
  constructor(body) {
3087
3171
  super(
3088
- `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
3172
+ `GIT_REPO_LIMIT_EXCEEDED: ${body.message}`
3089
3173
  );
3090
3174
  this.body = body;
3091
- this.name = "DomainOwnershipErrorError";
3175
+ this.name = "GitRepoLimitExceededError";
3092
3176
  }
3093
- static code = "DOMAIN_OWNERSHIP_ERROR";
3177
+ static code = "GIT_REPO_LIMIT_EXCEEDED";
3094
3178
  static statusCode = 403;
3095
- static description = `Account {account_id} does not own domain {domain}`;
3179
+ static description = `Repository limit exceeded: your plan allows {limit} repositories, you currently have {current}`;
3096
3180
  }
3097
- class UnauthorizedErrorError extends Error {
3181
+ class BranchNameEmptyError extends Error {
3098
3182
  constructor(body) {
3099
3183
  super(
3100
- `UNAUTHORIZED_ERROR: ${body.message}`
3184
+ `BRANCH_NAME_EMPTY: ${body.message}`
3101
3185
  );
3102
3186
  this.body = body;
3103
- this.name = "UnauthorizedErrorError";
3187
+ this.name = "BranchNameEmptyError";
3104
3188
  }
3105
- static code = "UNAUTHORIZED_ERROR";
3106
- static statusCode = 401;
3107
- static description = `Unauthorized request to {route}`;
3189
+ static code = "BRANCH_NAME_EMPTY";
3190
+ static statusCode = 400;
3191
+ static description = `Branch name cannot be empty`;
3108
3192
  }
3109
3193
  const FREESTYLE_ERROR_CODE_MAP = {
3110
3194
  "GIT_ERROR": GitErrorError,
@@ -3113,43 +3197,17 @@ const FREESTYLE_ERROR_CODE_MAP = {
3113
3197
  "BAD_SIGNATURE": BadSignatureError,
3114
3198
  "BAD_HEADER": BadHeaderError,
3115
3199
  "BAD_KEY": BadKeyError,
3116
- "ACTIVE_TRANSACTION_ERROR": ActiveTransactionErrorError,
3117
- "INTERNAL_ERROR": InternalErrorError,
3118
- "ROOTFS_COPY_ERROR": RootfsCopyErrorError,
3119
- "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
3120
- "VM_NOT_RUNNING": VmNotRunningError,
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
- "RESUMED_VM_NON_RESPONSIVE": ResumedVmNonResponsiveError,
3128
- "SNAPSHOT_LOAD_TIMEOUT": SnapshotLoadTimeoutError,
3129
- "UFFD_TIMEOUT_ERROR": UffdTimeoutErrorError,
3130
- "KERNEL_PANIC": KernelPanicError,
3131
- "VM_DELETED": VmDeletedError,
3132
- "REQWEST": ReqwestError,
3133
- "FIRECRACKER_PID_NOT_FOUND": FirecrackerPidNotFoundError,
3134
- "FIRECRACKER_API_SOCKET_NOT_FOUND": FirecrackerApiSocketNotFoundError,
3135
- "INVALID_SNAPSHOT_ID": InvalidSnapshotIdError,
3136
- "VM_START_TIMEOUT": VmStartTimeoutError,
3137
- "VM_EXIT_DURING_START": VmExitDuringStartError,
3138
- "VM_ACCESS_DENIED": VmAccessDeniedError,
3139
- "STD_IO": StdIoError,
3140
- "VM_CREATE_TMUX_SESSION": VmCreateTmuxSessionError,
3141
- "VM_SUBNET_NOT_FOUND": VmSubnetNotFoundError,
3142
3200
  "FILE_NOT_FOUND": FileNotFoundError,
3143
3201
  "FILES_BAD_REQUEST": FilesBadRequestError,
3144
- "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
3145
- "ALREADY_HAS_BASE": AlreadyHasBaseError,
3146
- "NOT_FOUND": NotFoundError,
3202
+ "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
3147
3203
  "DATABASE_ERROR": DatabaseErrorError,
3148
3204
  "PARTITION_NOT_FOUND": PartitionNotFoundError,
3149
3205
  "INVALID_VM_ID": InvalidVmIdError,
3150
- "INVALID_GIT_REPO_SPEC_ERROR": InvalidGitRepoSpecErrorError,
3151
- "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
3152
- "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
3206
+ "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
3207
+ "ALREADY_HAS_BASE": AlreadyHasBaseError,
3208
+ "NOT_FOUND": NotFoundError,
3209
+ "SNAPSHOT_SETUP_FAILED": SnapshotSetupFailedError,
3210
+ "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
3153
3211
  "USER_NOT_FOUND": UserNotFoundError,
3154
3212
  "USER_ALREADY_EXISTS": UserAlreadyExistsError,
3155
3213
  "VALIDATION_ERROR": ValidationErrorError,
@@ -3166,9 +3224,35 @@ const FREESTYLE_ERROR_CODE_MAP = {
3166
3224
  "GROUP_NAME_INVALID_CHARS": GroupNameInvalidCharsError,
3167
3225
  "GROUP_NAME_TOO_LONG": GroupNameTooLongError,
3168
3226
  "GROUP_NAME_EMPTY": GroupNameEmptyError,
3227
+ "INVALID_GIT_REPO_SPEC_ERROR": InvalidGitRepoSpecErrorError,
3228
+ "INTERNAL_ERROR": InternalErrorError,
3229
+ "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
3230
+ "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
3231
+ "RESUMED_VM_NON_RESPONSIVE": ResumedVmNonResponsiveError,
3232
+ "SNAPSHOT_LOAD_TIMEOUT": SnapshotLoadTimeoutError,
3233
+ "UFFD_TIMEOUT_ERROR": UffdTimeoutErrorError,
3234
+ "KERNEL_PANIC": KernelPanicError,
3235
+ "VM_DELETED": VmDeletedError,
3236
+ "REQWEST": ReqwestError,
3237
+ "FIRECRACKER_PID_NOT_FOUND": FirecrackerPidNotFoundError,
3238
+ "FIRECRACKER_API_SOCKET_NOT_FOUND": FirecrackerApiSocketNotFoundError,
3239
+ "INVALID_SNAPSHOT_ID": InvalidSnapshotIdError,
3240
+ "VM_START_TIMEOUT": VmStartTimeoutError,
3241
+ "VM_EXIT_DURING_START": VmExitDuringStartError,
3242
+ "VM_ACCESS_DENIED": VmAccessDeniedError,
3243
+ "STD_IO": StdIoError,
3244
+ "VM_CREATE_TMUX_SESSION": VmCreateTmuxSessionError,
3245
+ "VM_SUBNET_NOT_FOUND": VmSubnetNotFoundError,
3169
3246
  "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
3170
3247
  "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
3171
3248
  "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
3249
+ "ACTIVE_TRANSACTION_ERROR": ActiveTransactionErrorError,
3250
+ "ROOTFS_COPY_ERROR": RootfsCopyErrorError,
3251
+ "VM_NOT_RUNNING": VmNotRunningError,
3252
+ "VM_NOT_FOUND": VmNotFoundError,
3253
+ "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
3254
+ "BAD_REQUEST": BadRequestError,
3255
+ "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
3172
3256
  "DOCKER_SNAPSHOT_FAILED": DockerSnapshotFailedError,
3173
3257
  "SET_DEFAULT_SNAPSHOT_FAILED": SetDefaultSnapshotFailedError,
3174
3258
  "SNAPSHOT_LAYER_CREATION_FAILED": SnapshotLayerCreationFailedError,
@@ -3203,17 +3287,23 @@ const FREESTYLE_ERROR_CODE_MAP = {
3203
3287
  "INVALID_PARAMETERS": InvalidParametersError,
3204
3288
  "MAX_USES_EXCEEDED": MaxUsesExceededError,
3205
3289
  "EXPIRED": ExpiredError,
3206
- "PACKFILE": PackfileError,
3207
- "TREE_NOT_FOUND": TreeNotFoundError,
3290
+ "INVALID_RANGE": InvalidRangeError,
3291
+ "OFFSET_WITH_SELECTOR": OffsetWithSelectorError,
3292
+ "COMMIT_NOT_IN_BRANCH": CommitNotInBranchError,
3293
+ "COMMIT_NOT_FOUND": CommitNotFoundError,
3208
3294
  "BRANCH_NOT_FOUND": BranchNotFoundError,
3295
+ "NO_DEFAULT_BRANCH": NoDefaultBranchError,
3296
+ "INVALID_BASE64_CONTENT": InvalidBase64ContentError,
3297
+ "INVALID_FILE_CHANGE": InvalidFileChangeError,
3298
+ "INVALID_FILE_PATH": InvalidFilePathError,
3299
+ "CONFLICTING_PARENT": ConflictingParentError,
3300
+ "INVALID_SERVICE": InvalidServiceError,
3301
+ "EXPECTED_SERVICE": ExpectedServiceError,
3302
+ "TAG_NOT_FOUND": TagNotFoundError,
3303
+ "INVALID_REVISION": InvalidRevisionError,
3209
3304
  "FORBIDDEN": ForbiddenError,
3210
- "UNAUTHORIZED": UnauthorizedError,
3211
- "REPO_ALREADY_EXISTS": RepoAlreadyExistsError,
3212
- "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
3213
- "INVALID_OBJECT_ID": InvalidObjectIdError,
3214
- "COMMIT_NOT_FOUND": CommitNotFoundError,
3215
- "PATH_NOT_FOUND": PathNotFoundError,
3216
- "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
3305
+ "UNAUTHORIZED": UnauthorizedError,
3306
+ "BLOB_NOT_FOUND": BlobNotFoundError,
3217
3307
  "AMBIGUOUS": AmbiguousError,
3218
3308
  "INVALID": InvalidError,
3219
3309
  "INVALID_ACCOUNT_ID": InvalidAccountIdError,
@@ -3221,82 +3311,34 @@ const FREESTYLE_ERROR_CODE_MAP = {
3221
3311
  "SOURCE_UNAUTHORIZED": SourceUnauthorizedError,
3222
3312
  "SOURCE_NOT_FOUND": SourceNotFoundError,
3223
3313
  "IMPORT_SUBDIR_NOT_FOUND": ImportSubdirNotFoundError,
3224
- "TAG_NOT_FOUND": TagNotFoundError,
3314
+ "REPO_ALREADY_EXISTS": RepoAlreadyExistsError,
3315
+ "TREE_NOT_FOUND": TreeNotFoundError,
3316
+ "PATH_NOT_FOUND": PathNotFoundError,
3317
+ "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
3318
+ "CONFLICT": ConflictError,
3319
+ "BRANCH_ALREADY_EXISTS": BranchAlreadyExistsError,
3320
+ "PARENT_NOT_FOUND": ParentNotFoundError,
3321
+ "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
3322
+ "INVALID_OBJECT_ID": InvalidObjectIdError,
3225
3323
  "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
3324
+ "PACKFILE": PackfileError,
3226
3325
  "SEND_ERROR": SendErrorError,
3227
- "INVALID_SERVICE": InvalidServiceError,
3228
- "EXPECTED_SERVICE": ExpectedServiceError,
3229
- "INVALID_RANGE": InvalidRangeError,
3230
- "OFFSET_WITH_SELECTOR": OffsetWithSelectorError,
3231
- "COMMIT_NOT_IN_BRANCH": CommitNotInBranchError,
3232
- "BLOB_NOT_FOUND": BlobNotFoundError,
3233
- "INVALID_REVISION": InvalidRevisionError,
3234
- "CONFLICT": ConflictError,
3235
3326
  "UNAVAILABLE": UnavailableError,
3236
3327
  "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
3237
- "GIT_REPO_LIMIT_EXCEEDED": GitRepoLimitExceededError,
3238
3328
  "EMPTY_TAG": EmptyTagError,
3239
- "BRANCH_NAME_EMPTY": BranchNameEmptyError,
3240
- "VM_LIMIT_EXCEEDED": VmLimitExceededError,
3241
- "SCHEDULE_NOT_FOUND": ScheduleNotFoundError,
3242
- "SERVICE_UNAVAILABLE": ServiceUnavailableError,
3243
- "EXECUTE_LIMIT_EXCEEDED": ExecuteLimitExceededError,
3244
- "TRIGGER_ERROR": TriggerErrorError,
3245
- "TOKEN_ERROR": TokenErrorError,
3246
- "PERMISSION_ERROR": PermissionErrorError,
3247
- "IDENTITY_ERROR": IdentityErrorError,
3248
- "GET_CONTENT_FAILED": GetContentFailedError,
3249
- "CONTENT_NOT_FOUND": ContentNotFoundError,
3250
- "DOWNLOAD_FAILED": DownloadFailedError,
3251
- "GIT_SERVER_ERROR": GitServerErrorError,
3252
- "PARSE_RESPONSE_ERROR": ParseResponseErrorError,
3253
- "REPOSITORY_ACCESS_DENIED": RepositoryAccessDeniedError,
3254
- "GIT_HUB_SYNC_FAILED": GitHubSyncFailedError,
3255
- "UPDATE_DEFAULT_BRANCH_FAILED": UpdateDefaultBranchFailedError,
3256
- "GET_REPOSITORY_INFO_FAILED": GetRepositoryInfoFailedError,
3257
- "LIST_REPOSITORIES_FAILED": ListRepositoriesFailedError,
3258
- "DELETE_REPOSITORY_FAILED": DeleteRepositoryFailedError,
3259
- "CREATE_REPOSITORY_FAILED": CreateRepositoryFailedError,
3260
- "SERIALIZATION_ERROR": SerializationErrorError,
3261
- "GIT_INVALID_REQUEST": GitInvalidRequestError,
3262
- "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
3263
- "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
3264
- "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
3265
- "LIST_RUNS_FAILED": ListRunsFailedError,
3266
- "EXECUTION_ERROR": ExecutionErrorError,
3267
- "CONNECTION_FAILED": ConnectionFailedError,
3268
- "METADATA_WRITE_FAILED": MetadataWriteFailedError,
3269
- "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
3270
- "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
3271
- "LOCK_GENERATION_FAILED": LockGenerationFailedError,
3272
- "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
3273
- "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
3274
- "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
3275
- "LOGGING_FAILED": LoggingFailedError,
3276
- "RUN_NOT_FOUND": RunNotFoundError,
3277
- "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
3278
- "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
3279
- "PERMISSION_DENIED": PermissionDeniedError,
3280
- "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
3281
- "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
3282
- "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
3283
- "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
3284
- "VERIFICATION_FAILED": VerificationFailedError,
3285
- "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
3286
- "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
3287
- "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
3288
- "INVALID_DOMAIN": InvalidDomainError,
3289
- "LIMIT_EXCEEDED": LimitExceededError,
3290
- "DOMAIN_OWNERSHIP_NOT_VERIFIED": DomainOwnershipNotVerifiedError,
3291
- "VM_ACCESS_DENIED_FOR_MAPPING": VmAccessDeniedForMappingError,
3292
- "DEPLOYMENT_ACCESS_DENIED": DeploymentAccessDeniedError,
3293
- "FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING": FailedToProvisionCertificateForMappingError,
3294
- "FAILED_INSERT_DOMAIN_MAPPING": FailedInsertDomainMappingError,
3295
- "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
3296
- "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
3297
- "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
3298
- "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
3299
- "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
3329
+ "BROWSER_OPERATION_FAILED": BrowserOperationFailedError,
3330
+ "WATCH_FILES_FAILED": WatchFilesFailedError,
3331
+ "LOGS_FAILED": LogsFailedError,
3332
+ "STATUS_FAILED": StatusFailedError,
3333
+ "RESTART_FAILED": RestartFailedError,
3334
+ "SHUTDOWN_FAILED": ShutdownFailedError,
3335
+ "COMMIT_FAILED": CommitFailedError,
3336
+ "WRITE_FILE_FAILED": WriteFileFailedError,
3337
+ "READ_FILE_FAILED": ReadFileFailedError,
3338
+ "EXECUTION_FAILED": ExecutionFailedError,
3339
+ "REQUEST_FAILED": RequestFailedError,
3340
+ "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
3341
+ "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
3300
3342
  "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
3301
3343
  "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
3302
3344
  "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
@@ -3318,27 +3360,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
3318
3360
  "INVALID_DOMAINS": InvalidDomainsError,
3319
3361
  "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
3320
3362
  "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
3321
- "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
3322
- "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
3323
- "PARSE_LOGS_FAILED": ParseLogsFailedError,
3324
- "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
3325
- "INVALID_QUERY": InvalidQueryError,
3326
- "LOGS_NOT_FOUND": LogsNotFoundError,
3327
- "BROWSER_OPERATION_FAILED": BrowserOperationFailedError,
3328
- "WATCH_FILES_FAILED": WatchFilesFailedError,
3329
- "LOGS_FAILED": LogsFailedError,
3330
- "STATUS_FAILED": StatusFailedError,
3331
- "RESTART_FAILED": RestartFailedError,
3332
- "SHUTDOWN_FAILED": ShutdownFailedError,
3333
- "COMMIT_FAILED": CommitFailedError,
3334
- "WRITE_FILE_FAILED": WriteFileFailedError,
3335
- "READ_FILE_FAILED": ReadFileFailedError,
3336
- "EXECUTION_FAILED": ExecutionFailedError,
3337
- "REQUEST_FAILED": RequestFailedError,
3338
- "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
3339
- "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
3340
- "RESIZE_FAILED": ResizeFailedError,
3341
- "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
3342
3363
  "PERMISSION_ALREADY_EXISTS": PermissionAlreadyExistsError,
3343
3364
  "LIST_TOKENS_FAILED": ListTokensFailedError,
3344
3365
  "REVOKE_TOKEN_FAILED": RevokeTokenFailedError,
@@ -3359,12 +3380,82 @@ const FREESTYLE_ERROR_CODE_MAP = {
3359
3380
  "CANNOT_MODIFY_MANAGED_IDENTITY": CannotModifyManagedIdentityError,
3360
3381
  "IDENTITY_ACCESS_DENIED": IdentityAccessDeniedError,
3361
3382
  "IDENTITY_NOT_FOUND": IdentityNotFoundError,
3383
+ "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
3384
+ "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
3385
+ "LIST_RUNS_FAILED": ListRunsFailedError,
3386
+ "EXECUTION_ERROR": ExecutionErrorError,
3387
+ "CONNECTION_FAILED": ConnectionFailedError,
3388
+ "METADATA_WRITE_FAILED": MetadataWriteFailedError,
3389
+ "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
3390
+ "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
3391
+ "LOCK_GENERATION_FAILED": LockGenerationFailedError,
3392
+ "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
3393
+ "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
3394
+ "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
3395
+ "LOGGING_FAILED": LoggingFailedError,
3396
+ "RUN_NOT_FOUND": RunNotFoundError,
3397
+ "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
3398
+ "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
3399
+ "PERMISSION_DENIED": PermissionDeniedError,
3400
+ "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
3401
+ "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
3402
+ "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
3403
+ "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
3404
+ "VERIFICATION_FAILED": VerificationFailedError,
3405
+ "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
3406
+ "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
3407
+ "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
3408
+ "INVALID_DOMAIN": InvalidDomainError,
3362
3409
  "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
3363
3410
  "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
3364
3411
  "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
3365
3412
  "ERROR_CREATING_RECORD": ErrorCreatingRecordError,
3366
3413
  "DOMAIN_OWNERSHIP_ERROR": DomainOwnershipErrorError,
3367
- "UNAUTHORIZED_ERROR": UnauthorizedErrorError
3414
+ "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
3415
+ "EXECUTE_LIMIT_EXCEEDED": ExecuteLimitExceededError,
3416
+ "VM_LIMIT_EXCEEDED": VmLimitExceededError,
3417
+ "SCHEDULE_NOT_FOUND": ScheduleNotFoundError,
3418
+ "SERVICE_UNAVAILABLE": ServiceUnavailableError,
3419
+ "RESIZE_FAILED": ResizeFailedError,
3420
+ "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
3421
+ "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
3422
+ "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
3423
+ "PARSE_LOGS_FAILED": ParseLogsFailedError,
3424
+ "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
3425
+ "INVALID_QUERY": InvalidQueryError,
3426
+ "LOGS_NOT_FOUND": LogsNotFoundError,
3427
+ "TRIGGER_ERROR": TriggerErrorError,
3428
+ "TOKEN_ERROR": TokenErrorError,
3429
+ "PERMISSION_ERROR": PermissionErrorError,
3430
+ "IDENTITY_ERROR": IdentityErrorError,
3431
+ "GET_CONTENT_FAILED": GetContentFailedError,
3432
+ "CONTENT_NOT_FOUND": ContentNotFoundError,
3433
+ "DOWNLOAD_FAILED": DownloadFailedError,
3434
+ "GIT_SERVER_ERROR": GitServerErrorError,
3435
+ "PARSE_RESPONSE_ERROR": ParseResponseErrorError,
3436
+ "REPOSITORY_ACCESS_DENIED": RepositoryAccessDeniedError,
3437
+ "GIT_HUB_SYNC_FAILED": GitHubSyncFailedError,
3438
+ "UPDATE_DEFAULT_BRANCH_FAILED": UpdateDefaultBranchFailedError,
3439
+ "GET_REPOSITORY_INFO_FAILED": GetRepositoryInfoFailedError,
3440
+ "LIST_REPOSITORIES_FAILED": ListRepositoriesFailedError,
3441
+ "DELETE_REPOSITORY_FAILED": DeleteRepositoryFailedError,
3442
+ "CREATE_REPOSITORY_FAILED": CreateRepositoryFailedError,
3443
+ "SERIALIZATION_ERROR": SerializationErrorError,
3444
+ "GIT_INVALID_REQUEST": GitInvalidRequestError,
3445
+ "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
3446
+ "LIMIT_EXCEEDED": LimitExceededError,
3447
+ "DOMAIN_OWNERSHIP_NOT_VERIFIED": DomainOwnershipNotVerifiedError,
3448
+ "VM_ACCESS_DENIED_FOR_MAPPING": VmAccessDeniedForMappingError,
3449
+ "DEPLOYMENT_ACCESS_DENIED": DeploymentAccessDeniedError,
3450
+ "FAILED_TO_PROVISION_CERTIFICATE_FOR_MAPPING": FailedToProvisionCertificateForMappingError,
3451
+ "FAILED_INSERT_DOMAIN_MAPPING": FailedInsertDomainMappingError,
3452
+ "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
3453
+ "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
3454
+ "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
3455
+ "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
3456
+ "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
3457
+ "GIT_REPO_LIMIT_EXCEEDED": GitRepoLimitExceededError,
3458
+ "BRANCH_NAME_EMPTY": BranchNameEmptyError
3368
3459
  };
3369
3460
 
3370
3461
  var errors = /*#__PURE__*/Object.freeze({
@@ -3381,6 +3472,7 @@ var errors = /*#__PURE__*/Object.freeze({
3381
3472
  BadSignatureError: BadSignatureError,
3382
3473
  BadTimestampError: BadTimestampError,
3383
3474
  BlobNotFoundError: BlobNotFoundError,
3475
+ BranchAlreadyExistsError: BranchAlreadyExistsError,
3384
3476
  BranchNameEmptyError: BranchNameEmptyError,
3385
3477
  BranchNotFoundError: BranchNotFoundError,
3386
3478
  BrowserOperationFailedError: BrowserOperationFailedError,
@@ -3395,6 +3487,7 @@ var errors = /*#__PURE__*/Object.freeze({
3395
3487
  CommitNotFoundError: CommitNotFoundError,
3396
3488
  CommitNotInBranchError: CommitNotInBranchError,
3397
3489
  ConflictError: ConflictError,
3490
+ ConflictingParentError: ConflictingParentError,
3398
3491
  ConnectionFailedError: ConnectionFailedError,
3399
3492
  ContentNotFoundError: ContentNotFoundError,
3400
3493
  CreateBackupFailedError: CreateBackupFailedError,
@@ -3487,10 +3580,13 @@ var errors = /*#__PURE__*/Object.freeze({
3487
3580
  InternalResizeVmNotFoundError: InternalResizeVmNotFoundError,
3488
3581
  InternalVmNotFoundError: InternalVmNotFoundError,
3489
3582
  InvalidAccountIdError: InvalidAccountIdError,
3583
+ InvalidBase64ContentError: InvalidBase64ContentError,
3490
3584
  InvalidDeploymentRequestError: InvalidDeploymentRequestError,
3491
3585
  InvalidDomainError: InvalidDomainError,
3492
3586
  InvalidDomainsError: InvalidDomainsError,
3493
3587
  InvalidError: InvalidError,
3588
+ InvalidFileChangeError: InvalidFileChangeError,
3589
+ InvalidFilePathError: InvalidFilePathError,
3494
3590
  InvalidGitRepoSpecErrorError: InvalidGitRepoSpecErrorError,
3495
3591
  InvalidObjectIdError: InvalidObjectIdError,
3496
3592
  InvalidParametersError: InvalidParametersError,
@@ -3517,6 +3613,7 @@ var errors = /*#__PURE__*/Object.freeze({
3517
3613
  MaxUsesExceededError: MaxUsesExceededError,
3518
3614
  MetadataWriteFailedError: MetadataWriteFailedError,
3519
3615
  NetworkPermissionsFailedError: NetworkPermissionsFailedError,
3616
+ NoDefaultBranchError: NoDefaultBranchError,
3520
3617
  NoDomainOwnershipError: NoDomainOwnershipError,
3521
3618
  NoEntrypointFoundError: NoEntrypointFoundError,
3522
3619
  NodeModulesDownloadFailedError: NodeModulesDownloadFailedError,
@@ -3527,6 +3624,7 @@ var errors = /*#__PURE__*/Object.freeze({
3527
3624
  OffsetWithSelectorError: OffsetWithSelectorError,
3528
3625
  OnFailureArrayContainsEmptyError: OnFailureArrayContainsEmptyError,
3529
3626
  PackfileError: PackfileError,
3627
+ ParentNotFoundError: ParentNotFoundError,
3530
3628
  ParseLogsFailedError: ParseLogsFailedError,
3531
3629
  ParseResponseErrorError: ParseResponseErrorError,
3532
3630
  PartitionNotFoundError: PartitionNotFoundError,
@@ -3909,11 +4007,17 @@ class GitRepoBranchesNamespace {
3909
4007
  body: { defaultBranch }
3910
4008
  });
3911
4009
  }
4010
+ /**
4011
+ * List all branches in this repository.
4012
+ */
3912
4013
  async list() {
3913
4014
  return this.apiClient.get("/git/v1/repo/{repo}/git/refs/heads/", {
3914
4015
  params: { repo: this.repoId }
3915
4016
  });
3916
4017
  }
4018
+ /**
4019
+ * Get a specific branch by name.
4020
+ */
3917
4021
  async get({
3918
4022
  branchName
3919
4023
  }) {
@@ -3921,6 +4025,37 @@ class GitRepoBranchesNamespace {
3921
4025
  params: { repo: this.repoId, branch: branchName }
3922
4026
  });
3923
4027
  }
4028
+ /**
4029
+ * Create a new branch.
4030
+ *
4031
+ * If no SHA is provided, the branch will be created from the default branch.
4032
+ *
4033
+ * @param name - The name of the branch to create
4034
+ * @param sha - Optional commit SHA to branch from. If not provided, branches from the default branch.
4035
+ *
4036
+ * @example
4037
+ * ```ts
4038
+ * // Create a branch from the default branch
4039
+ * const newBranch = await repo.branches.create({
4040
+ * name: "feature/something"
4041
+ * });
4042
+ *
4043
+ * // Create a branch from a specific commit
4044
+ * const newBranch = await repo.branches.create({
4045
+ * name: "feature-xyz",
4046
+ * sha: "abc123..."
4047
+ * });
4048
+ * ```
4049
+ */
4050
+ async create({
4051
+ name,
4052
+ sha
4053
+ }) {
4054
+ return this.apiClient.post("/git/v1/repo/{repo}/git/refs/heads/{*branch}", {
4055
+ params: { repo: this.repoId, branch: name },
4056
+ body: { sha }
4057
+ });
4058
+ }
3924
4059
  }
3925
4060
  class GitRepoGitHubSyncNamespace {
3926
4061
  repoId;
@@ -4121,12 +4256,94 @@ class GitRepoCommitsNamespace {
4121
4256
  });
4122
4257
  }
4123
4258
  /**
4124
- * List commits for this repository.
4259
+ * List commits in this repository with optional filtering.
4125
4260
  */
4126
- async list(params = {}) {
4261
+ async list({
4262
+ branch,
4263
+ limit,
4264
+ order,
4265
+ since,
4266
+ until,
4267
+ offset
4268
+ } = {}) {
4127
4269
  return this.apiClient.get("/git/v1/repo/{repo}/git/commits", {
4128
4270
  params: { repo: this.repoId },
4129
- query: params
4271
+ query: {
4272
+ branch,
4273
+ limit,
4274
+ order,
4275
+ since,
4276
+ until,
4277
+ offset
4278
+ }
4279
+ });
4280
+ }
4281
+ /**
4282
+ * Create a new commit with files.
4283
+ *
4284
+ * Supports text files (UTF-8) and binary files (base64-encoded).
4285
+ * Files can be added, modified, or deleted.
4286
+ * Includes optimistic concurrency control via `expectedSha` to prevent race conditions.
4287
+ *
4288
+ * @example
4289
+ * ```ts
4290
+ * // Create a commit with text files
4291
+ * const { commit } = await repo.commits.create({
4292
+ * message: "Initial commit",
4293
+ * branch: "main",
4294
+ * files: [
4295
+ * { path: "README.md", content: "# My Project" },
4296
+ * { path: "src/index.ts", content: "console.log('Hello!');" }
4297
+ * ],
4298
+ * author: { name: "John Doe", email: "john@example.com" }
4299
+ * });
4300
+ *
4301
+ * // Create a commit with a binary file (base64-encoded)
4302
+ * const imageBuffer = await fs.readFile("image.png");
4303
+ * const base64Image = imageBuffer.toString("base64");
4304
+ * await repo.commits.create({
4305
+ * message: "Add logo",
4306
+ * branch: "main",
4307
+ * files: [
4308
+ * { path: "assets/logo.png", content: base64Image, encoding: "base64" }
4309
+ * ]
4310
+ * });
4311
+ *
4312
+ * // Delete a file
4313
+ * await repo.commits.create({
4314
+ * message: "Remove deprecated file",
4315
+ * branch: "main",
4316
+ * files: [
4317
+ * { path: "old/deprecated.ts", deleted: true }
4318
+ * ]
4319
+ * });
4320
+ *
4321
+ * // Use optimistic concurrency control (CAS)
4322
+ * const branchInfo = await repo.branches.get({ name: "main" });
4323
+ * await repo.commits.create({
4324
+ * message: "Update with CAS",
4325
+ * branch: "main",
4326
+ * files: [{ path: "version.txt", content: "2.0.0" }],
4327
+ * expectedSha: branchInfo.commit.sha // Will fail if branch tip changed
4328
+ * });
4329
+ * ```
4330
+ */
4331
+ async create({
4332
+ message,
4333
+ files,
4334
+ branch,
4335
+ author,
4336
+ expectedSha
4337
+ }) {
4338
+ return this.apiClient.post("/git/v1/repo/{repo}/commits", {
4339
+ params: { repo: this.repoId },
4340
+ body: {
4341
+ message,
4342
+ files,
4343
+ branch,
4344
+ author,
4345
+ expectedSha
4346
+ }
4130
4347
  });
4131
4348
  }
4132
4349
  }
@@ -5044,11 +5261,7 @@ class FileSystem {
5044
5261
  });
5045
5262
  if (response && typeof response === "object" && "content" in response) {
5046
5263
  const content = response.content;
5047
- try {
5048
- return Buffer.from(content, "base64");
5049
- } catch {
5050
- return Buffer.from(content, "utf-8");
5051
- }
5264
+ return Buffer.from(content, "utf-8");
5052
5265
  }
5053
5266
  throw new Error("Unexpected response format from VM file read");
5054
5267
  }
@@ -5058,10 +5271,10 @@ class FileSystem {
5058
5271
  * @param content Buffer containing the content to write
5059
5272
  */
5060
5273
  async writeFile(filepath, content) {
5061
- const base64Content = content.toString("base64");
5274
+ const textContent = content.toString("utf-8");
5062
5275
  await this.client.put("/v1/vms/{vm_id}/files/{filepath}", {
5063
5276
  params: { vm_id: this.vmId, filepath },
5064
- body: { content: base64Content },
5277
+ body: { content: textContent },
5065
5278
  headers: linuxUsernameHeader(this.vm?._linux_username)
5066
5279
  });
5067
5280
  }
@@ -5779,6 +5992,47 @@ function composeVmSpecs(specs) {
5779
5992
  return result;
5780
5993
  }
5781
5994
 
5995
+ function processSystemdServices(services, existingFiles = {}) {
5996
+ const additionalFiles = { ...existingFiles };
5997
+ const processedServices = [];
5998
+ for (const service of services) {
5999
+ const { bash, ...rest } = service;
6000
+ const mode = rest.mode ?? "service";
6001
+ if (bash) {
6002
+ const scriptPath = `/opt/freestyle/scripts/${service.name}.sh`;
6003
+ const scriptContent = bash.startsWith("#!/") ? bash : `#!/bin/bash
6004
+ ${bash}`;
6005
+ additionalFiles[scriptPath] = {
6006
+ content: scriptContent,
6007
+ encoding: "utf-8"
6008
+ };
6009
+ processedServices.push({
6010
+ ...rest,
6011
+ mode,
6012
+ exec: [`/bin/bash ${scriptPath}`]
6013
+ });
6014
+ } else {
6015
+ if (!rest.exec || rest.exec.length === 0) {
6016
+ throw new Error(
6017
+ `Systemd service "${service.name}" must have either 'exec' or 'bash' defined`
6018
+ );
6019
+ }
6020
+ processedServices.push({
6021
+ ...rest,
6022
+ mode,
6023
+ exec: rest.exec
6024
+ });
6025
+ }
6026
+ }
6027
+ return { services: processedServices, additionalFiles };
6028
+ }
6029
+ function normalizeGitOptions(git) {
6030
+ if (!git) return git;
6031
+ return {
6032
+ ...git,
6033
+ config: git.config ?? {}
6034
+ };
6035
+ }
5782
6036
  class VmTerminals {
5783
6037
  vm = null;
5784
6038
  vmId;
@@ -6119,6 +6373,44 @@ class VmsNamespace {
6119
6373
  options.spec = new VmSpec({ snapshot: options.snapshot });
6120
6374
  }
6121
6375
  }
6376
+ if (options.systemd?.services) {
6377
+ const normalizedServices = options.systemd.services.map((service) => {
6378
+ return {
6379
+ ...service,
6380
+ after: service.after?.map(
6381
+ (s) => s.includes(".") ? s : `${s}.service`
6382
+ ),
6383
+ requires: service.requires?.map(
6384
+ (s) => s.includes(".") ? s : `${s}.service`
6385
+ ),
6386
+ wantedBy: service.wantedBy?.map(
6387
+ (s) => s.includes(".") ? s : `${s}.service`
6388
+ )
6389
+ };
6390
+ });
6391
+ const { services: processedServices, additionalFiles: bashFiles } = processSystemdServices(
6392
+ normalizedServices,
6393
+ options.additionalFiles ?? {}
6394
+ );
6395
+ options.systemd.services = processedServices;
6396
+ options.additionalFiles = bashFiles;
6397
+ }
6398
+ if (options.systemd?.patchedServices) {
6399
+ options.systemd.patchedServices = options.systemd.patchedServices.map(
6400
+ (service) => {
6401
+ service.after = service.after?.map(
6402
+ (s) => s.includes(".") ? s : `${s}.service`
6403
+ );
6404
+ service.requires = service.requires?.map(
6405
+ (s) => s.includes(".") ? s : `${s}.service`
6406
+ );
6407
+ service.wantedBy = service.wantedBy?.map(
6408
+ (s) => s.includes(".") ? s : `${s}.service`
6409
+ );
6410
+ return service;
6411
+ }
6412
+ );
6413
+ }
6122
6414
  if ("snapshot" in options) {
6123
6415
  const { snapshot: _snapshot, ...rest } = options;
6124
6416
  options = rest;
@@ -6171,8 +6463,15 @@ class VmsNamespace {
6171
6463
  const response = await this.freestyle._apiClient.post("/v1/vms", {
6172
6464
  body: {
6173
6465
  ...config,
6174
- template: config.template instanceof VmTemplate ? config.template["raw"] : config.template
6466
+ template: config.template instanceof VmTemplate ? config.template["raw"] : config.template,
6467
+ // Cast systemd since we've processed SystemdServiceInput[] to RawSystemdService[]
6468
+ systemd: config.systemd,
6469
+ // Normalize git options - default config to {}
6470
+ git: normalizeGitOptions(config.git)
6175
6471
  }
6472
+ }).catch((e) => {
6473
+ enhanceError(e);
6474
+ throw e;
6176
6475
  });
6177
6476
  const vmId = response.id;
6178
6477
  const vm = new Vm({ vmId, freestyle: this.freestyle });
@@ -6184,8 +6483,9 @@ class VmsNamespace {
6184
6483
  vm[key] = instance;
6185
6484
  }
6186
6485
  }
6486
+ const { consoleUrl: _consoleUrl, ...responseWithoutConsoleUrl } = response;
6187
6487
  return {
6188
- ...response,
6488
+ ...responseWithoutConsoleUrl,
6189
6489
  vmId,
6190
6490
  vm,
6191
6491
  // start to phase out built in domain
@@ -6250,6 +6550,14 @@ class VmsNamespace {
6250
6550
  });
6251
6551
  }
6252
6552
  }
6553
+ function enhanceError(e) {
6554
+ if (e instanceof VmSetupFailedError) {
6555
+ if (!e.message.includes("create --snapshot")) {
6556
+ e.message = `${e.message}. Hint: use \`npx freestyle-sandboxes@latest vm create --snapshot ${e.body.snapshotId} --ssh --delete\` to debug.`;
6557
+ }
6558
+ }
6559
+ return e;
6560
+ }
6253
6561
  class VmSnapshotsNamespace {
6254
6562
  constructor(apiClient) {
6255
6563
  this.apiClient = apiClient;
@@ -6306,10 +6614,36 @@ class VmSnapshotsNamespace {
6306
6614
  ...requestOptions,
6307
6615
  template: requestOptions.template instanceof VmTemplate ? requestOptions.template.raw : requestOptions.template
6308
6616
  }
6617
+ }).catch((e) => {
6618
+ enhanceError(e);
6619
+ throw e;
6309
6620
  });
6310
6621
  }
6311
6622
  }
6312
6623
  async function processTemplateTree(template) {
6624
+ if (template.raw.git) {
6625
+ template.raw.git = normalizeGitOptions(
6626
+ template.raw.git
6627
+ );
6628
+ }
6629
+ if (template.raw.systemd?.services) {
6630
+ const normalizedServices = template.raw.systemd.services.map((service) => ({
6631
+ ...service,
6632
+ after: service.after?.map((s) => s.includes(".") ? s : `${s}.service`),
6633
+ requires: service.requires?.map(
6634
+ (s) => s.includes(".") ? s : `${s}.service`
6635
+ ),
6636
+ wantedBy: service.wantedBy?.map(
6637
+ (s) => s.includes(".") ? s : `${s}.service`
6638
+ )
6639
+ }));
6640
+ const { services: processedServices, additionalFiles: bashFiles } = processSystemdServices(
6641
+ normalizedServices,
6642
+ template.raw.additionalFiles ?? {}
6643
+ );
6644
+ template.raw.systemd.services = processedServices;
6645
+ template.raw.additionalFiles = bashFiles;
6646
+ }
6313
6647
  for (const key in template.with) {
6314
6648
  const builder = template.with[key];
6315
6649
  if (builder) {