1
1
import { assertPathLike , assertString } from "@/assertions/literal" ;
2
2
import {
3
- type Application ,
3
+ Application ,
4
+ type BaseApplication ,
4
5
type Collection ,
5
6
SimpleApplicationStatus ,
6
7
type SquareCloudAPI ,
7
8
SquareCloudAPIError ,
8
9
User ,
9
10
} from "@/index" ;
10
- import type { BaseApplication } from "@/structures/application/base" ;
11
11
import type { RESTPostAPIApplicationUploadResult } from "@squarecloud/api-types/v2" ;
12
12
import FormData from "form-data" ;
13
13
import { readFile } from "fs/promises" ;
@@ -19,15 +19,13 @@ export class ApplicationManager {
19
19
* If the ID is provided, it will return an application that you can manage or get information
20
20
* If the ID is not provided, it will return a collection of applications
21
21
*
22
- * @param appId - The application ID, you must own the application
22
+ * @param applicationId - The application ID, you must own the application
23
23
*/
24
24
async get ( ) : Promise < Collection < string , BaseApplication > > ;
25
- async get ( applicationId : string ) : Promise < Application > ;
25
+ async get ( applicationId : string ) : Promise < BaseApplication > ;
26
26
async get (
27
27
applicationId ?: string ,
28
- ) : Promise <
29
- Application | BaseApplication | Collection < string , BaseApplication >
30
- > {
28
+ ) : Promise < BaseApplication | Collection < string , BaseApplication > > {
31
29
const { response } = await this . client . api . user ( ) ;
32
30
const user = new User ( this . client , response ) ;
33
31
@@ -90,6 +88,17 @@ export class ApplicationManager {
90
88
( status ) => new SimpleApplicationStatus ( this . client , status ) ,
91
89
) ;
92
90
}
91
+
92
+ /**
93
+ * Returns an application that you can manage or get information
94
+ *
95
+ * @param applicationId - The application ID, you must own the application
96
+ */
97
+ async fetch ( applicationId : string ) : Promise < Application > {
98
+ const { response } = await this . client . api . application ( "" , applicationId ) ;
99
+
100
+ return new Application ( this . client , response ) ;
101
+ }
93
102
}
94
103
95
104
export * from "./backup" ;
0 commit comments