freestyle-sandboxes 0.1.5 → 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 (5) hide show
  1. package/index.cjs +757 -819
  2. package/index.d.cts +684 -614
  3. package/index.d.mts +684 -614
  4. package/index.mjs +757 -819
  5. package/package.json +1 -1
package/index.cjs CHANGED
@@ -20,29 +20,65 @@ class GitErrorError extends Error {
20
20
  static statusCode = 500;
21
21
  static description = `{message}`;
22
22
  }
23
- class SnapshotVmBadRequestError extends Error {
23
+ class InternalErrorError extends Error {
24
24
  constructor(body) {
25
25
  super(
26
- `SNAPSHOT_VM_BAD_REQUEST: ${body.message}`
26
+ `INTERNAL_ERROR: ${body.message}`
27
27
  );
28
28
  this.body = body;
29
- this.name = "SnapshotVmBadRequestError";
29
+ this.name = "InternalErrorError";
30
30
  }
31
- static code = "SNAPSHOT_VM_BAD_REQUEST";
31
+ static code = "INTERNAL_ERROR";
32
+ static statusCode = 500;
33
+ static description = `Internal error: {message}`;
34
+ }
35
+ class DockerImportBadRequestError extends Error {
36
+ constructor(body) {
37
+ super(
38
+ `DOCKER_IMPORT_BAD_REQUEST: ${body.message}`
39
+ );
40
+ this.body = body;
41
+ this.name = "DockerImportBadRequestError";
42
+ }
43
+ static code = "DOCKER_IMPORT_BAD_REQUEST";
32
44
  static statusCode = 400;
33
45
  static description = `Bad request: {message}`;
34
46
  }
35
- class InternalErrorError extends Error {
47
+ class VmOperationDeniedDuringTransactionError extends Error {
36
48
  constructor(body) {
37
49
  super(
38
- `INTERNAL_ERROR: ${body.message}`
50
+ `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
39
51
  );
40
52
  this.body = body;
41
- this.name = "InternalErrorError";
53
+ this.name = "VmOperationDeniedDuringTransactionError";
42
54
  }
43
- static code = "INTERNAL_ERROR";
44
- static statusCode = 500;
45
- static description = `Internal error: {message}`;
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}`;
58
+ }
59
+ class VmTransactionIdMismatchError extends Error {
60
+ constructor(body) {
61
+ super(
62
+ `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
63
+ );
64
+ this.body = body;
65
+ this.name = "VmTransactionIdMismatchError";
66
+ }
67
+ static code = "VM_TRANSACTION_ID_MISMATCH";
68
+ static statusCode = 400;
69
+ static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
70
+ }
71
+ class VmNotInTransactionError extends Error {
72
+ constructor(body) {
73
+ super(
74
+ `VM_NOT_IN_TRANSACTION: ${body.message}`
75
+ );
76
+ this.body = body;
77
+ this.name = "VmNotInTransactionError";
78
+ }
79
+ static code = "VM_NOT_IN_TRANSACTION";
80
+ static statusCode = 404;
81
+ static description = `VM not in a transaction: {vm_id}`;
46
82
  }
47
83
  class ForkVmNotFoundError extends Error {
48
84
  constructor(body) {
@@ -68,6 +104,18 @@ class CreateSnapshotBadRequestError extends Error {
68
104
  static statusCode = 400;
69
105
  static description = `Bad request: {message}`;
70
106
  }
107
+ class SnapshotVmBadRequestError extends Error {
108
+ constructor(body) {
109
+ super(
110
+ `SNAPSHOT_VM_BAD_REQUEST: ${body.message}`
111
+ );
112
+ this.body = body;
113
+ this.name = "SnapshotVmBadRequestError";
114
+ }
115
+ static code = "SNAPSHOT_VM_BAD_REQUEST";
116
+ static statusCode = 400;
117
+ static description = `Bad request: {message}`;
118
+ }
71
119
  class VmDeletedError extends Error {
72
120
  constructor(body) {
73
121
  super(
@@ -200,42 +248,6 @@ class FilesBadRequestError extends Error {
200
248
  static statusCode = 400;
201
249
  static description = `Bad request: {message}`;
202
250
  }
203
- class VmMustBeStoppedError extends Error {
204
- constructor(body) {
205
- super(
206
- `VM_MUST_BE_STOPPED: ${body.message}`
207
- );
208
- this.body = body;
209
- this.name = "VmMustBeStoppedError";
210
- }
211
- static code = "VM_MUST_BE_STOPPED";
212
- static statusCode = 400;
213
- static description = `VM must be stopped before converting to base`;
214
- }
215
- class AlreadyHasBaseError extends Error {
216
- constructor(body) {
217
- super(
218
- `ALREADY_HAS_BASE: ${body.message}`
219
- );
220
- this.body = body;
221
- this.name = "AlreadyHasBaseError";
222
- }
223
- static code = "ALREADY_HAS_BASE";
224
- static statusCode = 400;
225
- static description = `VM already has a base rootfs`;
226
- }
227
- class NotFoundError extends Error {
228
- constructor(body) {
229
- super(
230
- `NOT_FOUND: ${body.message}`
231
- );
232
- this.body = body;
233
- this.name = "NotFoundError";
234
- }
235
- static code = "NOT_FOUND";
236
- static statusCode = 404;
237
- static description = `VM not found`;
238
- }
239
251
  class VmNotFoundInFsError extends Error {
240
252
  constructor(body) {
241
253
  super(
@@ -308,53 +320,41 @@ class InternalVmNotFoundError extends Error {
308
320
  static statusCode = 404;
309
321
  static description = `VM not found: {vm_id}`;
310
322
  }
311
- class DockerImportBadRequestError extends Error {
323
+ class VmMustBeStoppedError extends Error {
312
324
  constructor(body) {
313
325
  super(
314
- `DOCKER_IMPORT_BAD_REQUEST: ${body.message}`
326
+ `VM_MUST_BE_STOPPED: ${body.message}`
315
327
  );
316
328
  this.body = body;
317
- this.name = "DockerImportBadRequestError";
329
+ this.name = "VmMustBeStoppedError";
318
330
  }
319
- static code = "DOCKER_IMPORT_BAD_REQUEST";
331
+ static code = "VM_MUST_BE_STOPPED";
320
332
  static statusCode = 400;
321
- static description = `Bad request: {message}`;
322
- }
323
- class VmOperationDeniedDuringTransactionError extends Error {
324
- constructor(body) {
325
- super(
326
- `VM_OPERATION_DENIED_DURING_TRANSACTION: ${body.message}`
327
- );
328
- this.body = body;
329
- this.name = "VmOperationDeniedDuringTransactionError";
330
- }
331
- static code = "VM_OPERATION_DENIED_DURING_TRANSACTION";
332
- static statusCode = 409;
333
- static description = `VM operation denied during active transaction for VM {vm_id} in transaction {transaction_id}`;
333
+ static description = `VM must be stopped before converting to base`;
334
334
  }
335
- class VmTransactionIdMismatchError extends Error {
335
+ class AlreadyHasBaseError extends Error {
336
336
  constructor(body) {
337
337
  super(
338
- `VM_TRANSACTION_ID_MISMATCH: ${body.message}`
338
+ `ALREADY_HAS_BASE: ${body.message}`
339
339
  );
340
340
  this.body = body;
341
- this.name = "VmTransactionIdMismatchError";
341
+ this.name = "AlreadyHasBaseError";
342
342
  }
343
- static code = "VM_TRANSACTION_ID_MISMATCH";
343
+ static code = "ALREADY_HAS_BASE";
344
344
  static statusCode = 400;
345
- static description = `Transaction ID {provided_transaction_id} does not match the current VM transaction {expected_transaction_id} for VM {vm_id}`;
345
+ static description = `VM already has a base rootfs`;
346
346
  }
347
- class VmNotInTransactionError extends Error {
347
+ class NotFoundError extends Error {
348
348
  constructor(body) {
349
349
  super(
350
- `VM_NOT_IN_TRANSACTION: ${body.message}`
350
+ `NOT_FOUND: ${body.message}`
351
351
  );
352
352
  this.body = body;
353
- this.name = "VmNotInTransactionError";
353
+ this.name = "NotFoundError";
354
354
  }
355
- static code = "VM_NOT_IN_TRANSACTION";
355
+ static code = "NOT_FOUND";
356
356
  static statusCode = 404;
357
- static description = `VM not in a transaction: {vm_id}`;
357
+ static description = `VM not found`;
358
358
  }
359
359
  class CreateVmBadRequestError extends Error {
360
360
  constructor(body) {
@@ -776,6 +776,30 @@ class RepoNotFoundError extends Error {
776
776
  static statusCode = 404;
777
777
  static description = `Repository not found: {repo_id}`;
778
778
  }
779
+ class RuntimeErrorError extends Error {
780
+ constructor(body) {
781
+ super(
782
+ `RUNTIME_ERROR: ${body.message}`
783
+ );
784
+ this.body = body;
785
+ this.name = "RuntimeErrorError";
786
+ }
787
+ static code = "RUNTIME_ERROR";
788
+ static statusCode = 500;
789
+ static description = `The script execution resulted in a runtime error: {message}`;
790
+ }
791
+ class SyntaxErrorError extends Error {
792
+ constructor(body) {
793
+ super(
794
+ `SYNTAX_ERROR: ${body.message}`
795
+ );
796
+ this.body = body;
797
+ this.name = "SyntaxErrorError";
798
+ }
799
+ static code = "SYNTAX_ERROR";
800
+ static statusCode = 503;
801
+ static description = `The provided script has a syntax error: {message}`;
802
+ }
779
803
  class InternalError extends Error {
780
804
  constructor(body) {
781
805
  super(
@@ -848,53 +872,53 @@ class ExpiredError extends Error {
848
872
  static statusCode = 403;
849
873
  static description = `Session has expired`;
850
874
  }
851
- class ConflictError extends Error {
875
+ class ForbiddenError extends Error {
852
876
  constructor(body) {
853
877
  super(
854
- `CONFLICT: ${body.message}`
878
+ `FORBIDDEN: ${body.message}`
855
879
  );
856
880
  this.body = body;
857
- this.name = "ConflictError";
881
+ this.name = "ForbiddenError";
858
882
  }
859
- static code = "CONFLICT";
860
- static statusCode = 409;
861
- static description = `Sync conflict: {message}`;
883
+ static code = "FORBIDDEN";
884
+ static statusCode = 403;
885
+ static description = `You do not have permission to push to this repository`;
862
886
  }
863
- class BranchNotFoundError extends Error {
887
+ class UnauthorizedError extends Error {
864
888
  constructor(body) {
865
889
  super(
866
- `BRANCH_NOT_FOUND: ${body.message}`
890
+ `UNAUTHORIZED: ${body.message}`
867
891
  );
868
892
  this.body = body;
869
- this.name = "BranchNotFoundError";
893
+ this.name = "UnauthorizedError";
870
894
  }
871
- static code = "BRANCH_NOT_FOUND";
872
- static statusCode = 404;
873
- static description = `Branch not found: {branch}`;
895
+ static code = "UNAUTHORIZED";
896
+ static statusCode = 401;
897
+ static description = `Unauthorized`;
874
898
  }
875
- class SendErrorError extends Error {
899
+ class InvalidServiceError extends Error {
876
900
  constructor(body) {
877
901
  super(
878
- `SEND_ERROR: ${body.message}`
902
+ `INVALID_SERVICE: ${body.message}`
879
903
  );
880
904
  this.body = body;
881
- this.name = "SendErrorError";
905
+ this.name = "InvalidServiceError";
882
906
  }
883
- static code = "SEND_ERROR";
884
- static statusCode = 500;
885
- static description = `Stream receiver dropped`;
907
+ static code = "INVALID_SERVICE";
908
+ static statusCode = 403;
909
+ static description = `Invalid service '{invalid}', expected 'git-upload-pack' or 'git-receive-pack'`;
886
910
  }
887
- class ForbiddenError extends Error {
911
+ class ExpectedServiceError extends Error {
888
912
  constructor(body) {
889
913
  super(
890
- `FORBIDDEN: ${body.message}`
914
+ `EXPECTED_SERVICE: ${body.message}`
891
915
  );
892
916
  this.body = body;
893
- this.name = "ForbiddenError";
917
+ this.name = "ExpectedServiceError";
894
918
  }
895
- static code = "FORBIDDEN";
919
+ static code = "EXPECTED_SERVICE";
896
920
  static statusCode = 403;
897
- static description = `Forbidden: {message}`;
921
+ static description = `Expected 'service' query parameter`;
898
922
  }
899
923
  class UnsupportedTransferError extends Error {
900
924
  constructor(body) {
@@ -908,113 +932,113 @@ class UnsupportedTransferError extends Error {
908
932
  static statusCode = 400;
909
933
  static description = `Unsupported LFS transfer protocol(s)`;
910
934
  }
911
- class ReferenceNotFoundError extends Error {
935
+ class ConflictError extends Error {
912
936
  constructor(body) {
913
937
  super(
914
- `REFERENCE_NOT_FOUND: ${body.message}`
938
+ `CONFLICT: ${body.message}`
915
939
  );
916
940
  this.body = body;
917
- this.name = "ReferenceNotFoundError";
941
+ this.name = "ConflictError";
918
942
  }
919
- static code = "REFERENCE_NOT_FOUND";
920
- static statusCode = 404;
921
- static description = `Reference not found: {reference}`;
943
+ static code = "CONFLICT";
944
+ static statusCode = 409;
945
+ static description = `Sync conflict: {message}`;
922
946
  }
923
- class InvalidRangeError extends Error {
947
+ class BranchNotFoundError extends Error {
924
948
  constructor(body) {
925
949
  super(
926
- `INVALID_RANGE: ${body.message}`
950
+ `BRANCH_NOT_FOUND: ${body.message}`
927
951
  );
928
952
  this.body = body;
929
- this.name = "InvalidRangeError";
953
+ this.name = "BranchNotFoundError";
930
954
  }
931
- static code = "INVALID_RANGE";
932
- static statusCode = 400;
933
- 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.`;
955
+ static code = "BRANCH_NOT_FOUND";
956
+ static statusCode = 404;
957
+ static description = `Branch not found: {branch}`;
934
958
  }
935
- class OffsetWithSelectorError extends Error {
959
+ class SourceImportConflictError extends Error {
936
960
  constructor(body) {
937
961
  super(
938
- `OFFSET_WITH_SELECTOR: ${body.message}`
962
+ `SOURCE_IMPORT_CONFLICT: ${body.message}`
939
963
  );
940
964
  this.body = body;
941
- this.name = "OffsetWithSelectorError";
965
+ this.name = "SourceImportConflictError";
942
966
  }
943
- static code = "OFFSET_WITH_SELECTOR";
967
+ static code = "SOURCE_IMPORT_CONFLICT";
944
968
  static statusCode = 400;
945
- static description = `Cannot use 'offset' parameter together with 'since' or 'until'. Use 'since' for cursor-based pagination.`;
969
+ static description = `Source and import are mutually exclusive`;
946
970
  }
947
- class CommitNotInBranchError extends Error {
971
+ class SourceUnauthorizedError extends Error {
948
972
  constructor(body) {
949
973
  super(
950
- `COMMIT_NOT_IN_BRANCH: ${body.message}`
974
+ `SOURCE_UNAUTHORIZED: ${body.message}`
951
975
  );
952
976
  this.body = body;
953
- this.name = "CommitNotInBranchError";
977
+ this.name = "SourceUnauthorizedError";
954
978
  }
955
- static code = "COMMIT_NOT_IN_BRANCH";
979
+ static code = "SOURCE_UNAUTHORIZED";
956
980
  static statusCode = 400;
957
- static description = `Commit {sha} is not in the history of branch {branch}`;
981
+ static description = `Unauthorized to access source repository at {url}`;
958
982
  }
959
- class CommitNotFoundError extends Error {
983
+ class SourceNotFoundError extends Error {
960
984
  constructor(body) {
961
985
  super(
962
- `COMMIT_NOT_FOUND: ${body.message}`
986
+ `SOURCE_NOT_FOUND: ${body.message}`
963
987
  );
964
988
  this.body = body;
965
- this.name = "CommitNotFoundError";
989
+ this.name = "SourceNotFoundError";
966
990
  }
967
- static code = "COMMIT_NOT_FOUND";
991
+ static code = "SOURCE_NOT_FOUND";
968
992
  static statusCode = 400;
969
- static description = `Commit not found: {sha}`;
993
+ static description = `Source repository not found at {url}`;
970
994
  }
971
- class BlobNotFoundError extends Error {
995
+ class ImportSubdirNotFoundError extends Error {
972
996
  constructor(body) {
973
997
  super(
974
- `BLOB_NOT_FOUND: ${body.message}`
998
+ `IMPORT_SUBDIR_NOT_FOUND: ${body.message}`
975
999
  );
976
1000
  this.body = body;
977
- this.name = "BlobNotFoundError";
1001
+ this.name = "ImportSubdirNotFoundError";
978
1002
  }
979
- static code = "BLOB_NOT_FOUND";
980
- static statusCode = 404;
981
- static description = `Blob not found: {hash}`;
1003
+ static code = "IMPORT_SUBDIR_NOT_FOUND";
1004
+ static statusCode = 400;
1005
+ static description = `Directory not found in {source}: {dir}`;
982
1006
  }
983
- class TreeNotFoundError extends Error {
1007
+ class RepoAlreadyExistsError extends Error {
984
1008
  constructor(body) {
985
1009
  super(
986
- `TREE_NOT_FOUND: ${body.message}`
1010
+ `REPO_ALREADY_EXISTS: ${body.message}`
987
1011
  );
988
1012
  this.body = body;
989
- this.name = "TreeNotFoundError";
1013
+ this.name = "RepoAlreadyExistsError";
990
1014
  }
991
- static code = "TREE_NOT_FOUND";
992
- static statusCode = 404;
993
- static description = `Tree not found: {hash}`;
1015
+ static code = "REPO_ALREADY_EXISTS";
1016
+ static statusCode = 409;
1017
+ static description = `Repo '{repo_id}' already exists`;
994
1018
  }
995
- class InvalidRevisionError extends Error {
1019
+ class PathNotFoundError extends Error {
996
1020
  constructor(body) {
997
1021
  super(
998
- `INVALID_REVISION: ${body.message}`
1022
+ `PATH_NOT_FOUND: ${body.message}`
999
1023
  );
1000
1024
  this.body = body;
1001
- this.name = "InvalidRevisionError";
1025
+ this.name = "PathNotFoundError";
1002
1026
  }
1003
- static code = "INVALID_REVISION";
1004
- static statusCode = 400;
1005
- static description = `Invalid revision: {revision}`;
1027
+ static code = "PATH_NOT_FOUND";
1028
+ static statusCode = 404;
1029
+ static description = `Path not found: {path}`;
1006
1030
  }
1007
- class UnauthorizedError extends Error {
1031
+ class ReferenceNotFoundError extends Error {
1008
1032
  constructor(body) {
1009
1033
  super(
1010
- `UNAUTHORIZED: ${body.message}`
1034
+ `REFERENCE_NOT_FOUND: ${body.message}`
1011
1035
  );
1012
1036
  this.body = body;
1013
- this.name = "UnauthorizedError";
1037
+ this.name = "ReferenceNotFoundError";
1014
1038
  }
1015
- static code = "UNAUTHORIZED";
1016
- static statusCode = 401;
1017
- static description = `Unauthorized`;
1039
+ static code = "REFERENCE_NOT_FOUND";
1040
+ static statusCode = 404;
1041
+ static description = `Reference not found: {reference}`;
1018
1042
  }
1019
1043
  class TagNotFoundError extends Error {
1020
1044
  constructor(body) {
@@ -1026,19 +1050,19 @@ class TagNotFoundError extends Error {
1026
1050
  }
1027
1051
  static code = "TAG_NOT_FOUND";
1028
1052
  static statusCode = 404;
1029
- static description = `Tag not found: {tag}`;
1053
+ static description = `Tag not found: {hash}`;
1030
1054
  }
1031
- class RepoAlreadyExistsError extends Error {
1055
+ class SendErrorError extends Error {
1032
1056
  constructor(body) {
1033
1057
  super(
1034
- `REPO_ALREADY_EXISTS: ${body.message}`
1058
+ `SEND_ERROR: ${body.message}`
1035
1059
  );
1036
1060
  this.body = body;
1037
- this.name = "RepoAlreadyExistsError";
1061
+ this.name = "SendErrorError";
1038
1062
  }
1039
- static code = "REPO_ALREADY_EXISTS";
1040
- static statusCode = 409;
1041
- static description = `Repository {repo_id} already exists`;
1063
+ static code = "SEND_ERROR";
1064
+ static statusCode = 500;
1065
+ static description = `Stream receiver dropped`;
1042
1066
  }
1043
1067
  class GitHubSyncConflictError extends Error {
1044
1068
  constructor(body) {
@@ -1064,197 +1088,149 @@ class InvalidObjectIdError extends Error {
1064
1088
  static statusCode = 400;
1065
1089
  static description = `Invalid object ID: {hash}`;
1066
1090
  }
1067
- class SourceImportConflictError extends Error {
1091
+ class CommitNotFoundError extends Error {
1068
1092
  constructor(body) {
1069
1093
  super(
1070
- `SOURCE_IMPORT_CONFLICT: ${body.message}`
1094
+ `COMMIT_NOT_FOUND: ${body.message}`
1071
1095
  );
1072
1096
  this.body = body;
1073
- this.name = "SourceImportConflictError";
1097
+ this.name = "CommitNotFoundError";
1074
1098
  }
1075
- static code = "SOURCE_IMPORT_CONFLICT";
1076
- static statusCode = 400;
1077
- static description = `Source and import are mutually exclusive`;
1099
+ static code = "COMMIT_NOT_FOUND";
1100
+ static statusCode = 404;
1101
+ static description = `Commit {commit_hash} not found in repository {repo_id}`;
1078
1102
  }
1079
- class SourceUnauthorizedError extends Error {
1103
+ class TreeNotFoundError extends Error {
1080
1104
  constructor(body) {
1081
1105
  super(
1082
- `SOURCE_UNAUTHORIZED: ${body.message}`
1106
+ `TREE_NOT_FOUND: ${body.message}`
1083
1107
  );
1084
1108
  this.body = body;
1085
- this.name = "SourceUnauthorizedError";
1109
+ this.name = "TreeNotFoundError";
1086
1110
  }
1087
- static code = "SOURCE_UNAUTHORIZED";
1088
- static statusCode = 400;
1089
- static description = `Unauthorized to access source repository at {url}`;
1111
+ static code = "TREE_NOT_FOUND";
1112
+ static statusCode = 404;
1113
+ static description = `Tree not found: {hash}`;
1090
1114
  }
1091
- class SourceNotFoundError extends Error {
1115
+ class InvalidRevisionError extends Error {
1092
1116
  constructor(body) {
1093
1117
  super(
1094
- `SOURCE_NOT_FOUND: ${body.message}`
1118
+ `INVALID_REVISION: ${body.message}`
1095
1119
  );
1096
1120
  this.body = body;
1097
- this.name = "SourceNotFoundError";
1121
+ this.name = "InvalidRevisionError";
1098
1122
  }
1099
- static code = "SOURCE_NOT_FOUND";
1123
+ static code = "INVALID_REVISION";
1100
1124
  static statusCode = 400;
1101
- static description = `Source repository not found at {url}`;
1125
+ static description = `Invalid revision: {revision}`;
1102
1126
  }
1103
- class ImportSubdirNotFoundError extends Error {
1127
+ class InvalidRangeError extends Error {
1104
1128
  constructor(body) {
1105
1129
  super(
1106
- `IMPORT_SUBDIR_NOT_FOUND: ${body.message}`
1130
+ `INVALID_RANGE: ${body.message}`
1107
1131
  );
1108
1132
  this.body = body;
1109
- this.name = "ImportSubdirNotFoundError";
1133
+ this.name = "InvalidRangeError";
1110
1134
  }
1111
- static code = "IMPORT_SUBDIR_NOT_FOUND";
1135
+ static code = "INVALID_RANGE";
1112
1136
  static statusCode = 400;
1113
- static description = `Directory not found in {source}: {dir}`;
1114
- }
1115
- class PackfileError extends Error {
1116
- constructor(body) {
1117
- super(
1118
- `PACKFILE: ${body.message}`
1119
- );
1120
- this.body = body;
1121
- this.name = "PackfileError";
1122
- }
1123
- static code = "PACKFILE";
1124
- static statusCode = 500;
1125
- static description = `Error building packfile`;
1126
- }
1127
- class PathNotFoundError extends Error {
1128
- constructor(body) {
1129
- super(
1130
- `PATH_NOT_FOUND: ${body.message}`
1131
- );
1132
- this.body = body;
1133
- this.name = "PathNotFoundError";
1134
- }
1135
- static code = "PATH_NOT_FOUND";
1136
- static statusCode = 404;
1137
- static description = `Path not found: {path}`;
1138
- }
1139
- class InvalidServiceError extends Error {
1140
- constructor(body) {
1141
- super(
1142
- `INVALID_SERVICE: ${body.message}`
1143
- );
1144
- this.body = body;
1145
- this.name = "InvalidServiceError";
1146
- }
1147
- static code = "INVALID_SERVICE";
1148
- static statusCode = 403;
1149
- static description = `Invalid service '{invalid}', expected 'git-upload-pack' or 'git-receive-pack'`;
1150
- }
1151
- class ExpectedServiceError extends Error {
1152
- constructor(body) {
1153
- super(
1154
- `EXPECTED_SERVICE: ${body.message}`
1155
- );
1156
- this.body = body;
1157
- this.name = "ExpectedServiceError";
1158
- }
1159
- static code = "EXPECTED_SERVICE";
1160
- static statusCode = 403;
1161
- static description = `Expected 'service' query parameter`;
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.`;
1162
1138
  }
1163
- class DatabaseErrorError extends Error {
1139
+ class OffsetWithSelectorError extends Error {
1164
1140
  constructor(body) {
1165
1141
  super(
1166
- `DATABASE_ERROR: ${body.message}`
1142
+ `OFFSET_WITH_SELECTOR: ${body.message}`
1167
1143
  );
1168
1144
  this.body = body;
1169
- this.name = "DatabaseErrorError";
1145
+ this.name = "OffsetWithSelectorError";
1170
1146
  }
1171
- static code = "DATABASE_ERROR";
1172
- static statusCode = 500;
1173
- static description = `Database error: {0}`;
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.`;
1174
1150
  }
1175
- class WaitTimeoutError extends Error {
1151
+ class CommitNotInBranchError extends Error {
1176
1152
  constructor(body) {
1177
1153
  super(
1178
- `WAIT_TIMEOUT: ${body.message}`
1154
+ `COMMIT_NOT_IN_BRANCH: ${body.message}`
1179
1155
  );
1180
1156
  this.body = body;
1181
- this.name = "WaitTimeoutError";
1157
+ this.name = "CommitNotInBranchError";
1182
1158
  }
1183
- static code = "WAIT_TIMEOUT";
1184
- static statusCode = 504;
1185
- static description = `Timed out waiting for certificate validation`;
1159
+ static code = "COMMIT_NOT_IN_BRANCH";
1160
+ static statusCode = 400;
1161
+ static description = `Commit {sha} is not in the history of branch {branch}`;
1186
1162
  }
1187
- class PreVerifyChallengeMismatchError extends Error {
1163
+ class BlobNotFoundError extends Error {
1188
1164
  constructor(body) {
1189
1165
  super(
1190
- `PRE_VERIFY_CHALLENGE_MISMATCH: ${body.message}`
1166
+ `BLOB_NOT_FOUND: ${body.message}`
1191
1167
  );
1192
1168
  this.body = body;
1193
- this.name = "PreVerifyChallengeMismatchError";
1169
+ this.name = "BlobNotFoundError";
1194
1170
  }
1195
- static code = "PRE_VERIFY_CHALLENGE_MISMATCH";
1196
- static statusCode = 400;
1197
- static description = `Certificate challenge verification failed - response did not match`;
1171
+ static code = "BLOB_NOT_FOUND";
1172
+ static statusCode = 404;
1173
+ static description = `Blob not found: {hash}`;
1198
1174
  }
1199
- class PreVerifyFailedParseError extends Error {
1175
+ class AmbiguousError extends Error {
1200
1176
  constructor(body) {
1201
1177
  super(
1202
- `PRE_VERIFY_FAILED_PARSE: ${body.message}`
1178
+ `AMBIGUOUS: ${body.message}`
1203
1179
  );
1204
1180
  this.body = body;
1205
- this.name = "PreVerifyFailedParseError";
1181
+ this.name = "AmbiguousError";
1206
1182
  }
1207
- static code = "PRE_VERIFY_FAILED_PARSE";
1183
+ static code = "AMBIGUOUS";
1208
1184
  static statusCode = 400;
1209
- static description = `Invalid response from domain during certificate verification`;
1185
+ static description = `rev is ambiguous: {rev}`;
1210
1186
  }
1211
- class PreVerifyFailedFetchError extends Error {
1187
+ class InvalidError extends Error {
1212
1188
  constructor(body) {
1213
1189
  super(
1214
- `PRE_VERIFY_FAILED_FETCH: ${body.message}`
1190
+ `INVALID: ${body.message}`
1215
1191
  );
1216
1192
  this.body = body;
1217
- this.name = "PreVerifyFailedFetchError";
1193
+ this.name = "InvalidError";
1218
1194
  }
1219
- static code = "PRE_VERIFY_FAILED_FETCH";
1195
+ static code = "INVALID";
1220
1196
  static statusCode = 400;
1221
- static description = `Could not reach domain for certificate verification - check DNS settings`;
1197
+ static description = `invalid rev syntax: {rev}`;
1222
1198
  }
1223
- class PreVerifyRouteNotFoundError extends Error {
1199
+ class PackfileError extends Error {
1224
1200
  constructor(body) {
1225
1201
  super(
1226
- `PRE_VERIFY_ROUTE_NOT_FOUND: ${body.message}`
1202
+ `PACKFILE: ${body.message}`
1227
1203
  );
1228
1204
  this.body = body;
1229
- this.name = "PreVerifyRouteNotFoundError";
1205
+ this.name = "PackfileError";
1230
1206
  }
1231
- static code = "PRE_VERIFY_ROUTE_NOT_FOUND";
1232
- static statusCode = 400;
1233
- static description = `Domain does not resolve to Freestyle servers`;
1207
+ static code = "PACKFILE";
1208
+ static statusCode = 500;
1209
+ static description = `Error building packfile`;
1234
1210
  }
1235
- class AuthorizationNotFoundError extends Error {
1211
+ class DatabaseErrorError extends Error {
1236
1212
  constructor(body) {
1237
1213
  super(
1238
- `AUTHORIZATION_NOT_FOUND: ${body.message}`
1214
+ `DATABASE_ERROR: ${body.message}`
1239
1215
  );
1240
1216
  this.body = body;
1241
- this.name = "AuthorizationNotFoundError";
1217
+ this.name = "DatabaseErrorError";
1242
1218
  }
1243
- static code = "AUTHORIZATION_NOT_FOUND";
1244
- static statusCode = 404;
1245
- static description = `No authorization found for domain`;
1219
+ static code = "DATABASE_ERROR";
1220
+ static statusCode = 500;
1221
+ static description = `Database error: {0}`;
1246
1222
  }
1247
- class OrderNotFoundError extends Error {
1223
+ class EmptyTagError extends Error {
1248
1224
  constructor(body) {
1249
1225
  super(
1250
- `ORDER_NOT_FOUND: ${body.message}`
1226
+ `EMPTY_TAG: ${body.message}`
1251
1227
  );
1252
1228
  this.body = body;
1253
- this.name = "OrderNotFoundError";
1229
+ this.name = "EmptyTagError";
1254
1230
  }
1255
- static code = "ORDER_NOT_FOUND";
1256
- static statusCode = 404;
1257
- static description = `No certificate order found for domain`;
1231
+ static code = "EMPTY_TAG";
1232
+ static statusCode = 400;
1233
+ static description = `Invalid request: tag cannot be empty`;
1258
1234
  }
1259
1235
  class ResizeFailedError extends Error {
1260
1236
  constructor(body) {
@@ -1508,73 +1484,349 @@ class DevServerNotFoundError extends Error {
1508
1484
  static statusCode = 404;
1509
1485
  static description = `Dev server not found: {server_id}`;
1510
1486
  }
1511
- class ExecuteInternalErrorError extends Error {
1487
+ class AnyhowError extends Error {
1512
1488
  constructor(body) {
1513
1489
  super(
1514
- `EXECUTE_INTERNAL_ERROR: ${body.message}`
1490
+ `ANYHOW: ${body.message}`
1515
1491
  );
1516
1492
  this.body = body;
1517
- this.name = "ExecuteInternalErrorError";
1493
+ this.name = "AnyhowError";
1518
1494
  }
1519
- static code = "EXECUTE_INTERNAL_ERROR";
1495
+ static code = "ANYHOW";
1520
1496
  static statusCode = 500;
1521
- static description = `Internal error: {message}`;
1497
+ static description = `Internal server error: {0}`;
1522
1498
  }
1523
- class ExecuteAccessDeniedError extends Error {
1499
+ class BranchNameEmptyError extends Error {
1524
1500
  constructor(body) {
1525
1501
  super(
1526
- `EXECUTE_ACCESS_DENIED: ${body.message}`
1502
+ `BRANCH_NAME_EMPTY: ${body.message}`
1527
1503
  );
1528
1504
  this.body = body;
1529
- this.name = "ExecuteAccessDeniedError";
1505
+ this.name = "BranchNameEmptyError";
1530
1506
  }
1531
- static code = "EXECUTE_ACCESS_DENIED";
1532
- static statusCode = 403;
1533
- static description = `Access denied to execute run`;
1507
+ static code = "BRANCH_NAME_EMPTY";
1508
+ static statusCode = 400;
1509
+ static description = `Branch name cannot be empty`;
1534
1510
  }
1535
- class ListRunsFailedError extends Error {
1511
+ class PermissionAlreadyExistsError extends Error {
1536
1512
  constructor(body) {
1537
1513
  super(
1538
- `LIST_RUNS_FAILED: ${body.message}`
1514
+ `PERMISSION_ALREADY_EXISTS: ${body.message}`
1539
1515
  );
1540
1516
  this.body = body;
1541
- this.name = "ListRunsFailedError";
1517
+ this.name = "PermissionAlreadyExistsError";
1542
1518
  }
1543
- static code = "LIST_RUNS_FAILED";
1544
- static statusCode = 500;
1545
- static description = `Failed to list execute runs: {message}`;
1519
+ static code = "PERMISSION_ALREADY_EXISTS";
1520
+ static statusCode = 409;
1521
+ static description = `Permission already exists`;
1546
1522
  }
1547
- class ExecutionErrorError extends Error {
1523
+ class ListTokensFailedError extends Error {
1548
1524
  constructor(body) {
1549
1525
  super(
1550
- `EXECUTION_ERROR: ${body.message}`
1526
+ `LIST_TOKENS_FAILED: ${body.message}`
1551
1527
  );
1552
1528
  this.body = body;
1553
- this.name = "ExecutionErrorError";
1529
+ this.name = "ListTokensFailedError";
1554
1530
  }
1555
- static code = "EXECUTION_ERROR";
1531
+ static code = "LIST_TOKENS_FAILED";
1556
1532
  static statusCode = 500;
1557
- static description = `Script execution error: {message}`;
1533
+ static description = `Failed to list tokens: {message}`;
1558
1534
  }
1559
- class ConnectionFailedError extends Error {
1535
+ class RevokeTokenFailedError extends Error {
1560
1536
  constructor(body) {
1561
1537
  super(
1562
- `CONNECTION_FAILED: ${body.message}`
1538
+ `REVOKE_TOKEN_FAILED: ${body.message}`
1563
1539
  );
1564
1540
  this.body = body;
1565
- this.name = "ConnectionFailedError";
1541
+ this.name = "RevokeTokenFailedError";
1566
1542
  }
1567
- static code = "CONNECTION_FAILED";
1543
+ static code = "REVOKE_TOKEN_FAILED";
1568
1544
  static statusCode = 500;
1569
- static description = `Failed to connect to execute server: {message}`;
1545
+ static description = `Failed to revoke token: {message}`;
1570
1546
  }
1571
- class MetadataWriteFailedError extends Error {
1547
+ class CreateTokenFailedError extends Error {
1572
1548
  constructor(body) {
1573
1549
  super(
1574
- `METADATA_WRITE_FAILED: ${body.message}`
1550
+ `CREATE_TOKEN_FAILED: ${body.message}`
1575
1551
  );
1576
1552
  this.body = body;
1577
- this.name = "MetadataWriteFailedError";
1553
+ this.name = "CreateTokenFailedError";
1554
+ }
1555
+ static code = "CREATE_TOKEN_FAILED";
1556
+ static statusCode = 500;
1557
+ static description = `Failed to create token: {message}`;
1558
+ }
1559
+ class ListPermissionsFailedError extends Error {
1560
+ constructor(body) {
1561
+ super(
1562
+ `LIST_PERMISSIONS_FAILED: ${body.message}`
1563
+ );
1564
+ this.body = body;
1565
+ this.name = "ListPermissionsFailedError";
1566
+ }
1567
+ static code = "LIST_PERMISSIONS_FAILED";
1568
+ static statusCode = 500;
1569
+ static description = `Failed to list permissions: {message}`;
1570
+ }
1571
+ class GetPermissionFailedError extends Error {
1572
+ constructor(body) {
1573
+ super(
1574
+ `GET_PERMISSION_FAILED: ${body.message}`
1575
+ );
1576
+ this.body = body;
1577
+ this.name = "GetPermissionFailedError";
1578
+ }
1579
+ static code = "GET_PERMISSION_FAILED";
1580
+ static statusCode = 500;
1581
+ static description = `Failed to get permission: {message}`;
1582
+ }
1583
+ class UpdatePermissionFailedError extends Error {
1584
+ constructor(body) {
1585
+ super(
1586
+ `UPDATE_PERMISSION_FAILED: ${body.message}`
1587
+ );
1588
+ this.body = body;
1589
+ this.name = "UpdatePermissionFailedError";
1590
+ }
1591
+ static code = "UPDATE_PERMISSION_FAILED";
1592
+ static statusCode = 500;
1593
+ static description = `Failed to update permission: {message}`;
1594
+ }
1595
+ class RevokePermissionFailedError extends Error {
1596
+ constructor(body) {
1597
+ super(
1598
+ `REVOKE_PERMISSION_FAILED: ${body.message}`
1599
+ );
1600
+ this.body = body;
1601
+ this.name = "RevokePermissionFailedError";
1602
+ }
1603
+ static code = "REVOKE_PERMISSION_FAILED";
1604
+ static statusCode = 500;
1605
+ static description = `Failed to revoke permission: {message}`;
1606
+ }
1607
+ class GrantPermissionFailedError extends Error {
1608
+ constructor(body) {
1609
+ super(
1610
+ `GRANT_PERMISSION_FAILED: ${body.message}`
1611
+ );
1612
+ this.body = body;
1613
+ this.name = "GrantPermissionFailedError";
1614
+ }
1615
+ static code = "GRANT_PERMISSION_FAILED";
1616
+ static statusCode = 500;
1617
+ static description = `Failed to grant permission: {message}`;
1618
+ }
1619
+ class ListIdentitiesFailedError extends Error {
1620
+ constructor(body) {
1621
+ super(
1622
+ `LIST_IDENTITIES_FAILED: ${body.message}`
1623
+ );
1624
+ this.body = body;
1625
+ this.name = "ListIdentitiesFailedError";
1626
+ }
1627
+ static code = "LIST_IDENTITIES_FAILED";
1628
+ static statusCode = 500;
1629
+ static description = `Failed to list identities: {message}`;
1630
+ }
1631
+ class DeleteIdentityFailedError extends Error {
1632
+ constructor(body) {
1633
+ super(
1634
+ `DELETE_IDENTITY_FAILED: ${body.message}`
1635
+ );
1636
+ this.body = body;
1637
+ this.name = "DeleteIdentityFailedError";
1638
+ }
1639
+ static code = "DELETE_IDENTITY_FAILED";
1640
+ static statusCode = 500;
1641
+ static description = `Failed to delete identity: {message}`;
1642
+ }
1643
+ class CreateIdentityFailedError extends Error {
1644
+ constructor(body) {
1645
+ super(
1646
+ `CREATE_IDENTITY_FAILED: ${body.message}`
1647
+ );
1648
+ this.body = body;
1649
+ this.name = "CreateIdentityFailedError";
1650
+ }
1651
+ static code = "CREATE_IDENTITY_FAILED";
1652
+ static statusCode = 500;
1653
+ static description = `Failed to create identity: {message}`;
1654
+ }
1655
+ class VmPermissionNotFoundError extends Error {
1656
+ constructor(body) {
1657
+ super(
1658
+ `VM_PERMISSION_NOT_FOUND: ${body.message}`
1659
+ );
1660
+ this.body = body;
1661
+ this.name = "VmPermissionNotFoundError";
1662
+ }
1663
+ static code = "VM_PERMISSION_NOT_FOUND";
1664
+ static statusCode = 404;
1665
+ static description = `VM permission not found`;
1666
+ }
1667
+ class PermissionNotFoundError extends Error {
1668
+ constructor(body) {
1669
+ super(
1670
+ `PERMISSION_NOT_FOUND: ${body.message}`
1671
+ );
1672
+ this.body = body;
1673
+ this.name = "PermissionNotFoundError";
1674
+ }
1675
+ static code = "PERMISSION_NOT_FOUND";
1676
+ static statusCode = 404;
1677
+ static description = `Permission not found`;
1678
+ }
1679
+ class VmAccessDeniedError extends Error {
1680
+ constructor(body) {
1681
+ super(
1682
+ `VM_ACCESS_DENIED: ${body.message}`
1683
+ );
1684
+ this.body = body;
1685
+ this.name = "VmAccessDeniedError";
1686
+ }
1687
+ static code = "VM_ACCESS_DENIED";
1688
+ static statusCode = 403;
1689
+ static description = `You are not allowed to access this VM`;
1690
+ }
1691
+ class GitRepositoryAccessDeniedError extends Error {
1692
+ constructor(body) {
1693
+ super(
1694
+ `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
1695
+ );
1696
+ this.body = body;
1697
+ this.name = "GitRepositoryAccessDeniedError";
1698
+ }
1699
+ static code = "GIT_REPOSITORY_ACCESS_DENIED";
1700
+ static statusCode = 403;
1701
+ static description = `You are not allowed to access this repository`;
1702
+ }
1703
+ class GitRepositoryNotFoundError extends Error {
1704
+ constructor(body) {
1705
+ super(
1706
+ `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
1707
+ );
1708
+ this.body = body;
1709
+ this.name = "GitRepositoryNotFoundError";
1710
+ }
1711
+ static code = "GIT_REPOSITORY_NOT_FOUND";
1712
+ static statusCode = 404;
1713
+ static description = `Repository not found`;
1714
+ }
1715
+ class CannotDeleteManagedIdentityError extends Error {
1716
+ constructor(body) {
1717
+ super(
1718
+ `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
1719
+ );
1720
+ this.body = body;
1721
+ this.name = "CannotDeleteManagedIdentityError";
1722
+ }
1723
+ static code = "CANNOT_DELETE_MANAGED_IDENTITY";
1724
+ static statusCode = 403;
1725
+ static description = `Cannot delete managed identities`;
1726
+ }
1727
+ class CannotModifyManagedIdentityError extends Error {
1728
+ constructor(body) {
1729
+ super(
1730
+ `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
1731
+ );
1732
+ this.body = body;
1733
+ this.name = "CannotModifyManagedIdentityError";
1734
+ }
1735
+ static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
1736
+ static statusCode = 403;
1737
+ static description = `Cannot modify managed identities`;
1738
+ }
1739
+ class IdentityAccessDeniedError extends Error {
1740
+ constructor(body) {
1741
+ super(
1742
+ `IDENTITY_ACCESS_DENIED: ${body.message}`
1743
+ );
1744
+ this.body = body;
1745
+ this.name = "IdentityAccessDeniedError";
1746
+ }
1747
+ static code = "IDENTITY_ACCESS_DENIED";
1748
+ static statusCode = 403;
1749
+ static description = `You are not allowed to access this identity`;
1750
+ }
1751
+ class IdentityNotFoundError extends Error {
1752
+ constructor(body) {
1753
+ super(
1754
+ `IDENTITY_NOT_FOUND: ${body.message}`
1755
+ );
1756
+ this.body = body;
1757
+ this.name = "IdentityNotFoundError";
1758
+ }
1759
+ static code = "IDENTITY_NOT_FOUND";
1760
+ static statusCode = 404;
1761
+ static description = `Identity not found`;
1762
+ }
1763
+ class ExecuteInternalErrorError extends Error {
1764
+ constructor(body) {
1765
+ super(
1766
+ `EXECUTE_INTERNAL_ERROR: ${body.message}`
1767
+ );
1768
+ this.body = body;
1769
+ this.name = "ExecuteInternalErrorError";
1770
+ }
1771
+ static code = "EXECUTE_INTERNAL_ERROR";
1772
+ static statusCode = 500;
1773
+ static description = `Internal error: {message}`;
1774
+ }
1775
+ class ExecuteAccessDeniedError extends Error {
1776
+ constructor(body) {
1777
+ super(
1778
+ `EXECUTE_ACCESS_DENIED: ${body.message}`
1779
+ );
1780
+ this.body = body;
1781
+ this.name = "ExecuteAccessDeniedError";
1782
+ }
1783
+ static code = "EXECUTE_ACCESS_DENIED";
1784
+ static statusCode = 403;
1785
+ static description = `Access denied to execute run`;
1786
+ }
1787
+ class ListRunsFailedError extends Error {
1788
+ constructor(body) {
1789
+ super(
1790
+ `LIST_RUNS_FAILED: ${body.message}`
1791
+ );
1792
+ this.body = body;
1793
+ this.name = "ListRunsFailedError";
1794
+ }
1795
+ static code = "LIST_RUNS_FAILED";
1796
+ static statusCode = 500;
1797
+ static description = `Failed to list execute runs: {message}`;
1798
+ }
1799
+ class ExecutionErrorError extends Error {
1800
+ constructor(body) {
1801
+ super(
1802
+ `EXECUTION_ERROR: ${body.message}`
1803
+ );
1804
+ this.body = body;
1805
+ this.name = "ExecutionErrorError";
1806
+ }
1807
+ static code = "EXECUTION_ERROR";
1808
+ static statusCode = 500;
1809
+ static description = `Script execution error: {message}`;
1810
+ }
1811
+ class ConnectionFailedError extends Error {
1812
+ constructor(body) {
1813
+ super(
1814
+ `CONNECTION_FAILED: ${body.message}`
1815
+ );
1816
+ this.body = body;
1817
+ this.name = "ConnectionFailedError";
1818
+ }
1819
+ static code = "CONNECTION_FAILED";
1820
+ static statusCode = 500;
1821
+ static description = `Failed to connect to execute server: {message}`;
1822
+ }
1823
+ class MetadataWriteFailedError extends Error {
1824
+ constructor(body) {
1825
+ super(
1826
+ `METADATA_WRITE_FAILED: ${body.message}`
1827
+ );
1828
+ this.body = body;
1829
+ this.name = "MetadataWriteFailedError";
1578
1830
  }
1579
1831
  static code = "METADATA_WRITE_FAILED";
1580
1832
  static statusCode = 500;
@@ -1676,42 +1928,6 @@ class RunNotFoundError extends Error {
1676
1928
  static statusCode = 404;
1677
1929
  static description = `Execute run not found: {run_id}`;
1678
1930
  }
1679
- class EmptyTagError extends Error {
1680
- constructor(body) {
1681
- super(
1682
- `EMPTY_TAG: ${body.message}`
1683
- );
1684
- this.body = body;
1685
- this.name = "EmptyTagError";
1686
- }
1687
- static code = "EMPTY_TAG";
1688
- static statusCode = 400;
1689
- static description = `Invalid request: tag cannot be empty`;
1690
- }
1691
- class AnyhowError extends Error {
1692
- constructor(body) {
1693
- super(
1694
- `ANYHOW: ${body.message}`
1695
- );
1696
- this.body = body;
1697
- this.name = "AnyhowError";
1698
- }
1699
- static code = "ANYHOW";
1700
- static statusCode = 500;
1701
- static description = `Internal server error: {0}`;
1702
- }
1703
- class BranchNameEmptyError extends Error {
1704
- constructor(body) {
1705
- super(
1706
- `BRANCH_NAME_EMPTY: ${body.message}`
1707
- );
1708
- this.body = body;
1709
- this.name = "BranchNameEmptyError";
1710
- }
1711
- static code = "BRANCH_NAME_EMPTY";
1712
- static statusCode = 400;
1713
- static description = `Branch name cannot be empty`;
1714
- }
1715
1931
  class CloudstateInternalErrorError extends Error {
1716
1932
  constructor(body) {
1717
1933
  super(
@@ -1820,269 +2036,161 @@ class ProjectNotFoundError extends Error {
1820
2036
  static statusCode = 404;
1821
2037
  static description = `Project not found: {project_id}`;
1822
2038
  }
1823
- class PermissionAlreadyExistsError extends Error {
1824
- constructor(body) {
1825
- super(
1826
- `PERMISSION_ALREADY_EXISTS: ${body.message}`
1827
- );
1828
- this.body = body;
1829
- this.name = "PermissionAlreadyExistsError";
1830
- }
1831
- static code = "PERMISSION_ALREADY_EXISTS";
1832
- static statusCode = 409;
1833
- static description = `Permission already exists`;
1834
- }
1835
- class ListTokensFailedError extends Error {
1836
- constructor(body) {
1837
- super(
1838
- `LIST_TOKENS_FAILED: ${body.message}`
1839
- );
1840
- this.body = body;
1841
- this.name = "ListTokensFailedError";
1842
- }
1843
- static code = "LIST_TOKENS_FAILED";
1844
- static statusCode = 500;
1845
- static description = `Failed to list tokens: {message}`;
1846
- }
1847
- class RevokeTokenFailedError extends Error {
1848
- constructor(body) {
1849
- super(
1850
- `REVOKE_TOKEN_FAILED: ${body.message}`
1851
- );
1852
- this.body = body;
1853
- this.name = "RevokeTokenFailedError";
1854
- }
1855
- static code = "REVOKE_TOKEN_FAILED";
1856
- static statusCode = 500;
1857
- static description = `Failed to revoke token: {message}`;
1858
- }
1859
- class CreateTokenFailedError extends Error {
1860
- constructor(body) {
1861
- super(
1862
- `CREATE_TOKEN_FAILED: ${body.message}`
1863
- );
1864
- this.body = body;
1865
- this.name = "CreateTokenFailedError";
1866
- }
1867
- static code = "CREATE_TOKEN_FAILED";
1868
- static statusCode = 500;
1869
- static description = `Failed to create token: {message}`;
1870
- }
1871
- class ListPermissionsFailedError extends Error {
1872
- constructor(body) {
1873
- super(
1874
- `LIST_PERMISSIONS_FAILED: ${body.message}`
1875
- );
1876
- this.body = body;
1877
- this.name = "ListPermissionsFailedError";
1878
- }
1879
- static code = "LIST_PERMISSIONS_FAILED";
1880
- static statusCode = 500;
1881
- static description = `Failed to list permissions: {message}`;
1882
- }
1883
- class GetPermissionFailedError extends Error {
1884
- constructor(body) {
1885
- super(
1886
- `GET_PERMISSION_FAILED: ${body.message}`
1887
- );
1888
- this.body = body;
1889
- this.name = "GetPermissionFailedError";
1890
- }
1891
- static code = "GET_PERMISSION_FAILED";
1892
- static statusCode = 500;
1893
- static description = `Failed to get permission: {message}`;
1894
- }
1895
- class UpdatePermissionFailedError extends Error {
1896
- constructor(body) {
1897
- super(
1898
- `UPDATE_PERMISSION_FAILED: ${body.message}`
1899
- );
1900
- this.body = body;
1901
- this.name = "UpdatePermissionFailedError";
1902
- }
1903
- static code = "UPDATE_PERMISSION_FAILED";
1904
- static statusCode = 500;
1905
- static description = `Failed to update permission: {message}`;
1906
- }
1907
- class RevokePermissionFailedError extends Error {
1908
- constructor(body) {
1909
- super(
1910
- `REVOKE_PERMISSION_FAILED: ${body.message}`
1911
- );
1912
- this.body = body;
1913
- this.name = "RevokePermissionFailedError";
1914
- }
1915
- static code = "REVOKE_PERMISSION_FAILED";
1916
- static statusCode = 500;
1917
- static description = `Failed to revoke permission: {message}`;
1918
- }
1919
- class GrantPermissionFailedError extends Error {
1920
- constructor(body) {
1921
- super(
1922
- `GRANT_PERMISSION_FAILED: ${body.message}`
1923
- );
1924
- this.body = body;
1925
- this.name = "GrantPermissionFailedError";
1926
- }
1927
- static code = "GRANT_PERMISSION_FAILED";
1928
- static statusCode = 500;
1929
- static description = `Failed to grant permission: {message}`;
1930
- }
1931
- class ListIdentitiesFailedError extends Error {
2039
+ class UnauthorizedErrorError extends Error {
1932
2040
  constructor(body) {
1933
2041
  super(
1934
- `LIST_IDENTITIES_FAILED: ${body.message}`
2042
+ `UNAUTHORIZED_ERROR: ${body.message}`
1935
2043
  );
1936
2044
  this.body = body;
1937
- this.name = "ListIdentitiesFailedError";
2045
+ this.name = "UnauthorizedErrorError";
1938
2046
  }
1939
- static code = "LIST_IDENTITIES_FAILED";
1940
- static statusCode = 500;
1941
- static description = `Failed to list identities: {message}`;
2047
+ static code = "UNAUTHORIZED_ERROR";
2048
+ static statusCode = 401;
2049
+ static description = `Unauthorized request to {route}`;
1942
2050
  }
1943
- class DeleteIdentityFailedError extends Error {
2051
+ class BuildFailedError extends Error {
1944
2052
  constructor(body) {
1945
2053
  super(
1946
- `DELETE_IDENTITY_FAILED: ${body.message}`
2054
+ `BUILD_FAILED: ${body.message}`
1947
2055
  );
1948
2056
  this.body = body;
1949
- this.name = "DeleteIdentityFailedError";
2057
+ this.name = "BuildFailedError";
1950
2058
  }
1951
- static code = "DELETE_IDENTITY_FAILED";
2059
+ static code = "BUILD_FAILED";
1952
2060
  static statusCode = 500;
1953
- static description = `Failed to delete identity: {message}`;
2061
+ static description = `Build failed on VM {vm_id}`;
1954
2062
  }
1955
- class CreateIdentityFailedError extends Error {
2063
+ class ServerDeploymentFailedError extends Error {
1956
2064
  constructor(body) {
1957
2065
  super(
1958
- `CREATE_IDENTITY_FAILED: ${body.message}`
2066
+ `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1959
2067
  );
1960
2068
  this.body = body;
1961
- this.name = "CreateIdentityFailedError";
2069
+ this.name = "ServerDeploymentFailedError";
1962
2070
  }
1963
- static code = "CREATE_IDENTITY_FAILED";
1964
- static statusCode = 500;
1965
- static description = `Failed to create identity: {message}`;
2071
+ static code = "SERVER_DEPLOYMENT_FAILED";
2072
+ static statusCode = 502;
2073
+ static description = `Failed to deploy to servers`;
1966
2074
  }
1967
- class VmPermissionNotFoundError extends Error {
2075
+ class LockfileErrorError extends Error {
1968
2076
  constructor(body) {
1969
2077
  super(
1970
- `VM_PERMISSION_NOT_FOUND: ${body.message}`
2078
+ `LOCKFILE_ERROR: ${body.message}`
1971
2079
  );
1972
2080
  this.body = body;
1973
- this.name = "VmPermissionNotFoundError";
2081
+ this.name = "LockfileErrorError";
1974
2082
  }
1975
- static code = "VM_PERMISSION_NOT_FOUND";
1976
- static statusCode = 404;
1977
- static description = `VM permission not found`;
2083
+ static code = "LOCKFILE_ERROR";
2084
+ static statusCode = 500;
2085
+ static description = `Failed to generate dependency lockfile: {message}`;
1978
2086
  }
1979
- class PermissionNotFoundError extends Error {
2087
+ class UploadErrorError extends Error {
1980
2088
  constructor(body) {
1981
2089
  super(
1982
- `PERMISSION_NOT_FOUND: ${body.message}`
2090
+ `UPLOAD_ERROR: ${body.message}`
1983
2091
  );
1984
2092
  this.body = body;
1985
- this.name = "PermissionNotFoundError";
2093
+ this.name = "UploadErrorError";
1986
2094
  }
1987
- static code = "PERMISSION_NOT_FOUND";
1988
- static statusCode = 404;
1989
- static description = `Permission not found`;
2095
+ static code = "UPLOAD_ERROR";
2096
+ static statusCode = 500;
2097
+ static description = `Failed to upload deployment to storage`;
1990
2098
  }
1991
- class VmAccessDeniedError extends Error {
2099
+ class DomainMappingErrorError extends Error {
1992
2100
  constructor(body) {
1993
2101
  super(
1994
- `VM_ACCESS_DENIED: ${body.message}`
2102
+ `DOMAIN_MAPPING_ERROR: ${body.message}`
1995
2103
  );
1996
2104
  this.body = body;
1997
- this.name = "VmAccessDeniedError";
2105
+ this.name = "DomainMappingErrorError";
1998
2106
  }
1999
- static code = "VM_ACCESS_DENIED";
2000
- static statusCode = 403;
2001
- static description = `You are not allowed to access this VM`;
2107
+ static code = "DOMAIN_MAPPING_ERROR";
2108
+ static statusCode = 500;
2109
+ static description = `Failed to configure domain mapping for: {domain}`;
2002
2110
  }
2003
- class GitRepositoryAccessDeniedError extends Error {
2111
+ class CertificateProvisioningErrorError extends Error {
2004
2112
  constructor(body) {
2005
2113
  super(
2006
- `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
2114
+ `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
2007
2115
  );
2008
2116
  this.body = body;
2009
- this.name = "GitRepositoryAccessDeniedError";
2117
+ this.name = "CertificateProvisioningErrorError";
2010
2118
  }
2011
- static code = "GIT_REPOSITORY_ACCESS_DENIED";
2012
- static statusCode = 403;
2013
- static description = `You are not allowed to access this repository`;
2119
+ static code = "CERTIFICATE_PROVISIONING_ERROR";
2120
+ static statusCode = 502;
2121
+ static description = `Failed to provision certificate for domain: {domain}`;
2014
2122
  }
2015
- class GitRepositoryNotFoundError extends Error {
2123
+ class NoEntrypointFoundError extends Error {
2016
2124
  constructor(body) {
2017
2125
  super(
2018
- `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
2126
+ `NO_ENTRYPOINT_FOUND: ${body.message}`
2019
2127
  );
2020
2128
  this.body = body;
2021
- this.name = "GitRepositoryNotFoundError";
2129
+ this.name = "NoEntrypointFoundError";
2022
2130
  }
2023
- static code = "GIT_REPOSITORY_NOT_FOUND";
2024
- static statusCode = 404;
2025
- static description = `Repository not found`;
2131
+ static code = "NO_ENTRYPOINT_FOUND";
2132
+ static statusCode = 400;
2133
+ static description = `No entrypoint found in deployment`;
2026
2134
  }
2027
- class CannotDeleteManagedIdentityError extends Error {
2135
+ class EntrypointNotFoundError extends Error {
2028
2136
  constructor(body) {
2029
2137
  super(
2030
- `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
2138
+ `ENTRYPOINT_NOT_FOUND: ${body.message}`
2031
2139
  );
2032
2140
  this.body = body;
2033
- this.name = "CannotDeleteManagedIdentityError";
2141
+ this.name = "EntrypointNotFoundError";
2034
2142
  }
2035
- static code = "CANNOT_DELETE_MANAGED_IDENTITY";
2036
- static statusCode = 403;
2037
- static description = `Cannot delete managed identities`;
2143
+ static code = "ENTRYPOINT_NOT_FOUND";
2144
+ static statusCode = 400;
2145
+ static description = `Entrypoint not found: {entrypoint}`;
2038
2146
  }
2039
- class CannotModifyManagedIdentityError extends Error {
2147
+ class NoDomainOwnershipError extends Error {
2040
2148
  constructor(body) {
2041
2149
  super(
2042
- `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
2150
+ `NO_DOMAIN_OWNERSHIP: ${body.message}`
2043
2151
  );
2044
2152
  this.body = body;
2045
- this.name = "CannotModifyManagedIdentityError";
2153
+ this.name = "NoDomainOwnershipError";
2046
2154
  }
2047
- static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
2155
+ static code = "NO_DOMAIN_OWNERSHIP";
2048
2156
  static statusCode = 403;
2049
- static description = `Cannot modify managed identities`;
2157
+ static description = `No domain ownership for: {domain}`;
2050
2158
  }
2051
- class IdentityAccessDeniedError extends Error {
2159
+ class InvalidDomainsError extends Error {
2052
2160
  constructor(body) {
2053
2161
  super(
2054
- `IDENTITY_ACCESS_DENIED: ${body.message}`
2162
+ `INVALID_DOMAINS: ${body.message}`
2055
2163
  );
2056
2164
  this.body = body;
2057
- this.name = "IdentityAccessDeniedError";
2165
+ this.name = "InvalidDomainsError";
2058
2166
  }
2059
- static code = "IDENTITY_ACCESS_DENIED";
2060
- static statusCode = 403;
2061
- static description = `You are not allowed to access this identity`;
2167
+ static code = "INVALID_DOMAINS";
2168
+ static statusCode = 400;
2169
+ static description = `Invalid domains provided`;
2062
2170
  }
2063
- class IdentityNotFoundError extends Error {
2171
+ class WebDeploymentBadRequestError extends Error {
2064
2172
  constructor(body) {
2065
2173
  super(
2066
- `IDENTITY_NOT_FOUND: ${body.message}`
2174
+ `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
2067
2175
  );
2068
2176
  this.body = body;
2069
- this.name = "IdentityNotFoundError";
2177
+ this.name = "WebDeploymentBadRequestError";
2070
2178
  }
2071
- static code = "IDENTITY_NOT_FOUND";
2072
- static statusCode = 404;
2073
- static description = `Identity not found`;
2179
+ static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2180
+ static statusCode = 400;
2181
+ static description = `Bad request: {message}`;
2074
2182
  }
2075
- class UnauthorizedErrorError extends Error {
2183
+ class DeploymentNotFoundError extends Error {
2076
2184
  constructor(body) {
2077
2185
  super(
2078
- `UNAUTHORIZED_ERROR: ${body.message}`
2186
+ `DEPLOYMENT_NOT_FOUND: ${body.message}`
2079
2187
  );
2080
2188
  this.body = body;
2081
- this.name = "UnauthorizedErrorError";
2189
+ this.name = "DeploymentNotFoundError";
2082
2190
  }
2083
- static code = "UNAUTHORIZED_ERROR";
2084
- static statusCode = 401;
2085
- static description = `Unauthorized request to {route}`;
2191
+ static code = "DEPLOYMENT_NOT_FOUND";
2192
+ static statusCode = 404;
2193
+ static description = `Deployment not found`;
2086
2194
  }
2087
2195
  class ObservabilityDatabaseErrorError extends Error {
2088
2196
  constructor(body) {
@@ -2406,271 +2514,127 @@ class FailedToInsertDomainMappingError extends Error {
2406
2514
  }
2407
2515
  static code = "FAILED_TO_INSERT_DOMAIN_MAPPING";
2408
2516
  static statusCode = 500;
2409
- static description = `Failed to insert domain mapping: {message}`;
2410
- }
2411
- class PermissionDeniedError extends Error {
2412
- constructor(body) {
2413
- super(
2414
- `PERMISSION_DENIED: ${body.message}`
2415
- );
2416
- this.body = body;
2417
- this.name = "PermissionDeniedError";
2418
- }
2419
- static code = "PERMISSION_DENIED";
2420
- static statusCode = 401;
2421
- static description = `Permission denied: {message}`;
2422
- }
2423
- class FailedToCheckPermissionsError extends Error {
2424
- constructor(body) {
2425
- super(
2426
- `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
2427
- );
2428
- this.body = body;
2429
- this.name = "FailedToCheckPermissionsError";
2430
- }
2431
- static code = "FAILED_TO_CHECK_PERMISSIONS";
2432
- static statusCode = 502;
2433
- static description = `Failed to check permissions: {message}`;
2434
- }
2435
- class FailedToListDomainsError extends Error {
2436
- constructor(body) {
2437
- super(
2438
- `FAILED_TO_LIST_DOMAINS: ${body.message}`
2439
- );
2440
- this.body = body;
2441
- this.name = "FailedToListDomainsError";
2442
- }
2443
- static code = "FAILED_TO_LIST_DOMAINS";
2444
- static statusCode = 500;
2445
- static description = `Failed to list domains: {message}`;
2446
- }
2447
- class FailedToListVerificationsError extends Error {
2448
- constructor(body) {
2449
- super(
2450
- `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
2451
- );
2452
- this.body = body;
2453
- this.name = "FailedToListVerificationsError";
2454
- }
2455
- static code = "FAILED_TO_LIST_VERIFICATIONS";
2456
- static statusCode = 500;
2457
- static description = `Failed to list verifications: {message}`;
2458
- }
2459
- class FailedToVerifyDomainError extends Error {
2460
- constructor(body) {
2461
- super(
2462
- `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
2463
- );
2464
- this.body = body;
2465
- this.name = "FailedToVerifyDomainError";
2466
- }
2467
- static code = "FAILED_TO_VERIFY_DOMAIN";
2468
- static statusCode = 500;
2469
- static description = `Failed to verify domain: {message}`;
2470
- }
2471
- class VerificationFailedError extends Error {
2472
- constructor(body) {
2473
- super(
2474
- `VERIFICATION_FAILED: ${body.message}`
2475
- );
2476
- this.body = body;
2477
- this.name = "VerificationFailedError";
2478
- }
2479
- static code = "VERIFICATION_FAILED";
2480
- static statusCode = 400;
2481
- static description = `Domain verification failed: {message}`;
2482
- }
2483
- class FailedToDeleteVerificationError extends Error {
2484
- constructor(body) {
2485
- super(
2486
- `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
2487
- );
2488
- this.body = body;
2489
- this.name = "FailedToDeleteVerificationError";
2490
- }
2491
- static code = "FAILED_TO_DELETE_VERIFICATION";
2492
- static statusCode = 400;
2493
- static description = `Failed to delete verification: {message}`;
2494
- }
2495
- class VerificationNotFoundError extends Error {
2496
- constructor(body) {
2497
- super(
2498
- `VERIFICATION_NOT_FOUND: ${body.message}`
2499
- );
2500
- this.body = body;
2501
- this.name = "VerificationNotFoundError";
2502
- }
2503
- static code = "VERIFICATION_NOT_FOUND";
2504
- static statusCode = 404;
2505
- static description = `Verification request not found for domain: {domain}`;
2506
- }
2507
- class FailedToCreateVerificationCodeError extends Error {
2508
- constructor(body) {
2509
- super(
2510
- `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
2511
- );
2512
- this.body = body;
2513
- this.name = "FailedToCreateVerificationCodeError";
2514
- }
2515
- static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
2516
- static statusCode = 400;
2517
- static description = `Failed to create verification code: {message}`;
2518
- }
2519
- class InvalidDomainError extends Error {
2520
- constructor(body) {
2521
- super(
2522
- `INVALID_DOMAIN: ${body.message}`
2523
- );
2524
- this.body = body;
2525
- this.name = "InvalidDomainError";
2526
- }
2527
- static code = "INVALID_DOMAIN";
2528
- static statusCode = 400;
2529
- static description = `Invalid domain: {domain}`;
2530
- }
2531
- class BuildFailedError extends Error {
2532
- constructor(body) {
2533
- super(
2534
- `BUILD_FAILED: ${body.message}`
2535
- );
2536
- this.body = body;
2537
- this.name = "BuildFailedError";
2538
- }
2539
- static code = "BUILD_FAILED";
2540
- static statusCode = 500;
2541
- static description = `Build failed on VM {vm_id}`;
2517
+ static description = `Failed to insert domain mapping: {message}`;
2542
2518
  }
2543
- class ServerDeploymentFailedError extends Error {
2519
+ class PermissionDeniedError extends Error {
2544
2520
  constructor(body) {
2545
2521
  super(
2546
- `SERVER_DEPLOYMENT_FAILED: ${body.message}`
2522
+ `PERMISSION_DENIED: ${body.message}`
2547
2523
  );
2548
2524
  this.body = body;
2549
- this.name = "ServerDeploymentFailedError";
2525
+ this.name = "PermissionDeniedError";
2550
2526
  }
2551
- static code = "SERVER_DEPLOYMENT_FAILED";
2552
- static statusCode = 502;
2553
- static description = `Failed to deploy to servers`;
2527
+ static code = "PERMISSION_DENIED";
2528
+ static statusCode = 401;
2529
+ static description = `Permission denied: {message}`;
2554
2530
  }
2555
- class LockfileErrorError extends Error {
2531
+ class FailedToCheckPermissionsError extends Error {
2556
2532
  constructor(body) {
2557
2533
  super(
2558
- `LOCKFILE_ERROR: ${body.message}`
2534
+ `FAILED_TO_CHECK_PERMISSIONS: ${body.message}`
2559
2535
  );
2560
2536
  this.body = body;
2561
- this.name = "LockfileErrorError";
2537
+ this.name = "FailedToCheckPermissionsError";
2562
2538
  }
2563
- static code = "LOCKFILE_ERROR";
2564
- static statusCode = 500;
2565
- static description = `Failed to generate dependency lockfile: {message}`;
2539
+ static code = "FAILED_TO_CHECK_PERMISSIONS";
2540
+ static statusCode = 502;
2541
+ static description = `Failed to check permissions: {message}`;
2566
2542
  }
2567
- class UploadErrorError extends Error {
2543
+ class FailedToListDomainsError extends Error {
2568
2544
  constructor(body) {
2569
2545
  super(
2570
- `UPLOAD_ERROR: ${body.message}`
2546
+ `FAILED_TO_LIST_DOMAINS: ${body.message}`
2571
2547
  );
2572
2548
  this.body = body;
2573
- this.name = "UploadErrorError";
2549
+ this.name = "FailedToListDomainsError";
2574
2550
  }
2575
- static code = "UPLOAD_ERROR";
2551
+ static code = "FAILED_TO_LIST_DOMAINS";
2576
2552
  static statusCode = 500;
2577
- static description = `Failed to upload deployment to storage`;
2553
+ static description = `Failed to list domains: {message}`;
2578
2554
  }
2579
- class DomainMappingErrorError extends Error {
2555
+ class FailedToListVerificationsError extends Error {
2580
2556
  constructor(body) {
2581
2557
  super(
2582
- `DOMAIN_MAPPING_ERROR: ${body.message}`
2558
+ `FAILED_TO_LIST_VERIFICATIONS: ${body.message}`
2583
2559
  );
2584
2560
  this.body = body;
2585
- this.name = "DomainMappingErrorError";
2561
+ this.name = "FailedToListVerificationsError";
2586
2562
  }
2587
- static code = "DOMAIN_MAPPING_ERROR";
2563
+ static code = "FAILED_TO_LIST_VERIFICATIONS";
2588
2564
  static statusCode = 500;
2589
- static description = `Failed to configure domain mapping for: {domain}`;
2565
+ static description = `Failed to list verifications: {message}`;
2590
2566
  }
2591
- class CertificateProvisioningErrorError extends Error {
2567
+ class FailedToVerifyDomainError extends Error {
2592
2568
  constructor(body) {
2593
2569
  super(
2594
- `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
2570
+ `FAILED_TO_VERIFY_DOMAIN: ${body.message}`
2595
2571
  );
2596
2572
  this.body = body;
2597
- this.name = "CertificateProvisioningErrorError";
2573
+ this.name = "FailedToVerifyDomainError";
2598
2574
  }
2599
- static code = "CERTIFICATE_PROVISIONING_ERROR";
2600
- static statusCode = 502;
2601
- static description = `Failed to provision certificate for domain: {domain}`;
2575
+ static code = "FAILED_TO_VERIFY_DOMAIN";
2576
+ static statusCode = 500;
2577
+ static description = `Failed to verify domain: {message}`;
2602
2578
  }
2603
- class NoEntrypointFoundError extends Error {
2579
+ class VerificationFailedError extends Error {
2604
2580
  constructor(body) {
2605
2581
  super(
2606
- `NO_ENTRYPOINT_FOUND: ${body.message}`
2582
+ `VERIFICATION_FAILED: ${body.message}`
2607
2583
  );
2608
2584
  this.body = body;
2609
- this.name = "NoEntrypointFoundError";
2585
+ this.name = "VerificationFailedError";
2610
2586
  }
2611
- static code = "NO_ENTRYPOINT_FOUND";
2587
+ static code = "VERIFICATION_FAILED";
2612
2588
  static statusCode = 400;
2613
- static description = `No entrypoint found in deployment`;
2589
+ static description = `Domain verification failed: {message}`;
2614
2590
  }
2615
- class EntrypointNotFoundError extends Error {
2591
+ class FailedToDeleteVerificationError extends Error {
2616
2592
  constructor(body) {
2617
2593
  super(
2618
- `ENTRYPOINT_NOT_FOUND: ${body.message}`
2594
+ `FAILED_TO_DELETE_VERIFICATION: ${body.message}`
2619
2595
  );
2620
2596
  this.body = body;
2621
- this.name = "EntrypointNotFoundError";
2597
+ this.name = "FailedToDeleteVerificationError";
2622
2598
  }
2623
- static code = "ENTRYPOINT_NOT_FOUND";
2599
+ static code = "FAILED_TO_DELETE_VERIFICATION";
2624
2600
  static statusCode = 400;
2625
- static description = `Entrypoint not found: {entrypoint}`;
2601
+ static description = `Failed to delete verification: {message}`;
2626
2602
  }
2627
- class NoDomainOwnershipError extends Error {
2603
+ class VerificationNotFoundError extends Error {
2628
2604
  constructor(body) {
2629
2605
  super(
2630
- `NO_DOMAIN_OWNERSHIP: ${body.message}`
2606
+ `VERIFICATION_NOT_FOUND: ${body.message}`
2631
2607
  );
2632
2608
  this.body = body;
2633
- this.name = "NoDomainOwnershipError";
2609
+ this.name = "VerificationNotFoundError";
2634
2610
  }
2635
- static code = "NO_DOMAIN_OWNERSHIP";
2636
- static statusCode = 403;
2637
- static description = `No domain ownership for: {domain}`;
2611
+ static code = "VERIFICATION_NOT_FOUND";
2612
+ static statusCode = 404;
2613
+ static description = `Verification request not found for domain: {domain}`;
2638
2614
  }
2639
- class InvalidDomainsError extends Error {
2615
+ class FailedToCreateVerificationCodeError extends Error {
2640
2616
  constructor(body) {
2641
2617
  super(
2642
- `INVALID_DOMAINS: ${body.message}`
2618
+ `FAILED_TO_CREATE_VERIFICATION_CODE: ${body.message}`
2643
2619
  );
2644
2620
  this.body = body;
2645
- this.name = "InvalidDomainsError";
2621
+ this.name = "FailedToCreateVerificationCodeError";
2646
2622
  }
2647
- static code = "INVALID_DOMAINS";
2623
+ static code = "FAILED_TO_CREATE_VERIFICATION_CODE";
2648
2624
  static statusCode = 400;
2649
- static description = `Invalid domains provided`;
2625
+ static description = `Failed to create verification code: {message}`;
2650
2626
  }
2651
- class WebDeploymentBadRequestError extends Error {
2627
+ class InvalidDomainError extends Error {
2652
2628
  constructor(body) {
2653
2629
  super(
2654
- `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
2630
+ `INVALID_DOMAIN: ${body.message}`
2655
2631
  );
2656
2632
  this.body = body;
2657
- this.name = "WebDeploymentBadRequestError";
2633
+ this.name = "InvalidDomainError";
2658
2634
  }
2659
- static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2635
+ static code = "INVALID_DOMAIN";
2660
2636
  static statusCode = 400;
2661
- static description = `Bad request: {message}`;
2662
- }
2663
- class DeploymentNotFoundError extends Error {
2664
- constructor(body) {
2665
- super(
2666
- `DEPLOYMENT_NOT_FOUND: ${body.message}`
2667
- );
2668
- this.body = body;
2669
- this.name = "DeploymentNotFoundError";
2670
- }
2671
- static code = "DEPLOYMENT_NOT_FOUND";
2672
- static statusCode = 404;
2673
- static description = `Deployment not found`;
2637
+ static description = `Invalid domain: {domain}`;
2674
2638
  }
2675
2639
  class DomainAlreadyExistsError extends Error {
2676
2640
  constructor(body) {
@@ -2734,10 +2698,14 @@ class FailedToCheckDomainMappingPermissionsError extends Error {
2734
2698
  }
2735
2699
  const FREESTYLE_ERROR_CODE_MAP = {
2736
2700
  "GIT_ERROR": GitErrorError,
2737
- "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
2738
2701
  "INTERNAL_ERROR": InternalErrorError,
2702
+ "DOCKER_IMPORT_BAD_REQUEST": DockerImportBadRequestError,
2703
+ "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
2704
+ "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
2705
+ "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
2739
2706
  "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
2740
2707
  "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
2708
+ "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
2741
2709
  "VM_DELETED": VmDeletedError,
2742
2710
  "REQWEST": ReqwestError,
2743
2711
  "FIRECRACKER_PID_NOT_FOUND": FirecrackerPidNotFoundError,
@@ -2749,19 +2717,15 @@ const FREESTYLE_ERROR_CODE_MAP = {
2749
2717
  "VM_SUBNET_NOT_FOUND": VmSubnetNotFoundError,
2750
2718
  "FILE_NOT_FOUND": FileNotFoundError,
2751
2719
  "FILES_BAD_REQUEST": FilesBadRequestError,
2752
- "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
2753
- "ALREADY_HAS_BASE": AlreadyHasBaseError,
2754
- "NOT_FOUND": NotFoundError,
2755
2720
  "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
2756
2721
  "VM_NOT_RUNNING": VmNotRunningError,
2757
2722
  "VM_NOT_FOUND": VmNotFoundError,
2758
2723
  "INTERNAL_FORK_VM_NOT_FOUND": InternalForkVmNotFoundError,
2759
2724
  "BAD_REQUEST": BadRequestError,
2760
2725
  "INTERNAL_VM_NOT_FOUND": InternalVmNotFoundError,
2761
- "DOCKER_IMPORT_BAD_REQUEST": DockerImportBadRequestError,
2762
- "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
2763
- "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
2764
- "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
2726
+ "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
2727
+ "ALREADY_HAS_BASE": AlreadyHasBaseError,
2728
+ "NOT_FOUND": NotFoundError,
2765
2729
  "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
2766
2730
  "USER_NOT_FOUND": UserNotFoundError,
2767
2731
  "USER_ALREADY_EXISTS": UserAlreadyExistsError,
@@ -2797,46 +2761,44 @@ const FREESTYLE_ERROR_CODE_MAP = {
2797
2761
  "SERVICE_NOT_FOUND": ServiceNotFoundError,
2798
2762
  "INVALID_REQUEST": InvalidRequestError,
2799
2763
  "REPO_NOT_FOUND": RepoNotFoundError,
2764
+ "RUNTIME_ERROR": RuntimeErrorError,
2765
+ "SYNTAX_ERROR": SyntaxErrorError,
2800
2766
  "INTERNAL": InternalError,
2801
2767
  "SIGNING": SigningError,
2802
2768
  "INVALID_SIGNATURE": InvalidSignatureError,
2803
2769
  "INVALID_PARAMETERS": InvalidParametersError,
2804
2770
  "MAX_USES_EXCEEDED": MaxUsesExceededError,
2805
2771
  "EXPIRED": ExpiredError,
2806
- "CONFLICT": ConflictError,
2807
- "BRANCH_NOT_FOUND": BranchNotFoundError,
2808
- "SEND_ERROR": SendErrorError,
2809
2772
  "FORBIDDEN": ForbiddenError,
2773
+ "UNAUTHORIZED": UnauthorizedError,
2774
+ "INVALID_SERVICE": InvalidServiceError,
2775
+ "EXPECTED_SERVICE": ExpectedServiceError,
2810
2776
  "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
2777
+ "CONFLICT": ConflictError,
2778
+ "BRANCH_NOT_FOUND": BranchNotFoundError,
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,
2811
2785
  "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
2786
+ "TAG_NOT_FOUND": TagNotFoundError,
2787
+ "SEND_ERROR": SendErrorError,
2788
+ "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
2789
+ "INVALID_OBJECT_ID": InvalidObjectIdError,
2790
+ "COMMIT_NOT_FOUND": CommitNotFoundError,
2791
+ "TREE_NOT_FOUND": TreeNotFoundError,
2792
+ "INVALID_REVISION": InvalidRevisionError,
2812
2793
  "INVALID_RANGE": InvalidRangeError,
2813
2794
  "OFFSET_WITH_SELECTOR": OffsetWithSelectorError,
2814
2795
  "COMMIT_NOT_IN_BRANCH": CommitNotInBranchError,
2815
- "COMMIT_NOT_FOUND": CommitNotFoundError,
2816
2796
  "BLOB_NOT_FOUND": BlobNotFoundError,
2817
- "TREE_NOT_FOUND": TreeNotFoundError,
2818
- "INVALID_REVISION": InvalidRevisionError,
2819
- "UNAUTHORIZED": UnauthorizedError,
2820
- "TAG_NOT_FOUND": TagNotFoundError,
2821
- "REPO_ALREADY_EXISTS": RepoAlreadyExistsError,
2822
- "GIT_HUB_SYNC_CONFLICT": GitHubSyncConflictError,
2823
- "INVALID_OBJECT_ID": InvalidObjectIdError,
2824
- "SOURCE_IMPORT_CONFLICT": SourceImportConflictError,
2825
- "SOURCE_UNAUTHORIZED": SourceUnauthorizedError,
2826
- "SOURCE_NOT_FOUND": SourceNotFoundError,
2827
- "IMPORT_SUBDIR_NOT_FOUND": ImportSubdirNotFoundError,
2797
+ "AMBIGUOUS": AmbiguousError,
2798
+ "INVALID": InvalidError,
2828
2799
  "PACKFILE": PackfileError,
2829
- "PATH_NOT_FOUND": PathNotFoundError,
2830
- "INVALID_SERVICE": InvalidServiceError,
2831
- "EXPECTED_SERVICE": ExpectedServiceError,
2832
2800
  "DATABASE_ERROR": DatabaseErrorError,
2833
- "WAIT_TIMEOUT": WaitTimeoutError,
2834
- "PRE_VERIFY_CHALLENGE_MISMATCH": PreVerifyChallengeMismatchError,
2835
- "PRE_VERIFY_FAILED_PARSE": PreVerifyFailedParseError,
2836
- "PRE_VERIFY_FAILED_FETCH": PreVerifyFailedFetchError,
2837
- "PRE_VERIFY_ROUTE_NOT_FOUND": PreVerifyRouteNotFoundError,
2838
- "AUTHORIZATION_NOT_FOUND": AuthorizationNotFoundError,
2839
- "ORDER_NOT_FOUND": OrderNotFoundError,
2801
+ "EMPTY_TAG": EmptyTagError,
2840
2802
  "RESIZE_FAILED": ResizeFailedError,
2841
2803
  "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
2842
2804
  "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
@@ -2858,32 +2820,8 @@ const FREESTYLE_ERROR_CODE_MAP = {
2858
2820
  "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
2859
2821
  "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
2860
2822
  "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
2861
- "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
2862
- "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
2863
- "LIST_RUNS_FAILED": ListRunsFailedError,
2864
- "EXECUTION_ERROR": ExecutionErrorError,
2865
- "CONNECTION_FAILED": ConnectionFailedError,
2866
- "METADATA_WRITE_FAILED": MetadataWriteFailedError,
2867
- "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
2868
- "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
2869
- "LOCK_GENERATION_FAILED": LockGenerationFailedError,
2870
- "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
2871
- "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
2872
- "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
2873
- "LOGGING_FAILED": LoggingFailedError,
2874
- "RUN_NOT_FOUND": RunNotFoundError,
2875
- "EMPTY_TAG": EmptyTagError,
2876
2823
  "ANYHOW": AnyhowError,
2877
2824
  "BRANCH_NAME_EMPTY": BranchNameEmptyError,
2878
- "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
2879
- "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
2880
- "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
2881
- "RESTORE_FAILED": RestoreFailedError,
2882
- "CREATE_BACKUP_FAILED": CreateBackupFailedError,
2883
- "BACKUP_FAILED": BackupFailedError,
2884
- "DEPLOYMENT_FAILED": DeploymentFailedError,
2885
- "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
2886
- "PROJECT_NOT_FOUND": ProjectNotFoundError,
2887
2825
  "PERMISSION_ALREADY_EXISTS": PermissionAlreadyExistsError,
2888
2826
  "LIST_TOKENS_FAILED": ListTokensFailedError,
2889
2827
  "REVOKE_TOKEN_FAILED": RevokeTokenFailedError,
@@ -2905,7 +2843,42 @@ const FREESTYLE_ERROR_CODE_MAP = {
2905
2843
  "CANNOT_MODIFY_MANAGED_IDENTITY": CannotModifyManagedIdentityError,
2906
2844
  "IDENTITY_ACCESS_DENIED": IdentityAccessDeniedError,
2907
2845
  "IDENTITY_NOT_FOUND": IdentityNotFoundError,
2846
+ "EXECUTE_INTERNAL_ERROR": ExecuteInternalErrorError,
2847
+ "EXECUTE_ACCESS_DENIED": ExecuteAccessDeniedError,
2848
+ "LIST_RUNS_FAILED": ListRunsFailedError,
2849
+ "EXECUTION_ERROR": ExecutionErrorError,
2850
+ "CONNECTION_FAILED": ConnectionFailedError,
2851
+ "METADATA_WRITE_FAILED": MetadataWriteFailedError,
2852
+ "NODE_MODULES_INSTALL_FAILED": NodeModulesInstallFailedError,
2853
+ "NODE_MODULES_DOWNLOAD_FAILED": NodeModulesDownloadFailedError,
2854
+ "LOCK_GENERATION_FAILED": LockGenerationFailedError,
2855
+ "WRITE_SCRIPT_FAILED": WriteScriptFailedError,
2856
+ "DIRECTORY_CREATION_FAILED": DirectoryCreationFailedError,
2857
+ "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
2858
+ "LOGGING_FAILED": LoggingFailedError,
2859
+ "RUN_NOT_FOUND": RunNotFoundError,
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,
2908
2869
  "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
2870
+ "BUILD_FAILED": BuildFailedError,
2871
+ "SERVER_DEPLOYMENT_FAILED": ServerDeploymentFailedError,
2872
+ "LOCKFILE_ERROR": LockfileErrorError,
2873
+ "UPLOAD_ERROR": UploadErrorError,
2874
+ "DOMAIN_MAPPING_ERROR": DomainMappingErrorError,
2875
+ "CERTIFICATE_PROVISIONING_ERROR": CertificateProvisioningErrorError,
2876
+ "NO_ENTRYPOINT_FOUND": NoEntrypointFoundError,
2877
+ "ENTRYPOINT_NOT_FOUND": EntrypointNotFoundError,
2878
+ "NO_DOMAIN_OWNERSHIP": NoDomainOwnershipError,
2879
+ "INVALID_DOMAINS": InvalidDomainsError,
2880
+ "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
2881
+ "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
2909
2882
  "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
2910
2883
  "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
2911
2884
  "PARSE_LOGS_FAILED": ParseLogsFailedError,
@@ -2943,18 +2916,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
2943
2916
  "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
2944
2917
  "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
2945
2918
  "INVALID_DOMAIN": InvalidDomainError,
2946
- "BUILD_FAILED": BuildFailedError,
2947
- "SERVER_DEPLOYMENT_FAILED": ServerDeploymentFailedError,
2948
- "LOCKFILE_ERROR": LockfileErrorError,
2949
- "UPLOAD_ERROR": UploadErrorError,
2950
- "DOMAIN_MAPPING_ERROR": DomainMappingErrorError,
2951
- "CERTIFICATE_PROVISIONING_ERROR": CertificateProvisioningErrorError,
2952
- "NO_ENTRYPOINT_FOUND": NoEntrypointFoundError,
2953
- "ENTRYPOINT_NOT_FOUND": EntrypointNotFoundError,
2954
- "NO_DOMAIN_OWNERSHIP": NoDomainOwnershipError,
2955
- "INVALID_DOMAINS": InvalidDomainsError,
2956
- "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
2957
- "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
2958
2919
  "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
2959
2920
  "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
2960
2921
  "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
@@ -2966,8 +2927,8 @@ var errors = /*#__PURE__*/Object.freeze({
2966
2927
  __proto__: null,
2967
2928
  AfterArrayContainsEmptyError: AfterArrayContainsEmptyError,
2968
2929
  AlreadyHasBaseError: AlreadyHasBaseError,
2930
+ AmbiguousError: AmbiguousError,
2969
2931
  AnyhowError: AnyhowError,
2970
- AuthorizationNotFoundError: AuthorizationNotFoundError,
2971
2932
  BackupFailedError: BackupFailedError,
2972
2933
  BadRequestError: BadRequestError,
2973
2934
  BlobNotFoundError: BlobNotFoundError,
@@ -3072,6 +3033,7 @@ var errors = /*#__PURE__*/Object.freeze({
3072
3033
  InvalidDeploymentRequestError: InvalidDeploymentRequestError,
3073
3034
  InvalidDomainError: InvalidDomainError,
3074
3035
  InvalidDomainsError: InvalidDomainsError,
3036
+ InvalidError: InvalidError,
3075
3037
  InvalidObjectIdError: InvalidObjectIdError,
3076
3038
  InvalidParametersError: InvalidParametersError,
3077
3039
  InvalidQueryError: InvalidQueryError,
@@ -3102,7 +3064,6 @@ var errors = /*#__PURE__*/Object.freeze({
3102
3064
  ObservabilityDatabaseErrorError: ObservabilityDatabaseErrorError,
3103
3065
  OffsetWithSelectorError: OffsetWithSelectorError,
3104
3066
  OnFailureArrayContainsEmptyError: OnFailureArrayContainsEmptyError,
3105
- OrderNotFoundError: OrderNotFoundError,
3106
3067
  PackfileError: PackfileError,
3107
3068
  ParseLogsFailedError: ParseLogsFailedError,
3108
3069
  ParseResponseErrorError: ParseResponseErrorError,
@@ -3111,10 +3072,6 @@ var errors = /*#__PURE__*/Object.freeze({
3111
3072
  PermissionDeniedError: PermissionDeniedError,
3112
3073
  PermissionErrorError: PermissionErrorError,
3113
3074
  PermissionNotFoundError: PermissionNotFoundError,
3114
- PreVerifyChallengeMismatchError: PreVerifyChallengeMismatchError,
3115
- PreVerifyFailedFetchError: PreVerifyFailedFetchError,
3116
- PreVerifyFailedParseError: PreVerifyFailedParseError,
3117
- PreVerifyRouteNotFoundError: PreVerifyRouteNotFoundError,
3118
3075
  ProjectNotFoundError: ProjectNotFoundError,
3119
3076
  ReadFileFailedError: ReadFileFailedError,
3120
3077
  RecordOwnershipErrorError: RecordOwnershipErrorError,
@@ -3133,6 +3090,7 @@ var errors = /*#__PURE__*/Object.freeze({
3133
3090
  RevokePermissionFailedError: RevokePermissionFailedError,
3134
3091
  RevokeTokenFailedError: RevokeTokenFailedError,
3135
3092
  RunNotFoundError: RunNotFoundError,
3093
+ RuntimeErrorError: RuntimeErrorError,
3136
3094
  SendErrorError: SendErrorError,
3137
3095
  SerializationErrorError: SerializationErrorError,
3138
3096
  ServerDeploymentFailedError: ServerDeploymentFailedError,
@@ -3150,6 +3108,7 @@ var errors = /*#__PURE__*/Object.freeze({
3150
3108
  SourceUnauthorizedError: SourceUnauthorizedError,
3151
3109
  StatusFailedError: StatusFailedError,
3152
3110
  StdIoError: StdIoError,
3111
+ SyntaxErrorError: SyntaxErrorError,
3153
3112
  TagNotFoundError: TagNotFoundError,
3154
3113
  TokenErrorError: TokenErrorError,
3155
3114
  TreeNotFoundError: TreeNotFoundError,
@@ -3185,7 +3144,6 @@ var errors = /*#__PURE__*/Object.freeze({
3185
3144
  VmStartTimeoutError: VmStartTimeoutError,
3186
3145
  VmSubnetNotFoundError: VmSubnetNotFoundError,
3187
3146
  VmTransactionIdMismatchError: VmTransactionIdMismatchError,
3188
- WaitTimeoutError: WaitTimeoutError,
3189
3147
  WantedByEmptyError: WantedByEmptyError,
3190
3148
  WatchFilesFailedError: WatchFilesFailedError,
3191
3149
  WebDeploymentBadRequestError: WebDeploymentBadRequestError,
@@ -4404,35 +4362,15 @@ class RunsNamespace {
4404
4362
  */
4405
4363
  async create({
4406
4364
  code,
4407
- config,
4408
- outgoingHeaders,
4409
- outgoingProxy
4365
+ ...config
4410
4366
  }) {
4411
- const response = await this.apiClient.post("/execute/v1/script", {
4367
+ const response = await this.apiClient.post("/execute/v2/script", {
4412
4368
  body: {
4413
4369
  script: code,
4414
- config: {
4415
- proxy: outgoingProxy,
4416
- customHeaders: outgoingHeaders,
4417
- networkPermissions: config.networkPermissions?.map((np) => ({
4418
- action: np.action,
4419
- query: np.domain,
4420
- behavior: np.behavior
4421
- })),
4422
- envVars: config.envVars,
4423
- nodeModules: config.nodeModules,
4424
- timeout: config.timeoutMs
4425
- // entrypoint: config.entrypointPath,
4426
- }
4370
+ config
4427
4371
  }
4428
4372
  });
4429
- if (!response.result && !response.logs) {
4430
- throw new Error("Execution failed");
4431
- }
4432
- return {
4433
- result: response.result,
4434
- logs: response.logs || []
4435
- };
4373
+ return response;
4436
4374
  }
4437
4375
  /**
4438
4376
  * List execution runs.