2020-12-16 22:02:43 +00:00
|
|
|
import { DefaultClient, PBResponse, QueryArguments } from "./Client";
|
2020-12-24 08:56:05 +00:00
|
|
|
import { Provider } from "./Providers";
|
2020-11-26 21:37:41 +00:00
|
|
|
|
2020-11-26 14:55:01 +00:00
|
|
|
export class Application {
|
2020-12-01 12:59:59 +00:00
|
|
|
pk: string;
|
|
|
|
name: string;
|
|
|
|
slug: string;
|
2020-12-27 18:40:50 +00:00
|
|
|
provider?: Provider;
|
2020-11-26 14:55:01 +00:00
|
|
|
|
2020-12-01 12:59:59 +00:00
|
|
|
launch_url: string;
|
|
|
|
meta_launch_url: string;
|
|
|
|
meta_icon: string;
|
|
|
|
meta_description: string;
|
|
|
|
meta_publisher: string;
|
|
|
|
policies: string[];
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
throw Error();
|
|
|
|
}
|
2020-11-26 14:55:01 +00:00
|
|
|
|
|
|
|
static get(slug: string): Promise<Application> {
|
2020-11-29 11:01:06 +00:00
|
|
|
return DefaultClient.fetch<Application>(["core", "applications", slug]);
|
2020-11-26 14:55:01 +00:00
|
|
|
}
|
2020-11-30 11:33:09 +00:00
|
|
|
|
2020-12-01 16:27:19 +00:00
|
|
|
static list(filter?: QueryArguments): Promise<PBResponse<Application>> {
|
2020-11-30 11:33:09 +00:00
|
|
|
return DefaultClient.fetch<PBResponse<Application>>(["core", "applications"], filter);
|
|
|
|
}
|
2020-12-24 08:56:05 +00:00
|
|
|
|
|
|
|
static adminUrl(rest: string): string {
|
|
|
|
return `/administration/applications/${rest}`;
|
|
|
|
}
|
2020-11-26 14:55:01 +00:00
|
|
|
}
|