forked from didirus/AstralRinth
feat: start of cross platform page system (#4731)
* feat: abstract api-client DI into ui package * feat: cross platform page system * feat: tanstack as cross platform useAsyncData * feat: archon servers routes + labrinth billing routes * fix: dont use partial * feat: migrate server list page to tanstack + api-client + re-enabled broken features! * feat: migrate servers manage page to api-client before page system * feat: migrate manage page to page system * fix: type issues * fix: upgrade wrapper bugs * refactor: move state types into api-client * feat: disable financial stuff on app frontend * feat: finalize cross platform page system for now * fix: lint * fix: build issues * feat: remove papaparse * fix: lint * fix: interface error --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { AbstractModule } from '../../../core/abstract-module'
|
||||
import type { ProjectSearchParams, ProjectV2, SearchResult } from './types/v2'
|
||||
import type { Labrinth } from '../types'
|
||||
|
||||
export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
public getModuleID(): string {
|
||||
@@ -18,8 +18,8 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
* console.log(project.title) // "Sodium"
|
||||
* ```
|
||||
*/
|
||||
public async get(id: string): Promise<ProjectV2> {
|
||||
return this.client.request<ProjectV2>(`/project/${id}`, {
|
||||
public async get(id: string): Promise<Labrinth.Projects.v2.Project> {
|
||||
return this.client.request<Labrinth.Projects.v2.Project>(`/project/${id}`, {
|
||||
api: 'labrinth',
|
||||
version: 2,
|
||||
method: 'GET',
|
||||
@@ -37,8 +37,8 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
* const projects = await client.labrinth.projects_v2.getMultiple(['sodium', 'lithium', 'phosphor'])
|
||||
* ```
|
||||
*/
|
||||
public async getMultiple(ids: string[]): Promise<ProjectV2[]> {
|
||||
return this.client.request<ProjectV2[]>(`/projects`, {
|
||||
public async getMultiple(ids: string[]): Promise<Labrinth.Projects.v2.Project[]> {
|
||||
return this.client.request<Labrinth.Projects.v2.Project[]>(`/projects`, {
|
||||
api: 'labrinth',
|
||||
version: 2,
|
||||
method: 'GET',
|
||||
@@ -61,8 +61,10 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
public async search(params: ProjectSearchParams): Promise<SearchResult> {
|
||||
return this.client.request<SearchResult>(`/search`, {
|
||||
public async search(
|
||||
params: Labrinth.Projects.v2.ProjectSearchParams,
|
||||
): Promise<Labrinth.Projects.v2.SearchResult> {
|
||||
return this.client.request<Labrinth.Projects.v2.SearchResult>(`/search`, {
|
||||
api: 'labrinth',
|
||||
version: 2,
|
||||
method: 'GET',
|
||||
@@ -83,7 +85,7 @@ export class LabrinthProjectsV2Module extends AbstractModule {
|
||||
* })
|
||||
* ```
|
||||
*/
|
||||
public async edit(id: string, data: Partial<ProjectV2>): Promise<void> {
|
||||
public async edit(id: string, data: Partial<Labrinth.Projects.v2.Project>): Promise<void> {
|
||||
return this.client.request(`/project/${id}`, {
|
||||
api: 'labrinth',
|
||||
version: 2,
|
||||
|
||||
Reference in New Issue
Block a user