// // Copyright (C) 2024 veypi // 2024-10-11 14:36:07 // Distributed under terms of the MIT license. // import webapi from "./webapi" import * as models from "./models" export interface TokenSaltOpts { username: string typ?: string } // keep export function TokenSalt(json: TokenSaltOpts) { return webapi.Get<{ id: string, salt: string }>(`/token/TokenSalt`, { json }) } export interface PostOpts { refresh?: string typ?: string user_id?: string salt?: string code?: string app_id?: string expired_at?: Date over_perm?: string device?: string } // keep export function Post(json: PostOpts) { return webapi.Post(`/token`, { json }) } export function Get(token_id: string) { return webapi.Get(`/token/${token_id}`, {}) } export interface PatchOpts { expired_at?: Date over_perm?: string } export function Patch(token_id: string, json: PatchOpts) { return webapi.Patch(`/token/${token_id}`, { json }) } export function Delete(token_id: string) { return webapi.Delete(`/token/${token_id}`, {}) } export interface ListQuery { user_id: string app_id: string } export function List(query: ListQuery) { return webapi.Get(`/token`, { query }) }