@@ -41,7 +41,9 @@ export class Application {
4141 /** Whether the application is a website or not */
4242 isWebsite : boolean ;
4343
44- constructor ( private apiManager : APIManager , data : RawApplicationData ) {
44+ #apiManager: APIManager ;
45+
46+ constructor ( apiManager : APIManager , data : RawApplicationData ) {
4547 this . id = data . id ;
4648 this . tag = data . tag ;
4749 this . ram = data . ram ;
@@ -50,6 +52,8 @@ export class Application {
5052 this . avatar = data . avatar ;
5153 this . cluster = data . cluster ;
5254 this . isWebsite = data . isWebsite ;
55+
56+ this . #apiManager = apiManager ;
5357 }
5458
5559 /** Gets the application's current information */
@@ -64,7 +68,7 @@ export class Application {
6468 status,
6569 uptime,
6670 time,
67- } = ( await this . apiManager . application ( 'status' , this . id ) ) . response ;
71+ } = ( await this . # apiManager. application ( 'status' , this . id ) ) . response ;
6872
6973 return {
7074 status,
@@ -89,33 +93,33 @@ export class Application {
8993 validateBoolean ( full , '[LOGS_FULL]' ) ;
9094
9195 return (
92- await this . apiManager . application ( `${ full ? 'full-' : '' } logs` , this . id )
96+ await this . # apiManager. application ( `${ full ? 'full-' : '' } logs` , this . id )
9397 ) . response . logs ;
9498 }
9599
96100 /** Generates the backup download URL */
97101 async backup ( ) : Promise < string > {
98- return ( await this . apiManager . application ( 'backup' , this . id ) ) . response
102+ return ( await this . # apiManager. application ( 'backup' , this . id ) ) . response
99103 . downloadURL ;
100104 }
101105
102106 /** Starts up the application */
103107 async start ( ) : Promise < boolean > {
104- const { code } = await this . apiManager . application ( 'start' , this . id , true ) ;
108+ const { code } = await this . # apiManager. application ( 'start' , this . id , true ) ;
105109
106110 return code === 'ACTION_SENT' ;
107111 }
108112
109113 /** Stops the application */
110114 async stop ( ) : Promise < boolean > {
111- const { code } = await this . apiManager . application ( 'stop' , this . id , true ) ;
115+ const { code } = await this . # apiManager. application ( 'stop' , this . id , true ) ;
112116
113117 return code === 'ACTION_SENT' ;
114118 }
115119
116120 /** Restarts the application */
117121 async restart ( ) : Promise < boolean > {
118- const { code } = await this . apiManager . application (
122+ const { code } = await this . # apiManager. application (
119123 'restart' ,
120124 this . id ,
121125 true
@@ -130,7 +134,7 @@ export class Application {
130134 * - This action is irreversible.
131135 */
132136 async delete ( ) : Promise < boolean > {
133- const { code } = await this . apiManager . application ( 'delete' , this . id , true ) ;
137+ const { code } = await this . # apiManager. application ( 'delete' , this . id , true ) ;
134138
135139 return code === 'APP_DELETED' ;
136140 }
@@ -174,7 +178,7 @@ export class Application {
174178 ) ;
175179 }
176180
177- const { code } = await this . apiManager . application ( 'commit' , this . id , {
181+ const { code } = await this . # apiManager. application ( 'commit' , this . id , {
178182 method : 'POST' ,
179183 data : formData ,
180184 headers : { ...formData . getHeaders ( ) } ,
0 commit comments