You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
2.9 KiB
TypeScript

//
// Copyright (C) 2024 veypi <i@veypi.com>
2 months ago
// 2024-10-11 14:36:07
// Distributed under terms of the MIT license.
//
import webapi from "./webapi"
import * as models from "./models"
1 month ago
export function Get(app_id: string) {
return webapi.Get<models.App>(`/app/${app_id}`, { })
}
1 month ago
export interface PatchOpts {
2 months ago
name?: string
icon?: string
des?: string
participate?: string
init_role_id?: string
}
2 months ago
export function Patch(app_id: string, json: PatchOpts) {
return webapi.Patch<models.App>(`/app/${app_id}`, { json })
}
2 months ago
export function Delete(app_id: string) {
return webapi.Delete<models.App>(`/app/${app_id}`, { })
2 months ago
}
1 month ago
export interface PostOpts {
2 months ago
name: string
icon: string
des: string
participate: string
}
export function Post(json: PostOpts) {
return webapi.Post<models.App>(`/app`, { json })
}
1 month ago
export interface ListOpts {
2 months ago
name?: string
}
export function List(json: ListOpts) {
1 month ago
return webapi.Get<[models.App]>(`/app`, { json })
}
1 month ago
export interface AppUserGetOpts {
2 months ago
user_id: string
}
2 months ago
export function AppUserGet(app_user_id: string, app_id: string, json: AppUserGetOpts) {
return webapi.Get<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json })
}
1 month ago
export interface AppUserPatchOpts {
2 months ago
status?: string
}
2 months ago
export function AppUserPatch(app_user_id: string, app_id: string, json: AppUserPatchOpts) {
return webapi.Patch<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { json })
}
2 months ago
export function AppUserDelete(app_user_id: string, app_id: string) {
return webapi.Delete<models.AppUser>(`/app/${app_id}/app_user/${app_user_id}`, { })
2 months ago
}
1 month ago
export interface AppUserListOpts {
2 months ago
user_id?: string
status?: string
}
export function AppUserList(app_id: string, json: AppUserListOpts) {
1 month ago
return webapi.Get<[models.AppUser]>(`/app/${app_id}/app_user`, { json })
2 months ago
}
1 month ago
export interface AppUserPostOpts {
2 months ago
status: string
user_id: string
}
2 months ago
export function AppUserPost(app_id: string, json: AppUserPostOpts) {
return webapi.Post<models.AppUser>(`/app/${app_id}/app_user`, { json })
}
1 month ago
export interface ResourceListQuery {
2 months ago
created_at?: Date
updated_at?: Date
}
export function ResourceList(app_id: string, query: ResourceListQuery) {
1 month ago
return webapi.Get<[models.Resource]>(`/app/${app_id}/resource`, { query })
2 months ago
}
1 month ago
export interface ResourcePostOpts {
2 months ago
name: string
des: string
}
export function ResourcePost(app_id: string, json: ResourcePostOpts) {
return webapi.Post<models.Resource>(`/app/${app_id}/resource`, { json })
}
1 month ago
export interface ResourceDeleteOpts {
2 months ago
name: string
}
2 months ago
export function ResourceDelete(app_id: string, json: ResourceDeleteOpts) {
return webapi.Delete<models.Resource>(`/app/${app_id}/resource`, { json })
}
2 months ago
export function ResourceGet(app_id: string) {
return webapi.Get<models.Resource>(`/app/${app_id}/resource`, { })
2 months ago
}
export function ResourcePatch(app_id: string) {
return webapi.Patch<models.Resource>(`/app/${app_id}/resource`, { })
2 months ago
}