Skip to content

Commit 4d7fb09

Browse files
committedAug 1, 2020
Fix the server ids, never worked...
1 parent 568f2df commit 4d7fb09

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ node_modules/
55
dist/
66
test/
77
test2/
8+
docs/
89

910
src/test.ts

‎src/lib/client/Server.ts

+23-23
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class Server extends ServerModel {
118118
public updateDetails(options: ServerDetailsRequestOptions): Promise<Server> {
119119
return new Promise(async (resolve, reject) => {
120120
try {
121-
let res = await this.api.call(`/application/servers/${this.internalId}/details`, 'PATCH', this.getDetailsRequestObject(options));
121+
let res = await this.api.call(`/application/servers/${this.id}/details`, 'PATCH', this.getDetailsRequestObject(options));
122122
resolve(new Server(this.api, res.data.attributes));
123123
} catch (error) {
124124
reject(error);
@@ -129,7 +129,7 @@ class Server extends ServerModel {
129129
public updateBuild(options: ServerBuildConfigRequestOptions): Promise<Server> {
130130
return new Promise(async (resolve, reject) => {
131131
try {
132-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject(options));
132+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject(options));
133133
resolve(new Server(this.api, res.data.attributes));
134134
} catch (error) {
135135
reject(error);
@@ -140,7 +140,7 @@ class Server extends ServerModel {
140140
public updateStartup(options: ServerStartupRequestOptions): Promise<Server> {
141141
return new Promise(async (resolve, reject) => {
142142
try {
143-
let res = await this.api.call(`/application/servers/${this.internalId}/startup`, 'PATCH', this.getStartupRequestObject(options));
143+
let res = await this.api.call(`/application/servers/${this.id}/startup`, 'PATCH', this.getStartupRequestObject(options));
144144
resolve(new Server(this.api, res.data.attributes));
145145
} catch (error) {
146146
reject(error);
@@ -153,7 +153,7 @@ class Server extends ServerModel {
153153

154154
return new Promise(async (resolve, reject) => {
155155
try {
156-
await this.api.call(`/application/servers/${this.internalId}/suspend`, 'POST');
156+
await this.api.call(`/application/servers/${this.id}/suspend`, 'POST');
157157
resolve();
158158
} catch (error) {
159159
reject(error);
@@ -166,7 +166,7 @@ class Server extends ServerModel {
166166

167167
return new Promise(async (resolve, reject) => {
168168
try {
169-
await this.api.call(`/application/servers/${this.internalId}/unsuspend`, 'POST');
169+
await this.api.call(`/application/servers/${this.id}/unsuspend`, 'POST');
170170
resolve();
171171
} catch (error) {
172172
reject(error);
@@ -177,7 +177,7 @@ class Server extends ServerModel {
177177
public reinstall(): Promise<void> {
178178
return new Promise(async (resolve, reject) => {
179179
try {
180-
await this.api.call(`/application/servers/${this.internalId}/reinstall`, 'POST');
180+
await this.api.call(`/application/servers/${this.id}/reinstall`, 'POST');
181181
resolve();
182182
} catch (error) {
183183
reject(error);
@@ -187,7 +187,7 @@ class Server extends ServerModel {
187187
public rebuild(): Promise<void> {
188188
return new Promise(async (resolve, reject) => {
189189
try {
190-
await this.api.call(`/application/servers/${this.internalId}/rebuild`, 'POST');
190+
await this.api.call(`/application/servers/${this.id}/rebuild`, 'POST');
191191
resolve();
192192
} catch (error) {
193193
reject(error);
@@ -206,7 +206,7 @@ class Server extends ServerModel {
206206

207207
return new Promise(async (resolve, reject) => {
208208
try {
209-
let res = await this.api.call(`/application/servers/${this.internalId}/details`, 'PATCH', this.getDetailsRequestObject({ name }));
209+
let res = await this.api.call(`/application/servers/${this.id}/details`, 'PATCH', this.getDetailsRequestObject({ name }));
210210
resolve(new Server(this.api, res.data.attributes));
211211
} catch (error) {
212212
reject(error);
@@ -219,7 +219,7 @@ class Server extends ServerModel {
219219

220220
return new Promise(async (resolve, reject) => {
221221
try {
222-
let res = await this.api.call(`/application/servers/${this.internalId}/details`, 'PATCH', this.getDetailsRequestObject({ description }));
222+
let res = await this.api.call(`/application/servers/${this.id}/details`, 'PATCH', this.getDetailsRequestObject({ description }));
223223
resolve(new Server(this.api, res.data.attributes));
224224
} catch (error) {
225225
reject(error);
@@ -232,7 +232,7 @@ class Server extends ServerModel {
232232

233233
return new Promise(async (resolve, reject) => {
234234
try {
235-
let res = await this.api.call(`/application/servers/${this.internalId}/details`, 'PATCH', this.getDetailsRequestObject({ user }));
235+
let res = await this.api.call(`/application/servers/${this.id}/details`, 'PATCH', this.getDetailsRequestObject({ user }));
236236
resolve(new Server(this.api, res.data.attributes));
237237
} catch (error) {
238238
reject(error);
@@ -246,7 +246,7 @@ class Server extends ServerModel {
246246

247247
return new Promise(async (resolve, reject) => {
248248
try {
249-
let res = await this.api.call(`/application/servers/${this.internalId}/details`, 'PATCH', this.getDetailsRequestObject({ limits: { memory } }));
249+
let res = await this.api.call(`/application/servers/${this.id}/details`, 'PATCH', this.getDetailsRequestObject({ limits: { memory } }));
250250
resolve(new Server(this.api, res.data.attributes));
251251
} catch (error) {
252252
reject(error);
@@ -260,7 +260,7 @@ class Server extends ServerModel {
260260

261261
return new Promise(async (resolve, reject) => {
262262
try {
263-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ limits: { cpu } }));
263+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ limits: { cpu } }));
264264
resolve(new Server(this.api, res.data.attributes));
265265
} catch (error) {
266266
reject(error);
@@ -273,7 +273,7 @@ class Server extends ServerModel {
273273

274274
return new Promise(async (resolve, reject) => {
275275
try {
276-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ limits: { disk } }));
276+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ limits: { disk } }));
277277
resolve(new Server(this.api, res.data.attributes));
278278
} catch (error) {
279279
reject(error);
@@ -286,7 +286,7 @@ class Server extends ServerModel {
286286

287287
return new Promise(async (resolve, reject) => {
288288
try {
289-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ limits: { io } }));
289+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ limits: { io } }));
290290
resolve(new Server(this.api, res.data.attributes));
291291
} catch (error) {
292292
reject(error);
@@ -299,7 +299,7 @@ class Server extends ServerModel {
299299

300300
return new Promise(async (resolve, reject) => {
301301
try {
302-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ limits: { swap } }));
302+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ limits: { swap } }));
303303
resolve(new Server(this.api, res.data.attributes));
304304
} catch (error) {
305305
reject(error);
@@ -312,7 +312,7 @@ class Server extends ServerModel {
312312

313313
return new Promise(async (resolve, reject) => {
314314
try {
315-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ feature_limits: { databases: amount } }));
315+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ feature_limits: { databases: amount } }));
316316
resolve(new Server(this.api, res.data.attributes));
317317
} catch (error) {
318318
reject(error);
@@ -325,7 +325,7 @@ class Server extends ServerModel {
325325

326326
return new Promise(async (resolve, reject) => {
327327
try {
328-
let res = await this.api.call(`/application/servers/${this.internalId}/build`, 'PATCH', this.getBuildRequestObject({ feature_limits: { allocations: amount } }));
328+
let res = await this.api.call(`/application/servers/${this.id}/build`, 'PATCH', this.getBuildRequestObject({ feature_limits: { allocations: amount } }));
329329
resolve(new Server(this.api, res.data.attributes));
330330
} catch (error) {
331331
reject(error);
@@ -338,7 +338,7 @@ class Server extends ServerModel {
338338

339339
return new Promise(async (resolve, reject) => {
340340
try {
341-
let res = await this.api.call(`/application/servers/${this.internalId}/startup`, 'PATCH', this.getStartupRequestObject({ startup: command }));
341+
let res = await this.api.call(`/application/servers/${this.id}/startup`, 'PATCH', this.getStartupRequestObject({ startup: command }));
342342
resolve(new Server(this.api, res.data.attributes));
343343
} catch (error) {
344344
reject(error);
@@ -351,7 +351,7 @@ class Server extends ServerModel {
351351

352352
return new Promise(async (resolve, reject) => {
353353
try {
354-
let res = await this.api.call(`/application/servers/${this.internalId}/startup`, 'PATCH', this.getStartupRequestObject({ egg }));
354+
let res = await this.api.call(`/application/servers/${this.id}/startup`, 'PATCH', this.getStartupRequestObject({ egg }));
355355
resolve(new Server(this.api, res.data.attributes));
356356
} catch (error) {
357357
reject(error);
@@ -364,7 +364,7 @@ class Server extends ServerModel {
364364

365365
return new Promise(async (resolve, reject) => {
366366
try {
367-
let res = await this.api.call(`/application/servers/${this.internalId}/startup`, 'PATCH', this.getStartupRequestObject({ pack }));
367+
let res = await this.api.call(`/application/servers/${this.id}/startup`, 'PATCH', this.getStartupRequestObject({ pack }));
368368
resolve(new Server(this.api, res.data.attributes));
369369
} catch (error) {
370370
reject(error);
@@ -378,7 +378,7 @@ class Server extends ServerModel {
378378

379379
return new Promise(async (resolve, reject) => {
380380
try {
381-
let res = await this.api.call(`/application/servers/${this.internalId}/startup`, 'PATCH', this.getStartupRequestObject({ image }));
381+
let res = await this.api.call(`/application/servers/${this.id}/startup`, 'PATCH', this.getStartupRequestObject({ image }));
382382
resolve(new Server(this.api, res.data.attributes));
383383
} catch (error) {
384384
reject(error);
@@ -389,7 +389,7 @@ class Server extends ServerModel {
389389
public createDatabase(name: string, remote: string, host: number): Promise<ServerDatabase> {
390390
return new Promise(async (resolve, reject) => {
391391
try {
392-
let res = await this.api.call(`/application/servers/${this.internalId}/databases`, 'POST', { database: name, remote, host });
392+
let res = await this.api.call(`/application/servers/${this.id}/databases`, 'POST', { database: name, remote, host });
393393
resolve(new ServerDatabase(this.api, res.data.attributes));
394394
} catch (error) {
395395
reject(error);
@@ -408,7 +408,7 @@ class Server extends ServerModel {
408408
public delete(force?: boolean): Promise<void> {
409409
return new Promise(async (resolve, reject) => {
410410
try {
411-
await this.api.call(`/application/servers/${this.internalId}${force ? '/force' : ''}`, 'DELETE');
411+
await this.api.call(`/application/servers/${this.id}${force ? '/force' : ''}`, 'DELETE');
412412
resolve();
413413
} catch (error) {
414414
reject(error);

0 commit comments

Comments
 (0)
Please sign in to comment.