freestyle-sandboxes 0.1.1 → 0.1.3

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 +1155 -844
  2. package/index.d.cts +924 -669
  3. package/index.d.mts +924 -669
  4. package/index.mjs +1155 -844
  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 {
1522
- constructor(body) {
1523
- super(
1524
- `ANYHOW: ${body.message}`
1525
- );
1526
- this.body = body;
1527
- this.name = "AnyhowError";
1528
- }
1529
- static code = "ANYHOW";
1530
- static statusCode = 500;
1531
- static description = `null`;
1532
- }
1533
- class ObservabilityDatabaseErrorError extends Error {
1534
- constructor(body) {
1535
- super(
1536
- `OBSERVABILITY_DATABASE_ERROR: ${body.message}`
1537
- );
1538
- this.body = body;
1539
- this.name = "ObservabilityDatabaseErrorError";
1540
- }
1541
- static code = "OBSERVABILITY_DATABASE_ERROR";
1542
- static statusCode = 500;
1543
- static description = `Database operation failed: {message}`;
1544
- }
1545
- class ObservabilityAccessDeniedError extends Error {
1737
+ class DomainOwnershipVerificationFailedError extends Error {
1546
1738
  constructor(body) {
1547
1739
  super(
1548
- `OBSERVABILITY_ACCESS_DENIED: ${body.message}`
1740
+ `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
1549
1741
  );
1550
1742
  this.body = body;
1551
- this.name = "ObservabilityAccessDeniedError";
1743
+ this.name = "DomainOwnershipVerificationFailedError";
1552
1744
  }
1553
- static code = "OBSERVABILITY_ACCESS_DENIED";
1745
+ static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
1554
1746
  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}`;
1747
+ static description = `Domain ownership verification failed`;
1568
1748
  }
1569
- class RetrieveLogsFailedError extends Error {
1749
+ class ErrorDeletingRecordError extends Error {
1570
1750
  constructor(body) {
1571
1751
  super(
1572
- `RETRIEVE_LOGS_FAILED: ${body.message}`
1752
+ `ERROR_DELETING_RECORD: ${body.message}`
1573
1753
  );
1574
1754
  this.body = body;
1575
- this.name = "RetrieveLogsFailedError";
1755
+ this.name = "ErrorDeletingRecordError";
1576
1756
  }
1577
- static code = "RETRIEVE_LOGS_FAILED";
1757
+ static code = "ERROR_DELETING_RECORD";
1578
1758
  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}`;
1759
+ static description = `Error deleting DNS record for {domain}/{name}: {message}`;
1604
1760
  }
1605
- class PermissionAlreadyExistsError extends Error {
1761
+ class RecordOwnershipErrorError extends Error {
1606
1762
  constructor(body) {
1607
1763
  super(
1608
- `PERMISSION_ALREADY_EXISTS: ${body.message}`
1764
+ `RECORD_OWNERSHIP_ERROR: ${body.message}`
1609
1765
  );
1610
1766
  this.body = body;
1611
- this.name = "PermissionAlreadyExistsError";
1767
+ this.name = "RecordOwnershipErrorError";
1612
1768
  }
1613
- static code = "PERMISSION_ALREADY_EXISTS";
1614
- static statusCode = 409;
1615
- static description = `Permission already exists`;
1769
+ static code = "RECORD_OWNERSHIP_ERROR";
1770
+ static statusCode = 403;
1771
+ static description = `Account {account_id} does not own record {record_id}`;
1616
1772
  }
1617
- class ListTokensFailedError extends Error {
1773
+ class ErrorCreatingRecordError extends Error {
1618
1774
  constructor(body) {
1619
1775
  super(
1620
- `LIST_TOKENS_FAILED: ${body.message}`
1776
+ `ERROR_CREATING_RECORD: ${body.message}`
1621
1777
  );
1622
1778
  this.body = body;
1623
- this.name = "ListTokensFailedError";
1779
+ this.name = "ErrorCreatingRecordError";
1624
1780
  }
1625
- static code = "LIST_TOKENS_FAILED";
1781
+ static code = "ERROR_CREATING_RECORD";
1626
1782
  static statusCode = 500;
1627
- static description = `Failed to list tokens: {message}`;
1783
+ static description = `Error creating DNS record: {message}`;
1628
1784
  }
1629
- class RevokeTokenFailedError extends Error {
1785
+ class DomainOwnershipErrorError extends Error {
1630
1786
  constructor(body) {
1631
1787
  super(
1632
- `REVOKE_TOKEN_FAILED: ${body.message}`
1788
+ `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
1633
1789
  );
1634
1790
  this.body = body;
1635
- this.name = "RevokeTokenFailedError";
1791
+ this.name = "DomainOwnershipErrorError";
1636
1792
  }
1637
- static code = "REVOKE_TOKEN_FAILED";
1638
- static statusCode = 500;
1639
- static description = `Failed to revoke token: {message}`;
1793
+ static code = "DOMAIN_OWNERSHIP_ERROR";
1794
+ static statusCode = 403;
1795
+ static description = `Account {account_id} does not own domain {domain}`;
1640
1796
  }
1641
- class CreateTokenFailedError extends Error {
1797
+ class BrowserOperationFailedError extends Error {
1642
1798
  constructor(body) {
1643
1799
  super(
1644
- `CREATE_TOKEN_FAILED: ${body.message}`
1800
+ `BROWSER_OPERATION_FAILED: ${body.message}`
1645
1801
  );
1646
1802
  this.body = body;
1647
- this.name = "CreateTokenFailedError";
1803
+ this.name = "BrowserOperationFailedError";
1648
1804
  }
1649
- static code = "CREATE_TOKEN_FAILED";
1805
+ static code = "BROWSER_OPERATION_FAILED";
1650
1806
  static statusCode = 500;
1651
- static description = `Failed to create token: {message}`;
1807
+ static description = `Browser operation failed: {message}`;
1652
1808
  }
1653
- class ListPermissionsFailedError extends Error {
1809
+ class WatchFilesFailedError extends Error {
1654
1810
  constructor(body) {
1655
1811
  super(
1656
- `LIST_PERMISSIONS_FAILED: ${body.message}`
1812
+ `WATCH_FILES_FAILED: ${body.message}`
1657
1813
  );
1658
1814
  this.body = body;
1659
- this.name = "ListPermissionsFailedError";
1815
+ this.name = "WatchFilesFailedError";
1660
1816
  }
1661
- static code = "LIST_PERMISSIONS_FAILED";
1817
+ static code = "WATCH_FILES_FAILED";
1662
1818
  static statusCode = 500;
1663
- static description = `Failed to list permissions: {message}`;
1819
+ static description = `Failed to watch files: {message}`;
1664
1820
  }
1665
- class GetPermissionFailedError extends Error {
1821
+ class LogsFailedError extends Error {
1666
1822
  constructor(body) {
1667
1823
  super(
1668
- `GET_PERMISSION_FAILED: ${body.message}`
1824
+ `LOGS_FAILED: ${body.message}`
1669
1825
  );
1670
1826
  this.body = body;
1671
- this.name = "GetPermissionFailedError";
1827
+ this.name = "LogsFailedError";
1672
1828
  }
1673
- static code = "GET_PERMISSION_FAILED";
1829
+ static code = "LOGS_FAILED";
1674
1830
  static statusCode = 500;
1675
- static description = `Failed to get permission: {message}`;
1831
+ static description = `Failed to get logs: {message}`;
1676
1832
  }
1677
- class UpdatePermissionFailedError extends Error {
1833
+ class StatusFailedError extends Error {
1678
1834
  constructor(body) {
1679
1835
  super(
1680
- `UPDATE_PERMISSION_FAILED: ${body.message}`
1836
+ `STATUS_FAILED: ${body.message}`
1681
1837
  );
1682
1838
  this.body = body;
1683
- this.name = "UpdatePermissionFailedError";
1839
+ this.name = "StatusFailedError";
1684
1840
  }
1685
- static code = "UPDATE_PERMISSION_FAILED";
1841
+ static code = "STATUS_FAILED";
1686
1842
  static statusCode = 500;
1687
- static description = `Failed to update permission: {message}`;
1843
+ static description = `Failed to get dev server status: {message}`;
1688
1844
  }
1689
- class RevokePermissionFailedError extends Error {
1845
+ class RestartFailedError extends Error {
1690
1846
  constructor(body) {
1691
1847
  super(
1692
- `REVOKE_PERMISSION_FAILED: ${body.message}`
1848
+ `RESTART_FAILED: ${body.message}`
1693
1849
  );
1694
1850
  this.body = body;
1695
- this.name = "RevokePermissionFailedError";
1851
+ this.name = "RestartFailedError";
1696
1852
  }
1697
- static code = "REVOKE_PERMISSION_FAILED";
1853
+ static code = "RESTART_FAILED";
1698
1854
  static statusCode = 500;
1699
- static description = `Failed to revoke permission: {message}`;
1855
+ static description = `Failed to restart dev server: {message}`;
1700
1856
  }
1701
- class GrantPermissionFailedError extends Error {
1857
+ class ShutdownFailedError extends Error {
1702
1858
  constructor(body) {
1703
1859
  super(
1704
- `GRANT_PERMISSION_FAILED: ${body.message}`
1860
+ `SHUTDOWN_FAILED: ${body.message}`
1705
1861
  );
1706
1862
  this.body = body;
1707
- this.name = "GrantPermissionFailedError";
1863
+ this.name = "ShutdownFailedError";
1708
1864
  }
1709
- static code = "GRANT_PERMISSION_FAILED";
1865
+ static code = "SHUTDOWN_FAILED";
1710
1866
  static statusCode = 500;
1711
- static description = `Failed to grant permission: {message}`;
1867
+ static description = `Failed to shutdown dev server: {message}`;
1712
1868
  }
1713
- class ListIdentitiesFailedError extends Error {
1869
+ class CommitFailedError extends Error {
1714
1870
  constructor(body) {
1715
1871
  super(
1716
- `LIST_IDENTITIES_FAILED: ${body.message}`
1872
+ `COMMIT_FAILED: ${body.message}`
1717
1873
  );
1718
1874
  this.body = body;
1719
- this.name = "ListIdentitiesFailedError";
1875
+ this.name = "CommitFailedError";
1720
1876
  }
1721
- static code = "LIST_IDENTITIES_FAILED";
1877
+ static code = "COMMIT_FAILED";
1722
1878
  static statusCode = 500;
1723
- static description = `Failed to list identities: {message}`;
1879
+ static description = `Failed to commit changes: {message}`;
1724
1880
  }
1725
- class DeleteIdentityFailedError extends Error {
1881
+ class WriteFileFailedError extends Error {
1726
1882
  constructor(body) {
1727
1883
  super(
1728
- `DELETE_IDENTITY_FAILED: ${body.message}`
1884
+ `WRITE_FILE_FAILED: ${body.message}`
1729
1885
  );
1730
1886
  this.body = body;
1731
- this.name = "DeleteIdentityFailedError";
1887
+ this.name = "WriteFileFailedError";
1732
1888
  }
1733
- static code = "DELETE_IDENTITY_FAILED";
1889
+ static code = "WRITE_FILE_FAILED";
1734
1890
  static statusCode = 500;
1735
- static description = `Failed to delete identity: {message}`;
1891
+ static description = `Failed to write file: {message}`;
1736
1892
  }
1737
- class CreateIdentityFailedError extends Error {
1893
+ class ReadFileFailedError extends Error {
1738
1894
  constructor(body) {
1739
1895
  super(
1740
- `CREATE_IDENTITY_FAILED: ${body.message}`
1896
+ `READ_FILE_FAILED: ${body.message}`
1741
1897
  );
1742
1898
  this.body = body;
1743
- this.name = "CreateIdentityFailedError";
1899
+ this.name = "ReadFileFailedError";
1744
1900
  }
1745
- static code = "CREATE_IDENTITY_FAILED";
1901
+ static code = "READ_FILE_FAILED";
1746
1902
  static statusCode = 500;
1747
- static description = `Failed to create identity: {message}`;
1903
+ static description = `Failed to read file: {message}`;
1748
1904
  }
1749
- class VmPermissionNotFoundError extends Error {
1905
+ class ExecutionFailedError extends Error {
1750
1906
  constructor(body) {
1751
1907
  super(
1752
- `VM_PERMISSION_NOT_FOUND: ${body.message}`
1908
+ `EXECUTION_FAILED: ${body.message}`
1753
1909
  );
1754
1910
  this.body = body;
1755
- this.name = "VmPermissionNotFoundError";
1911
+ this.name = "ExecutionFailedError";
1756
1912
  }
1757
- static code = "VM_PERMISSION_NOT_FOUND";
1758
- static statusCode = 404;
1759
- static description = `VM permission not found`;
1913
+ static code = "EXECUTION_FAILED";
1914
+ static statusCode = 500;
1915
+ static description = `Failed to execute command: {message}`;
1760
1916
  }
1761
- class PermissionNotFoundError extends Error {
1917
+ class RequestFailedError extends Error {
1762
1918
  constructor(body) {
1763
1919
  super(
1764
- `PERMISSION_NOT_FOUND: ${body.message}`
1920
+ `REQUEST_FAILED: ${body.message}`
1765
1921
  );
1766
1922
  this.body = body;
1767
- this.name = "PermissionNotFoundError";
1923
+ this.name = "RequestFailedError";
1768
1924
  }
1769
- static code = "PERMISSION_NOT_FOUND";
1770
- static statusCode = 404;
1771
- static description = `Permission not found`;
1925
+ static code = "REQUEST_FAILED";
1926
+ static statusCode = 500;
1927
+ static description = `Failed to request dev server: {message}`;
1772
1928
  }
1773
- class VmAccessDeniedError extends Error {
1929
+ class DevServerFileNotFoundError extends Error {
1774
1930
  constructor(body) {
1775
1931
  super(
1776
- `VM_ACCESS_DENIED: ${body.message}`
1932
+ `DEV_SERVER_FILE_NOT_FOUND: ${body.message}`
1777
1933
  );
1778
1934
  this.body = body;
1779
- this.name = "VmAccessDeniedError";
1935
+ this.name = "DevServerFileNotFoundError";
1780
1936
  }
1781
- static code = "VM_ACCESS_DENIED";
1782
- static statusCode = 403;
1783
- static description = `You are not allowed to access this VM`;
1937
+ static code = "DEV_SERVER_FILE_NOT_FOUND";
1938
+ static statusCode = 404;
1939
+ static description = `Dev server file not found: {path}`;
1784
1940
  }
1785
- class GitRepositoryAccessDeniedError extends Error {
1941
+ class DevServerInvalidRequestError extends Error {
1786
1942
  constructor(body) {
1787
1943
  super(
1788
- `GIT_REPOSITORY_ACCESS_DENIED: ${body.message}`
1944
+ `DEV_SERVER_INVALID_REQUEST: ${body.message}`
1789
1945
  );
1790
1946
  this.body = body;
1791
- this.name = "GitRepositoryAccessDeniedError";
1947
+ this.name = "DevServerInvalidRequestError";
1792
1948
  }
1793
- static code = "GIT_REPOSITORY_ACCESS_DENIED";
1794
- static statusCode = 403;
1795
- static description = `You are not allowed to access this repository`;
1949
+ static code = "DEV_SERVER_INVALID_REQUEST";
1950
+ static statusCode = 400;
1951
+ static description = `Invalid dev server request: {message}`;
1796
1952
  }
1797
- class GitRepositoryNotFoundError extends Error {
1953
+ class DevServerNotFoundError extends Error {
1798
1954
  constructor(body) {
1799
1955
  super(
1800
- `GIT_REPOSITORY_NOT_FOUND: ${body.message}`
1956
+ `DEV_SERVER_NOT_FOUND: ${body.message}`
1801
1957
  );
1802
1958
  this.body = body;
1803
- this.name = "GitRepositoryNotFoundError";
1959
+ this.name = "DevServerNotFoundError";
1804
1960
  }
1805
- static code = "GIT_REPOSITORY_NOT_FOUND";
1961
+ static code = "DEV_SERVER_NOT_FOUND";
1806
1962
  static statusCode = 404;
1807
- static description = `Repository not found`;
1963
+ static description = `Dev server not found: {server_id}`;
1808
1964
  }
1809
- class CannotDeleteManagedIdentityError extends Error {
1965
+ class BuildFailedError extends Error {
1810
1966
  constructor(body) {
1811
1967
  super(
1812
- `CANNOT_DELETE_MANAGED_IDENTITY: ${body.message}`
1968
+ `BUILD_FAILED: ${body.message}`
1813
1969
  );
1814
1970
  this.body = body;
1815
- this.name = "CannotDeleteManagedIdentityError";
1971
+ this.name = "BuildFailedError";
1816
1972
  }
1817
- static code = "CANNOT_DELETE_MANAGED_IDENTITY";
1818
- static statusCode = 403;
1819
- static description = `Cannot delete managed identities`;
1973
+ static code = "BUILD_FAILED";
1974
+ static statusCode = 500;
1975
+ static description = `Build failed on VM {vm_id}`;
1820
1976
  }
1821
- class CannotModifyManagedIdentityError extends Error {
1977
+ class ServerDeploymentFailedError extends Error {
1822
1978
  constructor(body) {
1823
1979
  super(
1824
- `CANNOT_MODIFY_MANAGED_IDENTITY: ${body.message}`
1980
+ `SERVER_DEPLOYMENT_FAILED: ${body.message}`
1825
1981
  );
1826
1982
  this.body = body;
1827
- this.name = "CannotModifyManagedIdentityError";
1983
+ this.name = "ServerDeploymentFailedError";
1828
1984
  }
1829
- static code = "CANNOT_MODIFY_MANAGED_IDENTITY";
1830
- static statusCode = 403;
1831
- static description = `Cannot modify managed identities`;
1985
+ static code = "SERVER_DEPLOYMENT_FAILED";
1986
+ static statusCode = 502;
1987
+ static description = `Failed to deploy to servers`;
1832
1988
  }
1833
- class IdentityAccessDeniedError extends Error {
1989
+ class LockfileErrorError extends Error {
1834
1990
  constructor(body) {
1835
1991
  super(
1836
- `IDENTITY_ACCESS_DENIED: ${body.message}`
1992
+ `LOCKFILE_ERROR: ${body.message}`
1837
1993
  );
1838
1994
  this.body = body;
1839
- this.name = "IdentityAccessDeniedError";
1995
+ this.name = "LockfileErrorError";
1840
1996
  }
1841
- static code = "IDENTITY_ACCESS_DENIED";
1842
- static statusCode = 403;
1843
- static description = `You are not allowed to access this identity`;
1997
+ static code = "LOCKFILE_ERROR";
1998
+ static statusCode = 500;
1999
+ static description = `Failed to generate dependency lockfile: {message}`;
1844
2000
  }
1845
- class IdentityNotFoundError extends Error {
2001
+ class UploadErrorError extends Error {
1846
2002
  constructor(body) {
1847
2003
  super(
1848
- `IDENTITY_NOT_FOUND: ${body.message}`
2004
+ `UPLOAD_ERROR: ${body.message}`
1849
2005
  );
1850
2006
  this.body = body;
1851
- this.name = "IdentityNotFoundError";
2007
+ this.name = "UploadErrorError";
1852
2008
  }
1853
- static code = "IDENTITY_NOT_FOUND";
1854
- static statusCode = 404;
1855
- static description = `Identity not found`;
2009
+ static code = "UPLOAD_ERROR";
2010
+ static statusCode = 500;
2011
+ static description = `Failed to upload deployment to storage`;
1856
2012
  }
1857
- class ExecuteInternalErrorError extends Error {
2013
+ class DomainMappingErrorError extends Error {
1858
2014
  constructor(body) {
1859
2015
  super(
1860
- `EXECUTE_INTERNAL_ERROR: ${body.message}`
2016
+ `DOMAIN_MAPPING_ERROR: ${body.message}`
1861
2017
  );
1862
2018
  this.body = body;
1863
- this.name = "ExecuteInternalErrorError";
2019
+ this.name = "DomainMappingErrorError";
1864
2020
  }
1865
- static code = "EXECUTE_INTERNAL_ERROR";
2021
+ static code = "DOMAIN_MAPPING_ERROR";
1866
2022
  static statusCode = 500;
1867
- static description = `Internal error: {message}`;
2023
+ static description = `Failed to configure domain mapping for: {domain}`;
1868
2024
  }
1869
- class ExecuteAccessDeniedError extends Error {
2025
+ class CertificateProvisioningErrorError extends Error {
1870
2026
  constructor(body) {
1871
2027
  super(
1872
- `EXECUTE_ACCESS_DENIED: ${body.message}`
2028
+ `CERTIFICATE_PROVISIONING_ERROR: ${body.message}`
1873
2029
  );
1874
2030
  this.body = body;
1875
- this.name = "ExecuteAccessDeniedError";
2031
+ this.name = "CertificateProvisioningErrorError";
1876
2032
  }
1877
- static code = "EXECUTE_ACCESS_DENIED";
1878
- static statusCode = 403;
1879
- static description = `Access denied to execute run`;
2033
+ static code = "CERTIFICATE_PROVISIONING_ERROR";
2034
+ static statusCode = 502;
2035
+ static description = `Failed to provision certificate for domain: {domain}`;
1880
2036
  }
1881
- class ListRunsFailedError extends Error {
2037
+ class NoEntrypointFoundError extends Error {
1882
2038
  constructor(body) {
1883
2039
  super(
1884
- `LIST_RUNS_FAILED: ${body.message}`
2040
+ `NO_ENTRYPOINT_FOUND: ${body.message}`
1885
2041
  );
1886
2042
  this.body = body;
1887
- this.name = "ListRunsFailedError";
2043
+ this.name = "NoEntrypointFoundError";
1888
2044
  }
1889
- static code = "LIST_RUNS_FAILED";
1890
- static statusCode = 500;
1891
- static description = `Failed to list execute runs: {message}`;
2045
+ static code = "NO_ENTRYPOINT_FOUND";
2046
+ static statusCode = 400;
2047
+ static description = `No entrypoint found in deployment`;
1892
2048
  }
1893
- class ExecutionErrorError extends Error {
2049
+ class EntrypointNotFoundError extends Error {
1894
2050
  constructor(body) {
1895
2051
  super(
1896
- `EXECUTION_ERROR: ${body.message}`
2052
+ `ENTRYPOINT_NOT_FOUND: ${body.message}`
1897
2053
  );
1898
2054
  this.body = body;
1899
- this.name = "ExecutionErrorError";
2055
+ this.name = "EntrypointNotFoundError";
1900
2056
  }
1901
- static code = "EXECUTION_ERROR";
1902
- static statusCode = 500;
1903
- static description = `Script execution error: {message}`;
2057
+ static code = "ENTRYPOINT_NOT_FOUND";
2058
+ static statusCode = 400;
2059
+ static description = `Entrypoint not found: {entrypoint}`;
1904
2060
  }
1905
- class ConnectionFailedError extends Error {
2061
+ class NoDomainOwnershipError extends Error {
1906
2062
  constructor(body) {
1907
2063
  super(
1908
- `CONNECTION_FAILED: ${body.message}`
2064
+ `NO_DOMAIN_OWNERSHIP: ${body.message}`
1909
2065
  );
1910
2066
  this.body = body;
1911
- this.name = "ConnectionFailedError";
2067
+ this.name = "NoDomainOwnershipError";
1912
2068
  }
1913
- static code = "CONNECTION_FAILED";
1914
- static statusCode = 500;
1915
- static description = `Failed to connect to execute server: {message}`;
2069
+ static code = "NO_DOMAIN_OWNERSHIP";
2070
+ static statusCode = 403;
2071
+ static description = `No domain ownership for: {domain}`;
1916
2072
  }
1917
- class MetadataWriteFailedError extends Error {
2073
+ class InvalidDomainsError extends Error {
1918
2074
  constructor(body) {
1919
2075
  super(
1920
- `METADATA_WRITE_FAILED: ${body.message}`
2076
+ `INVALID_DOMAINS: ${body.message}`
1921
2077
  );
1922
2078
  this.body = body;
1923
- this.name = "MetadataWriteFailedError";
2079
+ this.name = "InvalidDomainsError";
1924
2080
  }
1925
- static code = "METADATA_WRITE_FAILED";
1926
- static statusCode = 500;
1927
- static description = `Failed to write metadata file: {message}`;
2081
+ static code = "INVALID_DOMAINS";
2082
+ static statusCode = 400;
2083
+ static description = `Invalid domains provided`;
1928
2084
  }
1929
- class NodeModulesInstallFailedError extends Error {
2085
+ class WebDeploymentBadRequestError extends Error {
1930
2086
  constructor(body) {
1931
2087
  super(
1932
- `NODE_MODULES_INSTALL_FAILED: ${body.message}`
2088
+ `WEB_DEPLOYMENT_BAD_REQUEST: ${body.message}`
1933
2089
  );
1934
2090
  this.body = body;
1935
- this.name = "NodeModulesInstallFailedError";
2091
+ this.name = "WebDeploymentBadRequestError";
1936
2092
  }
1937
- static code = "NODE_MODULES_INSTALL_FAILED";
1938
- static statusCode = 500;
1939
- static description = `Failed to install node modules: {message}`;
2093
+ static code = "WEB_DEPLOYMENT_BAD_REQUEST";
2094
+ static statusCode = 400;
2095
+ static description = `Bad request: {message}`;
1940
2096
  }
1941
- class NodeModulesDownloadFailedError extends Error {
2097
+ class DeploymentNotFoundError extends Error {
1942
2098
  constructor(body) {
1943
2099
  super(
1944
- `NODE_MODULES_DOWNLOAD_FAILED: ${body.message}`
2100
+ `DEPLOYMENT_NOT_FOUND: ${body.message}`
1945
2101
  );
1946
2102
  this.body = body;
1947
- this.name = "NodeModulesDownloadFailedError";
2103
+ this.name = "DeploymentNotFoundError";
1948
2104
  }
1949
- static code = "NODE_MODULES_DOWNLOAD_FAILED";
1950
- static statusCode = 500;
1951
- static description = `Failed to download node modules: {message}`;
2105
+ static code = "DEPLOYMENT_NOT_FOUND";
2106
+ static statusCode = 404;
2107
+ static description = `Deployment not found`;
1952
2108
  }
1953
- class LockGenerationFailedError extends Error {
2109
+ class DatabaseErrorError extends Error {
1954
2110
  constructor(body) {
1955
2111
  super(
1956
- `LOCK_GENERATION_FAILED: ${body.message}`
2112
+ `DATABASE_ERROR: ${body.message}`
1957
2113
  );
1958
2114
  this.body = body;
1959
- this.name = "LockGenerationFailedError";
2115
+ this.name = "DatabaseErrorError";
1960
2116
  }
1961
- static code = "LOCK_GENERATION_FAILED";
2117
+ static code = "DATABASE_ERROR";
1962
2118
  static statusCode = 500;
1963
- static description = `Failed to generate lock file: {message}`;
2119
+ static description = `Database operation failed: {message}`;
1964
2120
  }
1965
- class WriteScriptFailedError extends Error {
2121
+ class TriggerErrorError extends Error {
1966
2122
  constructor(body) {
1967
2123
  super(
1968
- `WRITE_SCRIPT_FAILED: ${body.message}`
2124
+ `TRIGGER_ERROR: ${body.message}`
1969
2125
  );
1970
2126
  this.body = body;
1971
- this.name = "WriteScriptFailedError";
2127
+ this.name = "TriggerErrorError";
1972
2128
  }
1973
- static code = "WRITE_SCRIPT_FAILED";
2129
+ static code = "TRIGGER_ERROR";
1974
2130
  static statusCode = 500;
1975
- static description = `Failed to write script file: {message}`;
2131
+ static description = `Failed to manage triggers: {message}`;
1976
2132
  }
1977
- class DirectoryCreationFailedError extends Error {
2133
+ class TokenErrorError extends Error {
1978
2134
  constructor(body) {
1979
2135
  super(
1980
- `DIRECTORY_CREATION_FAILED: ${body.message}`
2136
+ `TOKEN_ERROR: ${body.message}`
1981
2137
  );
1982
2138
  this.body = body;
1983
- this.name = "DirectoryCreationFailedError";
2139
+ this.name = "TokenErrorError";
1984
2140
  }
1985
- static code = "DIRECTORY_CREATION_FAILED";
2141
+ static code = "TOKEN_ERROR";
1986
2142
  static statusCode = 500;
1987
- static description = `Failed to create script directory: {message}`;
2143
+ static description = `Failed to manage tokens: {message}`;
1988
2144
  }
1989
- class NetworkPermissionsFailedError extends Error {
2145
+ class PermissionErrorError extends Error {
1990
2146
  constructor(body) {
1991
2147
  super(
1992
- `NETWORK_PERMISSIONS_FAILED: ${body.message}`
2148
+ `PERMISSION_ERROR: ${body.message}`
1993
2149
  );
1994
2150
  this.body = body;
1995
- this.name = "NetworkPermissionsFailedError";
2151
+ this.name = "PermissionErrorError";
1996
2152
  }
1997
- static code = "NETWORK_PERMISSIONS_FAILED";
2153
+ static code = "PERMISSION_ERROR";
1998
2154
  static statusCode = 500;
1999
- static description = `Failed to insert network permissions: {message}`;
2155
+ static description = `Failed to manage permissions: {message}`;
2000
2156
  }
2001
- class LoggingFailedError extends Error {
2157
+ class IdentityErrorError extends Error {
2002
2158
  constructor(body) {
2003
2159
  super(
2004
- `LOGGING_FAILED: ${body.message}`
2160
+ `IDENTITY_ERROR: ${body.message}`
2005
2161
  );
2006
2162
  this.body = body;
2007
- this.name = "LoggingFailedError";
2163
+ this.name = "IdentityErrorError";
2008
2164
  }
2009
- static code = "LOGGING_FAILED";
2165
+ static code = "IDENTITY_ERROR";
2010
2166
  static statusCode = 500;
2011
- static description = `Failed to log execute run: {message}`;
2167
+ static description = `Failed to manage identity: {message}`;
2012
2168
  }
2013
- class RunNotFoundError extends Error {
2169
+ class GetContentFailedError extends Error {
2014
2170
  constructor(body) {
2015
2171
  super(
2016
- `RUN_NOT_FOUND: ${body.message}`
2172
+ `GET_CONTENT_FAILED: ${body.message}`
2017
2173
  );
2018
2174
  this.body = body;
2019
- this.name = "RunNotFoundError";
2175
+ this.name = "GetContentFailedError";
2020
2176
  }
2021
- static code = "RUN_NOT_FOUND";
2022
- static statusCode = 404;
2023
- static description = `Execute run not found: {run_id}`;
2177
+ static code = "GET_CONTENT_FAILED";
2178
+ static statusCode = 500;
2179
+ static description = `Failed to get content: {message}`;
2024
2180
  }
2025
- class CloudstateInternalErrorError extends Error {
2181
+ class ContentNotFoundError extends Error {
2026
2182
  constructor(body) {
2027
2183
  super(
2028
- `CLOUDSTATE_INTERNAL_ERROR: ${body.message}`
2184
+ `CONTENT_NOT_FOUND: ${body.message}`
2029
2185
  );
2030
2186
  this.body = body;
2031
- this.name = "CloudstateInternalErrorError";
2187
+ this.name = "ContentNotFoundError";
2032
2188
  }
2033
- static code = "CLOUDSTATE_INTERNAL_ERROR";
2034
- static statusCode = 500;
2035
- static description = `Internal error: {message}`;
2189
+ static code = "CONTENT_NOT_FOUND";
2190
+ static statusCode = 404;
2191
+ static description = `Content not found: {path}`;
2036
2192
  }
2037
- class CloudstateDatabaseErrorError extends Error {
2193
+ class DownloadFailedError extends Error {
2038
2194
  constructor(body) {
2039
2195
  super(
2040
- `CLOUDSTATE_DATABASE_ERROR: ${body.message}`
2196
+ `DOWNLOAD_FAILED: ${body.message}`
2041
2197
  );
2042
2198
  this.body = body;
2043
- this.name = "CloudstateDatabaseErrorError";
2199
+ this.name = "DownloadFailedError";
2044
2200
  }
2045
- static code = "CLOUDSTATE_DATABASE_ERROR";
2201
+ static code = "DOWNLOAD_FAILED";
2046
2202
  static statusCode = 500;
2047
- static description = `Database operation failed: {message}`;
2203
+ static description = `Failed to download repository: {message}`;
2048
2204
  }
2049
- class CloudstateAccessDeniedError extends Error {
2205
+ class GitServerErrorError extends Error {
2050
2206
  constructor(body) {
2051
2207
  super(
2052
- `CLOUDSTATE_ACCESS_DENIED: ${body.message}`
2208
+ `GIT_SERVER_ERROR: ${body.message}`
2053
2209
  );
2054
2210
  this.body = body;
2055
- this.name = "CloudstateAccessDeniedError";
2211
+ this.name = "GitServerErrorError";
2056
2212
  }
2057
- static code = "CLOUDSTATE_ACCESS_DENIED";
2058
- static statusCode = 403;
2059
- static description = `Access denied to project: {project_id}`;
2213
+ static code = "GIT_SERVER_ERROR";
2214
+ static statusCode = 500;
2215
+ static description = `Git server error: {message}`;
2060
2216
  }
2061
- class RestoreFailedError extends Error {
2217
+ class ParseResponseErrorError extends Error {
2062
2218
  constructor(body) {
2063
2219
  super(
2064
- `RESTORE_FAILED: ${body.message}`
2220
+ `PARSE_RESPONSE_ERROR: ${body.message}`
2065
2221
  );
2066
2222
  this.body = body;
2067
- this.name = "RestoreFailedError";
2223
+ this.name = "ParseResponseErrorError";
2068
2224
  }
2069
- static code = "RESTORE_FAILED";
2225
+ static code = "PARSE_RESPONSE_ERROR";
2070
2226
  static statusCode = 500;
2071
- static description = `Failed to restore from backup: {message}`;
2227
+ static description = `Failed to parse response from Git server: {message}`;
2072
2228
  }
2073
- class CreateBackupFailedError extends Error {
2229
+ class RepositoryAccessDeniedError extends Error {
2074
2230
  constructor(body) {
2075
2231
  super(
2076
- `CREATE_BACKUP_FAILED: ${body.message}`
2232
+ `REPOSITORY_ACCESS_DENIED: ${body.message}`
2077
2233
  );
2078
2234
  this.body = body;
2079
- this.name = "CreateBackupFailedError";
2235
+ this.name = "RepositoryAccessDeniedError";
2080
2236
  }
2081
- static code = "CREATE_BACKUP_FAILED";
2082
- static statusCode = 500;
2083
- static description = `Failed to create backup: {message}`;
2237
+ static code = "REPOSITORY_ACCESS_DENIED";
2238
+ static statusCode = 403;
2239
+ static description = `Repository does not belong to account`;
2084
2240
  }
2085
- class BackupFailedError extends Error {
2241
+ class GitHubSyncFailedError extends Error {
2086
2242
  constructor(body) {
2087
2243
  super(
2088
- `BACKUP_FAILED: ${body.message}`
2244
+ `GIT_HUB_SYNC_FAILED: ${body.message}`
2089
2245
  );
2090
2246
  this.body = body;
2091
- this.name = "BackupFailedError";
2247
+ this.name = "GitHubSyncFailedError";
2092
2248
  }
2093
- static code = "BACKUP_FAILED";
2249
+ static code = "GIT_HUB_SYNC_FAILED";
2094
2250
  static statusCode = 500;
2095
- static description = `Backup failed: {message}`;
2251
+ static description = `Failed to configure GitHub sync: {message}`;
2096
2252
  }
2097
- class DeploymentFailedError extends Error {
2253
+ class UpdateDefaultBranchFailedError extends Error {
2098
2254
  constructor(body) {
2099
2255
  super(
2100
- `DEPLOYMENT_FAILED: ${body.message}`
2256
+ `UPDATE_DEFAULT_BRANCH_FAILED: ${body.message}`
2101
2257
  );
2102
2258
  this.body = body;
2103
- this.name = "DeploymentFailedError";
2259
+ this.name = "UpdateDefaultBranchFailedError";
2104
2260
  }
2105
- static code = "DEPLOYMENT_FAILED";
2261
+ static code = "UPDATE_DEFAULT_BRANCH_FAILED";
2106
2262
  static statusCode = 500;
2107
- static description = `Deployment failed: {message}`;
2263
+ static description = `Failed to update default branch: {message}`;
2108
2264
  }
2109
- class InvalidDeploymentRequestError extends Error {
2265
+ class GetRepositoryInfoFailedError extends Error {
2110
2266
  constructor(body) {
2111
2267
  super(
2112
- `INVALID_DEPLOYMENT_REQUEST: ${body.message}`
2268
+ `GET_REPOSITORY_INFO_FAILED: ${body.message}`
2113
2269
  );
2114
2270
  this.body = body;
2115
- this.name = "InvalidDeploymentRequestError";
2271
+ this.name = "GetRepositoryInfoFailedError";
2116
2272
  }
2117
- static code = "INVALID_DEPLOYMENT_REQUEST";
2118
- static statusCode = 400;
2119
- static description = `Invalid deployment request: {message}`;
2273
+ static code = "GET_REPOSITORY_INFO_FAILED";
2274
+ static statusCode = 500;
2275
+ static description = `Failed to get repository info: {message}`;
2120
2276
  }
2121
- class ProjectNotFoundError extends Error {
2277
+ class ListRepositoriesFailedError extends Error {
2122
2278
  constructor(body) {
2123
2279
  super(
2124
- `PROJECT_NOT_FOUND: ${body.message}`
2280
+ `LIST_REPOSITORIES_FAILED: ${body.message}`
2125
2281
  );
2126
2282
  this.body = body;
2127
- this.name = "ProjectNotFoundError";
2283
+ this.name = "ListRepositoriesFailedError";
2128
2284
  }
2129
- static code = "PROJECT_NOT_FOUND";
2130
- static statusCode = 404;
2131
- static description = `Project not found: {project_id}`;
2285
+ static code = "LIST_REPOSITORIES_FAILED";
2286
+ static statusCode = 500;
2287
+ static description = `Failed to list repositories: {message}`;
2132
2288
  }
2133
- class ResizeFailedError extends Error {
2289
+ class DeleteRepositoryFailedError extends Error {
2134
2290
  constructor(body) {
2135
2291
  super(
2136
- `RESIZE_FAILED: ${body.message}`
2292
+ `DELETE_REPOSITORY_FAILED: ${body.message}`
2137
2293
  );
2138
2294
  this.body = body;
2139
- this.name = "ResizeFailedError";
2295
+ this.name = "DeleteRepositoryFailedError";
2140
2296
  }
2141
- static code = "RESIZE_FAILED";
2297
+ static code = "DELETE_REPOSITORY_FAILED";
2142
2298
  static statusCode = 500;
2143
- static description = `Failed to resize VM: {message}`;
2299
+ static description = `Failed to delete repository: {message}`;
2144
2300
  }
2145
- class InternalResizeVmNotFoundError extends Error {
2301
+ class CreateRepositoryFailedError extends Error {
2146
2302
  constructor(body) {
2147
2303
  super(
2148
- `INTERNAL_RESIZE_VM_NOT_FOUND: ${body.message}`
2304
+ `CREATE_REPOSITORY_FAILED: ${body.message}`
2149
2305
  );
2150
2306
  this.body = body;
2151
- this.name = "InternalResizeVmNotFoundError";
2307
+ this.name = "CreateRepositoryFailedError";
2152
2308
  }
2153
- static code = "INTERNAL_RESIZE_VM_NOT_FOUND";
2154
- static statusCode = 404;
2155
- static description = `VM not found`;
2309
+ static code = "CREATE_REPOSITORY_FAILED";
2310
+ static statusCode = 500;
2311
+ static description = `Failed to create repository: {message}`;
2156
2312
  }
2157
- class DomainOwnershipVerificationFailedError extends Error {
2313
+ class SerializationErrorError extends Error {
2158
2314
  constructor(body) {
2159
2315
  super(
2160
- `DOMAIN_OWNERSHIP_VERIFICATION_FAILED: ${body.message}`
2316
+ `SERIALIZATION_ERROR: ${body.message}`
2161
2317
  );
2162
2318
  this.body = body;
2163
- this.name = "DomainOwnershipVerificationFailedError";
2319
+ this.name = "SerializationErrorError";
2164
2320
  }
2165
- static code = "DOMAIN_OWNERSHIP_VERIFICATION_FAILED";
2166
- static statusCode = 403;
2167
- static description = `Domain ownership verification failed`;
2321
+ static code = "SERIALIZATION_ERROR";
2322
+ static statusCode = 400;
2323
+ static description = `Failed to serialize request: {message}`;
2168
2324
  }
2169
- class ErrorDeletingRecordError extends Error {
2325
+ class GitInvalidRequestError extends Error {
2170
2326
  constructor(body) {
2171
2327
  super(
2172
- `ERROR_DELETING_RECORD: ${body.message}`
2328
+ `GIT_INVALID_REQUEST: ${body.message}`
2173
2329
  );
2174
2330
  this.body = body;
2175
- this.name = "ErrorDeletingRecordError";
2331
+ this.name = "GitInvalidRequestError";
2176
2332
  }
2177
- static code = "ERROR_DELETING_RECORD";
2178
- static statusCode = 500;
2179
- static description = `Error deleting DNS record for {domain}/{name}: {message}`;
2333
+ static code = "GIT_INVALID_REQUEST";
2334
+ static statusCode = 400;
2335
+ static description = `Invalid request: {message}`;
2180
2336
  }
2181
- class RecordOwnershipErrorError extends Error {
2337
+ class RepositoryNotFoundError extends Error {
2182
2338
  constructor(body) {
2183
2339
  super(
2184
- `RECORD_OWNERSHIP_ERROR: ${body.message}`
2340
+ `REPOSITORY_NOT_FOUND: ${body.message}`
2185
2341
  );
2186
2342
  this.body = body;
2187
- this.name = "RecordOwnershipErrorError";
2343
+ this.name = "RepositoryNotFoundError";
2188
2344
  }
2189
- static code = "RECORD_OWNERSHIP_ERROR";
2190
- static statusCode = 403;
2191
- static description = `Account {account_id} does not own record {record_id}`;
2345
+ static code = "REPOSITORY_NOT_FOUND";
2346
+ static statusCode = 404;
2347
+ static description = `Repository not found: {repo_id}`;
2192
2348
  }
2193
- class ErrorCreatingRecordError extends Error {
2349
+ class DomainAlreadyExistsError extends Error {
2194
2350
  constructor(body) {
2195
2351
  super(
2196
- `ERROR_CREATING_RECORD: ${body.message}`
2352
+ `DOMAIN_ALREADY_EXISTS: ${body.message}`
2197
2353
  );
2198
2354
  this.body = body;
2199
- this.name = "ErrorCreatingRecordError";
2355
+ this.name = "DomainAlreadyExistsError";
2200
2356
  }
2201
- static code = "ERROR_CREATING_RECORD";
2202
- static statusCode = 500;
2203
- static description = `Error creating DNS record: {message}`;
2357
+ static code = "DOMAIN_ALREADY_EXISTS";
2358
+ static statusCode = 400;
2359
+ static description = `Domain already exists: {domain}`;
2204
2360
  }
2205
- class DomainOwnershipErrorError extends Error {
2361
+ class FailedToInsertOwnershipError extends Error {
2206
2362
  constructor(body) {
2207
2363
  super(
2208
- `DOMAIN_OWNERSHIP_ERROR: ${body.message}`
2364
+ `FAILED_TO_INSERT_OWNERSHIP: ${body.message}`
2209
2365
  );
2210
2366
  this.body = body;
2211
- this.name = "DomainOwnershipErrorError";
2367
+ this.name = "FailedToInsertOwnershipError";
2212
2368
  }
2213
- static code = "DOMAIN_OWNERSHIP_ERROR";
2214
- static statusCode = 403;
2215
- static description = `Account {account_id} does not own domain {domain}`;
2369
+ static code = "FAILED_TO_INSERT_OWNERSHIP";
2370
+ static statusCode = 500;
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";
2284
- }
2285
- static code = "SHUTDOWN_FAILED";
2286
- static statusCode = 500;
2287
- static description = `Failed to shutdown dev server: {message}`;
2439
+ this.name = "CloudstateAccessDeniedError";
2440
+ }
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,
@@ -3116,6 +3298,25 @@ class GitRepo {
3116
3298
  params: { repo: this.repoId, trigger: triggerId }
3117
3299
  });
3118
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
+ }
3119
3320
  }
3120
3321
  class GitReposNamespace {
3121
3322
  constructor(apiClient) {
@@ -3650,6 +3851,14 @@ class FileSystem {
3650
3851
  this.vmId = vmId;
3651
3852
  this.client = client;
3652
3853
  }
3854
+ vm = null;
3855
+ /**
3856
+ * @internal
3857
+ * Set the parent VM instance for exec operations
3858
+ */
3859
+ _setVm(vm) {
3860
+ this.vm = vm;
3861
+ }
3653
3862
  /**
3654
3863
  * Read a file from the VM as a buffer.
3655
3864
  * @param filepath The path to the file in the VM
@@ -3707,21 +3916,47 @@ class FileSystem {
3707
3916
  * @returns Array of file/directory names
3708
3917
  */
3709
3918
  async readDir(path) {
3710
- throw new Error("Not implemented");
3919
+ const response = await this.client.get("/v1/vms/{vm_id}/files/{filepath}", {
3920
+ params: { vm_id: this.vmId, filepath: path }
3921
+ });
3922
+ if ("files" in response && response.files) {
3923
+ return response.files;
3924
+ }
3925
+ throw new Error("Path is not a directory");
3711
3926
  }
3712
3927
  /**
3713
3928
  * Create a directory in the VM.
3714
3929
  * @param path The path to create
3930
+ * @param recursive Create parent directories if needed (default: false)
3715
3931
  */
3716
- async mkdir(path) {
3717
- throw new Error("Not implemented");
3932
+ async mkdir(path, recursive = false) {
3933
+ if (!this.vm) {
3934
+ throw new Error("FileSystem not properly initialized");
3935
+ }
3936
+ const flag = recursive ? "-p" : "";
3937
+ const result = await this.vm.exec(`mkdir ${flag} "${path}"`);
3938
+ if (result.statusCode !== 0) {
3939
+ throw new Error(
3940
+ `Failed to create directory: ${result.stderr || "Unknown error"}`
3941
+ );
3942
+ }
3718
3943
  }
3719
3944
  /**
3720
3945
  * Remove a file or directory from the VM.
3721
3946
  * @param path The path to remove
3947
+ * @param recursive Remove directories and their contents recursively (default: false)
3722
3948
  */
3723
- async remove(path) {
3724
- throw new Error("Not implemented");
3949
+ async remove(path, recursive = false) {
3950
+ if (!this.vm) {
3951
+ throw new Error("FileSystem not properly initialized");
3952
+ }
3953
+ const flag = recursive ? "-rf" : "-f";
3954
+ const result = await this.vm.exec(`rm ${flag} "${path}"`);
3955
+ if (result.statusCode !== 0) {
3956
+ throw new Error(
3957
+ `Failed to remove path: ${result.stderr || "Unknown error"}`
3958
+ );
3959
+ }
3725
3960
  }
3726
3961
  /**
3727
3962
  * Check if a file or directory exists in the VM.
@@ -3729,7 +3964,11 @@ class FileSystem {
3729
3964
  * @returns True if exists, false otherwise
3730
3965
  */
3731
3966
  async exists(path) {
3732
- throw new Error("Not implemented");
3967
+ if (!this.vm) {
3968
+ throw new Error("FileSystem not properly initialized");
3969
+ }
3970
+ const result = await this.vm.exec(`test -e "${path}"`);
3971
+ return result.statusCode === 0;
3733
3972
  }
3734
3973
  /**
3735
3974
  * Get file/directory stats.
@@ -3737,7 +3976,37 @@ class FileSystem {
3737
3976
  * @returns File/directory stats
3738
3977
  */
3739
3978
  async stat(path) {
3740
- throw new Error("Not implemented");
3979
+ if (!this.vm) {
3980
+ throw new Error("FileSystem not properly initialized");
3981
+ }
3982
+ const result = await this.vm.exec(
3983
+ `stat -c '%s|%F|%a|%U|%G|%y' "${path}" 2>/dev/null || stat -f '%z|%HT|%p|%Su|%Sg|%Sm' "${path}"`
3984
+ );
3985
+ if (result.statusCode !== 0 || !result.stdout) {
3986
+ throw new Error(
3987
+ `Failed to stat path: ${result.stderr || "Unknown error"}`
3988
+ );
3989
+ }
3990
+ const parts = result.stdout.trim().split("|");
3991
+ if (parts.length < 6) {
3992
+ throw new Error(`Invalid stat output: ${result.stdout}`);
3993
+ }
3994
+ const size = parseInt(parts[0] || "0");
3995
+ const fileType = parts[1] || "";
3996
+ const permissions = parts[2] || "";
3997
+ const owner = parts[3] || "";
3998
+ const group = parts[4] || "";
3999
+ const modified = parts[5] || "";
4000
+ return {
4001
+ size,
4002
+ isFile: fileType.includes("regular file") || fileType.includes("Regular File"),
4003
+ isDirectory: fileType.includes("directory") || fileType.includes("Directory"),
4004
+ isSymlink: fileType.includes("symbolic link") || fileType.includes("Symbolic Link"),
4005
+ permissions,
4006
+ owner,
4007
+ group,
4008
+ modified
4009
+ };
3741
4010
  }
3742
4011
  /**
3743
4012
  * Watch for file changes in the VM.
@@ -3922,12 +4191,16 @@ function composeCreateVmOptions(arr) {
3922
4191
  if (!result.template) {
3923
4192
  result.template = options.template;
3924
4193
  } else if (options.template !== null) {
3925
- const baseTemplate = result.template instanceof VmTemplate ? result.template["template"] : result.template;
3926
- const newTemplate = options.template instanceof VmTemplate ? options.template["template"] : options.template;
4194
+ const baseTemplate = result.template instanceof VmTemplate ? result.template["raw"] : result.template;
4195
+ const newTemplate = options.template instanceof VmTemplate ? options.template["raw"] : options.template;
3927
4196
  result.template = {
3928
4197
  // Simple overrides - start with base, override with new
3929
4198
  snapshotId: newTemplate.snapshotId !== void 0 ? newTemplate.snapshotId : baseTemplate.snapshotId,
3930
- rootfsSizeMb: newTemplate.rootfsSizeMb !== void 0 ? newTemplate.rootfsSizeMb : baseTemplate.rootfsSizeMb,
4199
+ rootfsSizeGb: newTemplate.rootfsSizeGb !== void 0 ? newTemplate.rootfsSizeGb : baseTemplate.rootfsSizeGb,
4200
+ memSizeGb: newTemplate.memSizeGb !== void 0 ? newTemplate.memSizeGb : baseTemplate.memSizeGb,
4201
+ aptDeps: newTemplate.aptDeps ?? baseTemplate.aptDeps,
4202
+ vcpuCount: newTemplate.vcpuCount !== void 0 ? newTemplate.vcpuCount : baseTemplate.vcpuCount,
4203
+ discriminator: newTemplate.discriminator ?? baseTemplate.discriminator,
3931
4204
  workdir: newTemplate.workdir !== void 0 ? newTemplate.workdir : baseTemplate.workdir,
3932
4205
  idleTimeoutSeconds: newTemplate.idleTimeoutSeconds !== void 0 ? newTemplate.idleTimeoutSeconds : baseTemplate.idleTimeoutSeconds,
3933
4206
  waitForReadySignal: newTemplate.waitForReadySignal !== void 0 ? newTemplate.waitForReadySignal : baseTemplate.waitForReadySignal,
@@ -4087,6 +4360,7 @@ class Vm {
4087
4360
  this.apiClient = apiClient;
4088
4361
  this.vmId = vmId;
4089
4362
  this.fs = new FileSystem(vmId, apiClient);
4363
+ this.fs._setVm(this);
4090
4364
  this.terminals = new VmTerminals(vmId, apiClient);
4091
4365
  }
4092
4366
  vmId;
@@ -4202,11 +4476,13 @@ class Vm {
4202
4476
  * @returns Resize response
4203
4477
  */
4204
4478
  async resize({
4205
- sizeMb
4479
+ memSizeGb,
4480
+ rootfsSizeGb,
4481
+ vcpuCount
4206
4482
  }) {
4207
4483
  return this.apiClient.post("/v1/vms/{id}/resize", {
4208
4484
  params: { id: this.vmId },
4209
- body: { sizeMb }
4485
+ body: { memSizeGb, rootfsSizeGb, vcpuCount }
4210
4486
  });
4211
4487
  }
4212
4488
  }
@@ -4215,15 +4491,44 @@ class VmSnapshotsNamespace {
4215
4491
  this.apiClient = apiClient;
4216
4492
  }
4217
4493
  async ensure(options) {
4494
+ if (options.template.raw.template instanceof VmTemplate) {
4495
+ options.template = await ensureNestedTemplates(options.template, this);
4496
+ }
4218
4497
  return this.apiClient.post("/v1/vms/snapshots", {
4219
4498
  body: {
4220
4499
  ...options,
4221
4500
  // @ts-ignore
4222
- template: options.template?.template
4501
+ template: options.template?.raw
4223
4502
  }
4224
4503
  });
4225
4504
  }
4226
4505
  }
4506
+ async function ensureNestedTemplates(template, snapshots) {
4507
+ let templates = [template];
4508
+ while (templates.at(-1)?.raw.template instanceof VmTemplate) {
4509
+ let innerTemplate = templates.at(-1).raw.template;
4510
+ templates.at(-1).raw.template = void 0;
4511
+ templates.push(innerTemplate);
4512
+ }
4513
+ return await layerTemplates(templates, snapshots);
4514
+ }
4515
+ async function layerTemplates(templates, snapshots) {
4516
+ let lastTemplate = templates.pop();
4517
+ const { snapshotId } = await snapshots.ensure({
4518
+ template: lastTemplate
4519
+ });
4520
+ let lastSnapshotId = snapshotId;
4521
+ while (templates.length > 0) {
4522
+ const template = templates.pop();
4523
+ template.raw.snapshotId = lastSnapshotId;
4524
+ const { snapshotId: snapshotId2 } = await snapshots.ensure({
4525
+ template
4526
+ });
4527
+ lastSnapshotId = snapshotId2;
4528
+ lastTemplate = template;
4529
+ }
4530
+ return lastTemplate;
4531
+ }
4227
4532
  class VmsNamespace {
4228
4533
  constructor(apiClient) {
4229
4534
  this.apiClient = apiClient;
@@ -4239,6 +4544,12 @@ class VmsNamespace {
4239
4544
  const builders = options.with || {};
4240
4545
  const { with: _, ...baseConfig } = options;
4241
4546
  let config = baseConfig;
4547
+ if (config.template instanceof VmTemplate) {
4548
+ config.template = await ensureNestedTemplates(
4549
+ config.template,
4550
+ this.snapshots
4551
+ );
4552
+ }
4242
4553
  const keys = Object.keys(builders);
4243
4554
  for (const key of keys) {
4244
4555
  const builder = builders[key];
@@ -4249,7 +4560,7 @@ class VmsNamespace {
4249
4560
  const response = await this.apiClient.post("/v1/vms", {
4250
4561
  body: {
4251
4562
  ...config,
4252
- template: config.template instanceof VmTemplate ? config.template["template"] : config.template
4563
+ template: config.template instanceof VmTemplate ? config.template["raw"] : config.template
4253
4564
  }
4254
4565
  });
4255
4566
  const vmId = response.id;
@@ -4295,9 +4606,9 @@ class VmsNamespace {
4295
4606
  }
4296
4607
  }
4297
4608
  class VmTemplate {
4298
- template;
4609
+ raw;
4299
4610
  constructor(template) {
4300
- this.template = template;
4611
+ this.raw = template;
4301
4612
  }
4302
4613
  }
4303
4614