freestyle-sandboxes 0.1.3 → 0.1.6

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 (6) hide show
  1. package/README.md +2 -2
  2. package/index.cjs +1485 -916
  3. package/index.d.cts +2316 -866
  4. package/index.d.mts +2316 -866
  5. package/index.mjs +1485 -916
  6. package/package.json +1 -1
package/index.cjs CHANGED
@@ -8,6 +8,18 @@ function errorFromJSON(body) {
8
8
  return new Error(`Unknown error code: ${body.code} - ${body.description}`);
9
9
  }
10
10
  }
11
+ class GitErrorError extends Error {
12
+ constructor(body) {
13
+ super(
14
+ `GIT_ERROR: ${body.message}`
15
+ );
16
+ this.body = body;
17
+ this.name = "GitErrorError";
18
+ }
19
+ static code = "GIT_ERROR";
20
+ static statusCode = 500;
21
+ static description = `{message}`;
22
+ }
11
23
  class InternalErrorError extends Error {
12
24
  constructor(body) {
13
25
  super(
@@ -32,113 +44,41 @@ class DockerImportBadRequestError extends Error {
32
44
  static statusCode = 400;
33
45
  static description = `Bad request: {message}`;
34
46
  }
35
- class VmNotFoundInFsError extends Error {
36
- constructor(body) {
37
- super(
38
- `VM_NOT_FOUND_IN_FS: ${body.message}`
39
- );
40
- this.body = body;
41
- this.name = "VmNotFoundInFsError";
42
- }
43
- static code = "VM_NOT_FOUND_IN_FS";
44
- static statusCode = 406;
45
- static description = `Vm Not found in filesystem`;
46
- }
47
- class VmNotRunningError extends Error {
48
- constructor(body) {
49
- super(
50
- `VM_NOT_RUNNING: ${body.message}`
51
- );
52
- this.body = body;
53
- this.name = "VmNotRunningError";
54
- }
55
- static code = "VM_NOT_RUNNING";
56
- static statusCode = 400;
57
- static description = `VmNotRunning`;
58
- }
59
- class VmNotFoundError extends Error {
60
- constructor(body) {
61
- super(
62
- `VM_NOT_FOUND: ${body.message}`
63
- );
64
- this.body = body;
65
- this.name = "VmNotFoundError";
66
- }
67
- static code = "VM_NOT_FOUND";
68
- static statusCode = 404;
69
- static description = `VmNotFound`;
70
- }
71
- class InternalForkVmNotFoundError extends Error {
72
- constructor(body) {
73
- super(
74
- `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
75
- );
76
- this.body = body;
77
- this.name = "InternalForkVmNotFoundError";
78
- }
79
- static code = "INTERNAL_FORK_VM_NOT_FOUND";
80
- static statusCode = 404;
81
- static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
82
- }
83
- class BadRequestError extends Error {
84
- constructor(body) {
85
- super(
86
- `BAD_REQUEST: ${body.message}`
87
- );
88
- this.body = body;
89
- this.name = "BadRequestError";
90
- }
91
- static code = "BAD_REQUEST";
92
- static statusCode = 400;
93
- static description = `Bad request: {message}`;
94
- }
95
- class InternalVmNotFoundError extends Error {
96
- constructor(body) {
97
- super(
98
- `INTERNAL_VM_NOT_FOUND: ${body.message}`
99
- );
100
- this.body = body;
101
- this.name = "InternalVmNotFoundError";
102
- }
103
- static code = "INTERNAL_VM_NOT_FOUND";
104
- static statusCode = 404;
105
- static description = `VM not found: {vm_id}`;
106
- }
107
- class VmMustBeStoppedError extends Error {
47
+ class VmOperationDeniedDuringTransactionError extends Error {
108
48
  constructor(body) {
109
49
  super(
110
- `VM_MUST_BE_STOPPED: ${body.message}`
50
+ `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
111
51
  );
112
52
  this.body = body;
113
- this.name = "VmMustBeStoppedError";
53
+ this.name = "VmOperationDeniedDuringTransactionError";
114
54
  }
115
- static code = "VM_MUST_BE_STOPPED";
116
- static statusCode = 400;
117
- static description = `VM must be stopped before converting to base`;
55
+ static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
56
+ static statusCode = 409;
57
+ static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
118
58
  }
119
- class AlreadyHasBaseError extends Error {
59
+ class VmTransactionIdMismatchError extends Error {
120
60
  constructor(body) {
121
61
  super(
122
- `ALREADY_HAS_BASE: ${body.message}`
62
+ `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
123
63
  );
124
64
  this.body = body;
125
- this.name = "AlreadyHasBaseError";
65
+ this.name = "VmTransactionIdMismatchError";
126
66
  }
127
- static code = "ALREADY_HAS_BASE";
67
+ static code = "VM_TRANSACTION_ID_MISMATCH";
128
68
  static statusCode = 400;
129
- static description = `VM already has a base rootfs`;
69
+ static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
130
70
  }
131
- class NotFoundError extends Error {
71
+ class VmNotInTransactionError extends Error {
132
72
  constructor(body) {
133
73
  super(
134
- `NOT_FOUND: ${body.message}`
74
+ `VM_NOT_IN_TRANSACTION: ${body.message}`
135
75
  );
136
76
  this.body = body;
137
- this.name = "NotFoundError";
77
+ this.name = "VmNotInTransactionError";
138
78
  }
139
- static code = "NOT_FOUND";
79
+ static code = "VM_NOT_IN_TRANSACTION";
140
80
  static statusCode = 404;
141
- static description = `VM not found`;
81
+ static description = `VM not in a transaction: {vm_id}`;
142
82
  }
143
83
  class ForkVmNotFoundError extends Error {
144
84
  constructor(body) {
@@ -176,30 +116,6 @@ class SnapshotVmBadRequestError extends Error {
176
116
  static statusCode = 400;
177
117
  static description = `Bad request: {message}`;
178
118
  }
179
- class FileNotFoundError extends Error {
180
- constructor(body) {
181
- super(
182
- `FILE_NOT_FOUND: ${body.message}`
183
- );
184
- this.body = body;
185
- this.name = "FileNotFoundError";
186
- }
187
- static code = "FILE_NOT_FOUND";
188
- static statusCode = 404;
189
- static description = `File not found: {path}`;
190
- }
191
- class FilesBadRequestError extends Error {
192
- constructor(body) {
193
- super(
194
- `FILES_BAD_REQUEST: ${body.message}`
195
- );
196
- this.body = body;
197
- this.name = "FilesBadRequestError";
198
- }
199
- static code = "FILES_BAD_REQUEST";
200
- static statusCode = 400;
201
- static description = `Bad request: {message}`;
202
- }
203
119
  class VmDeletedError extends Error {
204
120
  constructor(body) {
205
121
  super(
@@ -308,138 +224,246 @@ class VmSubnetNotFoundError extends Error {
308
224
  static statusCode = 500;
309
225
  static description = `Subnet for VM not found`;
310
226
  }
311
- class VmOperationDeniedDuringTransactionError extends Error {
227
+ class FileNotFoundError extends Error {
312
228
  constructor(body) {
313
229
  super(
314
- `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
230
+ `FILE_NOT_FOUND: ${body.message}`
315
231
  );
316
232
  this.body = body;
317
- this.name = "VmOperationDeniedDuringTransactionError";
233
+ this.name = "FileNotFoundError";
318
234
  }
319
- static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
320
- static statusCode = 409;
321
- static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
235
+ static code = "FILE_NOT_FOUND";
236
+ static statusCode = 404;
237
+ static description = `File not found: {path}`;
322
238
  }
323
- class VmTransactionIdMismatchError extends Error {
239
+ class FilesBadRequestError extends Error {
324
240
  constructor(body) {
325
241
  super(
326
- `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
242
+ `FILES_BAD_REQUEST: ${body.message}`
327
243
  );
328
244
  this.body = body;
329
- this.name = "VmTransactionIdMismatchError";
245
+ this.name = "FilesBadRequestError";
330
246
  }
331
- static code = "VM_TRANSACTION_ID_MISMATCH";
247
+ static code = "FILES_BAD_REQUEST";
332
248
  static statusCode = 400;
333
- static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
249
+ static description = `Bad request: {message}`;
334
250
  }
335
- class VmNotInTransactionError extends Error {
251
+ class VmNotFoundInFsError extends Error {
336
252
  constructor(body) {
337
253
  super(
338
- `VM_NOT_IN_TRANSACTION: ${body.message}`
254
+ `VM_NOT_FOUND_IN_FS: ${body.message}`
339
255
  );
340
256
  this.body = body;
341
- this.name = "VmNotInTransactionError";
257
+ this.name = "VmNotFoundInFsError";
342
258
  }
343
- static code = "VM_NOT_IN_TRANSACTION";
344
- static statusCode = 404;
345
- static description = `VM not in a transaction: {vm_id}`;
259
+ static code = "VM_NOT_FOUND_IN_FS";
260
+ static statusCode = 406;
261
+ static description = `Vm Not found in filesystem`;
346
262
  }
347
- class UserNotFoundError extends Error {
263
+ class VmNotRunningError extends Error {
348
264
  constructor(body) {
349
265
  super(
350
- `USER_NOT_FOUND: ${body.message}`
266
+ `VM_NOT_RUNNING: ${body.message}`
351
267
  );
352
268
  this.body = body;
353
- this.name = "UserNotFoundError";
269
+ this.name = "VmNotRunningError";
354
270
  }
355
- static code = "USER_NOT_FOUND";
356
- static statusCode = 404;
357
- static description = `User not found: {user_name}`;
271
+ static code = "VM_NOT_RUNNING";
272
+ static statusCode = 400;
273
+ static description = `VM is not running: {vm_id}`;
358
274
  }
359
- class UserAlreadyExistsError extends Error {
275
+ class VmNotFoundError extends Error {
360
276
  constructor(body) {
361
277
  super(
362
- `USER_ALREADY_EXISTS: ${body.message}`
278
+ `VM_NOT_FOUND: ${body.message}`
363
279
  );
364
280
  this.body = body;
365
- this.name = "UserAlreadyExistsError";
281
+ this.name = "VmNotFoundError";
366
282
  }
367
- static code = "USER_ALREADY_EXISTS";
368
- static statusCode = 409;
369
- static description = `Conflict: User '{user_name}' already exists`;
283
+ static code = "VM_NOT_FOUND";
284
+ static statusCode = 404;
285
+ static description = `VM not found: {vm_id}`;
370
286
  }
371
- class ValidationErrorError extends Error {
287
+ class InternalForkVmNotFoundError extends Error {
372
288
  constructor(body) {
373
289
  super(
374
- `VALIDATION_ERROR: ${body.message}`
290
+ `INTERNAL_FORK_VM_NOT_FOUND: ${body.message}`
375
291
  );
376
292
  this.body = body;
377
- this.name = "ValidationErrorError";
293
+ this.name = "InternalForkVmNotFoundError";
378
294
  }
379
- static code = "VALIDATION_ERROR";
380
- static statusCode = 400;
381
- static description = `Validation error: {message}`;
295
+ static code = "INTERNAL_FORK_VM_NOT_FOUND";
296
+ static statusCode = 404;
297
+ static description = `The VM you're trying to fork from was not found: {fork_vm_id}`;
382
298
  }
383
- class GroupNotFoundError extends Error {
299
+ class BadRequestError extends Error {
384
300
  constructor(body) {
385
301
  super(
386
- `GROUP_NOT_FOUND: ${body.message}`
302
+ `BAD_REQUEST: ${body.message}`
387
303
  );
388
304
  this.body = body;
389
- this.name = "GroupNotFoundError";
305
+ this.name = "BadRequestError";
390
306
  }
391
- static code = "GROUP_NOT_FOUND";
392
- static statusCode = 404;
393
- static description = `Group not found: {group_name}`;
307
+ static code = "BAD_REQUEST";
308
+ static statusCode = 400;
309
+ static description = `Bad request: {message}`;
394
310
  }
395
- class GroupAlreadyExistsError extends Error {
311
+ class InternalVmNotFoundError extends Error {
396
312
  constructor(body) {
397
313
  super(
398
- `GROUP_ALREADY_EXISTS: ${body.message}`
314
+ `INTERNAL_VM_NOT_FOUND: ${body.message}`
399
315
  );
400
316
  this.body = body;
401
- this.name = "GroupAlreadyExistsError";
317
+ this.name = "InternalVmNotFoundError";
402
318
  }
403
- static code = "GROUP_ALREADY_EXISTS";
404
- static statusCode = 409;
405
- static description = `Conflict: Group '{group_name}' already exists`;
319
+ static code = "INTERNAL_VM_NOT_FOUND";
320
+ static statusCode = 404;
321
+ static description = `VM not found: {vm_id}`;
406
322
  }
407
- class DuplicateUserNameError extends Error {
323
+ class VmMustBeStoppedError extends Error {
408
324
  constructor(body) {
409
325
  super(
410
- `DUPLICATE_USER_NAME: ${body.message}`
326
+ `VM_MUST_BE_STOPPED: ${body.message}`
411
327
  );
412
328
  this.body = body;
413
- this.name = "DuplicateUserNameError";
329
+ this.name = "VmMustBeStoppedError";
414
330
  }
415
- static code = "DUPLICATE_USER_NAME";
331
+ static code = "VM_MUST_BE_STOPPED";
416
332
  static statusCode = 400;
417
- static description = `Duplicate user name '{name}' found`;
333
+ static description = `VM must be stopped before converting to base`;
418
334
  }
419
- class UserGroupEmptyError extends Error {
335
+ class AlreadyHasBaseError extends Error {
420
336
  constructor(body) {
421
337
  super(
422
- `USER_GROUP_EMPTY: ${body.message}`
338
+ `ALREADY_HAS_BASE: ${body.message}`
423
339
  );
424
340
  this.body = body;
425
- this.name = "UserGroupEmptyError";
341
+ this.name = "AlreadyHasBaseError";
426
342
  }
427
- static code = "USER_GROUP_EMPTY";
343
+ static code = "ALREADY_HAS_BASE";
428
344
  static statusCode = 400;
429
- static description = `User '{user}' has empty string in groups`;
345
+ static description = `VM already has a base rootfs`;
430
346
  }
431
- class UserSystemFlagMismatchError extends Error {
347
+ class NotFoundError extends Error {
432
348
  constructor(body) {
433
349
  super(
434
- `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
350
+ `NOT_FOUND: ${body.message}`
435
351
  );
436
352
  this.body = body;
437
- this.name = "UserSystemFlagMismatchError";
353
+ this.name = "NotFoundError";
438
354
  }
439
- static code = "USER_SYSTEM_FLAG_MISMATCH";
440
- static statusCode = 400;
441
- static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
442
- }
355
+ static code = "NOT_FOUND";
356
+ static statusCode = 404;
357
+ static description = `VM not found`;
358
+ }
359
+ class CreateVmBadRequestError extends Error {
360
+ constructor(body) {
361
+ super(
362
+ `CREATE_VM_BAD_REQUEST: ${body.message}`
363
+ );
364
+ this.body = body;
365
+ this.name = "CreateVmBadRequestError";
366
+ }
367
+ static code = "CREATE_VM_BAD_REQUEST";
368
+ static statusCode = 400;
369
+ static description = `Bad request: {message}`;
370
+ }
371
+ class UserNotFoundError extends Error {
372
+ constructor(body) {
373
+ super(
374
+ `USER_NOT_FOUND: ${body.message}`
375
+ );
376
+ this.body = body;
377
+ this.name = "UserNotFoundError";
378
+ }
379
+ static code = "USER_NOT_FOUND";
380
+ static statusCode = 404;
381
+ static description = `User not found: {user_name}`;
382
+ }
383
+ class UserAlreadyExistsError extends Error {
384
+ constructor(body) {
385
+ super(
386
+ `USER_ALREADY_EXISTS: ${body.message}`
387
+ );
388
+ this.body = body;
389
+ this.name = "UserAlreadyExistsError";
390
+ }
391
+ static code = "USER_ALREADY_EXISTS";
392
+ static statusCode = 409;
393
+ static description = `Conflict: User '{user_name}' already exists`;
394
+ }
395
+ class ValidationErrorError extends Error {
396
+ constructor(body) {
397
+ super(
398
+ `VALIDATION_ERROR: ${body.message}`
399
+ );
400
+ this.body = body;
401
+ this.name = "ValidationErrorError";
402
+ }
403
+ static code = "VALIDATION_ERROR";
404
+ static statusCode = 400;
405
+ static description = `Validation error: {message}`;
406
+ }
407
+ class GroupNotFoundError extends Error {
408
+ constructor(body) {
409
+ super(
410
+ `GROUP_NOT_FOUND: ${body.message}`
411
+ );
412
+ this.body = body;
413
+ this.name = "GroupNotFoundError";
414
+ }
415
+ static code = "GROUP_NOT_FOUND";
416
+ static statusCode = 404;
417
+ static description = `Group not found: {group_name}`;
418
+ }
419
+ class GroupAlreadyExistsError extends Error {
420
+ constructor(body) {
421
+ super(
422
+ `GROUP_ALREADY_EXISTS: ${body.message}`
423
+ );
424
+ this.body = body;
425
+ this.name = "GroupAlreadyExistsError";
426
+ }
427
+ static code = "GROUP_ALREADY_EXISTS";
428
+ static statusCode = 409;
429
+ static description = `Conflict: Group '{group_name}' already exists`;
430
+ }
431
+ class DuplicateUserNameError extends Error {
432
+ constructor(body) {
433
+ super(
434
+ `DUPLICATE_USER_NAME: ${body.message}`
435
+ );
436
+ this.body = body;
437
+ this.name = "DuplicateUserNameError";
438
+ }
439
+ static code = "DUPLICATE_USER_NAME";
440
+ static statusCode = 400;
441
+ static description = `Duplicate user name '{name}' found`;
442
+ }
443
+ class UserGroupEmptyError extends Error {
444
+ constructor(body) {
445
+ super(
446
+ `USER_GROUP_EMPTY: ${body.message}`
447
+ );
448
+ this.body = body;
449
+ this.name = "UserGroupEmptyError";
450
+ }
451
+ static code = "USER_GROUP_EMPTY";
452
+ static statusCode = 400;
453
+ static description = `User '{user}' has empty string in groups`;
454
+ }
455
+ class UserSystemFlagMismatchError extends Error {
456
+ constructor(body) {
457
+ super(
458
+ `USER_SYSTEM_FLAG_MISMATCH: ${body.message}`
459
+ );
460
+ this.body = body;
461
+ this.name = "UserSystemFlagMismatchError";
462
+ }
463
+ static code = "USER_SYSTEM_FLAG_MISMATCH";
464
+ static statusCode = 400;
465
+ static description = `User '{user}' has system=true but UID {uid} is > 999 (system range)`;
466
+ }
443
467
  class UserUidOutOfRangeError extends Error {
444
468
  constructor(body) {
445
469
  super(
@@ -536,18 +560,6 @@ class GroupNameEmptyError extends Error {
536
560
  static statusCode = 400;
537
561
  static description = `Group name cannot be empty`;
538
562
  }
539
- class CreateVmBadRequestError extends Error {
540
- constructor(body) {
541
- super(
542
- `CREATE_VM_BAD_REQUEST: ${body.message}`
543
- );
544
- this.body = body;
545
- this.name = "CreateVmBadRequestError";
546
- }
547
- static code = "CREATE_VM_BAD_REQUEST";
548
- static statusCode = 400;
549
- static description = `Bad request: {message}`;
550
- }
551
563
  class WantedByEmptyError extends Error {
552
564
  constructor(body) {
553
565
  super(
@@ -738,91 +750,55 @@ class ServiceNotFoundError extends Error {
738
750
  }
739
751
  static code = "SERVICE_NOT_FOUND";
740
752
  static statusCode = 404;
741
- static description = `null`;
742
- }
743
- class WaitTimeoutError extends Error {
744
- constructor(body) {
745
- super(
746
- `WAIT_TIMEOUT: ${body.message}`
747
- );
748
- this.body = body;
749
- this.name = "WaitTimeoutError";
750
- }
751
- static code = "WAIT_TIMEOUT";
752
- static statusCode = 504;
753
- static description = `Timed out waiting for certificate validation`;
754
- }
755
- class PreVerifyChallengeMismatchError extends Error {
756
- constructor(body) {
757
- super(
758
- `PRE_VERIFY_CHALLENGE_MISMATCH: ${body.message}`
759
- );
760
- this.body = body;
761
- this.name = "PreVerifyChallengeMismatchError";
762
- }
763
- static code = "PRE_VERIFY_CHALLENGE_MISMATCH";
764
- static statusCode = 400;
765
- static description = `Certificate challenge verification failed - response did not match`;
766
- }
767
- class PreVerifyFailedParseError extends Error {
768
- constructor(body) {
769
- super(
770
- `PRE_VERIFY_FAILED_PARSE: ${body.message}`
771
- );
772
- this.body = body;
773
- this.name = "PreVerifyFailedParseError";
774
- }
775
- static code = "PRE_VERIFY_FAILED_PARSE";
776
- static statusCode = 400;
777
- static description = `Invalid response from domain during certificate verification`;
753
+ static description = `Service '{service_name}' not found`;
778
754
  }
779
- class PreVerifyFailedFetchError extends Error {
755
+ class InvalidRequestError extends Error {
780
756
  constructor(body) {
781
757
  super(
782
- `PRE_VERIFY_FAILED_FETCH: ${body.message}`
758
+ `INVALID_REQUEST: ${body.message}`
783
759
  );
784
760
  this.body = body;
785
- this.name = "PreVerifyFailedFetchError";
761
+ this.name = "InvalidRequestError";
786
762
  }
787
- static code = "PRE_VERIFY_FAILED_FETCH";
763
+ static code = "INVALID_REQUEST";
788
764
  static statusCode = 400;
789
- static description = `Could not reach domain for certificate verification - check DNS settings`;
765
+ static description = `Invalid request: {message}`;
790
766
  }
791
- class PreVerifyRouteNotFoundError extends Error {
767
+ class RepoNotFoundError extends Error {
792
768
  constructor(body) {
793
769
  super(
794
- `PRE_VERIFY_ROUTE_NOT_FOUND: ${body.message}`
770
+ `REPO_NOT_FOUND: ${body.message}`
795
771
  );
796
772
  this.body = body;
797
- this.name = "PreVerifyRouteNotFoundError";
773
+ this.name = "RepoNotFoundError";
798
774
  }
799
- static code = "PRE_VERIFY_ROUTE_NOT_FOUND";
800
- static statusCode = 400;
801
- static description = `Domain does not resolve to Freestyle servers`;
775
+ static code = "REPO_NOT_FOUND";
776
+ static statusCode = 404;
777
+ static description = `Repository not found: {repo_id}`;
802
778
  }
803
- class AuthorizationNotFoundError extends Error {
779
+ class RuntimeErrorError extends Error {
804
780
  constructor(body) {
805
781
  super(
806
- `AUTHORIZATION_NOT_FOUND: ${body.message}`
782
+ `RUNTIME_ERROR: ${body.message}`
807
783
  );
808
784
  this.body = body;
809
- this.name = "AuthorizationNotFoundError";
785
+ this.name = "RuntimeErrorError";
810
786
  }
811
- static code = "AUTHORIZATION_NOT_FOUND";
812
- static statusCode = 404;
813
- static description = `No authorization found for domain`;
787
+ static code = "RUNTIME_ERROR";
788
+ static statusCode = 500;
789
+ static description = `The script execution resulted in a runtime error: {message}`;
814
790
  }
815
- class OrderNotFoundError extends Error {
791
+ class SyntaxErrorError extends Error {
816
792
  constructor(body) {
817
793
  super(
818
- `ORDER_NOT_FOUND: ${body.message}`
794
+ `SYNTAX_ERROR: ${body.message}`
819
795
  );
820
796
  this.body = body;
821
- this.name = "OrderNotFoundError";
797
+ this.name = "SyntaxErrorError";
822
798
  }
823
- static code = "ORDER_NOT_FOUND";
824
- static statusCode = 404;
825
- static description = `No certificate order found for domain`;
799
+ static code = "SYNTAX_ERROR";
800
+ static statusCode = 503;
801
+ static description = `The provided script has a syntax error: {message}`;
826
802
  }
827
803
  class InternalError extends Error {
828
804
  constructor(body) {
@@ -896,173 +872,233 @@ class ExpiredError extends Error {
896
872
  static statusCode = 403;
897
873
  static description = `Session has expired`;
898
874
  }
899
- class TagNotFoundError extends Error {
875
+ class ForbiddenError extends Error {
900
876
  constructor(body) {
901
877
  super(
902
- `TAG_NOT_FOUND: ${body.message}`
878
+ `FORBIDDEN: ${body.message}`
903
879
  );
904
880
  this.body = body;
905
- this.name = "TagNotFoundError";
881
+ this.name = "ForbiddenError";
906
882
  }
907
- static code = "TAG_NOT_FOUND";
908
- static statusCode = 404;
909
- static description = `Tag not found: {tag}`;
883
+ static code = "FORBIDDEN";
884
+ static statusCode = 403;
885
+ static description = `You do not have permission to push to this repository`;
910
886
  }
911
- class BranchNotFoundError extends Error {
887
+ class UnauthorizedError extends Error {
912
888
  constructor(body) {
913
889
  super(
914
- `BRANCH_NOT_FOUND: ${body.message}`
890
+ `UNAUTHORIZED: ${body.message}`
915
891
  );
916
892
  this.body = body;
917
- this.name = "BranchNotFoundError";
893
+ this.name = "UnauthorizedError";
918
894
  }
919
- static code = "BRANCH_NOT_FOUND";
920
- static statusCode = 404;
921
- static description = `Branch not found: {branch}`;
895
+ static code = "UNAUTHORIZED";
896
+ static statusCode = 401;
897
+ static description = `Unauthorized`;
922
898
  }
923
- class RepoNotFoundError extends Error {
899
+ class InvalidServiceError extends Error {
924
900
  constructor(body) {
925
901
  super(
926
- `REPO_NOT_FOUND: ${body.message}`
902
+ `INVALID_SERVICE: ${body.message}`
927
903
  );
928
904
  this.body = body;
929
- this.name = "RepoNotFoundError";
905
+ this.name = "InvalidServiceError";
930
906
  }
931
- static code = "REPO_NOT_FOUND";
932
- static statusCode = 404;
933
- static description = `Repository not found`;
907
+ static code = "INVALID_SERVICE";
908
+ static statusCode = 403;
909
+ static description = `Invalid service '{invalid}', expected 'git-upload-pack' or 'git-receive-pack'`;
934
910
  }
935
- class InvalidObjectIdError extends Error {
911
+ class ExpectedServiceError extends Error {
936
912
  constructor(body) {
937
913
  super(
938
- `INVALID_OBJECT_ID: ${body.message}`
914
+ `EXPECTED_SERVICE: ${body.message}`
939
915
  );
940
916
  this.body = body;
941
- this.name = "InvalidObjectIdError";
917
+ this.name = "ExpectedServiceError";
942
918
  }
943
- static code = "INVALID_OBJECT_ID";
944
- static statusCode = 400;
945
- static description = `Invalid object ID`;
919
+ static code = "EXPECTED_SERVICE";
920
+ static statusCode = 403;
921
+ static description = `Expected 'service' query parameter`;
946
922
  }
947
- class CommitNotFoundError extends Error {
923
+ class UnsupportedTransferError extends Error {
948
924
  constructor(body) {
949
925
  super(
950
- `COMMIT_NOT_FOUND: ${body.message}`
926
+ `UNSUPPORTED_TRANSFER: ${body.message}`
951
927
  );
952
928
  this.body = body;
953
- this.name = "CommitNotFoundError";
929
+ this.name = "UnsupportedTransferError";
954
930
  }
955
- static code = "COMMIT_NOT_FOUND";
956
- static statusCode = 404;
957
- static description = `Commit not found: {hash}`;
931
+ static code = "UNSUPPORTED_TRANSFER";
932
+ static statusCode = 400;
933
+ static description = `Unsupported LFS transfer protocol(s)`;
958
934
  }
959
- class ReferenceNotFoundError extends Error {
935
+ class ConflictError extends Error {
960
936
  constructor(body) {
961
937
  super(
962
- `REFERENCE_NOT_FOUND: ${body.message}`
938
+ `CONFLICT: ${body.message}`
963
939
  );
964
940
  this.body = body;
965
- this.name = "ReferenceNotFoundError";
941
+ this.name = "ConflictError";
966
942
  }
967
- static code = "REFERENCE_NOT_FOUND";
968
- static statusCode = 404;
969
- static description = `Reference not found: {reference}`;
943
+ static code = "CONFLICT";
944
+ static statusCode = 409;
945
+ static description = `Sync conflict: {message}`;
970
946
  }
971
- class PathNotFoundError extends Error {
947
+ class BranchNotFoundError extends Error {
972
948
  constructor(body) {
973
949
  super(
974
- `PATH_NOT_FOUND: ${body.message}`
950
+ `BRANCH_NOT_FOUND: ${body.message}`
975
951
  );
976
952
  this.body = body;
977
- this.name = "PathNotFoundError";
953
+ this.name = "BranchNotFoundError";
978
954
  }
979
- static code = "PATH_NOT_FOUND";
955
+ static code = "BRANCH_NOT_FOUND";
980
956
  static statusCode = 404;
981
- static description = `Path not found: {path}`;
957
+ static description = `Branch not found: {branch}`;
982
958
  }
983
- class InvalidRequestError extends Error {
959
+ class SourceImportConflictError extends Error {
984
960
  constructor(body) {
985
961
  super(
986
- `INVALID_REQUEST: ${body.message}`
962
+ `SOURCE_IMPORT_CONFLICT: ${body.message}`
987
963
  );
988
964
  this.body = body;
989
- this.name = "InvalidRequestError";
965
+ this.name = "SourceImportConflictError";
990
966
  }
991
- static code = "INVALID_REQUEST";
967
+ static code = "SOURCE_IMPORT_CONFLICT";
992
968
  static statusCode = 400;
993
- static description = `null`;
969
+ static description = `Source and import are mutually exclusive`;
994
970
  }
995
- class InvalidRevisionError extends Error {
971
+ class SourceUnauthorizedError extends Error {
996
972
  constructor(body) {
997
973
  super(
998
- `INVALID_REVISION: ${body.message}`
974
+ `SOURCE_UNAUTHORIZED: ${body.message}`
999
975
  );
1000
976
  this.body = body;
1001
- this.name = "InvalidRevisionError";
977
+ this.name = "SourceUnauthorizedError";
1002
978
  }
1003
- static code = "INVALID_REVISION";
979
+ static code = "SOURCE_UNAUTHORIZED";
1004
980
  static statusCode = 400;
1005
- static description = `null`;
981
+ static description = `Unauthorized to access source repository at {url}`;
1006
982
  }
1007
- class ForbiddenError extends Error {
983
+ class SourceNotFoundError extends Error {
1008
984
  constructor(body) {
1009
985
  super(
1010
- `FORBIDDEN: ${body.message}`
986
+ `SOURCE_NOT_FOUND: ${body.message}`
1011
987
  );
1012
988
  this.body = body;
1013
- this.name = "ForbiddenError";
989
+ this.name = "SourceNotFoundError";
1014
990
  }
1015
- static code = "FORBIDDEN";
1016
- static statusCode = 403;
1017
- static description = `Forbidden`;
991
+ static code = "SOURCE_NOT_FOUND";
992
+ static statusCode = 400;
993
+ static description = `Source repository not found at {url}`;
1018
994
  }
1019
- class UnauthorizedError extends Error {
995
+ class ImportSubdirNotFoundError extends Error {
1020
996
  constructor(body) {
1021
997
  super(
1022
- `UNAUTHORIZED: ${body.message}`
998
+ `IMPORT_SUBDIR_NOT_FOUND: ${body.message}`
1023
999
  );
1024
1000
  this.body = body;
1025
- this.name = "UnauthorizedError";
1001
+ this.name = "ImportSubdirNotFoundError";
1026
1002
  }
1027
- static code = "UNAUTHORIZED";
1028
- static statusCode = 401;
1029
- static description = `Unauthorized`;
1003
+ static code = "IMPORT_SUBDIR_NOT_FOUND";
1004
+ static statusCode = 400;
1005
+ static description = `Directory not found in {source}: {dir}`;
1030
1006
  }
1031
- class ConflictError extends Error {
1007
+ class RepoAlreadyExistsError extends Error {
1032
1008
  constructor(body) {
1033
1009
  super(
1034
- `CONFLICT: ${body.message}`
1010
+ `REPO_ALREADY_EXISTS: ${body.message}`
1035
1011
  );
1036
1012
  this.body = body;
1037
- this.name = "ConflictError";
1013
+ this.name = "RepoAlreadyExistsError";
1038
1014
  }
1039
- static code = "CONFLICT";
1015
+ static code = "REPO_ALREADY_EXISTS";
1040
1016
  static statusCode = 409;
1041
- static description = `Sync conflict: {message}`;
1017
+ static description = `Repo '{repo_id}' already exists`;
1042
1018
  }
1043
- class UnsupportedTransferError extends Error {
1019
+ class PathNotFoundError extends Error {
1044
1020
  constructor(body) {
1045
1021
  super(
1046
- `UNSUPPORTED_TRANSFER: ${body.message}`
1022
+ `PATH_NOT_FOUND: ${body.message}`
1047
1023
  );
1048
1024
  this.body = body;
1049
- this.name = "UnsupportedTransferError";
1025
+ this.name = "PathNotFoundError";
1050
1026
  }
1051
- static code = "UNSUPPORTED_TRANSFER";
1027
+ static code = "PATH_NOT_FOUND";
1028
+ static statusCode = 404;
1029
+ static description = `Path not found: {path}`;
1030
+ }
1031
+ class ReferenceNotFoundError extends Error {
1032
+ constructor(body) {
1033
+ super(
1034
+ `REFERENCE_NOT_FOUND: ${body.message}`
1035
+ );
1036
+ this.body = body;
1037
+ this.name = "ReferenceNotFoundError";
1038
+ }
1039
+ static code = "REFERENCE_NOT_FOUND";
1040
+ static statusCode = 404;
1041
+ static description = `Reference not found: {reference}`;
1042
+ }
1043
+ class TagNotFoundError extends Error {
1044
+ constructor(body) {
1045
+ super(
1046
+ `TAG_NOT_FOUND: ${body.message}`
1047
+ );
1048
+ this.body = body;
1049
+ this.name = "TagNotFoundError";
1050
+ }
1051
+ static code = "TAG_NOT_FOUND";
1052
+ static statusCode = 404;
1053
+ static description = `Tag not found: {hash}`;
1054
+ }
1055
+ class SendErrorError extends Error {
1056
+ constructor(body) {
1057
+ super(
1058
+ `SEND_ERROR: ${body.message}`
1059
+ );
1060
+ this.body = body;
1061
+ this.name = "SendErrorError";
1062
+ }
1063
+ static code = "SEND_ERROR";
1064
+ static statusCode = 500;
1065
+ static description = `Stream receiver dropped`;
1066
+ }
1067
+ class GitHubSyncConflictError extends Error {
1068
+ constructor(body) {
1069
+ super(
1070
+ `GIT_HUB_SYNC_CONFLICT: ${body.message}`
1071
+ );
1072
+ this.body = body;
1073
+ this.name = "GitHubSyncConflictError";
1074
+ }
1075
+ static code = "GIT_HUB_SYNC_CONFLICT";
1076
+ static statusCode = 409;
1077
+ static description = `GitHub Sync Conflict: {message}`;
1078
+ }
1079
+ class InvalidObjectIdError extends Error {
1080
+ constructor(body) {
1081
+ super(
1082
+ `INVALID_OBJECT_ID: ${body.message}`
1083
+ );
1084
+ this.body = body;
1085
+ this.name = "InvalidObjectIdError";
1086
+ }
1087
+ static code = "INVALID_OBJECT_ID";
1052
1088
  static statusCode = 400;
1053
- static description = `Unsupported LFS transfer protocol(s)`;
1089
+ static description = `Invalid object ID: {hash}`;
1054
1090
  }
1055
- class BlobNotFoundError extends Error {
1091
+ class CommitNotFoundError extends Error {
1056
1092
  constructor(body) {
1057
1093
  super(
1058
- `BLOB_NOT_FOUND: ${body.message}`
1094
+ `COMMIT_NOT_FOUND: ${body.message}`
1059
1095
  );
1060
1096
  this.body = body;
1061
- this.name = "BlobNotFoundError";
1097
+ this.name = "CommitNotFoundError";
1062
1098
  }
1063
- static code = "BLOB_NOT_FOUND";
1099
+ static code = "COMMIT_NOT_FOUND";
1064
1100
  static statusCode = 404;
1065
- static description = `Blob not found: {hash}`;
1101
+ static description = `Commit {commit_hash} not found in repository {repo_id}`;
1066
1102
  }
1067
1103
  class TreeNotFoundError extends Error {
1068
1104
  constructor(body) {
@@ -1076,6 +1112,126 @@ class TreeNotFoundError extends Error {
1076
1112
  static statusCode = 404;
1077
1113
  static description = `Tree not found: {hash}`;
1078
1114
  }
1115
+ class InvalidRevisionError extends Error {
1116
+ constructor(body) {
1117
+ super(
1118
+ `INVALID_REVISION: ${body.message}`
1119
+ );
1120
+ this.body = body;
1121
+ this.name = "InvalidRevisionError";
1122
+ }
1123
+ static code = "INVALID_REVISION";
1124
+ static statusCode = 400;
1125
+ static description = `Invalid revision: {revision}`;
1126
+ }
1127
+ class InvalidRangeError extends Error {
1128
+ constructor(body) {
1129
+ super(
1130
+ `INVALID_RANGE: ${body.message}`
1131
+ );
1132
+ this.body = body;
1133
+ this.name = "InvalidRangeError";
1134
+ }
1135
+ static code = "INVALID_RANGE";
1136
+ static statusCode = 400;
1137
+ 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.`;
1138
+ }
1139
+ class OffsetWithSelectorError extends Error {
1140
+ constructor(body) {
1141
+ super(
1142
+ `OFFSET_WITH_SELECTOR: ${body.message}`
1143
+ );
1144
+ this.body = body;
1145
+ this.name = "OffsetWithSelectorError";
1146
+ }
1147
+ static code = "OFFSET_WITH_SELECTOR";
1148
+ static statusCode = 400;
1149
+ static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
1150
+ }
1151
+ class CommitNotInBranchError extends Error {
1152
+ constructor(body) {
1153
+ super(
1154
+ `COMMIT_NOT_IN_BRANCH: ${body.message}`
1155
+ );
1156
+ this.body = body;
1157
+ this.name = "CommitNotInBranchError";
1158
+ }
1159
+ static code = "COMMIT_NOT_IN_BRANCH";
1160
+ static statusCode = 400;
1161
+ static description = `Commit {sha} is not in the history of branch {branch}`;
1162
+ }
1163
+ class BlobNotFoundError extends Error {
1164
+ constructor(body) {
1165
+ super(
1166
+ `BLOB_NOT_FOUND: ${body.message}`
1167
+ );
1168
+ this.body = body;
1169
+ this.name = "BlobNotFoundError";
1170
+ }
1171
+ static code = "BLOB_NOT_FOUND";
1172
+ static statusCode = 404;
1173
+ static description = `Blob not found: {hash}`;
1174
+ }
1175
+ class AmbiguousError extends Error {
1176
+ constructor(body) {
1177
+ super(
1178
+ `AMBIGUOUS: ${body.message}`
1179
+ );
1180
+ this.body = body;
1181
+ this.name = "AmbiguousError";
1182
+ }
1183
+ static code = "AMBIGUOUS";
1184
+ static statusCode = 400;
1185
+ static description = `rev is ambiguous: {rev}`;
1186
+ }
1187
+ class InvalidError extends Error {
1188
+ constructor(body) {
1189
+ super(
1190
+ `INVALID: ${body.message}`
1191
+ );
1192
+ this.body = body;
1193
+ this.name = "InvalidError";
1194
+ }
1195
+ static code = "INVALID";
1196
+ static statusCode = 400;
1197
+ static description = `invalid rev syntax: {rev}`;
1198
+ }
1199
+ class PackfileError extends Error {
1200
+ constructor(body) {
1201
+ super(
1202
+ `PACKFILE: ${body.message}`
1203
+ );
1204
+ this.body = body;
1205
+ this.name = "PackfileError";
1206
+ }
1207
+ static code = "PACKFILE";
1208
+ static statusCode = 500;
1209
+ static description = `Error building packfile`;
1210
+ }
1211
+ class DatabaseErrorError extends Error {
1212
+ constructor(body) {
1213
+ super(
1214
+ `DATABASE_ERROR: ${body.message}`
1215
+ );
1216
+ this.body = body;
1217
+ this.name = "DatabaseErrorError";
1218
+ }
1219
+ static code = "DATABASE_ERROR";
1220
+ static statusCode = 500;
1221
+ static description = `Database error: {0}`;
1222
+ }
1223
+ class EmptyTagError extends Error {
1224
+ constructor(body) {
1225
+ super(
1226
+ `EMPTY_TAG: ${body.message}`
1227
+ );
1228
+ this.body = body;
1229
+ this.name = "EmptyTagError";
1230
+ }
1231
+ static code = "EMPTY_TAG";
1232
+ static statusCode = 400;
1233
+ static description = `Invalid request: tag cannot be empty`;
1234
+ }
1079
1235
  class ResizeFailedError extends Error {
1080
1236
  constructor(body) {
1081
1237
  super(
@@ -1100,77 +1256,257 @@ class InternalResizeVmNotFoundError extends Error {
1100
1256
  static statusCode = 404;
1101
1257
  static description = `VM not found`;
1102
1258
  }
1103
- class ObservabilityDatabaseErrorError extends Error {
1259
+ class DomainOwnershipVerificationFailedError extends Error {
1104
1260
  constructor(body) {
1105
1261
  super(
1106
- `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
1262
+ `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
1107
1263
  );
1108
1264
  this.body = body;
1109
- this.name = "ObservabilityDatabaseErrorError";
1265
+ this.name = "DomainOwnershipVerificationFailedError";
1110
1266
  }
1111
- static code = "OBSERVABILITY_DATABASE_ERROR";
1267
+ static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
1268
+ static statusCode = 403;
1269
+ static description = `Domain ownership verification failed`;
1270
+ }
1271
+ class ErrorDeletingRecordError extends Error {
1272
+ constructor(body) {
1273
+ super(
1274
+ `ERROR_DELETING_RECORD: ${body.message}`
1275
+ );
1276
+ this.body = body;
1277
+ this.name = "ErrorDeletingRecordError";
1278
+ }
1279
+ static code = "ERROR_DELETING_RECORD";
1112
1280
  static statusCode = 500;
1113
- static description = `Database operation failed: {message}`;
1281
+ static description = `Error deleting DNS record for {domain}/{name}: {message}`;
1114
1282
  }
1115
- class ObservabilityAccessDeniedError extends Error {
1283
+ class RecordOwnershipErrorError extends Error {
1116
1284
  constructor(body) {
1117
1285
  super(
1118
- `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
1286
+ `RECORD_OWNERSHIP_ERROR: ${body.message}`
1119
1287
  );
1120
1288
  this.body = body;
1121
- this.name = "ObservabilityAccessDeniedError";
1289
+ this.name = "RecordOwnershipErrorError";
1122
1290
  }
1123
- static code = "OBSERVABILITY_ACCESS_DENIED";
1291
+ static code = "RECORD_OWNERSHIP_ERROR";
1124
1292
  static statusCode = 403;
1125
- static description = `Access denied to logs for deployment: {deployment_id}`;
1293
+ static description = `Account {account_id} does not own record {record_id}`;
1126
1294
  }
1127
- class ParseLogsFailedError extends Error {
1295
+ class ErrorCreatingRecordError extends Error {
1128
1296
  constructor(body) {
1129
1297
  super(
1130
- `PARSE_LOGS_FAILED: ${body.message}`
1298
+ `ERROR_CREATING_RECORD: ${body.message}`
1131
1299
  );
1132
1300
  this.body = body;
1133
- this.name = "ParseLogsFailedError";
1301
+ this.name = "ErrorCreatingRecordError";
1134
1302
  }
1135
- static code = "PARSE_LOGS_FAILED";
1303
+ static code = "ERROR_CREATING_RECORD";
1136
1304
  static statusCode = 500;
1137
- static description = `Failed to parse logs: {message}`;
1305
+ static description = `Error creating DNS record: {message}`;
1138
1306
  }
1139
- class RetrieveLogsFailedError extends Error {
1307
+ class DomainOwnershipErrorError extends Error {
1140
1308
  constructor(body) {
1141
1309
  super(
1142
- `RETRIEVE_LOGS_FAILED: ${body.message}`
1310
+ `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
1143
1311
  );
1144
1312
  this.body = body;
1145
- this.name = "RetrieveLogsFailedError";
1313
+ this.name = "DomainOwnershipErrorError";
1146
1314
  }
1147
- static code = "RETRIEVE_LOGS_FAILED";
1315
+ static code = "DOMAIN_OWNERSHIP_ERROR";
1316
+ static statusCode = 403;
1317
+ static description = `Account {account_id} does not own domain {domain}`;
1318
+ }
1319
+ class BrowserOperationFailedError extends Error {
1320
+ constructor(body) {
1321
+ super(
1322
+ `BROWSER_OPERATION_FAILED: ${body.message}`
1323
+ );
1324
+ this.body = body;
1325
+ this.name = "BrowserOperationFailedError";
1326
+ }
1327
+ static code = "BROWSER_OPERATION_FAILED";
1148
1328
  static statusCode = 500;
1149
- static description = `Failed to retrieve logs: {message}`;
1329
+ static description = `Browser operation failed: {message}`;
1150
1330
  }
1151
- class InvalidQueryError extends Error {
1331
+ class WatchFilesFailedError extends Error {
1152
1332
  constructor(body) {
1153
1333
  super(
1154
- `INVALID_QUERY: ${body.message}`
1334
+ `WATCH_FILES_FAILED: ${body.message}`
1155
1335
  );
1156
1336
  this.body = body;
1157
- this.name = "InvalidQueryError";
1337
+ this.name = "WatchFilesFailedError";
1158
1338
  }
1159
- static code = "INVALID_QUERY";
1339
+ static code = "WATCH_FILES_FAILED";
1340
+ static statusCode = 500;
1341
+ static description = `Failed to watch files: {message}`;
1342
+ }
1343
+ class LogsFailedError extends Error {
1344
+ constructor(body) {
1345
+ super(
1346
+ `LOGS_FAILED: ${body.message}`
1347
+ );
1348
+ this.body = body;
1349
+ this.name = "LogsFailedError";
1350
+ }
1351
+ static code = "LOGS_FAILED";
1352
+ static statusCode = 500;
1353
+ static description = `Failed to get logs: {message}`;
1354
+ }
1355
+ class StatusFailedError extends Error {
1356
+ constructor(body) {
1357
+ super(
1358
+ `STATUS_FAILED: ${body.message}`
1359
+ );
1360
+ this.body = body;
1361
+ this.name = "StatusFailedError";
1362
+ }
1363
+ static code = "STATUS_FAILED";
1364
+ static statusCode = 500;
1365
+ static description = `Failed to get dev server status: {message}`;
1366
+ }
1367
+ class RestartFailedError extends Error {
1368
+ constructor(body) {
1369
+ super(
1370
+ `RESTART_FAILED: ${body.message}`
1371
+ );
1372
+ this.body = body;
1373
+ this.name = "RestartFailedError";
1374
+ }
1375
+ static code = "RESTART_FAILED";
1376
+ static statusCode = 500;
1377
+ static description = `Failed to restart dev server: {message}`;
1378
+ }
1379
+ class ShutdownFailedError extends Error {
1380
+ constructor(body) {
1381
+ super(
1382
+ `SHUTDOWN_FAILED: ${body.message}`
1383
+ );
1384
+ this.body = body;
1385
+ this.name = "ShutdownFailedError";
1386
+ }
1387
+ static code = "SHUTDOWN_FAILED";
1388
+ static statusCode = 500;
1389
+ static description = `Failed to shutdown dev server: {message}`;
1390
+ }
1391
+ class CommitFailedError extends Error {
1392
+ constructor(body) {
1393
+ super(
1394
+ `COMMIT_FAILED: ${body.message}`
1395
+ );
1396
+ this.body = body;
1397
+ this.name = "CommitFailedError";
1398
+ }
1399
+ static code = "COMMIT_FAILED";
1400
+ static statusCode = 500;
1401
+ static description = `Failed to commit changes: {message}`;
1402
+ }
1403
+ class WriteFileFailedError extends Error {
1404
+ constructor(body) {
1405
+ super(
1406
+ `WRITE_FILE_FAILED: ${body.message}`
1407
+ );
1408
+ this.body = body;
1409
+ this.name = "WriteFileFailedError";
1410
+ }
1411
+ static code = "WRITE_FILE_FAILED";
1412
+ static statusCode = 500;
1413
+ static description = `Failed to write file: {message}`;
1414
+ }
1415
+ class ReadFileFailedError extends Error {
1416
+ constructor(body) {
1417
+ super(
1418
+ `READ_FILE_FAILED: ${body.message}`
1419
+ );
1420
+ this.body = body;
1421
+ this.name = "ReadFileFailedError";
1422
+ }
1423
+ static code = "READ_FILE_FAILED";
1424
+ static statusCode = 500;
1425
+ static description = `Failed to read file: {message}`;
1426
+ }
1427
+ class ExecutionFailedError extends Error {
1428
+ constructor(body) {
1429
+ super(
1430
+ `EXECUTION_FAILED: ${body.message}`
1431
+ );
1432
+ this.body = body;
1433
+ this.name = "ExecutionFailedError";
1434
+ }
1435
+ static code = "EXECUTION_FAILED";
1436
+ static statusCode = 500;
1437
+ static description = `Failed to execute command: {message}`;
1438
+ }
1439
+ class RequestFailedError extends Error {
1440
+ constructor(body) {
1441
+ super(
1442
+ `REQUEST_FAILED: ${body.message}`
1443
+ );
1444
+ this.body = body;
1445
+ this.name = "RequestFailedError";
1446
+ }
1447
+ static code = "REQUEST_FAILED";
1448
+ static statusCode = 500;
1449
+ static description = `Failed to request dev server: {message}`;
1450
+ }
1451
+ class DevServerFileNotFoundError extends Error {
1452
+ constructor(body) {
1453
+ super(
1454
+ `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
1455
+ );
1456
+ this.body = body;
1457
+ this.name = "DevServerFileNotFoundError";
1458
+ }
1459
+ static code = "DEV_SERVER_FILE_NOT_FOUND";
1460
+ static statusCode = 404;
1461
+ static description = `Dev server file not found: {path}`;
1462
+ }
1463
+ class DevServerInvalidRequestError extends Error {
1464
+ constructor(body) {
1465
+ super(
1466
+ `DEV_SERVER_INVALID_REQUEST: ${body.message}`
1467
+ );
1468
+ this.body = body;
1469
+ this.name = "DevServerInvalidRequestError";
1470
+ }
1471
+ static code = "DEV_SERVER_INVALID_REQUEST";
1160
1472
  static statusCode = 400;
1161
- static description = `Invalid log query: {message}`;
1473
+ static description = `Invalid dev server request: {message}`;
1162
1474
  }
1163
- class LogsNotFoundError extends Error {
1475
+ class DevServerNotFoundError extends Error {
1164
1476
  constructor(body) {
1165
1477
  super(
1166
- `LOGS_NOT_FOUND: ${body.message}`
1478
+ `DEV_SERVER_NOT_FOUND: ${body.message}`
1167
1479
  );
1168
1480
  this.body = body;
1169
- this.name = "LogsNotFoundError";
1481
+ this.name = "DevServerNotFoundError";
1482
+ }
1483
+ static code = "DEV_SERVER_NOT_FOUND";
1484
+ static statusCode = 404;
1485
+ static description = `Dev server not found: {server_id}`;
1486
+ }
1487
+ class AnyhowError extends Error {
1488
+ constructor(body) {
1489
+ super(
1490
+ `ANYHOW: ${body.message}`
1491
+ );
1492
+ this.body = body;
1493
+ this.name = "AnyhowError";
1494
+ }
1495
+ static code = "ANYHOW";
1496
+ static statusCode = 500;
1497
+ static description = `Internal server error: {0}`;
1498
+ }
1499
+ class BranchNameEmptyError extends Error {
1500
+ constructor(body) {
1501
+ super(
1502
+ `BRANCH_NAME_EMPTY: ${body.message}`
1503
+ );
1504
+ this.body = body;
1505
+ this.name = "BranchNameEmptyError";
1170
1506
  }
1171
- static code = "LOGS_NOT_FOUND";
1172
- static statusCode = 404;
1173
- static description = `Logs not found for deployment: {deployment_id}`;
1507
+ static code = "BRANCH_NAME_EMPTY";
1508
+ static statusCode = 400;
1509
+ static description = `Branch name cannot be empty`;
1174
1510
  }
1175
1511
  class PermissionAlreadyExistsError extends Error {
1176
1512
  constructor(body) {
@@ -1574,395 +1910,143 @@ class LoggingFailedError extends Error {
1574
1910
  `LOGGING_FAILED: ${body.message}`
1575
1911
  );
1576
1912
  this.body = body;
1577
- this.name = "LoggingFailedError";
1578
- }
1579
- static code = "LOGGING_FAILED";
1580
- static statusCode = 500;
1581
- static description = `Failed to log execute run: {message}`;
1582
- }
1583
- class RunNotFoundError extends Error {
1584
- constructor(body) {
1585
- super(
1586
- `RUN_NOT_FOUND: ${body.message}`
1587
- );
1588
- this.body = body;
1589
- this.name = "RunNotFoundError";
1590
- }
1591
- static code = "RUN_NOT_FOUND";
1592
- static statusCode = 404;
1593
- static description = `Execute run not found: {run_id}`;
1594
- }
1595
- class FailedToProvisionCertificateError extends Error {
1596
- constructor(body) {
1597
- super(
1598
- `FAILED_TO_PROVISION_CERTIFICATE: ${body.message}`
1599
- );
1600
- this.body = body;
1601
- this.name = "FailedToProvisionCertificateError";
1602
- }
1603
- static code = "FAILED_TO_PROVISION_CERTIFICATE";
1604
- static statusCode = 422;
1605
- static description = `Failed to provision certificate: {message}`;
1606
- }
1607
- class FailedToInsertDomainMappingError extends Error {
1608
- constructor(body) {
1609
- super(
1610
- `FAILED_TO_INSERT_DOMAIN_MAPPING: ${body.message}`
1611
- );
1612
- this.body = body;
1613
- this.name = "FailedToInsertDomainMappingError";
1614
- }
1615
- static code = "FAILED_TO_INSERT_DOMAIN_MAPPING";
1616
- static statusCode = 500;
1617
- static description = `Failed to insert domain mapping: {message}`;
1618
- }
1619
- class PermissionDeniedError extends Error {
1620
- constructor(body) {
1621
- super(
1622
- `PERMISSION_DENIED: ${body.message}`
1623
- );
1624
- this.body = body;
1625
- this.name = "PermissionDeniedError";
1626
- }
1627
- static code = "PERMISSION_DENIED";
1628
- static statusCode = 401;
1629
- static description = `Permission denied: {message}`;
1630
- }
1631
- class FailedToCheckPermissionsError extends Error {
1632
- constructor(body) {
1633
- super(
1634
- `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
1635
- );
1636
- this.body = body;
1637
- this.name = "FailedToCheckPermissionsError";
1638
- }
1639
- static code = "FAILED_TO_CHECK_PERMISSIONS";
1640
- static statusCode = 502;
1641
- static description = `Failed to check permissions: {message}`;
1642
- }
1643
- class FailedToListDomainsError extends Error {
1644
- constructor(body) {
1645
- super(
1646
- `FAILED_TO_LIST_DOMAINS: ${body.message}`
1647
- );
1648
- this.body = body;
1649
- this.name = "FailedToListDomainsError";
1650
- }
1651
- static code = "FAILED_TO_LIST_DOMAINS";
1652
- static statusCode = 500;
1653
- static description = `Failed to list domains: {message}`;
1654
- }
1655
- class FailedToListVerificationsError extends Error {
1656
- constructor(body) {
1657
- super(
1658
- `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
1659
- );
1660
- this.body = body;
1661
- this.name = "FailedToListVerificationsError";
1662
- }
1663
- static code = "FAILED_TO_LIST_VERIFICATIONS";
1664
- static statusCode = 500;
1665
- static description = `Failed to list verifications: {message}`;
1666
- }
1667
- class FailedToVerifyDomainError extends Error {
1668
- constructor(body) {
1669
- super(
1670
- `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
1671
- );
1672
- this.body = body;
1673
- this.name = "FailedToVerifyDomainError";
1674
- }
1675
- static code = "FAILED_TO_VERIFY_DOMAIN";
1676
- static statusCode = 500;
1677
- static description = `Failed to verify domain: {message}`;
1678
- }
1679
- class VerificationFailedError extends Error {
1680
- constructor(body) {
1681
- super(
1682
- `VERIFICATION_FAILED: ${body.message}`
1683
- );
1684
- this.body = body;
1685
- this.name = "VerificationFailedError";
1686
- }
1687
- static code = "VERIFICATION_FAILED";
1688
- static statusCode = 400;
1689
- static description = `Domain verification failed: {message}`;
1690
- }
1691
- class FailedToDeleteVerificationError extends Error {
1692
- constructor(body) {
1693
- super(
1694
- `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
1695
- );
1696
- this.body = body;
1697
- this.name = "FailedToDeleteVerificationError";
1698
- }
1699
- static code = "FAILED_TO_DELETE_VERIFICATION";
1700
- static statusCode = 400;
1701
- static description = `Failed to delete verification: {message}`;
1702
- }
1703
- class VerificationNotFoundError extends Error {
1704
- constructor(body) {
1705
- super(
1706
- `VERIFICATION_NOT_FOUND: ${body.message}`
1707
- );
1708
- this.body = body;
1709
- this.name = "VerificationNotFoundError";
1710
- }
1711
- static code = "VERIFICATION_NOT_FOUND";
1712
- static statusCode = 404;
1713
- static description = `Verification request not found for domain: {domain}`;
1714
- }
1715
- class FailedToCreateVerificationCodeError extends Error {
1716
- constructor(body) {
1717
- super(
1718
- `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
1719
- );
1720
- this.body = body;
1721
- this.name = "FailedToCreateVerificationCodeError";
1722
- }
1723
- static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
1724
- static statusCode = 400;
1725
- static description = `Failed to create verification code: {message}`;
1726
- }
1727
- class InvalidDomainError extends Error {
1728
- constructor(body) {
1729
- super(
1730
- `INVALID_DOMAIN: ${body.message}`
1731
- );
1732
- this.body = body;
1733
- this.name = "InvalidDomainError";
1734
- }
1735
- static code = "INVALID_DOMAIN";
1736
- static statusCode = 400;
1737
- static description = `Invalid domain: {domain}`;
1738
- }
1739
- class DomainOwnershipVerificationFailedError extends Error {
1740
- constructor(body) {
1741
- super(
1742
- `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
1743
- );
1744
- this.body = body;
1745
- this.name = "DomainOwnershipVerificationFailedError";
1746
- }
1747
- static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
1748
- static statusCode = 403;
1749
- static description = `Domain ownership verification failed`;
1750
- }
1751
- class ErrorDeletingRecordError extends Error {
1752
- constructor(body) {
1753
- super(
1754
- `ERROR_DELETING_RECORD: ${body.message}`
1755
- );
1756
- this.body = body;
1757
- this.name = "ErrorDeletingRecordError";
1758
- }
1759
- static code = "ERROR_DELETING_RECORD";
1760
- static statusCode = 500;
1761
- static description = `Error deleting DNS record for {domain}/{name}: {message}`;
1762
- }
1763
- class RecordOwnershipErrorError extends Error {
1764
- constructor(body) {
1765
- super(
1766
- `RECORD_OWNERSHIP_ERROR: ${body.message}`
1767
- );
1768
- this.body = body;
1769
- this.name = "RecordOwnershipErrorError";
1770
- }
1771
- static code = "RECORD_OWNERSHIP_ERROR";
1772
- static statusCode = 403;
1773
- static description = `Account {account_id} does not own record {record_id}`;
1774
- }
1775
- class ErrorCreatingRecordError extends Error {
1776
- constructor(body) {
1777
- super(
1778
- `ERROR_CREATING_RECORD: ${body.message}`
1779
- );
1780
- this.body = body;
1781
- this.name = "ErrorCreatingRecordError";
1782
- }
1783
- static code = "ERROR_CREATING_RECORD";
1784
- static statusCode = 500;
1785
- static description = `Error creating DNS record: {message}`;
1786
- }
1787
- class DomainOwnershipErrorError extends Error {
1788
- constructor(body) {
1789
- super(
1790
- `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
1791
- );
1792
- this.body = body;
1793
- this.name = "DomainOwnershipErrorError";
1794
- }
1795
- static code = "DOMAIN_OWNERSHIP_ERROR";
1796
- static statusCode = 403;
1797
- static description = `Account {account_id} does not own domain {domain}`;
1798
- }
1799
- class BrowserOperationFailedError extends Error {
1800
- constructor(body) {
1801
- super(
1802
- `BROWSER_OPERATION_FAILED: ${body.message}`
1803
- );
1804
- this.body = body;
1805
- this.name = "BrowserOperationFailedError";
1806
- }
1807
- static code = "BROWSER_OPERATION_FAILED";
1808
- static statusCode = 500;
1809
- static description = `Browser operation failed: {message}`;
1810
- }
1811
- class WatchFilesFailedError extends Error {
1812
- constructor(body) {
1813
- super(
1814
- `WATCH_FILES_FAILED: ${body.message}`
1815
- );
1816
- this.body = body;
1817
- this.name = "WatchFilesFailedError";
1818
- }
1819
- static code = "WATCH_FILES_FAILED";
1820
- static statusCode = 500;
1821
- static description = `Failed to watch files: {message}`;
1822
- }
1823
- class LogsFailedError extends Error {
1824
- constructor(body) {
1825
- super(
1826
- `LOGS_FAILED: ${body.message}`
1827
- );
1828
- this.body = body;
1829
- this.name = "LogsFailedError";
1913
+ this.name = "LoggingFailedError";
1830
1914
  }
1831
- static code = "LOGS_FAILED";
1915
+ static code = "LOGGING_FAILED";
1832
1916
  static statusCode = 500;
1833
- static description = `Failed to get logs: {message}`;
1917
+ static description = `Failed to log execute run: {message}`;
1834
1918
  }
1835
- class StatusFailedError extends Error {
1919
+ class RunNotFoundError extends Error {
1836
1920
  constructor(body) {
1837
1921
  super(
1838
- `STATUS_FAILED: ${body.message}`
1922
+ `RUN_NOT_FOUND: ${body.message}`
1839
1923
  );
1840
1924
  this.body = body;
1841
- this.name = "StatusFailedError";
1925
+ this.name = "RunNotFoundError";
1842
1926
  }
1843
- static code = "STATUS_FAILED";
1844
- static statusCode = 500;
1845
- static description = `Failed to get dev server status: {message}`;
1927
+ static code = "RUN_NOT_FOUND";
1928
+ static statusCode = 404;
1929
+ static description = `Execute run not found: {run_id}`;
1846
1930
  }
1847
- class RestartFailedError extends Error {
1931
+ class CloudstateInternalErrorError extends Error {
1848
1932
  constructor(body) {
1849
1933
  super(
1850
- `RESTART_FAILED: ${body.message}`
1934
+ `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
1851
1935
  );
1852
1936
  this.body = body;
1853
- this.name = "RestartFailedError";
1937
+ this.name = "CloudstateInternalErrorError";
1854
1938
  }
1855
- static code = "RESTART_FAILED";
1939
+ static code = "CLOUDSTATE_INTERNAL_ERROR";
1856
1940
  static statusCode = 500;
1857
- static description = `Failed to restart dev server: {message}`;
1941
+ static description = `Internal error: {message}`;
1858
1942
  }
1859
- class ShutdownFailedError extends Error {
1943
+ class CloudstateDatabaseErrorError extends Error {
1860
1944
  constructor(body) {
1861
1945
  super(
1862
- `SHUTDOWN_FAILED: ${body.message}`
1946
+ `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
1863
1947
  );
1864
1948
  this.body = body;
1865
- this.name = "ShutdownFailedError";
1949
+ this.name = "CloudstateDatabaseErrorError";
1866
1950
  }
1867
- static code = "SHUTDOWN_FAILED";
1951
+ static code = "CLOUDSTATE_DATABASE_ERROR";
1868
1952
  static statusCode = 500;
1869
- static description = `Failed to shutdown dev server: {message}`;
1953
+ static description = `Database operation failed: {message}`;
1870
1954
  }
1871
- class CommitFailedError extends Error {
1955
+ class CloudstateAccessDeniedError extends Error {
1872
1956
  constructor(body) {
1873
1957
  super(
1874
- `COMMIT_FAILED: ${body.message}`
1958
+ `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
1875
1959
  );
1876
1960
  this.body = body;
1877
- this.name = "CommitFailedError";
1961
+ this.name = "CloudstateAccessDeniedError";
1878
1962
  }
1879
- static code = "COMMIT_FAILED";
1880
- static statusCode = 500;
1881
- static description = `Failed to commit changes: {message}`;
1963
+ static code = "CLOUDSTATE_ACCESS_DENIED";
1964
+ static statusCode = 403;
1965
+ static description = `Access denied to project: {project_id}`;
1882
1966
  }
1883
- class WriteFileFailedError extends Error {
1967
+ class RestoreFailedError extends Error {
1884
1968
  constructor(body) {
1885
1969
  super(
1886
- `WRITE_FILE_FAILED: ${body.message}`
1970
+ `RESTORE_FAILED: ${body.message}`
1887
1971
  );
1888
1972
  this.body = body;
1889
- this.name = "WriteFileFailedError";
1973
+ this.name = "RestoreFailedError";
1890
1974
  }
1891
- static code = "WRITE_FILE_FAILED";
1975
+ static code = "RESTORE_FAILED";
1892
1976
  static statusCode = 500;
1893
- static description = `Failed to write file: {message}`;
1977
+ static description = `Failed to restore from backup: {message}`;
1894
1978
  }
1895
- class ReadFileFailedError extends Error {
1979
+ class CreateBackupFailedError extends Error {
1896
1980
  constructor(body) {
1897
1981
  super(
1898
- `READ_FILE_FAILED: ${body.message}`
1982
+ `CREATE_BACKUP_FAILED: ${body.message}`
1899
1983
  );
1900
1984
  this.body = body;
1901
- this.name = "ReadFileFailedError";
1985
+ this.name = "CreateBackupFailedError";
1902
1986
  }
1903
- static code = "READ_FILE_FAILED";
1987
+ static code = "CREATE_BACKUP_FAILED";
1904
1988
  static statusCode = 500;
1905
- static description = `Failed to read file: {message}`;
1989
+ static description = `Failed to create backup: {message}`;
1906
1990
  }
1907
- class ExecutionFailedError extends Error {
1991
+ class BackupFailedError extends Error {
1908
1992
  constructor(body) {
1909
1993
  super(
1910
- `EXECUTION_FAILED: ${body.message}`
1994
+ `BACKUP_FAILED: ${body.message}`
1911
1995
  );
1912
1996
  this.body = body;
1913
- this.name = "ExecutionFailedError";
1997
+ this.name = "BackupFailedError";
1914
1998
  }
1915
- static code = "EXECUTION_FAILED";
1999
+ static code = "BACKUP_FAILED";
1916
2000
  static statusCode = 500;
1917
- static description = `Failed to execute command: {message}`;
2001
+ static description = `Backup failed: {message}`;
1918
2002
  }
1919
- class RequestFailedError extends Error {
2003
+ class DeploymentFailedError extends Error {
1920
2004
  constructor(body) {
1921
2005
  super(
1922
- `REQUEST_FAILED: ${body.message}`
2006
+ `DEPLOYMENT_FAILED: ${body.message}`
1923
2007
  );
1924
2008
  this.body = body;
1925
- this.name = "RequestFailedError";
2009
+ this.name = "DeploymentFailedError";
1926
2010
  }
1927
- static code = "REQUEST_FAILED";
2011
+ static code = "DEPLOYMENT_FAILED";
1928
2012
  static statusCode = 500;
1929
- static description = `Failed to request dev server: {message}`;
2013
+ static description = `Deployment failed: {message}`;
1930
2014
  }
1931
- class DevServerFileNotFoundError extends Error {
2015
+ class InvalidDeploymentRequestError extends Error {
1932
2016
  constructor(body) {
1933
2017
  super(
1934
- `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
2018
+ `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
1935
2019
  );
1936
2020
  this.body = body;
1937
- this.name = "DevServerFileNotFoundError";
2021
+ this.name = "InvalidDeploymentRequestError";
1938
2022
  }
1939
- static code = "DEV_SERVER_FILE_NOT_FOUND";
1940
- static statusCode = 404;
1941
- static description = `Dev server file not found: {path}`;
2023
+ static code = "INVALID_DEPLOYMENT_REQUEST";
2024
+ static statusCode = 400;
2025
+ static description = `Invalid deployment request: {message}`;
1942
2026
  }
1943
- class DevServerInvalidRequestError extends Error {
2027
+ class ProjectNotFoundError extends Error {
1944
2028
  constructor(body) {
1945
2029
  super(
1946
- `DEV_SERVER_INVALID_REQUEST: ${body.message}`
2030
+ `PROJECT_NOT_FOUND: ${body.message}`
1947
2031
  );
1948
2032
  this.body = body;
1949
- this.name = "DevServerInvalidRequestError";
2033
+ this.name = "ProjectNotFoundError";
1950
2034
  }
1951
- static code = "DEV_SERVER_INVALID_REQUEST";
1952
- static statusCode = 400;
1953
- static description = `Invalid dev server request: {message}`;
2035
+ static code = "PROJECT_NOT_FOUND";
2036
+ static statusCode = 404;
2037
+ static description = `Project not found: {project_id}`;
1954
2038
  }
1955
- class DevServerNotFoundError extends Error {
2039
+ class UnauthorizedErrorError extends Error {
1956
2040
  constructor(body) {
1957
2041
  super(
1958
- `DEV_SERVER_NOT_FOUND: ${body.message}`
2042
+ `UNAUTHORIZED_ERROR: ${body.message}`
1959
2043
  );
1960
2044
  this.body = body;
1961
- this.name = "DevServerNotFoundError";
2045
+ this.name = "UnauthorizedErrorError";
1962
2046
  }
1963
- static code = "DEV_SERVER_NOT_FOUND";
1964
- static statusCode = 404;
1965
- static description = `Dev server not found: {server_id}`;
2047
+ static code = "UNAUTHORIZED_ERROR";
2048
+ static statusCode = 401;
2049
+ static description = `Unauthorized request to {route}`;
1966
2050
  }
1967
2051
  class BuildFailedError extends Error {
1968
2052
  constructor(body) {
@@ -2108,18 +2192,78 @@ class DeploymentNotFoundError extends Error {
2108
2192
  static statusCode = 404;
2109
2193
  static description = `Deployment not found`;
2110
2194
  }
2111
- class DatabaseErrorError extends Error {
2195
+ class ObservabilityDatabaseErrorError extends Error {
2112
2196
  constructor(body) {
2113
2197
  super(
2114
- `DATABASE_ERROR: ${body.message}`
2198
+ `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
2115
2199
  );
2116
2200
  this.body = body;
2117
- this.name = "DatabaseErrorError";
2201
+ this.name = "ObservabilityDatabaseErrorError";
2118
2202
  }
2119
- static code = "DATABASE_ERROR";
2203
+ static code = "OBSERVABILITY_DATABASE_ERROR";
2120
2204
  static statusCode = 500;
2121
2205
  static description = `Database operation failed: {message}`;
2122
2206
  }
2207
+ class ObservabilityAccessDeniedError extends Error {
2208
+ constructor(body) {
2209
+ super(
2210
+ `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
2211
+ );
2212
+ this.body = body;
2213
+ this.name = "ObservabilityAccessDeniedError";
2214
+ }
2215
+ static code = "OBSERVABILITY_ACCESS_DENIED";
2216
+ static statusCode = 403;
2217
+ static description = `Access denied to logs for deployment: {deployment_id}`;
2218
+ }
2219
+ class ParseLogsFailedError extends Error {
2220
+ constructor(body) {
2221
+ super(
2222
+ `PARSE_LOGS_FAILED: ${body.message}`
2223
+ );
2224
+ this.body = body;
2225
+ this.name = "ParseLogsFailedError";
2226
+ }
2227
+ static code = "PARSE_LOGS_FAILED";
2228
+ static statusCode = 500;
2229
+ static description = `Failed to parse logs: {message}`;
2230
+ }
2231
+ class RetrieveLogsFailedError extends Error {
2232
+ constructor(body) {
2233
+ super(
2234
+ `RETRIEVE_LOGS_FAILED: ${body.message}`
2235
+ );
2236
+ this.body = body;
2237
+ this.name = "RetrieveLogsFailedError";
2238
+ }
2239
+ static code = "RETRIEVE_LOGS_FAILED";
2240
+ static statusCode = 500;
2241
+ static description = `Failed to retrieve logs: {message}`;
2242
+ }
2243
+ class InvalidQueryError extends Error {
2244
+ constructor(body) {
2245
+ super(
2246
+ `INVALID_QUERY: ${body.message}`
2247
+ );
2248
+ this.body = body;
2249
+ this.name = "InvalidQueryError";
2250
+ }
2251
+ static code = "INVALID_QUERY";
2252
+ static statusCode = 400;
2253
+ static description = `Invalid log query: {message}`;
2254
+ }
2255
+ class LogsNotFoundError extends Error {
2256
+ constructor(body) {
2257
+ super(
2258
+ `LOGS_NOT_FOUND: ${body.message}`
2259
+ );
2260
+ this.body = body;
2261
+ this.name = "LogsNotFoundError";
2262
+ }
2263
+ static code = "LOGS_NOT_FOUND";
2264
+ static statusCode = 404;
2265
+ static description = `Logs not found for deployment: {deployment_id}`;
2266
+ }
2123
2267
  class TriggerErrorError extends Error {
2124
2268
  constructor(body) {
2125
2269
  super(
@@ -2348,215 +2492,220 @@ class RepositoryNotFoundError extends Error {
2348
2492
  static statusCode = 404;
2349
2493
  static description = `Repository not found: {repo_id}`;
2350
2494
  }
2351
- class DomainAlreadyExistsError extends Error {
2495
+ class FailedToProvisionCertificateError extends Error {
2352
2496
  constructor(body) {
2353
2497
  super(
2354
- `DOMAIN_ALREADY_EXISTS: ${body.message}`
2498
+ `FAILED_TO_PROVISION_CERTIFICATE: ${body.message}`
2355
2499
  );
2356
2500
  this.body = body;
2357
- this.name = "DomainAlreadyExistsError";
2501
+ this.name = "FailedToProvisionCertificateError";
2358
2502
  }
2359
- static code = "DOMAIN_ALREADY_EXISTS";
2360
- static statusCode = 400;
2361
- static description = `Domain already exists: {domain}`;
2503
+ static code = "FAILED_TO_PROVISION_CERTIFICATE";
2504
+ static statusCode = 422;
2505
+ static description = `Failed to provision certificate: {message}`;
2362
2506
  }
2363
- class FailedToInsertOwnershipError extends Error {
2507
+ class FailedToInsertDomainMappingError extends Error {
2364
2508
  constructor(body) {
2365
2509
  super(
2366
- `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
2510
+ `FAILED_TO_INSERT_DOMAIN_MAPPING: ${body.message}`
2367
2511
  );
2368
2512
  this.body = body;
2369
- this.name = "FailedToInsertOwnershipError";
2513
+ this.name = "FailedToInsertDomainMappingError";
2370
2514
  }
2371
- static code = "FAILED_TO_INSERT_OWNERSHIP";
2515
+ static code = "FAILED_TO_INSERT_DOMAIN_MAPPING";
2372
2516
  static statusCode = 500;
2373
- static description = `Failed to insert domain ownership: {message}`;
2517
+ static description = `Failed to insert domain mapping: {message}`;
2374
2518
  }
2375
- class FailedRemoveDomainMappingError extends Error {
2519
+ class PermissionDeniedError extends Error {
2376
2520
  constructor(body) {
2377
2521
  super(
2378
- `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
2522
+ `PERMISSION_DENIED: ${body.message}`
2379
2523
  );
2380
2524
  this.body = body;
2381
- this.name = "FailedRemoveDomainMappingError";
2525
+ this.name = "PermissionDeniedError";
2382
2526
  }
2383
- static code = "FAILED_REMOVE_DOMAIN_MAPPING";
2384
- static statusCode = 500;
2385
- static description = `Failed to remove domain mapping: {message}`;
2527
+ static code = "PERMISSION_DENIED";
2528
+ static statusCode = 401;
2529
+ static description = `Permission denied: {message}`;
2386
2530
  }
2387
- class FailedPermissionsCheckError extends Error {
2531
+ class FailedToCheckPermissionsError extends Error {
2388
2532
  constructor(body) {
2389
2533
  super(
2390
- `FAILED_PERMISSIONS_CHECK: ${body.message}`
2534
+ `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
2391
2535
  );
2392
2536
  this.body = body;
2393
- this.name = "FailedPermissionsCheckError";
2537
+ this.name = "FailedToCheckPermissionsError";
2394
2538
  }
2395
- static code = "FAILED_PERMISSIONS_CHECK";
2396
- static statusCode = 401;
2397
- static description = `You do not have permission to delete the domain mapping for: {domain}`;
2539
+ static code = "FAILED_TO_CHECK_PERMISSIONS";
2540
+ static statusCode = 502;
2541
+ static description = `Failed to check permissions: {message}`;
2398
2542
  }
2399
- class FailedToCheckDomainMappingPermissionsError extends Error {
2543
+ class FailedToListDomainsError extends Error {
2400
2544
  constructor(body) {
2401
2545
  super(
2402
- `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
2546
+ `FAILED_TO_LIST_DOMAINS: ${body.message}`
2547
+ );
2548
+ this.body = body;
2549
+ this.name = "FailedToListDomainsError";
2550
+ }
2551
+ static code = "FAILED_TO_LIST_DOMAINS";
2552
+ static statusCode = 500;
2553
+ static description = `Failed to list domains: {message}`;
2554
+ }
2555
+ class FailedToListVerificationsError extends Error {
2556
+ constructor(body) {
2557
+ super(
2558
+ `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
2403
2559
  );
2404
2560
  this.body = body;
2405
- this.name = "FailedToCheckDomainMappingPermissionsError";
2561
+ this.name = "FailedToListVerificationsError";
2406
2562
  }
2407
- static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
2408
- static statusCode = 502;
2409
- static description = `Failed to check permissions: {message}`;
2563
+ static code = "FAILED_TO_LIST_VERIFICATIONS";
2564
+ static statusCode = 500;
2565
+ static description = `Failed to list verifications: {message}`;
2410
2566
  }
2411
- class CloudstateInternalErrorError extends Error {
2567
+ class FailedToVerifyDomainError extends Error {
2412
2568
  constructor(body) {
2413
2569
  super(
2414
- `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2570
+ `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
2415
2571
  );
2416
2572
  this.body = body;
2417
- this.name = "CloudstateInternalErrorError";
2573
+ this.name = "FailedToVerifyDomainError";
2418
2574
  }
2419
- static code = "CLOUDSTATE_INTERNAL_ERROR";
2575
+ static code = "FAILED_TO_VERIFY_DOMAIN";
2420
2576
  static statusCode = 500;
2421
- static description = `Internal error: {message}`;
2577
+ static description = `Failed to verify domain: {message}`;
2422
2578
  }
2423
- class CloudstateDatabaseErrorError extends Error {
2579
+ class VerificationFailedError extends Error {
2424
2580
  constructor(body) {
2425
2581
  super(
2426
- `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2582
+ `VERIFICATION_FAILED: ${body.message}`
2427
2583
  );
2428
2584
  this.body = body;
2429
- this.name = "CloudstateDatabaseErrorError";
2585
+ this.name = "VerificationFailedError";
2430
2586
  }
2431
- static code = "CLOUDSTATE_DATABASE_ERROR";
2432
- static statusCode = 500;
2433
- static description = `Database operation failed: {message}`;
2587
+ static code = "VERIFICATION_FAILED";
2588
+ static statusCode = 400;
2589
+ static description = `Domain verification failed: {message}`;
2434
2590
  }
2435
- class CloudstateAccessDeniedError extends Error {
2591
+ class FailedToDeleteVerificationError extends Error {
2436
2592
  constructor(body) {
2437
2593
  super(
2438
- `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2594
+ `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
2439
2595
  );
2440
2596
  this.body = body;
2441
- this.name = "CloudstateAccessDeniedError";
2597
+ this.name = "FailedToDeleteVerificationError";
2442
2598
  }
2443
- static code = "CLOUDSTATE_ACCESS_DENIED";
2444
- static statusCode = 403;
2445
- static description = `Access denied to project: {project_id}`;
2599
+ static code = "FAILED_TO_DELETE_VERIFICATION";
2600
+ static statusCode = 400;
2601
+ static description = `Failed to delete verification: {message}`;
2446
2602
  }
2447
- class RestoreFailedError extends Error {
2603
+ class VerificationNotFoundError extends Error {
2448
2604
  constructor(body) {
2449
2605
  super(
2450
- `RESTORE_FAILED: ${body.message}`
2606
+ `VERIFICATION_NOT_FOUND: ${body.message}`
2451
2607
  );
2452
2608
  this.body = body;
2453
- this.name = "RestoreFailedError";
2609
+ this.name = "VerificationNotFoundError";
2454
2610
  }
2455
- static code = "RESTORE_FAILED";
2456
- static statusCode = 500;
2457
- static description = `Failed to restore from backup: {message}`;
2611
+ static code = "VERIFICATION_NOT_FOUND";
2612
+ static statusCode = 404;
2613
+ static description = `Verification request not found for domain: {domain}`;
2458
2614
  }
2459
- class CreateBackupFailedError extends Error {
2615
+ class FailedToCreateVerificationCodeError extends Error {
2460
2616
  constructor(body) {
2461
2617
  super(
2462
- `CREATE_BACKUP_FAILED: ${body.message}`
2618
+ `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
2463
2619
  );
2464
2620
  this.body = body;
2465
- this.name = "CreateBackupFailedError";
2621
+ this.name = "FailedToCreateVerificationCodeError";
2466
2622
  }
2467
- static code = "CREATE_BACKUP_FAILED";
2468
- static statusCode = 500;
2469
- static description = `Failed to create backup: {message}`;
2623
+ static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
2624
+ static statusCode = 400;
2625
+ static description = `Failed to create verification code: {message}`;
2470
2626
  }
2471
- class BackupFailedError extends Error {
2627
+ class InvalidDomainError extends Error {
2472
2628
  constructor(body) {
2473
2629
  super(
2474
- `BACKUP_FAILED: ${body.message}`
2630
+ `INVALID_DOMAIN: ${body.message}`
2475
2631
  );
2476
2632
  this.body = body;
2477
- this.name = "BackupFailedError";
2633
+ this.name = "InvalidDomainError";
2478
2634
  }
2479
- static code = "BACKUP_FAILED";
2480
- static statusCode = 500;
2481
- static description = `Backup failed: {message}`;
2635
+ static code = "INVALID_DOMAIN";
2636
+ static statusCode = 400;
2637
+ static description = `Invalid domain: {domain}`;
2482
2638
  }
2483
- class DeploymentFailedError extends Error {
2639
+ class DomainAlreadyExistsError extends Error {
2484
2640
  constructor(body) {
2485
2641
  super(
2486
- `DEPLOYMENT_FAILED: ${body.message}`
2642
+ `DOMAIN_ALREADY_EXISTS: ${body.message}`
2487
2643
  );
2488
2644
  this.body = body;
2489
- this.name = "DeploymentFailedError";
2645
+ this.name = "DomainAlreadyExistsError";
2490
2646
  }
2491
- static code = "DEPLOYMENT_FAILED";
2492
- static statusCode = 500;
2493
- static description = `Deployment failed: {message}`;
2647
+ static code = "DOMAIN_ALREADY_EXISTS";
2648
+ static statusCode = 400;
2649
+ static description = `Domain already exists: {domain}`;
2494
2650
  }
2495
- class InvalidDeploymentRequestError extends Error {
2651
+ class FailedToInsertOwnershipError extends Error {
2496
2652
  constructor(body) {
2497
2653
  super(
2498
- `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2654
+ `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
2499
2655
  );
2500
2656
  this.body = body;
2501
- this.name = "InvalidDeploymentRequestError";
2657
+ this.name = "FailedToInsertOwnershipError";
2502
2658
  }
2503
- static code = "INVALID_DEPLOYMENT_REQUEST";
2504
- static statusCode = 400;
2505
- static description = `Invalid deployment request: {message}`;
2659
+ static code = "FAILED_TO_INSERT_OWNERSHIP";
2660
+ static statusCode = 500;
2661
+ static description = `Failed to insert domain ownership: {message}`;
2506
2662
  }
2507
- class ProjectNotFoundError extends Error {
2663
+ class FailedRemoveDomainMappingError extends Error {
2508
2664
  constructor(body) {
2509
2665
  super(
2510
- `PROJECT_NOT_FOUND: ${body.message}`
2666
+ `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
2511
2667
  );
2512
2668
  this.body = body;
2513
- this.name = "ProjectNotFoundError";
2669
+ this.name = "FailedRemoveDomainMappingError";
2514
2670
  }
2515
- static code = "PROJECT_NOT_FOUND";
2516
- static statusCode = 404;
2517
- static description = `Project not found: {project_id}`;
2671
+ static code = "FAILED_REMOVE_DOMAIN_MAPPING";
2672
+ static statusCode = 500;
2673
+ static description = `Failed to remove domain mapping: {message}`;
2518
2674
  }
2519
- class UnauthorizedErrorError extends Error {
2675
+ class FailedPermissionsCheckError extends Error {
2520
2676
  constructor(body) {
2521
2677
  super(
2522
- `UNAUTHORIZED_ERROR: ${body.message}`
2678
+ `FAILED_PERMISSIONS_CHECK: ${body.message}`
2523
2679
  );
2524
2680
  this.body = body;
2525
- this.name = "UnauthorizedErrorError";
2681
+ this.name = "FailedPermissionsCheckError";
2526
2682
  }
2527
- static code = "UNAUTHORIZED_ERROR";
2683
+ static code = "FAILED_PERMISSIONS_CHECK";
2528
2684
  static statusCode = 401;
2529
- static description = `Unauthorized request to {route}`;
2685
+ static description = `You do not have permission to delete the domain mapping for: {domain}`;
2530
2686
  }
2531
- class AnyhowError extends Error {
2687
+ class FailedToCheckDomainMappingPermissionsError extends Error {
2532
2688
  constructor(body) {
2533
2689
  super(
2534
- `ANYHOW: ${body.message}`
2690
+ `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
2535
2691
  );
2536
2692
  this.body = body;
2537
- this.name = "AnyhowError";
2693
+ this.name = "FailedToCheckDomainMappingPermissionsError";
2538
2694
  }
2539
- static code = "ANYHOW";
2540
- static statusCode = 500;
2541
- static description = `null`;
2695
+ static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
2696
+ static statusCode = 502;
2697
+ static description = `Failed to check permissions: {message}`;
2542
2698
  }
2543
2699
  const FREESTYLE_ERROR_CODE_MAP = {
2700
+ "GIT_ERROR": GitErrorError,
2544
2701
  "INTERNAL_ERROR": InternalErrorError,
2545
2702
  "DOCKER_IMPORT_BAD_REQUEST": DockerImportBadRequestError,
2546
- "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
2547
- "VM_NOT_RUNNING": VmNotRunningError,
2548
- "VM_NOT_FOUND": VmNotFoundError,
2549
- "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
2550
- "BAD_REQUEST": BadRequestError,
2551
- "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
2552
- "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
2553
- "ALREADY_HAS_BASE": AlreadyHasBaseError,
2554
- "NOT_FOUND": NotFoundError,
2703
+ "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
2704
+ "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
2705
+ "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
2555
2706
  "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
2556
2707
  "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
2557
2708
  "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
2558
- "FILE_NOT_FOUND": FileNotFoundError,
2559
- "FILES_BAD_REQUEST": FilesBadRequestError,
2560
2709
  "VM_DELETED": VmDeletedError,
2561
2710
  "REQWEST": ReqwestError,
2562
2711
  "FIRECRACKER_PID_NOT_FOUND": FirecrackerPidNotFoundError,
@@ -2566,9 +2715,18 @@ const FREESTYLE_ERROR_CODE_MAP = {
2566
2715
  "STD_IO": StdIoError,
2567
2716
  "VM_CREATE_TMUX_SESSION": VmCreateTmuxSessionError,
2568
2717
  "VM_SUBNET_NOT_FOUND": VmSubnetNotFoundError,
2569
- "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
2570
- "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
2571
- "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
2718
+ "FILE_NOT_FOUND": FileNotFoundError,
2719
+ "FILES_BAD_REQUEST": FilesBadRequestError,
2720
+ "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
2721
+ "VM_NOT_RUNNING": VmNotRunningError,
2722
+ "VM_NOT_FOUND": VmNotFoundError,
2723
+ "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
2724
+ "BAD_REQUEST": BadRequestError,
2725
+ "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
2726
+ "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
2727
+ "ALREADY_HAS_BASE": AlreadyHasBaseError,
2728
+ "NOT_FOUND": NotFoundError,
2729
+ "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
2572
2730
  "USER_NOT_FOUND": UserNotFoundError,
2573
2731
  "USER_ALREADY_EXISTS": UserAlreadyExistsError,
2574
2732
  "VALIDATION_ERROR": ValidationErrorError,
@@ -2585,7 +2743,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
2585
2743
  "GROUP_NAME_INVALID_CHARS": GroupNameInvalidCharsError,
2586
2744
  "GROUP_NAME_TOO_LONG": GroupNameTooLongError,
2587
2745
  "GROUP_NAME_EMPTY": GroupNameEmptyError,
2588
- "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
2589
2746
  "WANTED_BY_EMPTY": WantedByEmptyError,
2590
2747
  "WORKDIR_EMPTY": WorkdirEmptyError,
2591
2748
  "GROUP_EMPTY": GroupEmptyError,
@@ -2602,42 +2759,69 @@ const FREESTYLE_ERROR_CODE_MAP = {
2602
2759
  "SERVICE_NAME_EMPTY": ServiceNameEmptyError,
2603
2760
  "SERVICE_ALREADY_EXISTS": ServiceAlreadyExistsError,
2604
2761
  "SERVICE_NOT_FOUND": ServiceNotFoundError,
2605
- "WAIT_TIMEOUT": WaitTimeoutError,
2606
- "PRE_VERIFY_CHALLENGE_MISMATCH": PreVerifyChallengeMismatchError,
2607
- "PRE_VERIFY_FAILED_PARSE": PreVerifyFailedParseError,
2608
- "PRE_VERIFY_FAILED_FETCH": PreVerifyFailedFetchError,
2609
- "PRE_VERIFY_ROUTE_NOT_FOUND": PreVerifyRouteNotFoundError,
2610
- "AUTHORIZATION_NOT_FOUND": AuthorizationNotFoundError,
2611
- "ORDER_NOT_FOUND": OrderNotFoundError,
2762
+ "INVALID_REQUEST": InvalidRequestError,
2763
+ "REPO_NOT_FOUND": RepoNotFoundError,
2764
+ "RUNTIME_ERROR": RuntimeErrorError,
2765
+ "SYNTAX_ERROR": SyntaxErrorError,
2612
2766
  "INTERNAL": InternalError,
2613
2767
  "SIGNING": SigningError,
2614
2768
  "INVALID_SIGNATURE": InvalidSignatureError,
2615
2769
  "INVALID_PARAMETERS": InvalidParametersError,
2616
2770
  "MAX_USES_EXCEEDED": MaxUsesExceededError,
2617
2771
  "EXPIRED": ExpiredError,
2618
- "TAG_NOT_FOUND": TagNotFoundError,
2772
+ "FORBIDDEN": ForbiddenError,
2773
+ "UNAUTHORIZED": UnauthorizedError,
2774
+ "INVALID_SERVICE": InvalidServiceError,
2775
+ "EXPECTED_SERVICE": ExpectedServiceError,
2776
+ "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
2777
+ "CONFLICT": ConflictError,
2619
2778
  "BRANCH_NOT_FOUND": BranchNotFoundError,
2620
- "REPO_NOT_FOUND": RepoNotFoundError,
2779
+ "SOURCE_IMPORT_CONFLICT": SourceImportConflictError,
2780
+ "SOURCE_UNAUTHORIZED": SourceUnauthorizedError,
2781
+ "SOURCE_NOT_FOUND": SourceNotFoundError,
2782
+ "IMPORT_SUBDIR_NOT_FOUND": ImportSubdirNotFoundError,
2783
+ "REPO_ALREADY_EXISTS": RepoAlreadyExistsError,
2784
+ "PATH_NOT_FOUND": PathNotFoundError,
2785
+ "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
2786
+ "TAG_NOT_FOUND": TagNotFoundError,
2787
+ "SEND_ERROR": SendErrorError,
2788
+ "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
2621
2789
  "INVALID_OBJECT_ID": InvalidObjectIdError,
2622
2790
  "COMMIT_NOT_FOUND": CommitNotFoundError,
2623
- "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
2624
- "PATH_NOT_FOUND": PathNotFoundError,
2625
- "INVALID_REQUEST": InvalidRequestError,
2791
+ "TREE_NOT_FOUND": TreeNotFoundError,
2626
2792
  "INVALID_REVISION": InvalidRevisionError,
2627
- "FORBIDDEN": ForbiddenError,
2628
- "UNAUTHORIZED": UnauthorizedError,
2629
- "CONFLICT": ConflictError,
2630
- "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
2793
+ "INVALID_RANGE": InvalidRangeError,
2794
+ "OFFSET_WITH_SELECTOR": OffsetWithSelectorError,
2795
+ "COMMIT_NOT_IN_BRANCH": CommitNotInBranchError,
2631
2796
  "BLOB_NOT_FOUND": BlobNotFoundError,
2632
- "TREE_NOT_FOUND": TreeNotFoundError,
2797
+ "AMBIGUOUS": AmbiguousError,
2798
+ "INVALID": InvalidError,
2799
+ "PACKFILE": PackfileError,
2800
+ "DATABASE_ERROR": DatabaseErrorError,
2801
+ "EMPTY_TAG": EmptyTagError,
2633
2802
  "RESIZE_FAILED": ResizeFailedError,
2634
2803
  "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
2635
- "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
2636
- "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
2637
- "PARSE_LOGS_FAILED": ParseLogsFailedError,
2638
- "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
2639
- "INVALID_QUERY": InvalidQueryError,
2640
- "LOGS_NOT_FOUND": LogsNotFoundError,
2804
+ "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
2805
+ "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
2806
+ "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
2807
+ "ERROR_CREATING_RECORD": ErrorCreatingRecordError,
2808
+ "DOMAIN_OWNERSHIP_ERROR": DomainOwnershipErrorError,
2809
+ "BROWSER_OPERATION_FAILED": BrowserOperationFailedError,
2810
+ "WATCH_FILES_FAILED": WatchFilesFailedError,
2811
+ "LOGS_FAILED": LogsFailedError,
2812
+ "STATUS_FAILED": StatusFailedError,
2813
+ "RESTART_FAILED": RestartFailedError,
2814
+ "SHUTDOWN_FAILED": ShutdownFailedError,
2815
+ "COMMIT_FAILED": CommitFailedError,
2816
+ "WRITE_FILE_FAILED": WriteFileFailedError,
2817
+ "READ_FILE_FAILED": ReadFileFailedError,
2818
+ "EXECUTION_FAILED": ExecutionFailedError,
2819
+ "REQUEST_FAILED": RequestFailedError,
2820
+ "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
2821
+ "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
2822
+ "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
2823
+ "ANYHOW": AnyhowError,
2824
+ "BRANCH_NAME_EMPTY": BranchNameEmptyError,
2641
2825
  "PERMISSION_ALREADY_EXISTS": PermissionAlreadyExistsError,
2642
2826
  "LIST_TOKENS_FAILED": ListTokensFailedError,
2643
2827
  "REVOKE_TOKEN_FAILED": RevokeTokenFailedError,
@@ -2673,37 +2857,16 @@ const FREESTYLE_ERROR_CODE_MAP = {
2673
2857
  "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
2674
2858
  "LOGGING_FAILED": LoggingFailedError,
2675
2859
  "RUN_NOT_FOUND": RunNotFoundError,
2676
- "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
2677
- "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
2678
- "PERMISSION_DENIED": PermissionDeniedError,
2679
- "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
2680
- "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
2681
- "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
2682
- "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
2683
- "VERIFICATION_FAILED": VerificationFailedError,
2684
- "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
2685
- "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
2686
- "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
2687
- "INVALID_DOMAIN": InvalidDomainError,
2688
- "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
2689
- "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
2690
- "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
2691
- "ERROR_CREATING_RECORD": ErrorCreatingRecordError,
2692
- "DOMAIN_OWNERSHIP_ERROR": DomainOwnershipErrorError,
2693
- "BROWSER_OPERATION_FAILED": BrowserOperationFailedError,
2694
- "WATCH_FILES_FAILED": WatchFilesFailedError,
2695
- "LOGS_FAILED": LogsFailedError,
2696
- "STATUS_FAILED": StatusFailedError,
2697
- "RESTART_FAILED": RestartFailedError,
2698
- "SHUTDOWN_FAILED": ShutdownFailedError,
2699
- "COMMIT_FAILED": CommitFailedError,
2700
- "WRITE_FILE_FAILED": WriteFileFailedError,
2701
- "READ_FILE_FAILED": ReadFileFailedError,
2702
- "EXECUTION_FAILED": ExecutionFailedError,
2703
- "REQUEST_FAILED": RequestFailedError,
2704
- "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
2705
- "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
2706
- "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
2860
+ "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
2861
+ "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
2862
+ "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
2863
+ "RESTORE_FAILED": RestoreFailedError,
2864
+ "CREATE_BACKUP_FAILED": CreateBackupFailedError,
2865
+ "BACKUP_FAILED": BackupFailedError,
2866
+ "DEPLOYMENT_FAILED": DeploymentFailedError,
2867
+ "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
2868
+ "PROJECT_NOT_FOUND": ProjectNotFoundError,
2869
+ "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
2707
2870
  "BUILD_FAILED": BuildFailedError,
2708
2871
  "SERVER_DEPLOYMENT_FAILED": ServerDeploymentFailedError,
2709
2872
  "LOCKFILE_ERROR": LockfileErrorError,
@@ -2716,7 +2879,12 @@ const FREESTYLE_ERROR_CODE_MAP = {
2716
2879
  "INVALID_DOMAINS": InvalidDomainsError,
2717
2880
  "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
2718
2881
  "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
2719
- "DATABASE_ERROR": DatabaseErrorError,
2882
+ "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
2883
+ "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
2884
+ "PARSE_LOGS_FAILED": ParseLogsFailedError,
2885
+ "RETRIEVE_LOGS_FAILED": RetrieveLogsFailedError,
2886
+ "INVALID_QUERY": InvalidQueryError,
2887
+ "LOGS_NOT_FOUND": LogsNotFoundError,
2720
2888
  "TRIGGER_ERROR": TriggerErrorError,
2721
2889
  "TOKEN_ERROR": TokenErrorError,
2722
2890
  "PERMISSION_ERROR": PermissionErrorError,
@@ -2736,33 +2904,35 @@ const FREESTYLE_ERROR_CODE_MAP = {
2736
2904
  "SERIALIZATION_ERROR": SerializationErrorError,
2737
2905
  "GIT_INVALID_REQUEST": GitInvalidRequestError,
2738
2906
  "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
2907
+ "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
2908
+ "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
2909
+ "PERMISSION_DENIED": PermissionDeniedError,
2910
+ "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
2911
+ "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
2912
+ "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
2913
+ "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
2914
+ "VERIFICATION_FAILED": VerificationFailedError,
2915
+ "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
2916
+ "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
2917
+ "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
2918
+ "INVALID_DOMAIN": InvalidDomainError,
2739
2919
  "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
2740
2920
  "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
2741
2921
  "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
2742
2922
  "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
2743
- "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
2744
- "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
2745
- "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
2746
- "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
2747
- "RESTORE_FAILED": RestoreFailedError,
2748
- "CREATE_BACKUP_FAILED": CreateBackupFailedError,
2749
- "BACKUP_FAILED": BackupFailedError,
2750
- "DEPLOYMENT_FAILED": DeploymentFailedError,
2751
- "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
2752
- "PROJECT_NOT_FOUND": ProjectNotFoundError,
2753
- "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
2754
- "ANYHOW": AnyhowError
2923
+ "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError
2755
2924
  };
2756
2925
 
2757
2926
  var errors = /*#__PURE__*/Object.freeze({
2758
2927
  __proto__: null,
2759
2928
  AfterArrayContainsEmptyError: AfterArrayContainsEmptyError,
2760
2929
  AlreadyHasBaseError: AlreadyHasBaseError,
2930
+ AmbiguousError: AmbiguousError,
2761
2931
  AnyhowError: AnyhowError,
2762
- AuthorizationNotFoundError: AuthorizationNotFoundError,
2763
2932
  BackupFailedError: BackupFailedError,
2764
2933
  BadRequestError: BadRequestError,
2765
2934
  BlobNotFoundError: BlobNotFoundError,
2935
+ BranchNameEmptyError: BranchNameEmptyError,
2766
2936
  BranchNotFoundError: BranchNotFoundError,
2767
2937
  BrowserOperationFailedError: BrowserOperationFailedError,
2768
2938
  BuildFailedError: BuildFailedError,
@@ -2774,6 +2944,7 @@ var errors = /*#__PURE__*/Object.freeze({
2774
2944
  CloudstateInternalErrorError: CloudstateInternalErrorError,
2775
2945
  CommitFailedError: CommitFailedError,
2776
2946
  CommitNotFoundError: CommitNotFoundError,
2947
+ CommitNotInBranchError: CommitNotInBranchError,
2777
2948
  ConflictError: ConflictError,
2778
2949
  ConnectionFailedError: ConnectionFailedError,
2779
2950
  ContentNotFoundError: ContentNotFoundError,
@@ -2800,6 +2971,7 @@ var errors = /*#__PURE__*/Object.freeze({
2800
2971
  DownloadFailedError: DownloadFailedError,
2801
2972
  DuplicateGroupNameError: DuplicateGroupNameError,
2802
2973
  DuplicateUserNameError: DuplicateUserNameError,
2974
+ EmptyTagError: EmptyTagError,
2803
2975
  EntrypointNotFoundError: EntrypointNotFoundError,
2804
2976
  EnvKeyContainsEqualsError: EnvKeyContainsEqualsError,
2805
2977
  EnvKeyEmptyError: EnvKeyEmptyError,
@@ -2810,6 +2982,7 @@ var errors = /*#__PURE__*/Object.freeze({
2810
2982
  ExecuteInternalErrorError: ExecuteInternalErrorError,
2811
2983
  ExecutionErrorError: ExecutionErrorError,
2812
2984
  ExecutionFailedError: ExecutionFailedError,
2985
+ ExpectedServiceError: ExpectedServiceError,
2813
2986
  ExpiredError: ExpiredError,
2814
2987
  FREESTYLE_ERROR_CODE_MAP: FREESTYLE_ERROR_CODE_MAP,
2815
2988
  FailedPermissionsCheckError: FailedPermissionsCheckError,
@@ -2833,6 +3006,8 @@ var errors = /*#__PURE__*/Object.freeze({
2833
3006
  GetContentFailedError: GetContentFailedError,
2834
3007
  GetPermissionFailedError: GetPermissionFailedError,
2835
3008
  GetRepositoryInfoFailedError: GetRepositoryInfoFailedError,
3009
+ GitErrorError: GitErrorError,
3010
+ GitHubSyncConflictError: GitHubSyncConflictError,
2836
3011
  GitHubSyncFailedError: GitHubSyncFailedError,
2837
3012
  GitInvalidRequestError: GitInvalidRequestError,
2838
3013
  GitRepositoryAccessDeniedError: GitRepositoryAccessDeniedError,
@@ -2849,6 +3024,7 @@ var errors = /*#__PURE__*/Object.freeze({
2849
3024
  IdentityAccessDeniedError: IdentityAccessDeniedError,
2850
3025
  IdentityErrorError: IdentityErrorError,
2851
3026
  IdentityNotFoundError: IdentityNotFoundError,
3027
+ ImportSubdirNotFoundError: ImportSubdirNotFoundError,
2852
3028
  InternalError: InternalError,
2853
3029
  InternalErrorError: InternalErrorError,
2854
3030
  InternalForkVmNotFoundError: InternalForkVmNotFoundError,
@@ -2857,11 +3033,14 @@ var errors = /*#__PURE__*/Object.freeze({
2857
3033
  InvalidDeploymentRequestError: InvalidDeploymentRequestError,
2858
3034
  InvalidDomainError: InvalidDomainError,
2859
3035
  InvalidDomainsError: InvalidDomainsError,
3036
+ InvalidError: InvalidError,
2860
3037
  InvalidObjectIdError: InvalidObjectIdError,
2861
3038
  InvalidParametersError: InvalidParametersError,
2862
3039
  InvalidQueryError: InvalidQueryError,
3040
+ InvalidRangeError: InvalidRangeError,
2863
3041
  InvalidRequestError: InvalidRequestError,
2864
3042
  InvalidRevisionError: InvalidRevisionError,
3043
+ InvalidServiceError: InvalidServiceError,
2865
3044
  InvalidSignatureError: InvalidSignatureError,
2866
3045
  ListIdentitiesFailedError: ListIdentitiesFailedError,
2867
3046
  ListPermissionsFailedError: ListPermissionsFailedError,
@@ -2883,8 +3062,9 @@ var errors = /*#__PURE__*/Object.freeze({
2883
3062
  NotFoundError: NotFoundError,
2884
3063
  ObservabilityAccessDeniedError: ObservabilityAccessDeniedError,
2885
3064
  ObservabilityDatabaseErrorError: ObservabilityDatabaseErrorError,
3065
+ OffsetWithSelectorError: OffsetWithSelectorError,
2886
3066
  OnFailureArrayContainsEmptyError: OnFailureArrayContainsEmptyError,
2887
- OrderNotFoundError: OrderNotFoundError,
3067
+ PackfileError: PackfileError,
2888
3068
  ParseLogsFailedError: ParseLogsFailedError,
2889
3069
  ParseResponseErrorError: ParseResponseErrorError,
2890
3070
  PathNotFoundError: PathNotFoundError,
@@ -2892,14 +3072,11 @@ var errors = /*#__PURE__*/Object.freeze({
2892
3072
  PermissionDeniedError: PermissionDeniedError,
2893
3073
  PermissionErrorError: PermissionErrorError,
2894
3074
  PermissionNotFoundError: PermissionNotFoundError,
2895
- PreVerifyChallengeMismatchError: PreVerifyChallengeMismatchError,
2896
- PreVerifyFailedFetchError: PreVerifyFailedFetchError,
2897
- PreVerifyFailedParseError: PreVerifyFailedParseError,
2898
- PreVerifyRouteNotFoundError: PreVerifyRouteNotFoundError,
2899
3075
  ProjectNotFoundError: ProjectNotFoundError,
2900
3076
  ReadFileFailedError: ReadFileFailedError,
2901
3077
  RecordOwnershipErrorError: RecordOwnershipErrorError,
2902
3078
  ReferenceNotFoundError: ReferenceNotFoundError,
3079
+ RepoAlreadyExistsError: RepoAlreadyExistsError,
2903
3080
  RepoNotFoundError: RepoNotFoundError,
2904
3081
  RepositoryAccessDeniedError: RepositoryAccessDeniedError,
2905
3082
  RepositoryNotFoundError: RepositoryNotFoundError,
@@ -2913,6 +3090,8 @@ var errors = /*#__PURE__*/Object.freeze({
2913
3090
  RevokePermissionFailedError: RevokePermissionFailedError,
2914
3091
  RevokeTokenFailedError: RevokeTokenFailedError,
2915
3092
  RunNotFoundError: RunNotFoundError,
3093
+ RuntimeErrorError: RuntimeErrorError,
3094
+ SendErrorError: SendErrorError,
2916
3095
  SerializationErrorError: SerializationErrorError,
2917
3096
  ServerDeploymentFailedError: ServerDeploymentFailedError,
2918
3097
  ServiceAlreadyExistsError: ServiceAlreadyExistsError,
@@ -2924,8 +3103,12 @@ var errors = /*#__PURE__*/Object.freeze({
2924
3103
  ShutdownFailedError: ShutdownFailedError,
2925
3104
  SigningError: SigningError,
2926
3105
  SnapshotVmBadRequestError: SnapshotVmBadRequestError,
3106
+ SourceImportConflictError: SourceImportConflictError,
3107
+ SourceNotFoundError: SourceNotFoundError,
3108
+ SourceUnauthorizedError: SourceUnauthorizedError,
2927
3109
  StatusFailedError: StatusFailedError,
2928
3110
  StdIoError: StdIoError,
3111
+ SyntaxErrorError: SyntaxErrorError,
2929
3112
  TagNotFoundError: TagNotFoundError,
2930
3113
  TokenErrorError: TokenErrorError,
2931
3114
  TreeNotFoundError: TreeNotFoundError,
@@ -2961,7 +3144,6 @@ var errors = /*#__PURE__*/Object.freeze({
2961
3144
  VmStartTimeoutError: VmStartTimeoutError,
2962
3145
  VmSubnetNotFoundError: VmSubnetNotFoundError,
2963
3146
  VmTransactionIdMismatchError: VmTransactionIdMismatchError,
2964
- WaitTimeoutError: WaitTimeoutError,
2965
3147
  WantedByEmptyError: WantedByEmptyError,
2966
3148
  WatchFilesFailedError: WatchFilesFailedError,
2967
3149
  WebDeploymentBadRequestError: WebDeploymentBadRequestError,
@@ -3018,7 +3200,7 @@ class ApiClient {
3018
3200
  }
3019
3201
  return headers;
3020
3202
  }
3021
- async request(method, url, body) {
3203
+ async requestRaw(method, url, body) {
3022
3204
  const headers = this.getDefaultHeaders();
3023
3205
  if (body) {
3024
3206
  headers["Content-Type"] = "application/json";
@@ -3041,6 +3223,10 @@ class ApiClient {
3041
3223
  }
3042
3224
  throw errorFromJSON(errorData);
3043
3225
  }
3226
+ return response;
3227
+ }
3228
+ async request(method, url, body) {
3229
+ const response = await this.requestRaw(method, url, body);
3044
3230
  return response.json();
3045
3231
  }
3046
3232
  async fetch(url, options) {
@@ -3054,6 +3240,10 @@ class ApiClient {
3054
3240
  };
3055
3241
  return this.fetchFn(url, finalOptions);
3056
3242
  }
3243
+ getRaw(path, options) {
3244
+ const url = this.buildUrl(path, options?.params, options?.query);
3245
+ return this.requestRaw("GET", url);
3246
+ }
3057
3247
  get(path, ...args) {
3058
3248
  const options = args[0];
3059
3249
  const url = this.buildUrl(path, options?.params, options?.query);
@@ -3215,12 +3405,19 @@ class DomainsNamespace {
3215
3405
  }
3216
3406
  }
3217
3407
 
3218
- class GitRepo {
3408
+ class GitRepoBranchesNamespace {
3219
3409
  constructor(repoId, apiClient) {
3220
- this.apiClient = apiClient;
3221
3410
  this.repoId = repoId;
3411
+ this.apiClient = apiClient;
3412
+ }
3413
+ /**
3414
+ * Get the default branch for this repository.
3415
+ */
3416
+ async getDefaultBranch() {
3417
+ return this.apiClient.get("/git/v1/repo/{repo_id}/default-branch", {
3418
+ params: { repo_id: this.repoId }
3419
+ });
3222
3420
  }
3223
- repoId;
3224
3421
  /**
3225
3422
  * Set the default branch for this repository.
3226
3423
  */
@@ -3232,30 +3429,29 @@ class GitRepo {
3232
3429
  body: { defaultBranch }
3233
3430
  });
3234
3431
  }
3235
- /**
3236
- * Get the default branch for this repository.
3237
- */
3238
- async getDefaultBranch() {
3239
- return this.apiClient.get("/git/v1/repo/{repo_id}/default-branch", {
3240
- params: { repo_id: this.repoId }
3432
+ async list() {
3433
+ return this.apiClient.get("/git/v1/repo/{repo}/git/refs/heads/", {
3434
+ params: { repo: this.repoId }
3241
3435
  });
3242
3436
  }
3243
- /**
3244
- * Get the contents of this repository at the given path.
3245
- */
3246
- async getContents({
3247
- path = "",
3248
- ref
3249
- } = {}) {
3250
- return this.apiClient.get("/git/v1/repo/{repo}/contents/{path}", {
3251
- params: { repo: this.repoId, path },
3252
- query: { ref }
3437
+ async get({
3438
+ branchName
3439
+ }) {
3440
+ return this.apiClient.get("/git/v1/repo/{repo}/git/refs/heads/{branch}", {
3441
+ params: { repo: this.repoId, branch: branchName }
3253
3442
  });
3254
3443
  }
3444
+ }
3445
+ class GitRepoGitHubSyncNamespace {
3446
+ constructor(repoId, apiClient) {
3447
+ this.repoId = repoId;
3448
+ this.apiClient = apiClient;
3449
+ }
3255
3450
  /**
3256
3451
  * Get the GitHub sync configuration for this repository.
3452
+ * Returns null if GitHub sync is not configured.
3257
3453
  */
3258
- async getGitHubSyncConfig() {
3454
+ async get() {
3259
3455
  try {
3260
3456
  return await this.apiClient.get("/git/v1/repo/{repo_id}/github-sync", {
3261
3457
  params: { repo_id: this.repoId }
@@ -3267,10 +3463,33 @@ class GitRepo {
3267
3463
  throw error;
3268
3464
  }
3269
3465
  }
3466
+ /**
3467
+ * Enable GitHub sync for this repository.
3468
+ */
3469
+ async enable({ githubRepoName }) {
3470
+ await this.apiClient.post("/git/v1/repo/{repo_id}/github-sync", {
3471
+ params: { repo_id: this.repoId },
3472
+ body: { githubRepoName }
3473
+ });
3474
+ }
3475
+ /**
3476
+ * Disable GitHub sync for this repository.
3477
+ */
3478
+ async disable() {
3479
+ await this.apiClient.delete("/git/v1/repo/{repo_id}/github-sync", {
3480
+ params: { repo_id: this.repoId }
3481
+ });
3482
+ }
3483
+ }
3484
+ class GitRepoTriggersNamespace {
3485
+ constructor(repoId, apiClient) {
3486
+ this.repoId = repoId;
3487
+ this.apiClient = apiClient;
3488
+ }
3270
3489
  /**
3271
3490
  * List git triggers for this repository.
3272
3491
  */
3273
- async listTriggers() {
3492
+ async list() {
3274
3493
  return this.apiClient.get("/git/v1/repo/{repo}/trigger", {
3275
3494
  params: { repo: this.repoId }
3276
3495
  });
@@ -3278,7 +3497,7 @@ class GitRepo {
3278
3497
  /**
3279
3498
  * Create a git trigger for this repository.
3280
3499
  */
3281
- async createTrigger({
3500
+ async create({
3282
3501
  trigger,
3283
3502
  action
3284
3503
  }) {
@@ -3293,14 +3512,334 @@ class GitRepo {
3293
3512
  /**
3294
3513
  * Delete a git trigger.
3295
3514
  */
3296
- async deleteTrigger({
3515
+ async delete({
3297
3516
  triggerId
3298
3517
  }) {
3299
3518
  return this.apiClient.delete("/git/v1/repo/{repo}/trigger/{trigger}", {
3300
3519
  params: { repo: this.repoId, trigger: triggerId }
3301
3520
  });
3302
3521
  }
3303
- /**
3522
+ }
3523
+ class GitRepoOdbBlobsNamespace {
3524
+ constructor(repoId, apiClient) {
3525
+ this.repoId = repoId;
3526
+ this.apiClient = apiClient;
3527
+ }
3528
+ async get({
3529
+ sha
3530
+ }) {
3531
+ return this.apiClient.get("/git/v1/repo/{repo}/git/blobs/{hash}", {
3532
+ params: { repo: this.repoId, hash: sha }
3533
+ });
3534
+ }
3535
+ }
3536
+ class GitRepoOdbTreesNamespace {
3537
+ constructor(repoId, apiClient) {
3538
+ this.repoId = repoId;
3539
+ this.apiClient = apiClient;
3540
+ }
3541
+ async get({
3542
+ sha
3543
+ }) {
3544
+ return this.apiClient.get("/git/v1/repo/{repo}/git/trees/{hash}", {
3545
+ params: { repo: this.repoId, hash: sha }
3546
+ });
3547
+ }
3548
+ }
3549
+ class GitRepoContentsNamespace {
3550
+ constructor(repoId, apiClient) {
3551
+ this.repoId = repoId;
3552
+ this.apiClient = apiClient;
3553
+ }
3554
+ /**
3555
+ * Get the contents of a file or directory at a specific path and revision.
3556
+ *
3557
+ * @param path - The path to the file or directory (empty string for root)
3558
+ * @param rev - The revision (branch, tag, or commit SHA) to get contents from
3559
+ * @returns File contents (base64 encoded) or directory listing
3560
+ */
3561
+ async get({
3562
+ path = "",
3563
+ rev
3564
+ } = {}) {
3565
+ return this.apiClient.get("/git/v1/repo/{repo}/contents/{path}", {
3566
+ params: { repo: this.repoId, path },
3567
+ query: { rev }
3568
+ });
3569
+ }
3570
+ /**
3571
+ * Download repository contents as a tarball archive.
3572
+ *
3573
+ * @param rev - The revision (branch, tag, or commit SHA) to download
3574
+ * @returns The tarball as an ArrayBuffer
3575
+ *
3576
+ * @example
3577
+ * ```ts
3578
+ * const tarball = await repo.contents.downloadTarball({ rev: "main" });
3579
+ * await fs.writeFile("repo.tar", Buffer.from(tarball));
3580
+ * ```
3581
+ */
3582
+ async downloadTarball({
3583
+ rev
3584
+ } = {}) {
3585
+ const response = await this.apiClient.getRaw(
3586
+ "/git/v1/repo/{repo}/tarball",
3587
+ {
3588
+ params: { repo: this.repoId },
3589
+ query: { rev }
3590
+ }
3591
+ );
3592
+ return response.arrayBuffer();
3593
+ }
3594
+ /**
3595
+ * Download repository contents as a zip archive.
3596
+ *
3597
+ * @param rev - The revision (branch, tag, or commit SHA) to download
3598
+ * @returns The zip file as an ArrayBuffer
3599
+ *
3600
+ * @example
3601
+ * ```ts
3602
+ * const zip = await repo.contents.downloadZip({ rev: "main" });
3603
+ * await fs.writeFile("repo.zip", Buffer.from(zip));
3604
+ * ```
3605
+ */
3606
+ async downloadZip({
3607
+ rev
3608
+ } = {}) {
3609
+ const response = await this.apiClient.getRaw("/git/v1/repo/{repo}/zip", {
3610
+ params: { repo: this.repoId },
3611
+ query: { rev }
3612
+ });
3613
+ return response.arrayBuffer();
3614
+ }
3615
+ }
3616
+ class GitRepoCommitsNamespace {
3617
+ constructor(repoId, apiClient) {
3618
+ this.repoId = repoId;
3619
+ this.apiClient = apiClient;
3620
+ }
3621
+ /**
3622
+ * Get a specific commit by SHA.
3623
+ */
3624
+ async get({
3625
+ sha
3626
+ }) {
3627
+ return this.apiClient.get("/git/v1/repo/{repo}/git/commits/{hash}", {
3628
+ params: { repo: this.repoId, hash: sha }
3629
+ });
3630
+ }
3631
+ /**
3632
+ * List commits for this repository.
3633
+ */
3634
+ async list(params = {}) {
3635
+ return this.apiClient.get("/git/v1/repo/{repo}/git/commits", {
3636
+ params: { repo: this.repoId },
3637
+ query: params
3638
+ });
3639
+ }
3640
+ }
3641
+ class GitRepoTagsNamespace {
3642
+ constructor(repoId, apiClient) {
3643
+ this.repoId = repoId;
3644
+ this.apiClient = apiClient;
3645
+ }
3646
+ /**
3647
+ * List all tags in this repository.
3648
+ */
3649
+ async list() {
3650
+ return this.apiClient.get("/git/v1/repo/{repo}/git/refs/tags/", {
3651
+ params: { repo: this.repoId }
3652
+ });
3653
+ }
3654
+ /**
3655
+ * Get a tag by name.
3656
+ */
3657
+ async get({
3658
+ tagName
3659
+ }) {
3660
+ return this.apiClient.get("/git/v1/repo/{repo}/git/refs/tags/{tag}", {
3661
+ params: { repo: this.repoId, tag: tagName }
3662
+ });
3663
+ }
3664
+ /**
3665
+ * Get an annotated tag object by its SHA.
3666
+ */
3667
+ async getByHash({
3668
+ sha
3669
+ }) {
3670
+ return this.apiClient.get("/git/v1/repo/{repo}/git/tags/{hash}", {
3671
+ params: { repo: this.repoId, hash: sha }
3672
+ });
3673
+ }
3674
+ }
3675
+ class GitRepo {
3676
+ constructor(repoId, apiClient) {
3677
+ this.apiClient = apiClient;
3678
+ this.repoId = repoId;
3679
+ this.branches = new GitRepoBranchesNamespace(repoId, apiClient);
3680
+ this.contents = new GitRepoContentsNamespace(repoId, apiClient);
3681
+ this.commits = new GitRepoCommitsNamespace(repoId, apiClient);
3682
+ this.tags = new GitRepoTagsNamespace(repoId, apiClient);
3683
+ this.triggers = new GitRepoTriggersNamespace(repoId, apiClient);
3684
+ this.githubSync = new GitRepoGitHubSyncNamespace(repoId, apiClient);
3685
+ this.blobs = new GitRepoOdbBlobsNamespace(repoId, apiClient);
3686
+ this.trees = new GitRepoOdbTreesNamespace(repoId, apiClient);
3687
+ }
3688
+ repoId;
3689
+ /**
3690
+ * Manage branches in this repository.
3691
+ *
3692
+ * @example
3693
+ * ```ts
3694
+ * // List all branches
3695
+ * const branches = await repo.branches.list();
3696
+ *
3697
+ * // Get a specific branch
3698
+ * const main = await repo.branches.get({ branchName: "main" });
3699
+ *
3700
+ * // Get/set default branch
3701
+ * const { defaultBranch } = await repo.branches.getDefaultBranch();
3702
+ * await repo.branches.setDefaultBranch({ defaultBranch: "develop" });
3703
+ * ```
3704
+ */
3705
+ branches;
3706
+ /**
3707
+ * Access repository contents (files and directories).
3708
+ *
3709
+ * @example
3710
+ * ```ts
3711
+ * // Get file contents
3712
+ * const file = await repo.contents.get({ path: "README.md" });
3713
+ * const content = atob(file.content);
3714
+ *
3715
+ * // Get contents at a specific commit/branch/tag
3716
+ * const file = await repo.contents.get({
3717
+ * path: "src/index.ts",
3718
+ * rev: "main"
3719
+ * });
3720
+ *
3721
+ * // Get directory listing
3722
+ * const dir = await repo.contents.get({ path: "src" });
3723
+ *
3724
+ * // Download repository as tarball or zip
3725
+ * const tarball = await repo.contents.downloadTarball({ rev: "main" });
3726
+ * const zip = await repo.contents.downloadZip({ rev: "main" });
3727
+ * ```
3728
+ */
3729
+ contents;
3730
+ /**
3731
+ * Access commits in this repository.
3732
+ *
3733
+ * @example
3734
+ * ```ts
3735
+ * // Get a specific commit by SHA
3736
+ * const commit = await repo.commits.get({ sha: "abc123..." });
3737
+ * console.log(commit.message);
3738
+ * console.log(commit.author.name);
3739
+ *
3740
+ * // List recent commits
3741
+ * const commits = await repo.commits.list();
3742
+ * ```
3743
+ */
3744
+ commits;
3745
+ /**
3746
+ * Access tags in this repository.
3747
+ *
3748
+ * @example
3749
+ * ```ts
3750
+ * // List all tags
3751
+ * const tags = await repo.tags.list();
3752
+ *
3753
+ * // Get a tag by name
3754
+ * const tag = await repo.tags.get({ tagName: "v1.0.0" });
3755
+ *
3756
+ * // Get an annotated tag object by SHA
3757
+ * const tagObject = await repo.tags.getByHash({ sha: "abc123..." });
3758
+ * ```
3759
+ */
3760
+ tags;
3761
+ /**
3762
+ * Manage webhook triggers for this repository.
3763
+ *
3764
+ * Triggers send HTTP POST requests to your URL when events occur,
3765
+ * such as pushes to specific branches or changes to specific files.
3766
+ *
3767
+ * @example
3768
+ * ```ts
3769
+ * // Create a trigger for pushes to main
3770
+ * const { triggerId } = await repo.triggers.create({
3771
+ * trigger: { event: "push", branch: ["main"] },
3772
+ * action: { type: "webhook", url: "https://your-server.com/webhook" }
3773
+ * });
3774
+ *
3775
+ * // List all triggers
3776
+ * const triggers = await repo.triggers.list();
3777
+ *
3778
+ * // Delete a trigger
3779
+ * await repo.triggers.delete({ triggerId });
3780
+ * ```
3781
+ */
3782
+ triggers;
3783
+ /**
3784
+ * Manage GitHub synchronization for this repository.
3785
+ *
3786
+ * When enabled, pushes to either your Freestyle repository or the linked
3787
+ * GitHub repository are automatically synced to the other.
3788
+ *
3789
+ * @example
3790
+ * ```ts
3791
+ * // Enable sync with a GitHub repository
3792
+ * await repo.githubSync.enable({ githubRepoName: "owner/repo" });
3793
+ *
3794
+ * // Check sync configuration
3795
+ * const config = await repo.githubSync.get();
3796
+ *
3797
+ * // Disable sync
3798
+ * await repo.githubSync.disable();
3799
+ * ```
3800
+ */
3801
+ githubSync;
3802
+ /**
3803
+ * Access blob objects in the Git object database.
3804
+ *
3805
+ * Blobs represent raw file contents. Content is returned base64-encoded
3806
+ * for binary safety.
3807
+ *
3808
+ * @example
3809
+ * ```ts
3810
+ * // Get a blob by its SHA hash
3811
+ * const blob = await repo.blobs.get({ sha: "abc123..." });
3812
+ *
3813
+ * // Decode the base64 content
3814
+ * const content = atob(blob.content);
3815
+ * console.log(content);
3816
+ * ```
3817
+ */
3818
+ blobs;
3819
+ /**
3820
+ * Access tree objects in the Git object database.
3821
+ *
3822
+ * Trees represent directories in Git. Each tree contains entries
3823
+ * pointing to blobs (files) or other trees (subdirectories).
3824
+ *
3825
+ * @example
3826
+ * ```ts
3827
+ * // Get the root tree from a commit
3828
+ * const commit = await repo.commits.get({ sha: "abc123..." });
3829
+ * const tree = await repo.trees.get({ sha: commit.tree.sha });
3830
+ *
3831
+ * // Iterate over entries
3832
+ * for (const entry of tree.tree) {
3833
+ * if (entry.type === "blob") {
3834
+ * console.log(`File: ${entry.path}`);
3835
+ * } else {
3836
+ * console.log(`Directory: ${entry.path}`);
3837
+ * }
3838
+ * }
3839
+ * ```
3840
+ */
3841
+ trees;
3842
+ /**
3304
3843
  * Compare two revs in this repository.
3305
3844
  *
3306
3845
  * Head and base can be branch names, tags, or commit SHAs.
@@ -3350,7 +3889,7 @@ class GitReposNamespace {
3350
3889
  /**
3351
3890
  * Get a repository instance by ID.
3352
3891
  */
3353
- instance({ repoId }) {
3892
+ ref({ repoId }) {
3354
3893
  return new GitRepo(repoId, this.apiClient);
3355
3894
  }
3356
3895
  /**
@@ -3370,6 +3909,31 @@ class GitNamespace {
3370
3909
  this.freestyle = freestyle;
3371
3910
  this.repos = new GitReposNamespace(apiClient);
3372
3911
  }
3912
+ /**
3913
+ * Manage Git repositories.
3914
+ *
3915
+ * Create, list, delete, and get references to repositories.
3916
+ *
3917
+ * @example
3918
+ * ```ts
3919
+ * // Create a new empty repository
3920
+ * const { repoId, repo } = await freestyle.git.repos.create({});
3921
+ *
3922
+ * // Create from a GitHub URL
3923
+ * const { repo } = await freestyle.git.repos.create({
3924
+ * source: { url: "https://github.com/owner/repo" }
3925
+ * });
3926
+ *
3927
+ * // List repositories
3928
+ * const repos = await freestyle.git.repos.list({ limit: 10 });
3929
+ *
3930
+ * // Get a reference to an existing repository
3931
+ * const repo = freestyle.git.repos.ref({ repoId: "your-repo-id" });
3932
+ *
3933
+ * // Delete a repository
3934
+ * await freestyle.git.repos.delete({ repoId: "your-repo-id" });
3935
+ * ```
3936
+ */
3373
3937
  repos;
3374
3938
  }
3375
3939
 
@@ -3378,13 +3942,21 @@ class Identity {
3378
3942
  this.apiClient = apiClient;
3379
3943
  this.identityId = identityId;
3380
3944
  this.permissions = new IdentityPermissions(identityId, apiClient);
3945
+ this.tokens = new IdentityTokens(identityId, apiClient);
3381
3946
  }
3382
3947
  identityId;
3383
3948
  permissions;
3949
+ tokens;
3950
+ }
3951
+ class IdentityTokens {
3952
+ constructor(identityId, apiClient) {
3953
+ this.identityId = identityId;
3954
+ this.apiClient = apiClient;
3955
+ }
3384
3956
  /**
3385
3957
  * Create a new access token for this identity.
3386
3958
  */
3387
- async createToken() {
3959
+ async create() {
3388
3960
  const response = await this.apiClient.post(
3389
3961
  "/identity/v1/identities/{identity}/tokens",
3390
3962
  {
@@ -3399,7 +3971,7 @@ class Identity {
3399
3971
  /**
3400
3972
  * Revoke an access token.
3401
3973
  */
3402
- async revokeToken({
3974
+ async revoke({
3403
3975
  tokenId
3404
3976
  }) {
3405
3977
  return this.apiClient.delete(
@@ -3412,7 +3984,7 @@ class Identity {
3412
3984
  /**
3413
3985
  * List access tokens for this identity.
3414
3986
  */
3415
- async listTokens() {
3987
+ async list() {
3416
3988
  return this.apiClient.get("/identity/v1/identities/{identity}/tokens", {
3417
3989
  params: { identity: this.identityId }
3418
3990
  });
@@ -3480,7 +4052,7 @@ class GitPermissions {
3480
4052
  /**
3481
4053
  * Grant this identity access to a repository.
3482
4054
  */
3483
- async create({
4055
+ async grant({
3484
4056
  repoId,
3485
4057
  permission
3486
4058
  }) {
@@ -3495,7 +4067,7 @@ class GitPermissions {
3495
4067
  /**
3496
4068
  * Revoke this identity's access to a repository.
3497
4069
  */
3498
- async delete({
4070
+ async revoke({
3499
4071
  repoId
3500
4072
  }) {
3501
4073
  return this.apiClient.delete(
@@ -3558,7 +4130,7 @@ class VmPermissions {
3558
4130
  /**
3559
4131
  * Grant this identity access to a VM.
3560
4132
  */
3561
- async create({
4133
+ async grant({
3562
4134
  vmId,
3563
4135
  allowedUsers
3564
4136
  }) {
@@ -3573,7 +4145,7 @@ class VmPermissions {
3573
4145
  /**
3574
4146
  * Revoke this identity's access to a VM.
3575
4147
  */
3576
- async delete({
4148
+ async revoke({
3577
4149
  vmId
3578
4150
  }) {
3579
4151
  return this.apiClient.delete(
@@ -3698,9 +4270,11 @@ class DeploymentsNamespace {
3698
4270
  this.apiClient = apiClient;
3699
4271
  }
3700
4272
  /**
3701
- * Create a web deployment on the edge.
4273
+ * Create a serverless web deployment
3702
4274
  */
3703
- async create({ ...body }) {
4275
+ async create({
4276
+ ...body
4277
+ }) {
3704
4278
  let source;
3705
4279
  if ("repo" in body) {
3706
4280
  source = {
@@ -3790,30 +4364,13 @@ class RunsNamespace {
3790
4364
  code,
3791
4365
  ...config
3792
4366
  }) {
3793
- const response = await this.apiClient.post("/execute/v1/script", {
4367
+ const response = await this.apiClient.post("/execute/v2/script", {
3794
4368
  body: {
3795
4369
  script: code,
3796
- config: {
3797
- customHeaders: config.customHeaders,
3798
- networkPermissions: config.networkPermissions?.map((np) => ({
3799
- action: np.action,
3800
- query: np.domain,
3801
- behavior: np.behavior
3802
- })),
3803
- envVars: config.envVars,
3804
- nodeModules: config.nodeModules,
3805
- timeout: config.timeoutMs
3806
- // entrypoint: config.entrypointPath,
3807
- }
4370
+ config
3808
4371
  }
3809
4372
  });
3810
- if (!response.result && !response.logs) {
3811
- throw new Error("Execution failed");
3812
- }
3813
- return {
3814
- result: response.result,
3815
- logs: response.logs || []
3816
- };
4373
+ return response;
3817
4374
  }
3818
4375
  /**
3819
4376
  * List execution runs.
@@ -3838,7 +4395,7 @@ class RunsNamespace {
3838
4395
  };
3839
4396
  }
3840
4397
  }
3841
- class EdgeNamespace {
4398
+ class ServerlessNamespace {
3842
4399
  constructor(apiClient) {
3843
4400
  this.apiClient = apiClient;
3844
4401
  this.deployments = new DeploymentsNamespace(apiClient);
@@ -4424,6 +4981,18 @@ class Vm {
4424
4981
  params: { vm_id: this.vmId }
4425
4982
  });
4426
4983
  }
4984
+ /**
4985
+ * Create a snapshot of the VM.
4986
+ *
4987
+ * @param body Optional snapshot configuration
4988
+ * @returns Snapshot ID and Source VM ID
4989
+ */
4990
+ async snapshot(body = {}) {
4991
+ return this.apiClient.post("/v1/vms/{vm_id}/snapshot", {
4992
+ params: { vm_id: this.vmId },
4993
+ body
4994
+ });
4995
+ }
4427
4996
  /**
4428
4997
  * Execute a command in the VM and wait for it to complete.
4429
4998
  * @param command The command to execute
@@ -4621,7 +5190,7 @@ class Freestyle {
4621
5190
  git;
4622
5191
  identities;
4623
5192
  dns;
4624
- edge;
5193
+ serverless;
4625
5194
  vms;
4626
5195
  constructor(options = {}) {
4627
5196
  if (!options.baseUrl) {
@@ -4646,7 +5215,7 @@ class Freestyle {
4646
5215
  this.git = new GitNamespace(this.apiClient, this);
4647
5216
  this.identities = new IdentitiesNamespace(this.apiClient);
4648
5217
  this.dns = new DnsNamespace(this.apiClient);
4649
- this.edge = new EdgeNamespace(this.apiClient);
5218
+ this.serverless = new ServerlessNamespace(this.apiClient);
4650
5219
  this.vms = new VmsNamespace(this.apiClient);
4651
5220
  }
4652
5221
  /**