@@ -79,11 +79,12 @@ declare module 'pterodactyl.js' {
79
79
}
80
80
81
81
export class ClientServer extends ClientServerModel {
82
- constructor ( api : UserClient , options : ClientServerOptionsRaw ) ;
82
+ constructor ( api : UserClient , options : ClientServerOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
83
83
84
84
private api : UserClient ;
85
+ public pagination ?: Pagination ;
85
86
86
- public static getAll ( api : UserClient ) : Promise < ClientServer [ ] > ;
87
+ public static getAll ( api : UserClient , page : number ) : Promise < ClientServer [ ] > ;
87
88
88
89
public static getById ( api : UserClient , id : string ) : Promise < ClientServer > ;
89
90
@@ -113,13 +114,14 @@ declare module 'pterodactyl.js' {
113
114
}
114
115
115
116
export class User extends UserModel {
116
- constructor ( api : AdminClient , data : UserOptionsRaw ) ;
117
+ constructor ( api : AdminClient , data : UserOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
117
118
118
119
private api : AdminClient ;
120
+ public pagination ?: Pagination ;
119
121
120
122
public static create ( api : AdminClient , options : NewUserOptions ) : Promise < User > ;
121
123
122
- public static getAll ( api : AdminClient ) : Promise < User [ ] > ;
124
+ public static getAll ( api : AdminClient , page : number ) : Promise < User [ ] > ;
123
125
124
126
public static getById ( api : AdminClient , id : number ) : Promise < User > ;
125
127
@@ -145,13 +147,14 @@ declare module 'pterodactyl.js' {
145
147
}
146
148
147
149
export class Node extends NodeModel {
148
- constructor ( api : AdminClient , data : NodeOptionsRaw ) ;
150
+ constructor ( api : AdminClient , data : NodeOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
149
151
150
152
private api : AdminClient ;
153
+ public pagination ?: Pagination ;
151
154
152
155
public static create ( api : AdminClient , options : NewNodeOptions ) : Promise < Node > ;
153
156
154
- public static getAll ( api : AdminClient ) : Promise < Node [ ] > ;
157
+ public static getAll ( api : AdminClient , page : number ) : Promise < Node [ ] > ;
155
158
156
159
public static getById ( api : AdminClient , id : number ) : Promise < Node > ;
157
160
@@ -193,13 +196,14 @@ declare module 'pterodactyl.js' {
193
196
}
194
197
195
198
export class Location extends LocationModel {
196
- constructor ( api : AdminClient , data : LocationOptionsRaw ) ;
199
+ constructor ( api : AdminClient , data : LocationOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
197
200
198
201
private api : AdminClient ;
202
+ public pagination ?: Pagination ;
199
203
200
204
public static create ( api : AdminClient , options : NewLocationOptions ) : Promise < Location > ;
201
205
202
- public static getAll ( api : AdminClient ) : Promise < Location [ ] > ;
206
+ public static getAll ( api : AdminClient , page : number ) : Promise < Location [ ] > ;
203
207
204
208
public static getById ( api : AdminClient , id : number ) : Promise < Location > ;
205
209
@@ -211,13 +215,14 @@ declare module 'pterodactyl.js' {
211
215
}
212
216
213
217
export class Server extends ServerModel {
214
- constructor ( api : AdminClient , data : ServerOptionsRaw ) ;
218
+ constructor ( api : AdminClient , data : ServerOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
215
219
216
220
private api : AdminClient ;
221
+ public pagination ?: Pagination ;
217
222
218
223
public static create ( api : AdminClient , options : NewServerOptions ) : Promise < Server > ;
219
224
220
- public static getAll ( api : AdminClient ) : Promise < Server [ ] > ;
225
+ public static getAll ( api : AdminClient , page : number ) : Promise < Server [ ] > ;
221
226
222
227
public static getById ( api : AdminClient , id : number ) : Promise < Server > ;
223
228
@@ -277,11 +282,12 @@ declare module 'pterodactyl.js' {
277
282
}
278
283
279
284
export class Nest extends NestModel {
280
- constructor ( api : AdminClient , data : NestOptionsRaw ) ;
285
+ constructor ( api : AdminClient , data : NestOptionsRaw , paginationOptions ?: PaginationOptionsRaw ) ;
281
286
282
287
private api : AdminClient ;
288
+ public pagination ?: Pagination ;
283
289
284
- public static getAll ( api : AdminClient ) : Promise < Nest [ ] > ;
290
+ public static getAll ( api : AdminClient , page : number ) : Promise < Nest [ ] > ;
285
291
286
292
public static getById ( api : AdminClient , id : number ) : Promise < Nest > ;
287
293
@@ -315,11 +321,12 @@ declare module 'pterodactyl.js' {
315
321
}
316
322
317
323
export class NodeAllocation extends NodeAllocationModel {
318
- constructor ( api : AdminClient , data : NodeAllocationOptions ) ;
324
+ constructor ( api : AdminClient , node : number , data : NodeAllocationOptions , paginationOptions ?: PaginationOptionsRaw ) ;
319
325
320
326
private api : AdminClient ;
327
+ public pagination ?: Pagination ;
321
328
322
- public static getAll ( api : AdminClient , node : number ) : Promise < NodeAllocation [ ] > ;
329
+ public static getAll ( api : AdminClient , node : number , page : number ) : Promise < NodeAllocation [ ] > ;
323
330
}
324
331
325
332
export class ClientServerModel implements ClientServerOptions {
@@ -384,6 +391,19 @@ declare module 'pterodactyl.js' {
384
391
public toJSON ( ) : any ;
385
392
}
386
393
394
+ export class Pagination implements PaginationOptions {
395
+ constructor ( data : PaginationOptionsRaw ) ;
396
+
397
+ public total : number ;
398
+ public count : number ;
399
+ public pageSize : number ;
400
+ public currentPage : number ;
401
+ public totalPages : number ;
402
+ public links : any [ ] ;
403
+
404
+ public nextPage ( ) : number ;
405
+ }
406
+
387
407
export class LocationModel implements LocationOptions {
388
408
constructor ( data : LocationOptionsRaw ) ;
389
409
@@ -799,6 +819,26 @@ declare module 'pterodactyl.js' {
799
819
node : number ;
800
820
}
801
821
822
+ interface PaginationOptions {
823
+ total : number ;
824
+ count : number ;
825
+ pageSize : number ;
826
+ currentPage : number ;
827
+ totalPages : number ;
828
+ links : any [ ] ;
829
+ }
830
+
831
+ interface PaginationOptionsRaw {
832
+ pagination : {
833
+ total : number ;
834
+ count : number ;
835
+ per_page : number ;
836
+ current_page : number ;
837
+ total_pages : number ;
838
+ links : any [ ] ;
839
+ } ;
840
+ }
841
+
802
842
interface NewServerOptions {
803
843
externalId ?: string ;
804
844
name : string ;
0 commit comments