freestyle-sandboxes 0.1.0 → 0.1.2

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 +1058 -832
  2. package/index.d.cts +900 -665
  3. package/index.d.mts +900 -665
  4. package/index.mjs +1058 -832
  5. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6,6 +6,30 @@ function errorFromJSON(body) {
6
6
  return new Error(`Unknown error code: ${body.code} - ${body.description}`);
7
7
  }
8
8
  }
9
+ class InternalErrorError extends Error {
10
+ constructor(body) {
11
+ super(
12
+ `INTERNAL_ERROR: ${body.message}`
13
+ );
14
+ this.body = body;
15
+ this.name = "InternalErrorError";
16
+ }
17
+ static code = "INTERNAL_ERROR";
18
+ static statusCode = 500;
19
+ static description = `Internal error: {message}`;
20
+ }
21
+ class DockerImportBadRequestError extends Error {
22
+ constructor(body) {
23
+ super(
24
+ `DOCKER_IMPORT_BAD_REQUEST: ${body.message}`
25
+ );
26
+ this.body = body;
27
+ this.name = "DockerImportBadRequestError";
28
+ }
29
+ static code = "DOCKER_IMPORT_BAD_REQUEST";
30
+ static statusCode = 400;
31
+ static description = `Bad request: {message}`;
32
+ }
9
33
  class VmNotFoundInFsError extends Error {
10
34
  constructor(body) {
11
35
  super(
@@ -114,30 +138,6 @@ class NotFoundError extends Error {
114
138
  static statusCode = 404;
115
139
  static description = `VM not found`;
116
140
  }
117
- class InternalErrorError extends Error {
118
- constructor(body) {
119
- super(
120
- `INTERNAL_ERROR: ${body.message}`
121
- );
122
- this.body = body;
123
- this.name = "InternalErrorError";
124
- }
125
- static code = "INTERNAL_ERROR";
126
- static statusCode = 500;
127
- static description = `Internal error: {message}`;
128
- }
129
- class DockerImportBadRequestError extends Error {
130
- constructor(body) {
131
- super(
132
- `DOCKER_IMPORT_BAD_REQUEST: ${body.message}`
133
- );
134
- this.body = body;
135
- this.name = "DockerImportBadRequestError";
136
- }
137
- static code = "DOCKER_IMPORT_BAD_REQUEST";
138
- static statusCode = 400;
139
- static description = `Bad request: {message}`;
140
- }
141
141
  class ForkVmNotFoundError extends Error {
142
142
  constructor(body) {
143
143
  super(
@@ -342,18 +342,6 @@ class VmNotInTransactionError extends Error {
342
342
  static statusCode = 404;
343
343
  static description = `VM not in a transaction: {vm_id}`;
344
344
  }
345
- class CreateVmBadRequestError extends Error {
346
- constructor(body) {
347
- super(
348
- `CREATE_VM_BAD_REQUEST: ${body.message}`
349
- );
350
- this.body = body;
351
- this.name = "CreateVmBadRequestError";
352
- }
353
- static code = "CREATE_VM_BAD_REQUEST";
354
- static statusCode = 400;
355
- static description = `Bad request: {message}`;
356
- }
357
345
  class UserNotFoundError extends Error {
358
346
  constructor(body) {
359
347
  super(
@@ -546,6 +534,18 @@ class GroupNameEmptyError extends Error {
546
534
  static statusCode = 400;
547
535
  static description = `Group name cannot be empty`;
548
536
  }
537
+ class CreateVmBadRequestError extends Error {
538
+ constructor(body) {
539
+ super(
540
+ `CREATE_VM_BAD_REQUEST: ${body.message}`
541
+ );
542
+ this.body = body;
543
+ this.name = "CreateVmBadRequestError";
544
+ }
545
+ static code = "CREATE_VM_BAD_REQUEST";
546
+ static statusCode = 400;
547
+ static description = `Bad request: {message}`;
548
+ }
549
549
  class WantedByEmptyError extends Error {
550
550
  constructor(body) {
551
551
  super(
@@ -738,6 +738,90 @@ class ServiceNotFoundError extends Error {
738
738
  static statusCode = 404;
739
739
  static description = `null`;
740
740
  }
741
+ class WaitTimeoutError extends Error {
742
+ constructor(body) {
743
+ super(
744
+ `WAIT_TIMEOUT: ${body.message}`
745
+ );
746
+ this.body = body;
747
+ this.name = "WaitTimeoutError";
748
+ }
749
+ static code = "WAIT_TIMEOUT";
750
+ static statusCode = 504;
751
+ static description = `Timed out waiting for certificate validation`;
752
+ }
753
+ class PreVerifyChallengeMismatchError extends Error {
754
+ constructor(body) {
755
+ super(
756
+ `PRE_VERIFY_CHALLENGE_MISMATCH: ${body.message}`
757
+ );
758
+ this.body = body;
759
+ this.name = "PreVerifyChallengeMismatchError";
760
+ }
761
+ static code = "PRE_VERIFY_CHALLENGE_MISMATCH";
762
+ static statusCode = 400;
763
+ static description = `Certificate challenge verification failed - response did not match`;
764
+ }
765
+ class PreVerifyFailedParseError extends Error {
766
+ constructor(body) {
767
+ super(
768
+ `PRE_VERIFY_FAILED_PARSE: ${body.message}`
769
+ );
770
+ this.body = body;
771
+ this.name = "PreVerifyFailedParseError";
772
+ }
773
+ static code = "PRE_VERIFY_FAILED_PARSE";
774
+ static statusCode = 400;
775
+ static description = `Invalid response from domain during certificate verification`;
776
+ }
777
+ class PreVerifyFailedFetchError extends Error {
778
+ constructor(body) {
779
+ super(
780
+ `PRE_VERIFY_FAILED_FETCH: ${body.message}`
781
+ );
782
+ this.body = body;
783
+ this.name = "PreVerifyFailedFetchError";
784
+ }
785
+ static code = "PRE_VERIFY_FAILED_FETCH";
786
+ static statusCode = 400;
787
+ static description = `Could not reach domain for certificate verification - check DNS settings`;
788
+ }
789
+ class PreVerifyRouteNotFoundError extends Error {
790
+ constructor(body) {
791
+ super(
792
+ `PRE_VERIFY_ROUTE_NOT_FOUND: ${body.message}`
793
+ );
794
+ this.body = body;
795
+ this.name = "PreVerifyRouteNotFoundError";
796
+ }
797
+ static code = "PRE_VERIFY_ROUTE_NOT_FOUND";
798
+ static statusCode = 400;
799
+ static description = `Domain does not resolve to Freestyle servers`;
800
+ }
801
+ class AuthorizationNotFoundError extends Error {
802
+ constructor(body) {
803
+ super(
804
+ `AUTHORIZATION_NOT_FOUND: ${body.message}`
805
+ );
806
+ this.body = body;
807
+ this.name = "AuthorizationNotFoundError";
808
+ }
809
+ static code = "AUTHORIZATION_NOT_FOUND";
810
+ static statusCode = 404;
811
+ static description = `No authorization found for domain`;
812
+ }
813
+ class OrderNotFoundError extends Error {
814
+ constructor(body) {
815
+ super(
816
+ `ORDER_NOT_FOUND: ${body.message}`
817
+ );
818
+ this.body = body;
819
+ this.name = "OrderNotFoundError";
820
+ }
821
+ static code = "ORDER_NOT_FOUND";
822
+ static statusCode = 404;
823
+ static description = `No certificate order found for domain`;
824
+ }
741
825
  class InternalError extends Error {
742
826
  constructor(body) {
743
827
  super(
@@ -810,65 +894,41 @@ class ExpiredError extends Error {
810
894
  static statusCode = 403;
811
895
  static description = `Session has expired`;
812
896
  }
813
- class ConflictError extends Error {
814
- constructor(body) {
815
- super(
816
- `CONFLICT: ${body.message}`
817
- );
818
- this.body = body;
819
- this.name = "ConflictError";
820
- }
821
- static code = "CONFLICT";
822
- static statusCode = 409;
823
- static description = `Sync conflict: {message}`;
824
- }
825
- class RepoNotFoundError extends Error {
897
+ class TagNotFoundError extends Error {
826
898
  constructor(body) {
827
899
  super(
828
- `REPO_NOT_FOUND: ${body.message}`
900
+ `TAG_NOT_FOUND: ${body.message}`
829
901
  );
830
902
  this.body = body;
831
- this.name = "RepoNotFoundError";
903
+ this.name = "TagNotFoundError";
832
904
  }
833
- static code = "REPO_NOT_FOUND";
905
+ static code = "TAG_NOT_FOUND";
834
906
  static statusCode = 404;
835
- static description = `Repository not found`;
836
- }
837
- class ForbiddenError extends Error {
838
- constructor(body) {
839
- super(
840
- `FORBIDDEN: ${body.message}`
841
- );
842
- this.body = body;
843
- this.name = "ForbiddenError";
844
- }
845
- static code = "FORBIDDEN";
846
- static statusCode = 403;
847
- static description = `Forbidden: {message}`;
907
+ static description = `Tag not found: {tag}`;
848
908
  }
849
- class UnsupportedTransferError extends Error {
909
+ class BranchNotFoundError extends Error {
850
910
  constructor(body) {
851
911
  super(
852
- `UNSUPPORTED_TRANSFER: ${body.message}`
912
+ `BRANCH_NOT_FOUND: ${body.message}`
853
913
  );
854
914
  this.body = body;
855
- this.name = "UnsupportedTransferError";
915
+ this.name = "BranchNotFoundError";
856
916
  }
857
- static code = "UNSUPPORTED_TRANSFER";
858
- static statusCode = 400;
859
- static description = `Unsupported LFS transfer protocol(s)`;
917
+ static code = "BRANCH_NOT_FOUND";
918
+ static statusCode = 404;
919
+ static description = `Branch not found: {branch}`;
860
920
  }
861
- class BranchNotFoundError extends Error {
921
+ class RepoNotFoundError extends Error {
862
922
  constructor(body) {
863
923
  super(
864
- `BRANCH_NOT_FOUND: ${body.message}`
924
+ `REPO_NOT_FOUND: ${body.message}`
865
925
  );
866
926
  this.body = body;
867
- this.name = "BranchNotFoundError";
927
+ this.name = "RepoNotFoundError";
868
928
  }
869
- static code = "BRANCH_NOT_FOUND";
929
+ static code = "REPO_NOT_FOUND";
870
930
  static statusCode = 404;
871
- static description = `Branch not found: {branch}`;
931
+ static description = `Repository not found`;
872
932
  }
873
933
  class InvalidObjectIdError extends Error {
874
934
  constructor(body) {
@@ -882,17 +942,17 @@ class InvalidObjectIdError extends Error {
882
942
  static statusCode = 400;
883
943
  static description = `Invalid object ID`;
884
944
  }
885
- class BlobNotFoundError extends Error {
945
+ class CommitNotFoundError extends Error {
886
946
  constructor(body) {
887
947
  super(
888
- `BLOB_NOT_FOUND: ${body.message}`
948
+ `COMMIT_NOT_FOUND: ${body.message}`
889
949
  );
890
950
  this.body = body;
891
- this.name = "BlobNotFoundError";
951
+ this.name = "CommitNotFoundError";
892
952
  }
893
- static code = "BLOB_NOT_FOUND";
953
+ static code = "COMMIT_NOT_FOUND";
894
954
  static statusCode = 404;
895
- static description = `Blob not found: {hash}`;
955
+ static description = `Commit not found: {hash}`;
896
956
  }
897
957
  class ReferenceNotFoundError extends Error {
898
958
  constructor(body) {
@@ -906,29 +966,17 @@ class ReferenceNotFoundError extends Error {
906
966
  static statusCode = 404;
907
967
  static description = `Reference not found: {reference}`;
908
968
  }
909
- class TagNotFoundError extends Error {
910
- constructor(body) {
911
- super(
912
- `TAG_NOT_FOUND: ${body.message}`
913
- );
914
- this.body = body;
915
- this.name = "TagNotFoundError";
916
- }
917
- static code = "TAG_NOT_FOUND";
918
- static statusCode = 404;
919
- static description = `Tag not found: {tag}`;
920
- }
921
- class CommitNotFoundError extends Error {
969
+ class PathNotFoundError extends Error {
922
970
  constructor(body) {
923
971
  super(
924
- `COMMIT_NOT_FOUND: ${body.message}`
972
+ `PATH_NOT_FOUND: ${body.message}`
925
973
  );
926
974
  this.body = body;
927
- this.name = "CommitNotFoundError";
975
+ this.name = "PathNotFoundError";
928
976
  }
929
- static code = "COMMIT_NOT_FOUND";
977
+ static code = "PATH_NOT_FOUND";
930
978
  static statusCode = 404;
931
- static description = `Commit not found: {hash}`;
979
+ static description = `Path not found: {path}`;
932
980
  }
933
981
  class InvalidRequestError extends Error {
934
982
  constructor(body) {
@@ -940,19 +988,7 @@ class InvalidRequestError extends Error {
940
988
  }
941
989
  static code = "INVALID_REQUEST";
942
990
  static statusCode = 400;
943
- static description = `Invalid request: {message}`;
944
- }
945
- class PathNotFoundError extends Error {
946
- constructor(body) {
947
- super(
948
- `PATH_NOT_FOUND: ${body.message}`
949
- );
950
- this.body = body;
951
- this.name = "PathNotFoundError";
952
- }
953
- static code = "PATH_NOT_FOUND";
954
- static statusCode = 404;
955
- static description = `Path not found: {path}`;
991
+ static description = `null`;
956
992
  }
957
993
  class InvalidRevisionError extends Error {
958
994
  constructor(body) {
@@ -966,6 +1002,18 @@ class InvalidRevisionError extends Error {
966
1002
  static statusCode = 400;
967
1003
  static description = `null`;
968
1004
  }
1005
+ class ForbiddenError extends Error {
1006
+ constructor(body) {
1007
+ super(
1008
+ `FORBIDDEN: ${body.message}`
1009
+ );
1010
+ this.body = body;
1011
+ this.name = "ForbiddenError";
1012
+ }
1013
+ static code = "FORBIDDEN";
1014
+ static statusCode = 403;
1015
+ static description = `Forbidden`;
1016
+ }
969
1017
  class UnauthorizedError extends Error {
970
1018
  constructor(body) {
971
1019
  super(
@@ -978,341 +1026,569 @@ class UnauthorizedError extends Error {
978
1026
  static statusCode = 401;
979
1027
  static description = `Unauthorized`;
980
1028
  }
981
- class TreeNotFoundError extends Error {
1029
+ class ConflictError extends Error {
982
1030
  constructor(body) {
983
1031
  super(
984
- `TREE_NOT_FOUND: ${body.message}`
1032
+ `CONFLICT: ${body.message}`
985
1033
  );
986
1034
  this.body = body;
987
- this.name = "TreeNotFoundError";
1035
+ this.name = "ConflictError";
988
1036
  }
989
- static code = "TREE_NOT_FOUND";
990
- static statusCode = 404;
991
- static description = `Tree not found: {hash}`;
1037
+ static code = "CONFLICT";
1038
+ static statusCode = 409;
1039
+ static description = `Sync conflict: {message}`;
992
1040
  }
993
- class BuildFailedError extends Error {
1041
+ class UnsupportedTransferError extends Error {
994
1042
  constructor(body) {
995
1043
  super(
996
- `BUILD_FAILED: ${body.message}`
1044
+ `UNSUPPORTED_TRANSFER: ${body.message}`
997
1045
  );
998
1046
  this.body = body;
999
- this.name = "BuildFailedError";
1047
+ this.name = "UnsupportedTransferError";
1000
1048
  }
1001
- static code = "BUILD_FAILED";
1002
- static statusCode = 500;
1003
- static description = `Build failed on VM {vm_id}`;
1004
- }
1005
- class NoEntrypointFoundError extends Error {
1049
+ static code = "UNSUPPORTED_TRANSFER";
1050
+ static statusCode = 400;
1051
+ static description = `Unsupported LFS transfer protocol(s)`;
1052
+ }
1053
+ class BlobNotFoundError extends Error {
1006
1054
  constructor(body) {
1007
1055
  super(
1008
- `NO_ENTRYPOINT_FOUND: ${body.message}`
1056
+ `BLOB_NOT_FOUND: ${body.message}`
1009
1057
  );
1010
1058
  this.body = body;
1011
- this.name = "NoEntrypointFoundError";
1059
+ this.name = "BlobNotFoundError";
1012
1060
  }
1013
- static code = "NO_ENTRYPOINT_FOUND";
1014
- static statusCode = 400;
1015
- static description = `No entrypoint found in deployment`;
1061
+ static code = "BLOB_NOT_FOUND";
1062
+ static statusCode = 404;
1063
+ static description = `Blob not found: {hash}`;
1016
1064
  }
1017
- class EntrypointNotFoundError extends Error {
1065
+ class TreeNotFoundError extends Error {
1018
1066
  constructor(body) {
1019
1067
  super(
1020
- `ENTRYPOINT_NOT_FOUND: ${body.message}`
1068
+ `TREE_NOT_FOUND: ${body.message}`
1021
1069
  );
1022
1070
  this.body = body;
1023
- this.name = "EntrypointNotFoundError";
1071
+ this.name = "TreeNotFoundError";
1024
1072
  }
1025
- static code = "ENTRYPOINT_NOT_FOUND";
1026
- static statusCode = 400;
1027
- static description = `Entrypoint not found: {entrypoint}`;
1073
+ static code = "TREE_NOT_FOUND";
1074
+ static statusCode = 404;
1075
+ static description = `Tree not found: {hash}`;
1028
1076
  }
1029
- class NoDomainOwnershipError extends Error {
1077
+ class ResizeFailedError extends Error {
1030
1078
  constructor(body) {
1031
1079
  super(
1032
- `NO_DOMAIN_OWNERSHIP: ${body.message}`
1080
+ `RESIZE_FAILED: ${body.message}`
1033
1081
  );
1034
1082
  this.body = body;
1035
- this.name = "NoDomainOwnershipError";
1083
+ this.name = "ResizeFailedError";
1036
1084
  }
1037
- static code = "NO_DOMAIN_OWNERSHIP";
1038
- static statusCode = 403;
1039
- static description = `No domain ownership for: {domain}`;
1085
+ static code = "RESIZE_FAILED";
1086
+ static statusCode = 500;
1087
+ static description = `Failed to resize VM: {message}`;
1040
1088
  }
1041
- class InvalidDomainsError extends Error {
1089
+ class InternalResizeVmNotFoundError extends Error {
1042
1090
  constructor(body) {
1043
1091
  super(
1044
- `INVALID_DOMAINS: ${body.message}`
1092
+ `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
1045
1093
  );
1046
1094
  this.body = body;
1047
- this.name = "InvalidDomainsError";
1095
+ this.name = "InternalResizeVmNotFoundError";
1048
1096
  }
1049
- static code = "INVALID_DOMAINS";
1050
- static statusCode = 400;
1051
- static description = `Invalid domains provided`;
1097
+ static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
1098
+ static statusCode = 404;
1099
+ static description = `VM not found`;
1052
1100
  }
1053
- class WebDeploymentBadRequestError extends Error {
1101
+ class ObservabilityDatabaseErrorError extends Error {
1054
1102
  constructor(body) {
1055
1103
  super(
1056
- `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
1104
+ `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
1057
1105
  );
1058
1106
  this.body = body;
1059
- this.name = "WebDeploymentBadRequestError";
1107
+ this.name = "ObservabilityDatabaseErrorError";
1060
1108
  }
1061
- static code = "WEB_DEPLOYMENT_BAD_REQUEST";
1062
- static statusCode = 400;
1063
- static description = `Bad request: {message}`;
1109
+ static code = "OBSERVABILITY_DATABASE_ERROR";
1110
+ static statusCode = 500;
1111
+ static description = `Database operation failed: {message}`;
1064
1112
  }
1065
- class DeploymentNotFoundError extends Error {
1113
+ class ObservabilityAccessDeniedError extends Error {
1066
1114
  constructor(body) {
1067
1115
  super(
1068
- `DEPLOYMENT_NOT_FOUND: ${body.message}`
1116
+ `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
1069
1117
  );
1070
1118
  this.body = body;
1071
- this.name = "DeploymentNotFoundError";
1119
+ this.name = "ObservabilityAccessDeniedError";
1072
1120
  }
1073
- static code = "DEPLOYMENT_NOT_FOUND";
1074
- static statusCode = 404;
1075
- static description = `Deployment not found`;
1121
+ static code = "OBSERVABILITY_ACCESS_DENIED";
1122
+ static statusCode = 403;
1123
+ static description = `Access denied to logs for deployment: {deployment_id}`;
1076
1124
  }
1077
- class DatabaseErrorError extends Error {
1125
+ class ParseLogsFailedError extends Error {
1078
1126
  constructor(body) {
1079
1127
  super(
1080
- `DATABASE_ERROR: ${body.message}`
1128
+ `PARSE_LOGS_FAILED: ${body.message}`
1081
1129
  );
1082
1130
  this.body = body;
1083
- this.name = "DatabaseErrorError";
1131
+ this.name = "ParseLogsFailedError";
1084
1132
  }
1085
- static code = "DATABASE_ERROR";
1133
+ static code = "PARSE_LOGS_FAILED";
1086
1134
  static statusCode = 500;
1087
- static description = `Database operation failed: {message}`;
1135
+ static description = `Failed to parse logs: {message}`;
1088
1136
  }
1089
- class TriggerErrorError extends Error {
1137
+ class RetrieveLogsFailedError extends Error {
1090
1138
  constructor(body) {
1091
1139
  super(
1092
- `TRIGGER_ERROR: ${body.message}`
1140
+ `RETRIEVE_LOGS_FAILED: ${body.message}`
1093
1141
  );
1094
1142
  this.body = body;
1095
- this.name = "TriggerErrorError";
1143
+ this.name = "RetrieveLogsFailedError";
1096
1144
  }
1097
- static code = "TRIGGER_ERROR";
1145
+ static code = "RETRIEVE_LOGS_FAILED";
1098
1146
  static statusCode = 500;
1099
- static description = `Failed to manage triggers: {message}`;
1147
+ static description = `Failed to retrieve logs: {message}`;
1100
1148
  }
1101
- class TokenErrorError extends Error {
1149
+ class InvalidQueryError extends Error {
1102
1150
  constructor(body) {
1103
1151
  super(
1104
- `TOKEN_ERROR: ${body.message}`
1152
+ `INVALID_QUERY: ${body.message}`
1105
1153
  );
1106
1154
  this.body = body;
1107
- this.name = "TokenErrorError";
1155
+ this.name = "InvalidQueryError";
1108
1156
  }
1109
- static code = "TOKEN_ERROR";
1110
- static statusCode = 500;
1111
- static description = `Failed to manage tokens: {message}`;
1157
+ static code = "INVALID_QUERY";
1158
+ static statusCode = 400;
1159
+ static description = `Invalid log query: {message}`;
1112
1160
  }
1113
- class PermissionErrorError extends Error {
1161
+ class LogsNotFoundError extends Error {
1114
1162
  constructor(body) {
1115
1163
  super(
1116
- `PERMISSION_ERROR: ${body.message}`
1164
+ `LOGS_NOT_FOUND: ${body.message}`
1117
1165
  );
1118
1166
  this.body = body;
1119
- this.name = "PermissionErrorError";
1167
+ this.name = "LogsNotFoundError";
1120
1168
  }
1121
- static code = "PERMISSION_ERROR";
1122
- static statusCode = 500;
1123
- static description = `Failed to manage permissions: {message}`;
1169
+ static code = "LOGS_NOT_FOUND";
1170
+ static statusCode = 404;
1171
+ static description = `Logs not found for deployment: {deployment_id}`;
1124
1172
  }
1125
- class IdentityErrorError extends Error {
1173
+ class PermissionAlreadyExistsError extends Error {
1126
1174
  constructor(body) {
1127
1175
  super(
1128
- `IDENTITY_ERROR: ${body.message}`
1176
+ `PERMISSION_ALREADY_EXISTS: ${body.message}`
1129
1177
  );
1130
1178
  this.body = body;
1131
- this.name = "IdentityErrorError";
1179
+ this.name = "PermissionAlreadyExistsError";
1132
1180
  }
1133
- static code = "IDENTITY_ERROR";
1134
- static statusCode = 500;
1135
- static description = `Failed to manage identity: {message}`;
1181
+ static code = "PERMISSION_ALREADY_EXISTS";
1182
+ static statusCode = 409;
1183
+ static description = `Permission already exists`;
1136
1184
  }
1137
- class GetContentFailedError extends Error {
1185
+ class ListTokensFailedError extends Error {
1138
1186
  constructor(body) {
1139
1187
  super(
1140
- `GET_CONTENT_FAILED: ${body.message}`
1188
+ `LIST_TOKENS_FAILED: ${body.message}`
1141
1189
  );
1142
1190
  this.body = body;
1143
- this.name = "GetContentFailedError";
1191
+ this.name = "ListTokensFailedError";
1144
1192
  }
1145
- static code = "GET_CONTENT_FAILED";
1193
+ static code = "LIST_TOKENS_FAILED";
1146
1194
  static statusCode = 500;
1147
- static description = `Failed to get content: {message}`;
1195
+ static description = `Failed to list tokens: {message}`;
1148
1196
  }
1149
- class ContentNotFoundError extends Error {
1197
+ class RevokeTokenFailedError extends Error {
1150
1198
  constructor(body) {
1151
1199
  super(
1152
- `CONTENT_NOT_FOUND: ${body.message}`
1200
+ `REVOKE_TOKEN_FAILED: ${body.message}`
1153
1201
  );
1154
1202
  this.body = body;
1155
- this.name = "ContentNotFoundError";
1203
+ this.name = "RevokeTokenFailedError";
1156
1204
  }
1157
- static code = "CONTENT_NOT_FOUND";
1158
- static statusCode = 404;
1159
- static description = `Content not found: {path}`;
1205
+ static code = "REVOKE_TOKEN_FAILED";
1206
+ static statusCode = 500;
1207
+ static description = `Failed to revoke token: {message}`;
1160
1208
  }
1161
- class DownloadFailedError extends Error {
1209
+ class CreateTokenFailedError extends Error {
1162
1210
  constructor(body) {
1163
1211
  super(
1164
- `DOWNLOAD_FAILED: ${body.message}`
1212
+ `CREATE_TOKEN_FAILED: ${body.message}`
1165
1213
  );
1166
1214
  this.body = body;
1167
- this.name = "DownloadFailedError";
1215
+ this.name = "CreateTokenFailedError";
1168
1216
  }
1169
- static code = "DOWNLOAD_FAILED";
1217
+ static code = "CREATE_TOKEN_FAILED";
1170
1218
  static statusCode = 500;
1171
- static description = `Failed to download repository: {message}`;
1219
+ static description = `Failed to create token: {message}`;
1172
1220
  }
1173
- class GitServerErrorError extends Error {
1221
+ class ListPermissionsFailedError extends Error {
1174
1222
  constructor(body) {
1175
1223
  super(
1176
- `GIT_SERVER_ERROR: ${body.message}`
1224
+ `LIST_PERMISSIONS_FAILED: ${body.message}`
1177
1225
  );
1178
1226
  this.body = body;
1179
- this.name = "GitServerErrorError";
1227
+ this.name = "ListPermissionsFailedError";
1180
1228
  }
1181
- static code = "GIT_SERVER_ERROR";
1229
+ static code = "LIST_PERMISSIONS_FAILED";
1182
1230
  static statusCode = 500;
1183
- static description = `Git server error: {message}`;
1231
+ static description = `Failed to list permissions: {message}`;
1184
1232
  }
1185
- class ParseResponseErrorError extends Error {
1233
+ class GetPermissionFailedError extends Error {
1186
1234
  constructor(body) {
1187
1235
  super(
1188
- `PARSE_RESPONSE_ERROR: ${body.message}`
1236
+ `GET_PERMISSION_FAILED: ${body.message}`
1189
1237
  );
1190
1238
  this.body = body;
1191
- this.name = "ParseResponseErrorError";
1239
+ this.name = "GetPermissionFailedError";
1192
1240
  }
1193
- static code = "PARSE_RESPONSE_ERROR";
1241
+ static code = "GET_PERMISSION_FAILED";
1194
1242
  static statusCode = 500;
1195
- static description = `Failed to parse response from Git server: {message}`;
1243
+ static description = `Failed to get permission: {message}`;
1196
1244
  }
1197
- class RepositoryAccessDeniedError extends Error {
1245
+ class UpdatePermissionFailedError extends Error {
1198
1246
  constructor(body) {
1199
1247
  super(
1200
- `REPOSITORY_ACCESS_DENIED: ${body.message}`
1248
+ `UPDATE_PERMISSION_FAILED: ${body.message}`
1201
1249
  );
1202
1250
  this.body = body;
1203
- this.name = "RepositoryAccessDeniedError";
1251
+ this.name = "UpdatePermissionFailedError";
1204
1252
  }
1205
- static code = "REPOSITORY_ACCESS_DENIED";
1206
- static statusCode = 403;
1207
- static description = `Repository does not belong to account`;
1253
+ static code = "UPDATE_PERMISSION_FAILED";
1254
+ static statusCode = 500;
1255
+ static description = `Failed to update permission: {message}`;
1208
1256
  }
1209
- class GitHubSyncFailedError extends Error {
1257
+ class RevokePermissionFailedError extends Error {
1210
1258
  constructor(body) {
1211
1259
  super(
1212
- `GIT_HUB_SYNC_FAILED: ${body.message}`
1260
+ `REVOKE_PERMISSION_FAILED: ${body.message}`
1213
1261
  );
1214
1262
  this.body = body;
1215
- this.name = "GitHubSyncFailedError";
1263
+ this.name = "RevokePermissionFailedError";
1216
1264
  }
1217
- static code = "GIT_HUB_SYNC_FAILED";
1265
+ static code = "REVOKE_PERMISSION_FAILED";
1218
1266
  static statusCode = 500;
1219
- static description = `Failed to configure GitHub sync: {message}`;
1267
+ static description = `Failed to revoke permission: {message}`;
1220
1268
  }
1221
- class UpdateDefaultBranchFailedError extends Error {
1269
+ class GrantPermissionFailedError extends Error {
1222
1270
  constructor(body) {
1223
1271
  super(
1224
- `UPDATE_DEFAULT_BRANCH_FAILED: ${body.message}`
1272
+ `GRANT_PERMISSION_FAILED: ${body.message}`
1225
1273
  );
1226
1274
  this.body = body;
1227
- this.name = "UpdateDefaultBranchFailedError";
1275
+ this.name = "GrantPermissionFailedError";
1228
1276
  }
1229
- static code = "UPDATE_DEFAULT_BRANCH_FAILED";
1277
+ static code = "GRANT_PERMISSION_FAILED";
1230
1278
  static statusCode = 500;
1231
- static description = `Failed to update default branch: {message}`;
1279
+ static description = `Failed to grant permission: {message}`;
1232
1280
  }
1233
- class GetRepositoryInfoFailedError extends Error {
1281
+ class ListIdentitiesFailedError extends Error {
1234
1282
  constructor(body) {
1235
1283
  super(
1236
- `GET_REPOSITORY_INFO_FAILED: ${body.message}`
1284
+ `LIST_IDENTITIES_FAILED: ${body.message}`
1237
1285
  );
1238
1286
  this.body = body;
1239
- this.name = "GetRepositoryInfoFailedError";
1287
+ this.name = "ListIdentitiesFailedError";
1240
1288
  }
1241
- static code = "GET_REPOSITORY_INFO_FAILED";
1289
+ static code = "LIST_IDENTITIES_FAILED";
1242
1290
  static statusCode = 500;
1243
- static description = `Failed to get repository info: {message}`;
1291
+ static description = `Failed to list identities: {message}`;
1244
1292
  }
1245
- class ListRepositoriesFailedError extends Error {
1293
+ class DeleteIdentityFailedError extends Error {
1246
1294
  constructor(body) {
1247
1295
  super(
1248
- `LIST_REPOSITORIES_FAILED: ${body.message}`
1296
+ `DELETE_IDENTITY_FAILED: ${body.message}`
1249
1297
  );
1250
1298
  this.body = body;
1251
- this.name = "ListRepositoriesFailedError";
1299
+ this.name = "DeleteIdentityFailedError";
1252
1300
  }
1253
- static code = "LIST_REPOSITORIES_FAILED";
1301
+ static code = "DELETE_IDENTITY_FAILED";
1254
1302
  static statusCode = 500;
1255
- static description = `Failed to list repositories: {message}`;
1303
+ static description = `Failed to delete identity: {message}`;
1256
1304
  }
1257
- class DeleteRepositoryFailedError extends Error {
1305
+ class CreateIdentityFailedError extends Error {
1258
1306
  constructor(body) {
1259
1307
  super(
1260
- `DELETE_REPOSITORY_FAILED: ${body.message}`
1308
+ `CREATE_IDENTITY_FAILED: ${body.message}`
1261
1309
  );
1262
1310
  this.body = body;
1263
- this.name = "DeleteRepositoryFailedError";
1311
+ this.name = "CreateIdentityFailedError";
1264
1312
  }
1265
- static code = "DELETE_REPOSITORY_FAILED";
1313
+ static code = "CREATE_IDENTITY_FAILED";
1266
1314
  static statusCode = 500;
1267
- static description = `Failed to delete repository: {message}`;
1315
+ static description = `Failed to create identity: {message}`;
1268
1316
  }
1269
- class CreateRepositoryFailedError extends Error {
1317
+ class VmPermissionNotFoundError extends Error {
1270
1318
  constructor(body) {
1271
1319
  super(
1272
- `CREATE_REPOSITORY_FAILED: ${body.message}`
1320
+ `VM_PERMISSION_NOT_FOUND: ${body.message}`
1273
1321
  );
1274
1322
  this.body = body;
1275
- this.name = "CreateRepositoryFailedError";
1323
+ this.name = "VmPermissionNotFoundError";
1276
1324
  }
1277
- static code = "CREATE_REPOSITORY_FAILED";
1278
- static statusCode = 500;
1279
- static description = `Failed to create repository: {message}`;
1280
- }
1281
- class SerializationErrorError extends Error {
1325
+ static code = "VM_PERMISSION_NOT_FOUND";
1326
+ static statusCode = 404;
1327
+ static description = `VM permission not found`;
1328
+ }
1329
+ class PermissionNotFoundError extends Error {
1282
1330
  constructor(body) {
1283
1331
  super(
1284
- `SERIALIZATION_ERROR: ${body.message}`
1332
+ `PERMISSION_NOT_FOUND: ${body.message}`
1285
1333
  );
1286
1334
  this.body = body;
1287
- this.name = "SerializationErrorError";
1335
+ this.name = "PermissionNotFoundError";
1288
1336
  }
1289
- static code = "SERIALIZATION_ERROR";
1290
- static statusCode = 400;
1291
- static description = `Failed to serialize request: {message}`;
1337
+ static code = "PERMISSION_NOT_FOUND";
1338
+ static statusCode = 404;
1339
+ static description = `Permission not found`;
1292
1340
  }
1293
- class GitInvalidRequestError extends Error {
1341
+ class VmAccessDeniedError extends Error {
1294
1342
  constructor(body) {
1295
1343
  super(
1296
- `GIT_INVALID_REQUEST: ${body.message}`
1344
+ `VM_ACCESS_DENIED: ${body.message}`
1297
1345
  );
1298
1346
  this.body = body;
1299
- this.name = "GitInvalidRequestError";
1347
+ this.name = "VmAccessDeniedError";
1300
1348
  }
1301
- static code = "GIT_INVALID_REQUEST";
1302
- static statusCode = 400;
1303
- static description = `Invalid request: {message}`;
1349
+ static code = "VM_ACCESS_DENIED";
1350
+ static statusCode = 403;
1351
+ static description = `You are not allowed to access this VM`;
1304
1352
  }
1305
- class RepositoryNotFoundError extends Error {
1353
+ class GitRepositoryAccessDeniedError extends Error {
1306
1354
  constructor(body) {
1307
1355
  super(
1308
- `REPOSITORY_NOT_FOUND: ${body.message}`
1356
+ `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
1309
1357
  );
1310
1358
  this.body = body;
1311
- this.name = "RepositoryNotFoundError";
1359
+ this.name = "GitRepositoryAccessDeniedError";
1312
1360
  }
1313
- static code = "REPOSITORY_NOT_FOUND";
1361
+ static code = "GIT_REPOSITORY_ACCESS_DENIED";
1362
+ static statusCode = 403;
1363
+ static description = `You are not allowed to access this repository`;
1364
+ }
1365
+ class GitRepositoryNotFoundError extends Error {
1366
+ constructor(body) {
1367
+ super(
1368
+ `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
1369
+ );
1370
+ this.body = body;
1371
+ this.name = "GitRepositoryNotFoundError";
1372
+ }
1373
+ static code = "GIT_REPOSITORY_NOT_FOUND";
1314
1374
  static statusCode = 404;
1315
- static description = `Repository not found: {repo_id}`;
1375
+ static description = `Repository not found`;
1376
+ }
1377
+ class CannotDeleteManagedIdentityError extends Error {
1378
+ constructor(body) {
1379
+ super(
1380
+ `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
1381
+ );
1382
+ this.body = body;
1383
+ this.name = "CannotDeleteManagedIdentityError";
1384
+ }
1385
+ static code = "CANNOT_DELETE_MANAGED_IDENTITY";
1386
+ static statusCode = 403;
1387
+ static description = `Cannot delete managed identities`;
1388
+ }
1389
+ class CannotModifyManagedIdentityError extends Error {
1390
+ constructor(body) {
1391
+ super(
1392
+ `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
1393
+ );
1394
+ this.body = body;
1395
+ this.name = "CannotModifyManagedIdentityError";
1396
+ }
1397
+ static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
1398
+ static statusCode = 403;
1399
+ static description = `Cannot modify managed identities`;
1400
+ }
1401
+ class IdentityAccessDeniedError extends Error {
1402
+ constructor(body) {
1403
+ super(
1404
+ `IDENTITY_ACCESS_DENIED: ${body.message}`
1405
+ );
1406
+ this.body = body;
1407
+ this.name = "IdentityAccessDeniedError";
1408
+ }
1409
+ static code = "IDENTITY_ACCESS_DENIED";
1410
+ static statusCode = 403;
1411
+ static description = `You are not allowed to access this identity`;
1412
+ }
1413
+ class IdentityNotFoundError extends Error {
1414
+ constructor(body) {
1415
+ super(
1416
+ `IDENTITY_NOT_FOUND: ${body.message}`
1417
+ );
1418
+ this.body = body;
1419
+ this.name = "IdentityNotFoundError";
1420
+ }
1421
+ static code = "IDENTITY_NOT_FOUND";
1422
+ static statusCode = 404;
1423
+ static description = `Identity not found`;
1424
+ }
1425
+ class ExecuteInternalErrorError extends Error {
1426
+ constructor(body) {
1427
+ super(
1428
+ `EXECUTE_INTERNAL_ERROR: ${body.message}`
1429
+ );
1430
+ this.body = body;
1431
+ this.name = "ExecuteInternalErrorError";
1432
+ }
1433
+ static code = "EXECUTE_INTERNAL_ERROR";
1434
+ static statusCode = 500;
1435
+ static description = `Internal error: {message}`;
1436
+ }
1437
+ class ExecuteAccessDeniedError extends Error {
1438
+ constructor(body) {
1439
+ super(
1440
+ `EXECUTE_ACCESS_DENIED: ${body.message}`
1441
+ );
1442
+ this.body = body;
1443
+ this.name = "ExecuteAccessDeniedError";
1444
+ }
1445
+ static code = "EXECUTE_ACCESS_DENIED";
1446
+ static statusCode = 403;
1447
+ static description = `Access denied to execute run`;
1448
+ }
1449
+ class ListRunsFailedError extends Error {
1450
+ constructor(body) {
1451
+ super(
1452
+ `LIST_RUNS_FAILED: ${body.message}`
1453
+ );
1454
+ this.body = body;
1455
+ this.name = "ListRunsFailedError";
1456
+ }
1457
+ static code = "LIST_RUNS_FAILED";
1458
+ static statusCode = 500;
1459
+ static description = `Failed to list execute runs: {message}`;
1460
+ }
1461
+ class ExecutionErrorError extends Error {
1462
+ constructor(body) {
1463
+ super(
1464
+ `EXECUTION_ERROR: ${body.message}`
1465
+ );
1466
+ this.body = body;
1467
+ this.name = "ExecutionErrorError";
1468
+ }
1469
+ static code = "EXECUTION_ERROR";
1470
+ static statusCode = 500;
1471
+ static description = `Script execution error: {message}`;
1472
+ }
1473
+ class ConnectionFailedError extends Error {
1474
+ constructor(body) {
1475
+ super(
1476
+ `CONNECTION_FAILED: ${body.message}`
1477
+ );
1478
+ this.body = body;
1479
+ this.name = "ConnectionFailedError";
1480
+ }
1481
+ static code = "CONNECTION_FAILED";
1482
+ static statusCode = 500;
1483
+ static description = `Failed to connect to execute server: {message}`;
1484
+ }
1485
+ class MetadataWriteFailedError extends Error {
1486
+ constructor(body) {
1487
+ super(
1488
+ `METADATA_WRITE_FAILED: ${body.message}`
1489
+ );
1490
+ this.body = body;
1491
+ this.name = "MetadataWriteFailedError";
1492
+ }
1493
+ static code = "METADATA_WRITE_FAILED";
1494
+ static statusCode = 500;
1495
+ static description = `Failed to write metadata file: {message}`;
1496
+ }
1497
+ class NodeModulesInstallFailedError extends Error {
1498
+ constructor(body) {
1499
+ super(
1500
+ `NODE_MODULES_INSTALL_FAILED: ${body.message}`
1501
+ );
1502
+ this.body = body;
1503
+ this.name = "NodeModulesInstallFailedError";
1504
+ }
1505
+ static code = "NODE_MODULES_INSTALL_FAILED";
1506
+ static statusCode = 500;
1507
+ static description = `Failed to install node modules: {message}`;
1508
+ }
1509
+ class NodeModulesDownloadFailedError extends Error {
1510
+ constructor(body) {
1511
+ super(
1512
+ `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
1513
+ );
1514
+ this.body = body;
1515
+ this.name = "NodeModulesDownloadFailedError";
1516
+ }
1517
+ static code = "NODE_MODULES_DOWNLOAD_FAILED";
1518
+ static statusCode = 500;
1519
+ static description = `Failed to download node modules: {message}`;
1520
+ }
1521
+ class LockGenerationFailedError extends Error {
1522
+ constructor(body) {
1523
+ super(
1524
+ `LOCK_GENERATION_FAILED: ${body.message}`
1525
+ );
1526
+ this.body = body;
1527
+ this.name = "LockGenerationFailedError";
1528
+ }
1529
+ static code = "LOCK_GENERATION_FAILED";
1530
+ static statusCode = 500;
1531
+ static description = `Failed to generate lock file: {message}`;
1532
+ }
1533
+ class WriteScriptFailedError extends Error {
1534
+ constructor(body) {
1535
+ super(
1536
+ `WRITE_SCRIPT_FAILED: ${body.message}`
1537
+ );
1538
+ this.body = body;
1539
+ this.name = "WriteScriptFailedError";
1540
+ }
1541
+ static code = "WRITE_SCRIPT_FAILED";
1542
+ static statusCode = 500;
1543
+ static description = `Failed to write script file: {message}`;
1544
+ }
1545
+ class DirectoryCreationFailedError extends Error {
1546
+ constructor(body) {
1547
+ super(
1548
+ `DIRECTORY_CREATION_FAILED: ${body.message}`
1549
+ );
1550
+ this.body = body;
1551
+ this.name = "DirectoryCreationFailedError";
1552
+ }
1553
+ static code = "DIRECTORY_CREATION_FAILED";
1554
+ static statusCode = 500;
1555
+ static description = `Failed to create script directory: {message}`;
1556
+ }
1557
+ class NetworkPermissionsFailedError extends Error {
1558
+ constructor(body) {
1559
+ super(
1560
+ `NETWORK_PERMISSIONS_FAILED: ${body.message}`
1561
+ );
1562
+ this.body = body;
1563
+ this.name = "NetworkPermissionsFailedError";
1564
+ }
1565
+ static code = "NETWORK_PERMISSIONS_FAILED";
1566
+ static statusCode = 500;
1567
+ static description = `Failed to insert network permissions: {message}`;
1568
+ }
1569
+ class LoggingFailedError extends Error {
1570
+ constructor(body) {
1571
+ super(
1572
+ `LOGGING_FAILED: ${body.message}`
1573
+ );
1574
+ this.body = body;
1575
+ this.name = "LoggingFailedError";
1576
+ }
1577
+ static code = "LOGGING_FAILED";
1578
+ static statusCode = 500;
1579
+ static description = `Failed to log execute run: {message}`;
1580
+ }
1581
+ class RunNotFoundError extends Error {
1582
+ constructor(body) {
1583
+ super(
1584
+ `RUN_NOT_FOUND: ${body.message}`
1585
+ );
1586
+ this.body = body;
1587
+ this.name = "RunNotFoundError";
1588
+ }
1589
+ static code = "RUN_NOT_FOUND";
1590
+ static statusCode = 404;
1591
+ static description = `Execute run not found: {run_id}`;
1316
1592
  }
1317
1593
  class FailedToProvisionCertificateError extends Error {
1318
1594
  constructor(body) {
@@ -1458,931 +1734,813 @@ class InvalidDomainError extends Error {
1458
1734
  static statusCode = 400;
1459
1735
  static description = `Invalid domain: {domain}`;
1460
1736
  }
1461
- class DomainAlreadyExistsError extends Error {
1462
- constructor(body) {
1463
- super(
1464
- `DOMAIN_ALREADY_EXISTS: ${body.message}`
1465
- );
1466
- this.body = body;
1467
- this.name = "DomainAlreadyExistsError";
1468
- }
1469
- static code = "DOMAIN_ALREADY_EXISTS";
1470
- static statusCode = 400;
1471
- static description = `Domain already exists: {domain}`;
1472
- }
1473
- class FailedToInsertOwnershipError extends Error {
1474
- constructor(body) {
1475
- super(
1476
- `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
1477
- );
1478
- this.body = body;
1479
- this.name = "FailedToInsertOwnershipError";
1480
- }
1481
- static code = "FAILED_TO_INSERT_OWNERSHIP";
1482
- static statusCode = 500;
1483
- static description = `Failed to insert domain ownership: {message}`;
1484
- }
1485
- class FailedRemoveDomainMappingError extends Error {
1486
- constructor(body) {
1487
- super(
1488
- `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
1489
- );
1490
- this.body = body;
1491
- this.name = "FailedRemoveDomainMappingError";
1492
- }
1493
- static code = "FAILED_REMOVE_DOMAIN_MAPPING";
1494
- static statusCode = 500;
1495
- static description = `Failed to remove domain mapping: {message}`;
1496
- }
1497
- class FailedPermissionsCheckError extends Error {
1498
- constructor(body) {
1499
- super(
1500
- `FAILED_PERMISSIONS_CHECK: ${body.message}`
1501
- );
1502
- this.body = body;
1503
- this.name = "FailedPermissionsCheckError";
1504
- }
1505
- static code = "FAILED_PERMISSIONS_CHECK";
1506
- static statusCode = 401;
1507
- static description = `You do not have permission to delete the domain mapping for: {domain}`;
1508
- }
1509
- class FailedToCheckDomainMappingPermissionsError extends Error {
1510
- constructor(body) {
1511
- super(
1512
- `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
1513
- );
1514
- this.body = body;
1515
- this.name = "FailedToCheckDomainMappingPermissionsError";
1516
- }
1517
- static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
1518
- static statusCode = 502;
1519
- static description = `Failed to check permissions: {message}`;
1520
- }
1521
- class AnyhowError extends Error {
1737
+ class DomainOwnershipVerificationFailedError extends Error {
1522
1738
  constructor(body) {
1523
1739
  super(
1524
- `ANYHOW: ${body.message}`
1740
+ `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
1525
1741
  );
1526
1742
  this.body = body;
1527
- this.name = "AnyhowError";
1743
+ this.name = "DomainOwnershipVerificationFailedError";
1528
1744
  }
1529
- static code = "ANYHOW";
1530
- static statusCode = 500;
1531
- static description = `null`;
1745
+ static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
1746
+ static statusCode = 403;
1747
+ static description = `Domain ownership verification failed`;
1532
1748
  }
1533
- class ObservabilityDatabaseErrorError extends Error {
1749
+ class ErrorDeletingRecordError extends Error {
1534
1750
  constructor(body) {
1535
1751
  super(
1536
- `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
1752
+ `ERROR_DELETING_RECORD: ${body.message}`
1537
1753
  );
1538
1754
  this.body = body;
1539
- this.name = "ObservabilityDatabaseErrorError";
1755
+ this.name = "ErrorDeletingRecordError";
1540
1756
  }
1541
- static code = "OBSERVABILITY_DATABASE_ERROR";
1757
+ static code = "ERROR_DELETING_RECORD";
1542
1758
  static statusCode = 500;
1543
- static description = `Database operation failed: {message}`;
1759
+ static description = `Error deleting DNS record for {domain}/{name}: {message}`;
1544
1760
  }
1545
- class ObservabilityAccessDeniedError extends Error {
1761
+ class RecordOwnershipErrorError extends Error {
1546
1762
  constructor(body) {
1547
1763
  super(
1548
- `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
1764
+ `RECORD_OWNERSHIP_ERROR: ${body.message}`
1549
1765
  );
1550
1766
  this.body = body;
1551
- this.name = "ObservabilityAccessDeniedError";
1767
+ this.name = "RecordOwnershipErrorError";
1552
1768
  }
1553
- static code = "OBSERVABILITY_ACCESS_DENIED";
1769
+ static code = "RECORD_OWNERSHIP_ERROR";
1554
1770
  static statusCode = 403;
1555
- static description = `Access denied to logs for deployment: {deployment_id}`;
1556
- }
1557
- class ParseLogsFailedError extends Error {
1558
- constructor(body) {
1559
- super(
1560
- `PARSE_LOGS_FAILED: ${body.message}`
1561
- );
1562
- this.body = body;
1563
- this.name = "ParseLogsFailedError";
1564
- }
1565
- static code = "PARSE_LOGS_FAILED";
1566
- static statusCode = 500;
1567
- static description = `Failed to parse logs: {message}`;
1771
+ static description = `Account {account_id} does not own record {record_id}`;
1568
1772
  }
1569
- class RetrieveLogsFailedError extends Error {
1773
+ class ErrorCreatingRecordError extends Error {
1570
1774
  constructor(body) {
1571
1775
  super(
1572
- `RETRIEVE_LOGS_FAILED: ${body.message}`
1776
+ `ERROR_CREATING_RECORD: ${body.message}`
1573
1777
  );
1574
1778
  this.body = body;
1575
- this.name = "RetrieveLogsFailedError";
1779
+ this.name = "ErrorCreatingRecordError";
1576
1780
  }
1577
- static code = "RETRIEVE_LOGS_FAILED";
1781
+ static code = "ERROR_CREATING_RECORD";
1578
1782
  static statusCode = 500;
1579
- static description = `Failed to retrieve logs: {message}`;
1580
- }
1581
- class InvalidQueryError extends Error {
1582
- constructor(body) {
1583
- super(
1584
- `INVALID_QUERY: ${body.message}`
1585
- );
1586
- this.body = body;
1587
- this.name = "InvalidQueryError";
1588
- }
1589
- static code = "INVALID_QUERY";
1590
- static statusCode = 400;
1591
- static description = `Invalid log query: {message}`;
1592
- }
1593
- class LogsNotFoundError extends Error {
1594
- constructor(body) {
1595
- super(
1596
- `LOGS_NOT_FOUND: ${body.message}`
1597
- );
1598
- this.body = body;
1599
- this.name = "LogsNotFoundError";
1600
- }
1601
- static code = "LOGS_NOT_FOUND";
1602
- static statusCode = 404;
1603
- static description = `Logs not found for deployment: {deployment_id}`;
1604
- }
1605
- class PermissionAlreadyExistsError extends Error {
1606
- constructor(body) {
1607
- super(
1608
- `PERMISSION_ALREADY_EXISTS: ${body.message}`
1609
- );
1610
- this.body = body;
1611
- this.name = "PermissionAlreadyExistsError";
1612
- }
1613
- static code = "PERMISSION_ALREADY_EXISTS";
1614
- static statusCode = 409;
1615
- static description = `Permission already exists`;
1783
+ static description = `Error creating DNS record: {message}`;
1616
1784
  }
1617
- class ListTokensFailedError extends Error {
1785
+ class DomainOwnershipErrorError extends Error {
1618
1786
  constructor(body) {
1619
1787
  super(
1620
- `LIST_TOKENS_FAILED: ${body.message}`
1788
+ `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
1621
1789
  );
1622
1790
  this.body = body;
1623
- this.name = "ListTokensFailedError";
1791
+ this.name = "DomainOwnershipErrorError";
1624
1792
  }
1625
- static code = "LIST_TOKENS_FAILED";
1626
- static statusCode = 500;
1627
- static description = `Failed to list tokens: {message}`;
1793
+ static code = "DOMAIN_OWNERSHIP_ERROR";
1794
+ static statusCode = 403;
1795
+ static description = `Account {account_id} does not own domain {domain}`;
1628
1796
  }
1629
- class RevokeTokenFailedError extends Error {
1797
+ class BrowserOperationFailedError extends Error {
1630
1798
  constructor(body) {
1631
1799
  super(
1632
- `REVOKE_TOKEN_FAILED: ${body.message}`
1800
+ `BROWSER_OPERATION_FAILED: ${body.message}`
1633
1801
  );
1634
1802
  this.body = body;
1635
- this.name = "RevokeTokenFailedError";
1803
+ this.name = "BrowserOperationFailedError";
1636
1804
  }
1637
- static code = "REVOKE_TOKEN_FAILED";
1805
+ static code = "BROWSER_OPERATION_FAILED";
1638
1806
  static statusCode = 500;
1639
- static description = `Failed to revoke token: {message}`;
1807
+ static description = `Browser operation failed: {message}`;
1640
1808
  }
1641
- class CreateTokenFailedError extends Error {
1809
+ class WatchFilesFailedError extends Error {
1642
1810
  constructor(body) {
1643
1811
  super(
1644
- `CREATE_TOKEN_FAILED: ${body.message}`
1812
+ `WATCH_FILES_FAILED: ${body.message}`
1645
1813
  );
1646
1814
  this.body = body;
1647
- this.name = "CreateTokenFailedError";
1815
+ this.name = "WatchFilesFailedError";
1648
1816
  }
1649
- static code = "CREATE_TOKEN_FAILED";
1817
+ static code = "WATCH_FILES_FAILED";
1650
1818
  static statusCode = 500;
1651
- static description = `Failed to create token: {message}`;
1819
+ static description = `Failed to watch files: {message}`;
1652
1820
  }
1653
- class ListPermissionsFailedError extends Error {
1821
+ class LogsFailedError extends Error {
1654
1822
  constructor(body) {
1655
1823
  super(
1656
- `LIST_PERMISSIONS_FAILED: ${body.message}`
1824
+ `LOGS_FAILED: ${body.message}`
1657
1825
  );
1658
1826
  this.body = body;
1659
- this.name = "ListPermissionsFailedError";
1827
+ this.name = "LogsFailedError";
1660
1828
  }
1661
- static code = "LIST_PERMISSIONS_FAILED";
1829
+ static code = "LOGS_FAILED";
1662
1830
  static statusCode = 500;
1663
- static description = `Failed to list permissions: {message}`;
1831
+ static description = `Failed to get logs: {message}`;
1664
1832
  }
1665
- class GetPermissionFailedError extends Error {
1833
+ class StatusFailedError extends Error {
1666
1834
  constructor(body) {
1667
1835
  super(
1668
- `GET_PERMISSION_FAILED: ${body.message}`
1836
+ `STATUS_FAILED: ${body.message}`
1669
1837
  );
1670
1838
  this.body = body;
1671
- this.name = "GetPermissionFailedError";
1839
+ this.name = "StatusFailedError";
1672
1840
  }
1673
- static code = "GET_PERMISSION_FAILED";
1841
+ static code = "STATUS_FAILED";
1674
1842
  static statusCode = 500;
1675
- static description = `Failed to get permission: {message}`;
1843
+ static description = `Failed to get dev server status: {message}`;
1676
1844
  }
1677
- class UpdatePermissionFailedError extends Error {
1845
+ class RestartFailedError extends Error {
1678
1846
  constructor(body) {
1679
1847
  super(
1680
- `UPDATE_PERMISSION_FAILED: ${body.message}`
1848
+ `RESTART_FAILED: ${body.message}`
1681
1849
  );
1682
1850
  this.body = body;
1683
- this.name = "UpdatePermissionFailedError";
1851
+ this.name = "RestartFailedError";
1684
1852
  }
1685
- static code = "UPDATE_PERMISSION_FAILED";
1853
+ static code = "RESTART_FAILED";
1686
1854
  static statusCode = 500;
1687
- static description = `Failed to update permission: {message}`;
1855
+ static description = `Failed to restart dev server: {message}`;
1688
1856
  }
1689
- class RevokePermissionFailedError extends Error {
1857
+ class ShutdownFailedError extends Error {
1690
1858
  constructor(body) {
1691
1859
  super(
1692
- `REVOKE_PERMISSION_FAILED: ${body.message}`
1860
+ `SHUTDOWN_FAILED: ${body.message}`
1693
1861
  );
1694
1862
  this.body = body;
1695
- this.name = "RevokePermissionFailedError";
1863
+ this.name = "ShutdownFailedError";
1696
1864
  }
1697
- static code = "REVOKE_PERMISSION_FAILED";
1865
+ static code = "SHUTDOWN_FAILED";
1698
1866
  static statusCode = 500;
1699
- static description = `Failed to revoke permission: {message}`;
1867
+ static description = `Failed to shutdown dev server: {message}`;
1700
1868
  }
1701
- class GrantPermissionFailedError extends Error {
1869
+ class CommitFailedError extends Error {
1702
1870
  constructor(body) {
1703
1871
  super(
1704
- `GRANT_PERMISSION_FAILED: ${body.message}`
1872
+ `COMMIT_FAILED: ${body.message}`
1705
1873
  );
1706
1874
  this.body = body;
1707
- this.name = "GrantPermissionFailedError";
1875
+ this.name = "CommitFailedError";
1708
1876
  }
1709
- static code = "GRANT_PERMISSION_FAILED";
1877
+ static code = "COMMIT_FAILED";
1710
1878
  static statusCode = 500;
1711
- static description = `Failed to grant permission: {message}`;
1879
+ static description = `Failed to commit changes: {message}`;
1712
1880
  }
1713
- class ListIdentitiesFailedError extends Error {
1881
+ class WriteFileFailedError extends Error {
1714
1882
  constructor(body) {
1715
1883
  super(
1716
- `LIST_IDENTITIES_FAILED: ${body.message}`
1884
+ `WRITE_FILE_FAILED: ${body.message}`
1717
1885
  );
1718
1886
  this.body = body;
1719
- this.name = "ListIdentitiesFailedError";
1887
+ this.name = "WriteFileFailedError";
1720
1888
  }
1721
- static code = "LIST_IDENTITIES_FAILED";
1889
+ static code = "WRITE_FILE_FAILED";
1722
1890
  static statusCode = 500;
1723
- static description = `Failed to list identities: {message}`;
1891
+ static description = `Failed to write file: {message}`;
1724
1892
  }
1725
- class DeleteIdentityFailedError extends Error {
1893
+ class ReadFileFailedError extends Error {
1726
1894
  constructor(body) {
1727
1895
  super(
1728
- `DELETE_IDENTITY_FAILED: ${body.message}`
1896
+ `READ_FILE_FAILED: ${body.message}`
1729
1897
  );
1730
1898
  this.body = body;
1731
- this.name = "DeleteIdentityFailedError";
1899
+ this.name = "ReadFileFailedError";
1732
1900
  }
1733
- static code = "DELETE_IDENTITY_FAILED";
1901
+ static code = "READ_FILE_FAILED";
1734
1902
  static statusCode = 500;
1735
- static description = `Failed to delete identity: {message}`;
1903
+ static description = `Failed to read file: {message}`;
1736
1904
  }
1737
- class CreateIdentityFailedError extends Error {
1905
+ class ExecutionFailedError extends Error {
1738
1906
  constructor(body) {
1739
1907
  super(
1740
- `CREATE_IDENTITY_FAILED: ${body.message}`
1908
+ `EXECUTION_FAILED: ${body.message}`
1741
1909
  );
1742
1910
  this.body = body;
1743
- this.name = "CreateIdentityFailedError";
1911
+ this.name = "ExecutionFailedError";
1744
1912
  }
1745
- static code = "CREATE_IDENTITY_FAILED";
1913
+ static code = "EXECUTION_FAILED";
1746
1914
  static statusCode = 500;
1747
- static description = `Failed to create identity: {message}`;
1915
+ static description = `Failed to execute command: {message}`;
1748
1916
  }
1749
- class VmPermissionNotFoundError extends Error {
1917
+ class RequestFailedError extends Error {
1750
1918
  constructor(body) {
1751
1919
  super(
1752
- `VM_PERMISSION_NOT_FOUND: ${body.message}`
1920
+ `REQUEST_FAILED: ${body.message}`
1753
1921
  );
1754
1922
  this.body = body;
1755
- this.name = "VmPermissionNotFoundError";
1923
+ this.name = "RequestFailedError";
1756
1924
  }
1757
- static code = "VM_PERMISSION_NOT_FOUND";
1758
- static statusCode = 404;
1759
- static description = `VM permission not found`;
1925
+ static code = "REQUEST_FAILED";
1926
+ static statusCode = 500;
1927
+ static description = `Failed to request dev server: {message}`;
1760
1928
  }
1761
- class PermissionNotFoundError extends Error {
1929
+ class DevServerFileNotFoundError extends Error {
1762
1930
  constructor(body) {
1763
1931
  super(
1764
- `PERMISSION_NOT_FOUND: ${body.message}`
1932
+ `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
1765
1933
  );
1766
1934
  this.body = body;
1767
- this.name = "PermissionNotFoundError";
1935
+ this.name = "DevServerFileNotFoundError";
1768
1936
  }
1769
- static code = "PERMISSION_NOT_FOUND";
1937
+ static code = "DEV_SERVER_FILE_NOT_FOUND";
1770
1938
  static statusCode = 404;
1771
- static description = `Permission not found`;
1939
+ static description = `Dev server file not found: {path}`;
1772
1940
  }
1773
- class VmAccessDeniedError extends Error {
1941
+ class DevServerInvalidRequestError extends Error {
1774
1942
  constructor(body) {
1775
1943
  super(
1776
- `VM_ACCESS_DENIED: ${body.message}`
1944
+ `DEV_SERVER_INVALID_REQUEST: ${body.message}`
1777
1945
  );
1778
1946
  this.body = body;
1779
- this.name = "VmAccessDeniedError";
1947
+ this.name = "DevServerInvalidRequestError";
1780
1948
  }
1781
- static code = "VM_ACCESS_DENIED";
1782
- static statusCode = 403;
1783
- static description = `You are not allowed to access this VM`;
1949
+ static code = "DEV_SERVER_INVALID_REQUEST";
1950
+ static statusCode = 400;
1951
+ static description = `Invalid dev server request: {message}`;
1784
1952
  }
1785
- class GitRepositoryAccessDeniedError extends Error {
1953
+ class DevServerNotFoundError extends Error {
1786
1954
  constructor(body) {
1787
1955
  super(
1788
- `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
1956
+ `DEV_SERVER_NOT_FOUND: ${body.message}`
1789
1957
  );
1790
1958
  this.body = body;
1791
- this.name = "GitRepositoryAccessDeniedError";
1959
+ this.name = "DevServerNotFoundError";
1792
1960
  }
1793
- static code = "GIT_REPOSITORY_ACCESS_DENIED";
1794
- static statusCode = 403;
1795
- static description = `You are not allowed to access this repository`;
1961
+ static code = "DEV_SERVER_NOT_FOUND";
1962
+ static statusCode = 404;
1963
+ static description = `Dev server not found: {server_id}`;
1796
1964
  }
1797
- class GitRepositoryNotFoundError extends Error {
1965
+ class BuildFailedError extends Error {
1798
1966
  constructor(body) {
1799
1967
  super(
1800
- `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
1968
+ `BUILD_FAILED: ${body.message}`
1801
1969
  );
1802
1970
  this.body = body;
1803
- this.name = "GitRepositoryNotFoundError";
1971
+ this.name = "BuildFailedError";
1804
1972
  }
1805
- static code = "GIT_REPOSITORY_NOT_FOUND";
1806
- static statusCode = 404;
1807
- static description = `Repository not found`;
1973
+ static code = "BUILD_FAILED";
1974
+ static statusCode = 500;
1975
+ static description = `Build failed on VM {vm_id}`;
1808
1976
  }
1809
- class CannotDeleteManagedIdentityError extends Error {
1977
+ class ServerDeploymentFailedError extends Error {
1810
1978
  constructor(body) {
1811
1979
  super(
1812
- `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
1980
+ `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1813
1981
  );
1814
1982
  this.body = body;
1815
- this.name = "CannotDeleteManagedIdentityError";
1983
+ this.name = "ServerDeploymentFailedError";
1816
1984
  }
1817
- static code = "CANNOT_DELETE_MANAGED_IDENTITY";
1818
- static statusCode = 403;
1819
- static description = `Cannot delete managed identities`;
1985
+ static code = "SERVER_DEPLOYMENT_FAILED";
1986
+ static statusCode = 502;
1987
+ static description = `Failed to deploy to servers`;
1820
1988
  }
1821
- class CannotModifyManagedIdentityError extends Error {
1989
+ class LockfileErrorError extends Error {
1822
1990
  constructor(body) {
1823
1991
  super(
1824
- `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
1992
+ `LOCKFILE_ERROR: ${body.message}`
1825
1993
  );
1826
1994
  this.body = body;
1827
- this.name = "CannotModifyManagedIdentityError";
1995
+ this.name = "LockfileErrorError";
1828
1996
  }
1829
- static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
1830
- static statusCode = 403;
1831
- static description = `Cannot modify managed identities`;
1997
+ static code = "LOCKFILE_ERROR";
1998
+ static statusCode = 500;
1999
+ static description = `Failed to generate dependency lockfile: {message}`;
1832
2000
  }
1833
- class IdentityAccessDeniedError extends Error {
2001
+ class UploadErrorError extends Error {
1834
2002
  constructor(body) {
1835
2003
  super(
1836
- `IDENTITY_ACCESS_DENIED: ${body.message}`
2004
+ `UPLOAD_ERROR: ${body.message}`
1837
2005
  );
1838
2006
  this.body = body;
1839
- this.name = "IdentityAccessDeniedError";
2007
+ this.name = "UploadErrorError";
1840
2008
  }
1841
- static code = "IDENTITY_ACCESS_DENIED";
1842
- static statusCode = 403;
1843
- static description = `You are not allowed to access this identity`;
2009
+ static code = "UPLOAD_ERROR";
2010
+ static statusCode = 500;
2011
+ static description = `Failed to upload deployment to storage`;
1844
2012
  }
1845
- class IdentityNotFoundError extends Error {
2013
+ class DomainMappingErrorError extends Error {
1846
2014
  constructor(body) {
1847
2015
  super(
1848
- `IDENTITY_NOT_FOUND: ${body.message}`
2016
+ `DOMAIN_MAPPING_ERROR: ${body.message}`
1849
2017
  );
1850
2018
  this.body = body;
1851
- this.name = "IdentityNotFoundError";
2019
+ this.name = "DomainMappingErrorError";
1852
2020
  }
1853
- static code = "IDENTITY_NOT_FOUND";
1854
- static statusCode = 404;
1855
- static description = `Identity not found`;
2021
+ static code = "DOMAIN_MAPPING_ERROR";
2022
+ static statusCode = 500;
2023
+ static description = `Failed to configure domain mapping for: {domain}`;
1856
2024
  }
1857
- class ExecuteInternalErrorError extends Error {
2025
+ class CertificateProvisioningErrorError extends Error {
1858
2026
  constructor(body) {
1859
2027
  super(
1860
- `EXECUTE_INTERNAL_ERROR: ${body.message}`
2028
+ `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
1861
2029
  );
1862
2030
  this.body = body;
1863
- this.name = "ExecuteInternalErrorError";
2031
+ this.name = "CertificateProvisioningErrorError";
1864
2032
  }
1865
- static code = "EXECUTE_INTERNAL_ERROR";
1866
- static statusCode = 500;
1867
- static description = `Internal error: {message}`;
2033
+ static code = "CERTIFICATE_PROVISIONING_ERROR";
2034
+ static statusCode = 502;
2035
+ static description = `Failed to provision certificate for domain: {domain}`;
1868
2036
  }
1869
- class ExecuteAccessDeniedError extends Error {
2037
+ class NoEntrypointFoundError extends Error {
1870
2038
  constructor(body) {
1871
2039
  super(
1872
- `EXECUTE_ACCESS_DENIED: ${body.message}`
2040
+ `NO_ENTRYPOINT_FOUND: ${body.message}`
1873
2041
  );
1874
2042
  this.body = body;
1875
- this.name = "ExecuteAccessDeniedError";
2043
+ this.name = "NoEntrypointFoundError";
1876
2044
  }
1877
- static code = "EXECUTE_ACCESS_DENIED";
1878
- static statusCode = 403;
1879
- static description = `Access denied to execute run`;
2045
+ static code = "NO_ENTRYPOINT_FOUND";
2046
+ static statusCode = 400;
2047
+ static description = `No entrypoint found in deployment`;
1880
2048
  }
1881
- class ListRunsFailedError extends Error {
2049
+ class EntrypointNotFoundError extends Error {
1882
2050
  constructor(body) {
1883
2051
  super(
1884
- `LIST_RUNS_FAILED: ${body.message}`
2052
+ `ENTRYPOINT_NOT_FOUND: ${body.message}`
1885
2053
  );
1886
2054
  this.body = body;
1887
- this.name = "ListRunsFailedError";
2055
+ this.name = "EntrypointNotFoundError";
1888
2056
  }
1889
- static code = "LIST_RUNS_FAILED";
1890
- static statusCode = 500;
1891
- static description = `Failed to list execute runs: {message}`;
2057
+ static code = "ENTRYPOINT_NOT_FOUND";
2058
+ static statusCode = 400;
2059
+ static description = `Entrypoint not found: {entrypoint}`;
1892
2060
  }
1893
- class ExecutionErrorError extends Error {
2061
+ class NoDomainOwnershipError extends Error {
1894
2062
  constructor(body) {
1895
2063
  super(
1896
- `EXECUTION_ERROR: ${body.message}`
2064
+ `NO_DOMAIN_OWNERSHIP: ${body.message}`
1897
2065
  );
1898
2066
  this.body = body;
1899
- this.name = "ExecutionErrorError";
2067
+ this.name = "NoDomainOwnershipError";
1900
2068
  }
1901
- static code = "EXECUTION_ERROR";
1902
- static statusCode = 500;
1903
- static description = `Script execution error: {message}`;
2069
+ static code = "NO_DOMAIN_OWNERSHIP";
2070
+ static statusCode = 403;
2071
+ static description = `No domain ownership for: {domain}`;
1904
2072
  }
1905
- class ConnectionFailedError extends Error {
2073
+ class InvalidDomainsError extends Error {
1906
2074
  constructor(body) {
1907
2075
  super(
1908
- `CONNECTION_FAILED: ${body.message}`
2076
+ `INVALID_DOMAINS: ${body.message}`
1909
2077
  );
1910
2078
  this.body = body;
1911
- this.name = "ConnectionFailedError";
2079
+ this.name = "InvalidDomainsError";
1912
2080
  }
1913
- static code = "CONNECTION_FAILED";
1914
- static statusCode = 500;
1915
- static description = `Failed to connect to execute server: {message}`;
2081
+ static code = "INVALID_DOMAINS";
2082
+ static statusCode = 400;
2083
+ static description = `Invalid domains provided`;
1916
2084
  }
1917
- class MetadataWriteFailedError extends Error {
2085
+ class WebDeploymentBadRequestError extends Error {
1918
2086
  constructor(body) {
1919
2087
  super(
1920
- `METADATA_WRITE_FAILED: ${body.message}`
2088
+ `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
1921
2089
  );
1922
2090
  this.body = body;
1923
- this.name = "MetadataWriteFailedError";
2091
+ this.name = "WebDeploymentBadRequestError";
1924
2092
  }
1925
- static code = "METADATA_WRITE_FAILED";
1926
- static statusCode = 500;
1927
- static description = `Failed to write metadata file: {message}`;
2093
+ static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2094
+ static statusCode = 400;
2095
+ static description = `Bad request: {message}`;
1928
2096
  }
1929
- class NodeModulesInstallFailedError extends Error {
2097
+ class DeploymentNotFoundError extends Error {
1930
2098
  constructor(body) {
1931
2099
  super(
1932
- `NODE_MODULES_INSTALL_FAILED: ${body.message}`
2100
+ `DEPLOYMENT_NOT_FOUND: ${body.message}`
1933
2101
  );
1934
2102
  this.body = body;
1935
- this.name = "NodeModulesInstallFailedError";
2103
+ this.name = "DeploymentNotFoundError";
1936
2104
  }
1937
- static code = "NODE_MODULES_INSTALL_FAILED";
1938
- static statusCode = 500;
1939
- static description = `Failed to install node modules: {message}`;
2105
+ static code = "DEPLOYMENT_NOT_FOUND";
2106
+ static statusCode = 404;
2107
+ static description = `Deployment not found`;
1940
2108
  }
1941
- class NodeModulesDownloadFailedError extends Error {
2109
+ class DatabaseErrorError extends Error {
1942
2110
  constructor(body) {
1943
2111
  super(
1944
- `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
2112
+ `DATABASE_ERROR: ${body.message}`
1945
2113
  );
1946
2114
  this.body = body;
1947
- this.name = "NodeModulesDownloadFailedError";
2115
+ this.name = "DatabaseErrorError";
1948
2116
  }
1949
- static code = "NODE_MODULES_DOWNLOAD_FAILED";
2117
+ static code = "DATABASE_ERROR";
1950
2118
  static statusCode = 500;
1951
- static description = `Failed to download node modules: {message}`;
2119
+ static description = `Database operation failed: {message}`;
1952
2120
  }
1953
- class LockGenerationFailedError extends Error {
2121
+ class TriggerErrorError extends Error {
1954
2122
  constructor(body) {
1955
2123
  super(
1956
- `LOCK_GENERATION_FAILED: ${body.message}`
2124
+ `TRIGGER_ERROR: ${body.message}`
1957
2125
  );
1958
2126
  this.body = body;
1959
- this.name = "LockGenerationFailedError";
2127
+ this.name = "TriggerErrorError";
1960
2128
  }
1961
- static code = "LOCK_GENERATION_FAILED";
2129
+ static code = "TRIGGER_ERROR";
1962
2130
  static statusCode = 500;
1963
- static description = `Failed to generate lock file: {message}`;
2131
+ static description = `Failed to manage triggers: {message}`;
1964
2132
  }
1965
- class WriteScriptFailedError extends Error {
2133
+ class TokenErrorError extends Error {
1966
2134
  constructor(body) {
1967
2135
  super(
1968
- `WRITE_SCRIPT_FAILED: ${body.message}`
2136
+ `TOKEN_ERROR: ${body.message}`
1969
2137
  );
1970
2138
  this.body = body;
1971
- this.name = "WriteScriptFailedError";
2139
+ this.name = "TokenErrorError";
1972
2140
  }
1973
- static code = "WRITE_SCRIPT_FAILED";
2141
+ static code = "TOKEN_ERROR";
1974
2142
  static statusCode = 500;
1975
- static description = `Failed to write script file: {message}`;
2143
+ static description = `Failed to manage tokens: {message}`;
1976
2144
  }
1977
- class DirectoryCreationFailedError extends Error {
2145
+ class PermissionErrorError extends Error {
1978
2146
  constructor(body) {
1979
2147
  super(
1980
- `DIRECTORY_CREATION_FAILED: ${body.message}`
2148
+ `PERMISSION_ERROR: ${body.message}`
1981
2149
  );
1982
2150
  this.body = body;
1983
- this.name = "DirectoryCreationFailedError";
2151
+ this.name = "PermissionErrorError";
1984
2152
  }
1985
- static code = "DIRECTORY_CREATION_FAILED";
2153
+ static code = "PERMISSION_ERROR";
1986
2154
  static statusCode = 500;
1987
- static description = `Failed to create script directory: {message}`;
2155
+ static description = `Failed to manage permissions: {message}`;
1988
2156
  }
1989
- class NetworkPermissionsFailedError extends Error {
2157
+ class IdentityErrorError extends Error {
1990
2158
  constructor(body) {
1991
2159
  super(
1992
- `NETWORK_PERMISSIONS_FAILED: ${body.message}`
2160
+ `IDENTITY_ERROR: ${body.message}`
1993
2161
  );
1994
2162
  this.body = body;
1995
- this.name = "NetworkPermissionsFailedError";
2163
+ this.name = "IdentityErrorError";
1996
2164
  }
1997
- static code = "NETWORK_PERMISSIONS_FAILED";
2165
+ static code = "IDENTITY_ERROR";
1998
2166
  static statusCode = 500;
1999
- static description = `Failed to insert network permissions: {message}`;
2167
+ static description = `Failed to manage identity: {message}`;
2000
2168
  }
2001
- class LoggingFailedError extends Error {
2169
+ class GetContentFailedError extends Error {
2002
2170
  constructor(body) {
2003
2171
  super(
2004
- `LOGGING_FAILED: ${body.message}`
2172
+ `GET_CONTENT_FAILED: ${body.message}`
2005
2173
  );
2006
2174
  this.body = body;
2007
- this.name = "LoggingFailedError";
2175
+ this.name = "GetContentFailedError";
2008
2176
  }
2009
- static code = "LOGGING_FAILED";
2177
+ static code = "GET_CONTENT_FAILED";
2010
2178
  static statusCode = 500;
2011
- static description = `Failed to log execute run: {message}`;
2179
+ static description = `Failed to get content: {message}`;
2012
2180
  }
2013
- class RunNotFoundError extends Error {
2181
+ class ContentNotFoundError extends Error {
2014
2182
  constructor(body) {
2015
2183
  super(
2016
- `RUN_NOT_FOUND: ${body.message}`
2184
+ `CONTENT_NOT_FOUND: ${body.message}`
2017
2185
  );
2018
2186
  this.body = body;
2019
- this.name = "RunNotFoundError";
2187
+ this.name = "ContentNotFoundError";
2020
2188
  }
2021
- static code = "RUN_NOT_FOUND";
2189
+ static code = "CONTENT_NOT_FOUND";
2022
2190
  static statusCode = 404;
2023
- static description = `Execute run not found: {run_id}`;
2191
+ static description = `Content not found: {path}`;
2024
2192
  }
2025
- class CloudstateInternalErrorError extends Error {
2193
+ class DownloadFailedError extends Error {
2026
2194
  constructor(body) {
2027
2195
  super(
2028
- `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2196
+ `DOWNLOAD_FAILED: ${body.message}`
2029
2197
  );
2030
2198
  this.body = body;
2031
- this.name = "CloudstateInternalErrorError";
2199
+ this.name = "DownloadFailedError";
2032
2200
  }
2033
- static code = "CLOUDSTATE_INTERNAL_ERROR";
2201
+ static code = "DOWNLOAD_FAILED";
2034
2202
  static statusCode = 500;
2035
- static description = `Internal error: {message}`;
2203
+ static description = `Failed to download repository: {message}`;
2036
2204
  }
2037
- class CloudstateDatabaseErrorError extends Error {
2205
+ class GitServerErrorError extends Error {
2038
2206
  constructor(body) {
2039
2207
  super(
2040
- `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2208
+ `GIT_SERVER_ERROR: ${body.message}`
2041
2209
  );
2042
2210
  this.body = body;
2043
- this.name = "CloudstateDatabaseErrorError";
2211
+ this.name = "GitServerErrorError";
2044
2212
  }
2045
- static code = "CLOUDSTATE_DATABASE_ERROR";
2213
+ static code = "GIT_SERVER_ERROR";
2046
2214
  static statusCode = 500;
2047
- static description = `Database operation failed: {message}`;
2215
+ static description = `Git server error: {message}`;
2048
2216
  }
2049
- class CloudstateAccessDeniedError extends Error {
2217
+ class ParseResponseErrorError extends Error {
2050
2218
  constructor(body) {
2051
2219
  super(
2052
- `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2220
+ `PARSE_RESPONSE_ERROR: ${body.message}`
2053
2221
  );
2054
2222
  this.body = body;
2055
- this.name = "CloudstateAccessDeniedError";
2223
+ this.name = "ParseResponseErrorError";
2056
2224
  }
2057
- static code = "CLOUDSTATE_ACCESS_DENIED";
2058
- static statusCode = 403;
2059
- static description = `Access denied to project: {project_id}`;
2225
+ static code = "PARSE_RESPONSE_ERROR";
2226
+ static statusCode = 500;
2227
+ static description = `Failed to parse response from Git server: {message}`;
2060
2228
  }
2061
- class RestoreFailedError extends Error {
2229
+ class RepositoryAccessDeniedError extends Error {
2062
2230
  constructor(body) {
2063
2231
  super(
2064
- `RESTORE_FAILED: ${body.message}`
2232
+ `REPOSITORY_ACCESS_DENIED: ${body.message}`
2065
2233
  );
2066
2234
  this.body = body;
2067
- this.name = "RestoreFailedError";
2235
+ this.name = "RepositoryAccessDeniedError";
2068
2236
  }
2069
- static code = "RESTORE_FAILED";
2070
- static statusCode = 500;
2071
- static description = `Failed to restore from backup: {message}`;
2237
+ static code = "REPOSITORY_ACCESS_DENIED";
2238
+ static statusCode = 403;
2239
+ static description = `Repository does not belong to account`;
2072
2240
  }
2073
- class CreateBackupFailedError extends Error {
2241
+ class GitHubSyncFailedError extends Error {
2074
2242
  constructor(body) {
2075
2243
  super(
2076
- `CREATE_BACKUP_FAILED: ${body.message}`
2244
+ `GIT_HUB_SYNC_FAILED: ${body.message}`
2077
2245
  );
2078
2246
  this.body = body;
2079
- this.name = "CreateBackupFailedError";
2247
+ this.name = "GitHubSyncFailedError";
2080
2248
  }
2081
- static code = "CREATE_BACKUP_FAILED";
2249
+ static code = "GIT_HUB_SYNC_FAILED";
2082
2250
  static statusCode = 500;
2083
- static description = `Failed to create backup: {message}`;
2251
+ static description = `Failed to configure GitHub sync: {message}`;
2084
2252
  }
2085
- class BackupFailedError extends Error {
2253
+ class UpdateDefaultBranchFailedError extends Error {
2086
2254
  constructor(body) {
2087
2255
  super(
2088
- `BACKUP_FAILED: ${body.message}`
2256
+ `UPDATE_DEFAULT_BRANCH_FAILED: ${body.message}`
2089
2257
  );
2090
2258
  this.body = body;
2091
- this.name = "BackupFailedError";
2259
+ this.name = "UpdateDefaultBranchFailedError";
2092
2260
  }
2093
- static code = "BACKUP_FAILED";
2261
+ static code = "UPDATE_DEFAULT_BRANCH_FAILED";
2094
2262
  static statusCode = 500;
2095
- static description = `Backup failed: {message}`;
2263
+ static description = `Failed to update default branch: {message}`;
2096
2264
  }
2097
- class DeploymentFailedError extends Error {
2265
+ class GetRepositoryInfoFailedError extends Error {
2098
2266
  constructor(body) {
2099
2267
  super(
2100
- `DEPLOYMENT_FAILED: ${body.message}`
2268
+ `GET_REPOSITORY_INFO_FAILED: ${body.message}`
2101
2269
  );
2102
2270
  this.body = body;
2103
- this.name = "DeploymentFailedError";
2271
+ this.name = "GetRepositoryInfoFailedError";
2104
2272
  }
2105
- static code = "DEPLOYMENT_FAILED";
2273
+ static code = "GET_REPOSITORY_INFO_FAILED";
2106
2274
  static statusCode = 500;
2107
- static description = `Deployment failed: {message}`;
2275
+ static description = `Failed to get repository info: {message}`;
2108
2276
  }
2109
- class InvalidDeploymentRequestError extends Error {
2277
+ class ListRepositoriesFailedError extends Error {
2110
2278
  constructor(body) {
2111
2279
  super(
2112
- `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2280
+ `LIST_REPOSITORIES_FAILED: ${body.message}`
2113
2281
  );
2114
2282
  this.body = body;
2115
- this.name = "InvalidDeploymentRequestError";
2283
+ this.name = "ListRepositoriesFailedError";
2116
2284
  }
2117
- static code = "INVALID_DEPLOYMENT_REQUEST";
2118
- static statusCode = 400;
2119
- static description = `Invalid deployment request: {message}`;
2285
+ static code = "LIST_REPOSITORIES_FAILED";
2286
+ static statusCode = 500;
2287
+ static description = `Failed to list repositories: {message}`;
2120
2288
  }
2121
- class ProjectNotFoundError extends Error {
2289
+ class DeleteRepositoryFailedError extends Error {
2122
2290
  constructor(body) {
2123
2291
  super(
2124
- `PROJECT_NOT_FOUND: ${body.message}`
2292
+ `DELETE_REPOSITORY_FAILED: ${body.message}`
2125
2293
  );
2126
2294
  this.body = body;
2127
- this.name = "ProjectNotFoundError";
2295
+ this.name = "DeleteRepositoryFailedError";
2128
2296
  }
2129
- static code = "PROJECT_NOT_FOUND";
2130
- static statusCode = 404;
2131
- static description = `Project not found: {project_id}`;
2297
+ static code = "DELETE_REPOSITORY_FAILED";
2298
+ static statusCode = 500;
2299
+ static description = `Failed to delete repository: {message}`;
2132
2300
  }
2133
- class ResizeFailedError extends Error {
2301
+ class CreateRepositoryFailedError extends Error {
2134
2302
  constructor(body) {
2135
2303
  super(
2136
- `RESIZE_FAILED: ${body.message}`
2304
+ `CREATE_REPOSITORY_FAILED: ${body.message}`
2137
2305
  );
2138
2306
  this.body = body;
2139
- this.name = "ResizeFailedError";
2307
+ this.name = "CreateRepositoryFailedError";
2140
2308
  }
2141
- static code = "RESIZE_FAILED";
2309
+ static code = "CREATE_REPOSITORY_FAILED";
2142
2310
  static statusCode = 500;
2143
- static description = `Failed to resize VM: {message}`;
2311
+ static description = `Failed to create repository: {message}`;
2144
2312
  }
2145
- class InternalResizeVmNotFoundError extends Error {
2313
+ class SerializationErrorError extends Error {
2146
2314
  constructor(body) {
2147
2315
  super(
2148
- `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
2316
+ `SERIALIZATION_ERROR: ${body.message}`
2149
2317
  );
2150
2318
  this.body = body;
2151
- this.name = "InternalResizeVmNotFoundError";
2319
+ this.name = "SerializationErrorError";
2152
2320
  }
2153
- static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2154
- static statusCode = 404;
2155
- static description = `VM not found`;
2321
+ static code = "SERIALIZATION_ERROR";
2322
+ static statusCode = 400;
2323
+ static description = `Failed to serialize request: {message}`;
2156
2324
  }
2157
- class DomainOwnershipVerificationFailedError extends Error {
2325
+ class GitInvalidRequestError extends Error {
2158
2326
  constructor(body) {
2159
2327
  super(
2160
- `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
2328
+ `GIT_INVALID_REQUEST: ${body.message}`
2161
2329
  );
2162
2330
  this.body = body;
2163
- this.name = "DomainOwnershipVerificationFailedError";
2331
+ this.name = "GitInvalidRequestError";
2164
2332
  }
2165
- static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
2166
- static statusCode = 403;
2167
- static description = `Domain ownership verification failed`;
2333
+ static code = "GIT_INVALID_REQUEST";
2334
+ static statusCode = 400;
2335
+ static description = `Invalid request: {message}`;
2168
2336
  }
2169
- class ErrorDeletingRecordError extends Error {
2337
+ class RepositoryNotFoundError extends Error {
2170
2338
  constructor(body) {
2171
2339
  super(
2172
- `ERROR_DELETING_RECORD: ${body.message}`
2340
+ `REPOSITORY_NOT_FOUND: ${body.message}`
2173
2341
  );
2174
2342
  this.body = body;
2175
- this.name = "ErrorDeletingRecordError";
2343
+ this.name = "RepositoryNotFoundError";
2176
2344
  }
2177
- static code = "ERROR_DELETING_RECORD";
2178
- static statusCode = 500;
2179
- static description = `Error deleting DNS record for {domain}/{name}: {message}`;
2345
+ static code = "REPOSITORY_NOT_FOUND";
2346
+ static statusCode = 404;
2347
+ static description = `Repository not found: {repo_id}`;
2180
2348
  }
2181
- class RecordOwnershipErrorError extends Error {
2349
+ class DomainAlreadyExistsError extends Error {
2182
2350
  constructor(body) {
2183
2351
  super(
2184
- `RECORD_OWNERSHIP_ERROR: ${body.message}`
2352
+ `DOMAIN_ALREADY_EXISTS: ${body.message}`
2185
2353
  );
2186
2354
  this.body = body;
2187
- this.name = "RecordOwnershipErrorError";
2355
+ this.name = "DomainAlreadyExistsError";
2188
2356
  }
2189
- static code = "RECORD_OWNERSHIP_ERROR";
2190
- static statusCode = 403;
2191
- static description = `Account {account_id} does not own record {record_id}`;
2357
+ static code = "DOMAIN_ALREADY_EXISTS";
2358
+ static statusCode = 400;
2359
+ static description = `Domain already exists: {domain}`;
2192
2360
  }
2193
- class ErrorCreatingRecordError extends Error {
2361
+ class FailedToInsertOwnershipError extends Error {
2194
2362
  constructor(body) {
2195
2363
  super(
2196
- `ERROR_CREATING_RECORD: ${body.message}`
2364
+ `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
2197
2365
  );
2198
2366
  this.body = body;
2199
- this.name = "ErrorCreatingRecordError";
2367
+ this.name = "FailedToInsertOwnershipError";
2200
2368
  }
2201
- static code = "ERROR_CREATING_RECORD";
2369
+ static code = "FAILED_TO_INSERT_OWNERSHIP";
2202
2370
  static statusCode = 500;
2203
- static description = `Error creating DNS record: {message}`;
2204
- }
2205
- class DomainOwnershipErrorError extends Error {
2206
- constructor(body) {
2207
- super(
2208
- `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
2209
- );
2210
- this.body = body;
2211
- this.name = "DomainOwnershipErrorError";
2212
- }
2213
- static code = "DOMAIN_OWNERSHIP_ERROR";
2214
- static statusCode = 403;
2215
- static description = `Account {account_id} does not own domain {domain}`;
2371
+ static description = `Failed to insert domain ownership: {message}`;
2216
2372
  }
2217
- class BrowserOperationFailedError extends Error {
2373
+ class FailedRemoveDomainMappingError extends Error {
2218
2374
  constructor(body) {
2219
2375
  super(
2220
- `BROWSER_OPERATION_FAILED: ${body.message}`
2376
+ `FAILED_REMOVE_DOMAIN_MAPPING: ${body.message}`
2221
2377
  );
2222
2378
  this.body = body;
2223
- this.name = "BrowserOperationFailedError";
2379
+ this.name = "FailedRemoveDomainMappingError";
2224
2380
  }
2225
- static code = "BROWSER_OPERATION_FAILED";
2381
+ static code = "FAILED_REMOVE_DOMAIN_MAPPING";
2226
2382
  static statusCode = 500;
2227
- static description = `Browser operation failed: {message}`;
2383
+ static description = `Failed to remove domain mapping: {message}`;
2228
2384
  }
2229
- class WatchFilesFailedError extends Error {
2385
+ class FailedPermissionsCheckError extends Error {
2230
2386
  constructor(body) {
2231
2387
  super(
2232
- `WATCH_FILES_FAILED: ${body.message}`
2388
+ `FAILED_PERMISSIONS_CHECK: ${body.message}`
2233
2389
  );
2234
2390
  this.body = body;
2235
- this.name = "WatchFilesFailedError";
2391
+ this.name = "FailedPermissionsCheckError";
2236
2392
  }
2237
- static code = "WATCH_FILES_FAILED";
2238
- static statusCode = 500;
2239
- static description = `Failed to watch files: {message}`;
2393
+ static code = "FAILED_PERMISSIONS_CHECK";
2394
+ static statusCode = 401;
2395
+ static description = `You do not have permission to delete the domain mapping for: {domain}`;
2240
2396
  }
2241
- class LogsFailedError extends Error {
2397
+ class FailedToCheckDomainMappingPermissionsError extends Error {
2242
2398
  constructor(body) {
2243
2399
  super(
2244
- `LOGS_FAILED: ${body.message}`
2400
+ `FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS: ${body.message}`
2245
2401
  );
2246
2402
  this.body = body;
2247
- this.name = "LogsFailedError";
2403
+ this.name = "FailedToCheckDomainMappingPermissionsError";
2248
2404
  }
2249
- static code = "LOGS_FAILED";
2250
- static statusCode = 500;
2251
- static description = `Failed to get logs: {message}`;
2405
+ static code = "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS";
2406
+ static statusCode = 502;
2407
+ static description = `Failed to check permissions: {message}`;
2252
2408
  }
2253
- class StatusFailedError extends Error {
2409
+ class CloudstateInternalErrorError extends Error {
2254
2410
  constructor(body) {
2255
2411
  super(
2256
- `STATUS_FAILED: ${body.message}`
2412
+ `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2257
2413
  );
2258
2414
  this.body = body;
2259
- this.name = "StatusFailedError";
2415
+ this.name = "CloudstateInternalErrorError";
2260
2416
  }
2261
- static code = "STATUS_FAILED";
2417
+ static code = "CLOUDSTATE_INTERNAL_ERROR";
2262
2418
  static statusCode = 500;
2263
- static description = `Failed to get dev server status: {message}`;
2419
+ static description = `Internal error: {message}`;
2264
2420
  }
2265
- class RestartFailedError extends Error {
2421
+ class CloudstateDatabaseErrorError extends Error {
2266
2422
  constructor(body) {
2267
2423
  super(
2268
- `RESTART_FAILED: ${body.message}`
2424
+ `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2269
2425
  );
2270
2426
  this.body = body;
2271
- this.name = "RestartFailedError";
2427
+ this.name = "CloudstateDatabaseErrorError";
2272
2428
  }
2273
- static code = "RESTART_FAILED";
2429
+ static code = "CLOUDSTATE_DATABASE_ERROR";
2274
2430
  static statusCode = 500;
2275
- static description = `Failed to restart dev server: {message}`;
2431
+ static description = `Database operation failed: {message}`;
2276
2432
  }
2277
- class ShutdownFailedError extends Error {
2433
+ class CloudstateAccessDeniedError extends Error {
2278
2434
  constructor(body) {
2279
2435
  super(
2280
- `SHUTDOWN_FAILED: ${body.message}`
2436
+ `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2281
2437
  );
2282
2438
  this.body = body;
2283
- this.name = "ShutdownFailedError";
2439
+ this.name = "CloudstateAccessDeniedError";
2284
2440
  }
2285
- static code = "SHUTDOWN_FAILED";
2286
- static statusCode = 500;
2287
- static description = `Failed to shutdown dev server: {message}`;
2441
+ static code = "CLOUDSTATE_ACCESS_DENIED";
2442
+ static statusCode = 403;
2443
+ static description = `Access denied to project: {project_id}`;
2288
2444
  }
2289
- class CommitFailedError extends Error {
2445
+ class RestoreFailedError extends Error {
2290
2446
  constructor(body) {
2291
2447
  super(
2292
- `COMMIT_FAILED: ${body.message}`
2448
+ `RESTORE_FAILED: ${body.message}`
2293
2449
  );
2294
2450
  this.body = body;
2295
- this.name = "CommitFailedError";
2451
+ this.name = "RestoreFailedError";
2296
2452
  }
2297
- static code = "COMMIT_FAILED";
2453
+ static code = "RESTORE_FAILED";
2298
2454
  static statusCode = 500;
2299
- static description = `Failed to commit changes: {message}`;
2455
+ static description = `Failed to restore from backup: {message}`;
2300
2456
  }
2301
- class WriteFileFailedError extends Error {
2457
+ class CreateBackupFailedError extends Error {
2302
2458
  constructor(body) {
2303
2459
  super(
2304
- `WRITE_FILE_FAILED: ${body.message}`
2460
+ `CREATE_BACKUP_FAILED: ${body.message}`
2305
2461
  );
2306
2462
  this.body = body;
2307
- this.name = "WriteFileFailedError";
2463
+ this.name = "CreateBackupFailedError";
2308
2464
  }
2309
- static code = "WRITE_FILE_FAILED";
2465
+ static code = "CREATE_BACKUP_FAILED";
2310
2466
  static statusCode = 500;
2311
- static description = `Failed to write file: {message}`;
2467
+ static description = `Failed to create backup: {message}`;
2312
2468
  }
2313
- class ReadFileFailedError extends Error {
2469
+ class BackupFailedError extends Error {
2314
2470
  constructor(body) {
2315
2471
  super(
2316
- `READ_FILE_FAILED: ${body.message}`
2472
+ `BACKUP_FAILED: ${body.message}`
2317
2473
  );
2318
2474
  this.body = body;
2319
- this.name = "ReadFileFailedError";
2475
+ this.name = "BackupFailedError";
2320
2476
  }
2321
- static code = "READ_FILE_FAILED";
2477
+ static code = "BACKUP_FAILED";
2322
2478
  static statusCode = 500;
2323
- static description = `Failed to read file: {message}`;
2479
+ static description = `Backup failed: {message}`;
2324
2480
  }
2325
- class ExecutionFailedError extends Error {
2481
+ class DeploymentFailedError extends Error {
2326
2482
  constructor(body) {
2327
2483
  super(
2328
- `EXECUTION_FAILED: ${body.message}`
2484
+ `DEPLOYMENT_FAILED: ${body.message}`
2329
2485
  );
2330
2486
  this.body = body;
2331
- this.name = "ExecutionFailedError";
2487
+ this.name = "DeploymentFailedError";
2332
2488
  }
2333
- static code = "EXECUTION_FAILED";
2489
+ static code = "DEPLOYMENT_FAILED";
2334
2490
  static statusCode = 500;
2335
- static description = `Failed to execute command: {message}`;
2491
+ static description = `Deployment failed: {message}`;
2336
2492
  }
2337
- class RequestFailedError extends Error {
2493
+ class InvalidDeploymentRequestError extends Error {
2338
2494
  constructor(body) {
2339
2495
  super(
2340
- `REQUEST_FAILED: ${body.message}`
2496
+ `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2341
2497
  );
2342
2498
  this.body = body;
2343
- this.name = "RequestFailedError";
2499
+ this.name = "InvalidDeploymentRequestError";
2344
2500
  }
2345
- static code = "REQUEST_FAILED";
2346
- static statusCode = 500;
2347
- static description = `Failed to request dev server: {message}`;
2501
+ static code = "INVALID_DEPLOYMENT_REQUEST";
2502
+ static statusCode = 400;
2503
+ static description = `Invalid deployment request: {message}`;
2348
2504
  }
2349
- class DevServerFileNotFoundError extends Error {
2505
+ class ProjectNotFoundError extends Error {
2350
2506
  constructor(body) {
2351
2507
  super(
2352
- `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
2508
+ `PROJECT_NOT_FOUND: ${body.message}`
2353
2509
  );
2354
2510
  this.body = body;
2355
- this.name = "DevServerFileNotFoundError";
2511
+ this.name = "ProjectNotFoundError";
2356
2512
  }
2357
- static code = "DEV_SERVER_FILE_NOT_FOUND";
2513
+ static code = "PROJECT_NOT_FOUND";
2358
2514
  static statusCode = 404;
2359
- static description = `Dev server file not found: {path}`;
2515
+ static description = `Project not found: {project_id}`;
2360
2516
  }
2361
- class DevServerInvalidRequestError extends Error {
2517
+ class UnauthorizedErrorError extends Error {
2362
2518
  constructor(body) {
2363
2519
  super(
2364
- `DEV_SERVER_INVALID_REQUEST: ${body.message}`
2520
+ `UNAUTHORIZED_ERROR: ${body.message}`
2365
2521
  );
2366
2522
  this.body = body;
2367
- this.name = "DevServerInvalidRequestError";
2523
+ this.name = "UnauthorizedErrorError";
2368
2524
  }
2369
- static code = "DEV_SERVER_INVALID_REQUEST";
2370
- static statusCode = 400;
2371
- static description = `Invalid dev server request: {message}`;
2525
+ static code = "UNAUTHORIZED_ERROR";
2526
+ static statusCode = 401;
2527
+ static description = `Unauthorized request to {route}`;
2372
2528
  }
2373
- class DevServerNotFoundError extends Error {
2529
+ class AnyhowError extends Error {
2374
2530
  constructor(body) {
2375
2531
  super(
2376
- `DEV_SERVER_NOT_FOUND: ${body.message}`
2532
+ `ANYHOW: ${body.message}`
2377
2533
  );
2378
2534
  this.body = body;
2379
- this.name = "DevServerNotFoundError";
2535
+ this.name = "AnyhowError";
2380
2536
  }
2381
- static code = "DEV_SERVER_NOT_FOUND";
2382
- static statusCode = 404;
2383
- static description = `Dev server not found: {server_id}`;
2537
+ static code = "ANYHOW";
2538
+ static statusCode = 500;
2539
+ static description = `null`;
2384
2540
  }
2385
2541
  const FREESTYLE_ERROR_CODE_MAP = {
2542
+ "INTERNAL_ERROR": InternalErrorError,
2543
+ "DOCKER_IMPORT_BAD_REQUEST": DockerImportBadRequestError,
2386
2544
  "VM_NOT_FOUND_IN_FS": VmNotFoundInFsError,
2387
2545
  "VM_NOT_RUNNING": VmNotRunningError,
2388
2546
  "VM_NOT_FOUND": VmNotFoundError,
@@ -2392,8 +2550,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
2392
2550
  "VM_MUST_BE_STOPPED": VmMustBeStoppedError,
2393
2551
  "ALREADY_HAS_BASE": AlreadyHasBaseError,
2394
2552
  "NOT_FOUND": NotFoundError,
2395
- "INTERNAL_ERROR": InternalErrorError,
2396
- "DOCKER_IMPORT_BAD_REQUEST": DockerImportBadRequestError,
2397
2553
  "FORK_VM_NOT_FOUND": ForkVmNotFoundError,
2398
2554
  "CREATE_SNAPSHOT_BAD_REQUEST": CreateSnapshotBadRequestError,
2399
2555
  "SNAPSHOT_VM_BAD_REQUEST": SnapshotVmBadRequestError,
@@ -2411,7 +2567,6 @@ const FREESTYLE_ERROR_CODE_MAP = {
2411
2567
  "VM_OPERATION_DENIED_DURING_TRANSACTION": VmOperationDeniedDuringTransactionError,
2412
2568
  "VM_TRANSACTION_ID_MISMATCH": VmTransactionIdMismatchError,
2413
2569
  "VM_NOT_IN_TRANSACTION": VmNotInTransactionError,
2414
- "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
2415
2570
  "USER_NOT_FOUND": UserNotFoundError,
2416
2571
  "USER_ALREADY_EXISTS": UserAlreadyExistsError,
2417
2572
  "VALIDATION_ERROR": ValidationErrorError,
@@ -2428,6 +2583,7 @@ const FREESTYLE_ERROR_CODE_MAP = {
2428
2583
  "GROUP_NAME_INVALID_CHARS": GroupNameInvalidCharsError,
2429
2584
  "GROUP_NAME_TOO_LONG": GroupNameTooLongError,
2430
2585
  "GROUP_NAME_EMPTY": GroupNameEmptyError,
2586
+ "CREATE_VM_BAD_REQUEST": CreateVmBadRequestError,
2431
2587
  "WANTED_BY_EMPTY": WantedByEmptyError,
2432
2588
  "WORKDIR_EMPTY": WorkdirEmptyError,
2433
2589
  "GROUP_EMPTY": GroupEmptyError,
@@ -2444,72 +2600,36 @@ const FREESTYLE_ERROR_CODE_MAP = {
2444
2600
  "SERVICE_NAME_EMPTY": ServiceNameEmptyError,
2445
2601
  "SERVICE_ALREADY_EXISTS": ServiceAlreadyExistsError,
2446
2602
  "SERVICE_NOT_FOUND": ServiceNotFoundError,
2603
+ "WAIT_TIMEOUT": WaitTimeoutError,
2604
+ "PRE_VERIFY_CHALLENGE_MISMATCH": PreVerifyChallengeMismatchError,
2605
+ "PRE_VERIFY_FAILED_PARSE": PreVerifyFailedParseError,
2606
+ "PRE_VERIFY_FAILED_FETCH": PreVerifyFailedFetchError,
2607
+ "PRE_VERIFY_ROUTE_NOT_FOUND": PreVerifyRouteNotFoundError,
2608
+ "AUTHORIZATION_NOT_FOUND": AuthorizationNotFoundError,
2609
+ "ORDER_NOT_FOUND": OrderNotFoundError,
2447
2610
  "INTERNAL": InternalError,
2448
2611
  "SIGNING": SigningError,
2449
2612
  "INVALID_SIGNATURE": InvalidSignatureError,
2450
2613
  "INVALID_PARAMETERS": InvalidParametersError,
2451
2614
  "MAX_USES_EXCEEDED": MaxUsesExceededError,
2452
2615
  "EXPIRED": ExpiredError,
2453
- "CONFLICT": ConflictError,
2454
- "REPO_NOT_FOUND": RepoNotFoundError,
2455
- "FORBIDDEN": ForbiddenError,
2456
- "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
2616
+ "TAG_NOT_FOUND": TagNotFoundError,
2457
2617
  "BRANCH_NOT_FOUND": BranchNotFoundError,
2618
+ "REPO_NOT_FOUND": RepoNotFoundError,
2458
2619
  "INVALID_OBJECT_ID": InvalidObjectIdError,
2459
- "BLOB_NOT_FOUND": BlobNotFoundError,
2460
- "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
2461
- "TAG_NOT_FOUND": TagNotFoundError,
2462
2620
  "COMMIT_NOT_FOUND": CommitNotFoundError,
2463
- "INVALID_REQUEST": InvalidRequestError,
2621
+ "REFERENCE_NOT_FOUND": ReferenceNotFoundError,
2464
2622
  "PATH_NOT_FOUND": PathNotFoundError,
2623
+ "INVALID_REQUEST": InvalidRequestError,
2465
2624
  "INVALID_REVISION": InvalidRevisionError,
2625
+ "FORBIDDEN": ForbiddenError,
2466
2626
  "UNAUTHORIZED": UnauthorizedError,
2627
+ "CONFLICT": ConflictError,
2628
+ "UNSUPPORTED_TRANSFER": UnsupportedTransferError,
2629
+ "BLOB_NOT_FOUND": BlobNotFoundError,
2467
2630
  "TREE_NOT_FOUND": TreeNotFoundError,
2468
- "BUILD_FAILED": BuildFailedError,
2469
- "NO_ENTRYPOINT_FOUND": NoEntrypointFoundError,
2470
- "ENTRYPOINT_NOT_FOUND": EntrypointNotFoundError,
2471
- "NO_DOMAIN_OWNERSHIP": NoDomainOwnershipError,
2472
- "INVALID_DOMAINS": InvalidDomainsError,
2473
- "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
2474
- "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
2475
- "DATABASE_ERROR": DatabaseErrorError,
2476
- "TRIGGER_ERROR": TriggerErrorError,
2477
- "TOKEN_ERROR": TokenErrorError,
2478
- "PERMISSION_ERROR": PermissionErrorError,
2479
- "IDENTITY_ERROR": IdentityErrorError,
2480
- "GET_CONTENT_FAILED": GetContentFailedError,
2481
- "CONTENT_NOT_FOUND": ContentNotFoundError,
2482
- "DOWNLOAD_FAILED": DownloadFailedError,
2483
- "GIT_SERVER_ERROR": GitServerErrorError,
2484
- "PARSE_RESPONSE_ERROR": ParseResponseErrorError,
2485
- "REPOSITORY_ACCESS_DENIED": RepositoryAccessDeniedError,
2486
- "GIT_HUB_SYNC_FAILED": GitHubSyncFailedError,
2487
- "UPDATE_DEFAULT_BRANCH_FAILED": UpdateDefaultBranchFailedError,
2488
- "GET_REPOSITORY_INFO_FAILED": GetRepositoryInfoFailedError,
2489
- "LIST_REPOSITORIES_FAILED": ListRepositoriesFailedError,
2490
- "DELETE_REPOSITORY_FAILED": DeleteRepositoryFailedError,
2491
- "CREATE_REPOSITORY_FAILED": CreateRepositoryFailedError,
2492
- "SERIALIZATION_ERROR": SerializationErrorError,
2493
- "GIT_INVALID_REQUEST": GitInvalidRequestError,
2494
- "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
2495
- "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
2496
- "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
2497
- "PERMISSION_DENIED": PermissionDeniedError,
2498
- "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
2499
- "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
2500
- "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
2501
- "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
2502
- "VERIFICATION_FAILED": VerificationFailedError,
2503
- "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
2504
- "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
2505
- "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
2506
- "INVALID_DOMAIN": InvalidDomainError,
2507
- "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
2508
- "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
2509
- "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
2510
- "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
2511
- "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
2512
- "ANYHOW": AnyhowError,
2631
+ "RESIZE_FAILED": ResizeFailedError,
2632
+ "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
2513
2633
  "OBSERVABILITY_DATABASE_ERROR": ObservabilityDatabaseErrorError,
2514
2634
  "OBSERVABILITY_ACCESS_DENIED": ObservabilityAccessDeniedError,
2515
2635
  "PARSE_LOGS_FAILED": ParseLogsFailedError,
@@ -2551,17 +2671,18 @@ const FREESTYLE_ERROR_CODE_MAP = {
2551
2671
  "NETWORK_PERMISSIONS_FAILED": NetworkPermissionsFailedError,
2552
2672
  "LOGGING_FAILED": LoggingFailedError,
2553
2673
  "RUN_NOT_FOUND": RunNotFoundError,
2554
- "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
2555
- "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
2556
- "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
2557
- "RESTORE_FAILED": RestoreFailedError,
2558
- "CREATE_BACKUP_FAILED": CreateBackupFailedError,
2559
- "BACKUP_FAILED": BackupFailedError,
2560
- "DEPLOYMENT_FAILED": DeploymentFailedError,
2561
- "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
2562
- "PROJECT_NOT_FOUND": ProjectNotFoundError,
2563
- "RESIZE_FAILED": ResizeFailedError,
2564
- "INTERNAL_RESIZE_VM_NOT_FOUND": InternalResizeVmNotFoundError,
2674
+ "FAILED_TO_PROVISION_CERTIFICATE": FailedToProvisionCertificateError,
2675
+ "FAILED_TO_INSERT_DOMAIN_MAPPING": FailedToInsertDomainMappingError,
2676
+ "PERMISSION_DENIED": PermissionDeniedError,
2677
+ "FAILED_TO_CHECK_PERMISSIONS": FailedToCheckPermissionsError,
2678
+ "FAILED_TO_LIST_DOMAINS": FailedToListDomainsError,
2679
+ "FAILED_TO_LIST_VERIFICATIONS": FailedToListVerificationsError,
2680
+ "FAILED_TO_VERIFY_DOMAIN": FailedToVerifyDomainError,
2681
+ "VERIFICATION_FAILED": VerificationFailedError,
2682
+ "FAILED_TO_DELETE_VERIFICATION": FailedToDeleteVerificationError,
2683
+ "VERIFICATION_NOT_FOUND": VerificationNotFoundError,
2684
+ "FAILED_TO_CREATE_VERIFICATION_CODE": FailedToCreateVerificationCodeError,
2685
+ "INVALID_DOMAIN": InvalidDomainError,
2565
2686
  "DOMAIN_OWNERSHIP_VERIFICATION_FAILED": DomainOwnershipVerificationFailedError,
2566
2687
  "ERROR_DELETING_RECORD": ErrorDeletingRecordError,
2567
2688
  "RECORD_OWNERSHIP_ERROR": RecordOwnershipErrorError,
@@ -2580,7 +2701,55 @@ const FREESTYLE_ERROR_CODE_MAP = {
2580
2701
  "REQUEST_FAILED": RequestFailedError,
2581
2702
  "DEV_SERVER_FILE_NOT_FOUND": DevServerFileNotFoundError,
2582
2703
  "DEV_SERVER_INVALID_REQUEST": DevServerInvalidRequestError,
2583
- "DEV_SERVER_NOT_FOUND": DevServerNotFoundError
2704
+ "DEV_SERVER_NOT_FOUND": DevServerNotFoundError,
2705
+ "BUILD_FAILED": BuildFailedError,
2706
+ "SERVER_DEPLOYMENT_FAILED": ServerDeploymentFailedError,
2707
+ "LOCKFILE_ERROR": LockfileErrorError,
2708
+ "UPLOAD_ERROR": UploadErrorError,
2709
+ "DOMAIN_MAPPING_ERROR": DomainMappingErrorError,
2710
+ "CERTIFICATE_PROVISIONING_ERROR": CertificateProvisioningErrorError,
2711
+ "NO_ENTRYPOINT_FOUND": NoEntrypointFoundError,
2712
+ "ENTRYPOINT_NOT_FOUND": EntrypointNotFoundError,
2713
+ "NO_DOMAIN_OWNERSHIP": NoDomainOwnershipError,
2714
+ "INVALID_DOMAINS": InvalidDomainsError,
2715
+ "WEB_DEPLOYMENT_BAD_REQUEST": WebDeploymentBadRequestError,
2716
+ "DEPLOYMENT_NOT_FOUND": DeploymentNotFoundError,
2717
+ "DATABASE_ERROR": DatabaseErrorError,
2718
+ "TRIGGER_ERROR": TriggerErrorError,
2719
+ "TOKEN_ERROR": TokenErrorError,
2720
+ "PERMISSION_ERROR": PermissionErrorError,
2721
+ "IDENTITY_ERROR": IdentityErrorError,
2722
+ "GET_CONTENT_FAILED": GetContentFailedError,
2723
+ "CONTENT_NOT_FOUND": ContentNotFoundError,
2724
+ "DOWNLOAD_FAILED": DownloadFailedError,
2725
+ "GIT_SERVER_ERROR": GitServerErrorError,
2726
+ "PARSE_RESPONSE_ERROR": ParseResponseErrorError,
2727
+ "REPOSITORY_ACCESS_DENIED": RepositoryAccessDeniedError,
2728
+ "GIT_HUB_SYNC_FAILED": GitHubSyncFailedError,
2729
+ "UPDATE_DEFAULT_BRANCH_FAILED": UpdateDefaultBranchFailedError,
2730
+ "GET_REPOSITORY_INFO_FAILED": GetRepositoryInfoFailedError,
2731
+ "LIST_REPOSITORIES_FAILED": ListRepositoriesFailedError,
2732
+ "DELETE_REPOSITORY_FAILED": DeleteRepositoryFailedError,
2733
+ "CREATE_REPOSITORY_FAILED": CreateRepositoryFailedError,
2734
+ "SERIALIZATION_ERROR": SerializationErrorError,
2735
+ "GIT_INVALID_REQUEST": GitInvalidRequestError,
2736
+ "REPOSITORY_NOT_FOUND": RepositoryNotFoundError,
2737
+ "DOMAIN_ALREADY_EXISTS": DomainAlreadyExistsError,
2738
+ "FAILED_TO_INSERT_OWNERSHIP": FailedToInsertOwnershipError,
2739
+ "FAILED_REMOVE_DOMAIN_MAPPING": FailedRemoveDomainMappingError,
2740
+ "FAILED_PERMISSIONS_CHECK": FailedPermissionsCheckError,
2741
+ "FAILED_TO_CHECK_DOMAIN_MAPPING_PERMISSIONS": FailedToCheckDomainMappingPermissionsError,
2742
+ "CLOUDSTATE_INTERNAL_ERROR": CloudstateInternalErrorError,
2743
+ "CLOUDSTATE_DATABASE_ERROR": CloudstateDatabaseErrorError,
2744
+ "CLOUDSTATE_ACCESS_DENIED": CloudstateAccessDeniedError,
2745
+ "RESTORE_FAILED": RestoreFailedError,
2746
+ "CREATE_BACKUP_FAILED": CreateBackupFailedError,
2747
+ "BACKUP_FAILED": BackupFailedError,
2748
+ "DEPLOYMENT_FAILED": DeploymentFailedError,
2749
+ "INVALID_DEPLOYMENT_REQUEST": InvalidDeploymentRequestError,
2750
+ "PROJECT_NOT_FOUND": ProjectNotFoundError,
2751
+ "UNAUTHORIZED_ERROR": UnauthorizedErrorError,
2752
+ "ANYHOW": AnyhowError
2584
2753
  };
2585
2754
 
2586
2755
  var errors = /*#__PURE__*/Object.freeze({
@@ -2588,6 +2757,7 @@ var errors = /*#__PURE__*/Object.freeze({
2588
2757
  AfterArrayContainsEmptyError: AfterArrayContainsEmptyError,
2589
2758
  AlreadyHasBaseError: AlreadyHasBaseError,
2590
2759
  AnyhowError: AnyhowError,
2760
+ AuthorizationNotFoundError: AuthorizationNotFoundError,
2591
2761
  BackupFailedError: BackupFailedError,
2592
2762
  BadRequestError: BadRequestError,
2593
2763
  BlobNotFoundError: BlobNotFoundError,
@@ -2596,6 +2766,7 @@ var errors = /*#__PURE__*/Object.freeze({
2596
2766
  BuildFailedError: BuildFailedError,
2597
2767
  CannotDeleteManagedIdentityError: CannotDeleteManagedIdentityError,
2598
2768
  CannotModifyManagedIdentityError: CannotModifyManagedIdentityError,
2769
+ CertificateProvisioningErrorError: CertificateProvisioningErrorError,
2599
2770
  CloudstateAccessDeniedError: CloudstateAccessDeniedError,
2600
2771
  CloudstateDatabaseErrorError: CloudstateDatabaseErrorError,
2601
2772
  CloudstateInternalErrorError: CloudstateInternalErrorError,
@@ -2621,6 +2792,7 @@ var errors = /*#__PURE__*/Object.freeze({
2621
2792
  DirectoryCreationFailedError: DirectoryCreationFailedError,
2622
2793
  DockerImportBadRequestError: DockerImportBadRequestError,
2623
2794
  DomainAlreadyExistsError: DomainAlreadyExistsError,
2795
+ DomainMappingErrorError: DomainMappingErrorError,
2624
2796
  DomainOwnershipErrorError: DomainOwnershipErrorError,
2625
2797
  DomainOwnershipVerificationFailedError: DomainOwnershipVerificationFailedError,
2626
2798
  DownloadFailedError: DownloadFailedError,
@@ -2695,6 +2867,7 @@ var errors = /*#__PURE__*/Object.freeze({
2695
2867
  ListRunsFailedError: ListRunsFailedError,
2696
2868
  ListTokensFailedError: ListTokensFailedError,
2697
2869
  LockGenerationFailedError: LockGenerationFailedError,
2870
+ LockfileErrorError: LockfileErrorError,
2698
2871
  LoggingFailedError: LoggingFailedError,
2699
2872
  LogsFailedError: LogsFailedError,
2700
2873
  LogsNotFoundError: LogsNotFoundError,
@@ -2709,6 +2882,7 @@ var errors = /*#__PURE__*/Object.freeze({
2709
2882
  ObservabilityAccessDeniedError: ObservabilityAccessDeniedError,
2710
2883
  ObservabilityDatabaseErrorError: ObservabilityDatabaseErrorError,
2711
2884
  OnFailureArrayContainsEmptyError: OnFailureArrayContainsEmptyError,
2885
+ OrderNotFoundError: OrderNotFoundError,
2712
2886
  ParseLogsFailedError: ParseLogsFailedError,
2713
2887
  ParseResponseErrorError: ParseResponseErrorError,
2714
2888
  PathNotFoundError: PathNotFoundError,
@@ -2716,6 +2890,10 @@ var errors = /*#__PURE__*/Object.freeze({
2716
2890
  PermissionDeniedError: PermissionDeniedError,
2717
2891
  PermissionErrorError: PermissionErrorError,
2718
2892
  PermissionNotFoundError: PermissionNotFoundError,
2893
+ PreVerifyChallengeMismatchError: PreVerifyChallengeMismatchError,
2894
+ PreVerifyFailedFetchError: PreVerifyFailedFetchError,
2895
+ PreVerifyFailedParseError: PreVerifyFailedParseError,
2896
+ PreVerifyRouteNotFoundError: PreVerifyRouteNotFoundError,
2719
2897
  ProjectNotFoundError: ProjectNotFoundError,
2720
2898
  ReadFileFailedError: ReadFileFailedError,
2721
2899
  RecordOwnershipErrorError: RecordOwnershipErrorError,
@@ -2734,6 +2912,7 @@ var errors = /*#__PURE__*/Object.freeze({
2734
2912
  RevokeTokenFailedError: RevokeTokenFailedError,
2735
2913
  RunNotFoundError: RunNotFoundError,
2736
2914
  SerializationErrorError: SerializationErrorError,
2915
+ ServerDeploymentFailedError: ServerDeploymentFailedError,
2737
2916
  ServiceAlreadyExistsError: ServiceAlreadyExistsError,
2738
2917
  ServiceNameEmptyError: ServiceNameEmptyError,
2739
2918
  ServiceNameInvalidCharsError: ServiceNameInvalidCharsError,
@@ -2750,9 +2929,11 @@ var errors = /*#__PURE__*/Object.freeze({
2750
2929
  TreeNotFoundError: TreeNotFoundError,
2751
2930
  TriggerErrorError: TriggerErrorError,
2752
2931
  UnauthorizedError: UnauthorizedError,
2932
+ UnauthorizedErrorError: UnauthorizedErrorError,
2753
2933
  UnsupportedTransferError: UnsupportedTransferError,
2754
2934
  UpdateDefaultBranchFailedError: UpdateDefaultBranchFailedError,
2755
2935
  UpdatePermissionFailedError: UpdatePermissionFailedError,
2936
+ UploadErrorError: UploadErrorError,
2756
2937
  UserAlreadyExistsError: UserAlreadyExistsError,
2757
2938
  UserEmptyError: UserEmptyError,
2758
2939
  UserGroupEmptyError: UserGroupEmptyError,
@@ -2778,6 +2959,7 @@ var errors = /*#__PURE__*/Object.freeze({
2778
2959
  VmStartTimeoutError: VmStartTimeoutError,
2779
2960
  VmSubnetNotFoundError: VmSubnetNotFoundError,
2780
2961
  VmTransactionIdMismatchError: VmTransactionIdMismatchError,
2962
+ WaitTimeoutError: WaitTimeoutError,
2781
2963
  WantedByEmptyError: WantedByEmptyError,
2782
2964
  WatchFilesFailedError: WatchFilesFailedError,
2783
2965
  WebDeploymentBadRequestError: WebDeploymentBadRequestError,
@@ -2845,7 +3027,16 @@ class ApiClient {
2845
3027
  body: body ? JSON.stringify(body) : void 0
2846
3028
  });
2847
3029
  if (!response.ok) {
2848
- const errorData = await response.json();
3030
+ let errorText = await response.text();
3031
+ let errorData;
3032
+ try {
3033
+ errorData = JSON.parse(errorText);
3034
+ } catch (e) {
3035
+ if (response.status === 401) {
3036
+ errorText += " (Your API key or access token may be invalid.)";
3037
+ }
3038
+ throw new Error(`HTTP error ${response.status}: ${errorText}. ${e}`);
3039
+ }
2849
3040
  throw errorFromJSON(errorData);
2850
3041
  }
2851
3042
  return response.json();
@@ -3107,6 +3298,25 @@ class GitRepo {
3107
3298
  params: { repo: this.repoId, trigger: triggerId }
3108
3299
  });
3109
3300
  }
3301
+ /**
3302
+ * Compare two revs in this repository.
3303
+ *
3304
+ * Head and base can be branch names, tags, or commit SHAs.
3305
+ */
3306
+ async compare({
3307
+ base,
3308
+ head
3309
+ }) {
3310
+ return this.apiClient.get("/git/v1/repo/{repo}/compare", {
3311
+ params: {
3312
+ repo: this.repoId
3313
+ },
3314
+ query: {
3315
+ base,
3316
+ head
3317
+ }
3318
+ });
3319
+ }
3110
3320
  }
3111
3321
  class GitReposNamespace {
3112
3322
  constructor(apiClient) {
@@ -3918,7 +4128,11 @@ function composeCreateVmOptions(arr) {
3918
4128
  result.template = {
3919
4129
  // Simple overrides - start with base, override with new
3920
4130
  snapshotId: newTemplate.snapshotId !== void 0 ? newTemplate.snapshotId : baseTemplate.snapshotId,
3921
- rootfsSizeMb: newTemplate.rootfsSizeMb !== void 0 ? newTemplate.rootfsSizeMb : baseTemplate.rootfsSizeMb,
4131
+ rootfsSizeGb: newTemplate.rootfsSizeGb !== void 0 ? newTemplate.rootfsSizeGb : baseTemplate.rootfsSizeGb,
4132
+ memSizeGb: newTemplate.memSizeGb !== void 0 ? newTemplate.memSizeGb : baseTemplate.memSizeGb,
4133
+ aptDeps: newTemplate.aptDeps ?? baseTemplate.aptDeps,
4134
+ vcpuCount: newTemplate.vcpuCount !== void 0 ? newTemplate.vcpuCount : baseTemplate.vcpuCount,
4135
+ discriminator: newTemplate.discriminator ?? baseTemplate.discriminator,
3922
4136
  workdir: newTemplate.workdir !== void 0 ? newTemplate.workdir : baseTemplate.workdir,
3923
4137
  idleTimeoutSeconds: newTemplate.idleTimeoutSeconds !== void 0 ? newTemplate.idleTimeoutSeconds : baseTemplate.idleTimeoutSeconds,
3924
4138
  waitForReadySignal: newTemplate.waitForReadySignal !== void 0 ? newTemplate.waitForReadySignal : baseTemplate.waitForReadySignal,
@@ -4193,11 +4407,13 @@ class Vm {
4193
4407
  * @returns Resize response
4194
4408
  */
4195
4409
  async resize({
4196
- sizeMb
4410
+ memSizeGb,
4411
+ rootfsSizeGb,
4412
+ vcpuCount
4197
4413
  }) {
4198
4414
  return this.apiClient.post("/v1/vms/{id}/resize", {
4199
4415
  params: { id: this.vmId },
4200
- body: { sizeMb }
4416
+ body: { memSizeGb, rootfsSizeGb, vcpuCount }
4201
4417
  });
4202
4418
  }
4203
4419
  }
@@ -4279,6 +4495,11 @@ class VmsNamespace {
4279
4495
  ref({ vmId }) {
4280
4496
  return new Vm(vmId, this.apiClient);
4281
4497
  }
4498
+ async delete({ vmId }) {
4499
+ return this.apiClient.delete("/v1/vms/{vm_id}", {
4500
+ params: { vm_id: vmId }
4501
+ });
4502
+ }
4282
4503
  }
4283
4504
  class VmTemplate {
4284
4505
  template;
@@ -4297,15 +4518,20 @@ class Freestyle {
4297
4518
  edge;
4298
4519
  vms;
4299
4520
  constructor(options = {}) {
4300
- options.baseUrl ?? process.env.FREESTYLE_API_URL;
4301
- let apiKey;
4521
+ if (!options.baseUrl) {
4522
+ options.baseUrl = process.env.FREESTYLE_API_URL;
4523
+ }
4524
+ if (options.baseUrl) {
4525
+ options.baseUrl = new URL(options.baseUrl).toString();
4526
+ options.baseUrl = options.baseUrl.replace(/\/+$/, "");
4527
+ }
4302
4528
  if ("accessToken" in options && options.accessToken) {
4303
4529
  options.accessToken;
4304
4530
  } else {
4305
- apiKey = options.apiKey ?? process.env.FREESTYLE_API_KEY;
4306
- if (!apiKey) {
4531
+ options.apiKey = options.apiKey ?? process.env.FREESTYLE_API_KEY;
4532
+ if (!options.apiKey) {
4307
4533
  throw new Error(
4308
- "API key is required. Please provide it in the constructor or set the FREESTYLE_API_KEY environment variable."
4534
+ "API key is required. Please set the FREESTYLE_API_KEY environment variable or construct a Freestyle client with the `apiKey` option."
4309
4535
  );
4310
4536
  }
4311
4537
  }