11import { assertPathLike , assertString } from "@/assertions/literal" ;
22import {
3- type Application ,
3+ Application ,
4+ type BaseApplication ,
45 type Collection ,
56 SimpleApplicationStatus ,
67 type SquareCloudAPI ,
78 SquareCloudAPIError ,
89 User ,
910} from "@/index" ;
10- import type { BaseApplication } from "@/structures/application/base" ;
1111import type { RESTPostAPIApplicationUploadResult } from "@squarecloud/api-types/v2" ;
1212import FormData from "form-data" ;
1313import { readFile } from "fs/promises" ;
@@ -19,15 +19,13 @@ export class ApplicationManager {
1919 * If the ID is provided, it will return an application that you can manage or get information
2020 * If the ID is not provided, it will return a collection of applications
2121 *
22- * @param appId - The application ID, you must own the application
22+ * @param applicationId - The application ID, you must own the application
2323 */
2424 async get ( ) : Promise < Collection < string , BaseApplication > > ;
25- async get ( applicationId : string ) : Promise < Application > ;
25+ async get ( applicationId : string ) : Promise < BaseApplication > ;
2626 async get (
2727 applicationId ?: string ,
28- ) : Promise <
29- Application | BaseApplication | Collection < string , BaseApplication >
30- > {
28+ ) : Promise < BaseApplication | Collection < string , BaseApplication > > {
3129 const { response } = await this . client . api . user ( ) ;
3230 const user = new User ( this . client , response ) ;
3331
@@ -90,6 +88,17 @@ export class ApplicationManager {
9088 ( status ) => new SimpleApplicationStatus ( this . client , status ) ,
9189 ) ;
9290 }
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+ }
93102}
94103
95104export * from "./backup" ;
0 commit comments