File tree 7 files changed +60
-2
lines changed
7 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -96,4 +96,14 @@ client.v1
96
96
.then ((response ) => {
97
97
console .log (" ClaimServer Response:" , response );
98
98
});
99
+
100
+ client .v1
101
+ .RenameServer ({
102
+ data: {
103
+ serverName: " Shinigami-PC localhost" ,
104
+ },
105
+ })
106
+ .then (() => {
107
+ // response will be an empty string if valid
108
+ });
99
109
```
Original file line number Diff line number Diff line change @@ -35,4 +35,7 @@ export type {
35
35
VerifyAuthenticationTokenRequest ,
36
36
VerifyAuthenticationTokenResponse ,
37
37
WrongPasswordErrorResponse ,
38
+ RenameServerRequest ,
39
+ RenameServerResponse ,
40
+ ServerClaimedErrorResponse ,
38
41
} from "./v1/index.js" ;
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ export type ClaimServerRequest = ApiRequest<
5
5
"ClaimServer" ,
6
6
{
7
7
/**
8
- * New name of the Dedicated Server.
8
+ * New name of the Dedicated Server.
9
9
*/
10
10
serverName : string ;
11
11
/**
12
- * Admin Password to set on the Dedicated Server, in plaintext.
12
+ * Admin Password to set on the Dedicated Server, in plaintext.
13
13
*/
14
14
adminPassword : string ;
15
15
}
Original file line number Diff line number Diff line change
1
+ import type { ApiRequest } from "./common.js" ;
2
+ import { buildApiRequest } from "./common.js" ;
3
+
4
+ export type RenameServerRequest = ApiRequest <
5
+ "RenameServer" ,
6
+ {
7
+ /**
8
+ * New name of the Dedicated Server.
9
+ */
10
+ serverName : string ;
11
+ }
12
+ > ;
13
+
14
+ export type RenameServerResponse = string ;
15
+
16
+ export const buildRenameServer = buildApiRequest <
17
+ RenameServerRequest ,
18
+ RenameServerResponse
19
+ > ( "v1" , {
20
+ function : "RenameServer" ,
21
+ } ) ;
Original file line number Diff line number Diff line change @@ -36,3 +36,7 @@ export interface WrongPasswordErrorResponse extends ErrorResponse {
36
36
export interface ServerClaimedErrorResponse extends ErrorResponse {
37
37
errorCode : "server_claimed" ;
38
38
}
39
+
40
+ export interface ServerNotClaimedErrorResponse extends ErrorResponse {
41
+ errorCode : "server_not_claimed" ;
42
+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { buildHealthCheck } from "./HealthCheck.js";
7
7
import { buildPasswordlessLogin } from "./PasswordlessLogin.js" ;
8
8
import { buildPasswordLogin } from "./PasswordLogin.js" ;
9
9
import { buildQueryServerState } from "./QueryServerState.js" ;
10
+ import { buildRenameServer } from "./RenameServer.js" ;
10
11
import { buildVerifyAuthenticationToken } from "./VerifyAuthenticationToken.js" ;
11
12
12
13
export function buildV1 ( options : InternalClientOptions ) {
@@ -65,6 +66,14 @@ export function buildV1(options: InternalClientOptions) {
65
66
* The client should drop InitialAdmin privileges after that and use returned AuthenticationToken instead, and update it's cached server game state by calling QueryServerState.
66
67
*/
67
68
ClaimServer : buildClaimServer ( options ) ,
69
+ /**
70
+ * Renames the Dedicated Server once it has been claimed.
71
+ *
72
+ * Requires Admin privileges.
73
+ *
74
+ * Function does not return any data on success.
75
+ */
76
+ RenameServer : buildRenameServer ( options ) ,
68
77
} ;
69
78
}
70
79
@@ -78,4 +87,5 @@ export type * from "./HealthCheck.js";
78
87
export type * from "./PasswordlessLogin.js" ;
79
88
export type * from "./PasswordLogin.js" ;
80
89
export type * from "./QueryServerState.js" ;
90
+ export type * from "./RenameServer.js" ;
81
91
export type * from "./VerifyAuthenticationToken.js" ;
Original file line number Diff line number Diff line change @@ -77,3 +77,13 @@ client.v1
77
77
. then ( ( response ) => {
78
78
console . log ( "ClaimServer Response:" , response ) ;
79
79
} ) ;
80
+
81
+ client . v1
82
+ . RenameServer ( {
83
+ data : {
84
+ serverName : "Shinigami-PC localhost" ,
85
+ } ,
86
+ } )
87
+ . then ( ( response ) => {
88
+ console . log ( "RenameServer Response:" , typeof response ) ;
89
+ } ) ;
You can’t perform that action at this time.
0 commit comments