#183 package shapes

This commit is contained in:
neil 2023-01-30 20:15:27 +08:00
parent 4273295168
commit 4daea75753
4 changed files with 12 additions and 3 deletions

View file

@ -41,4 +41,4 @@ export type DeviceAuth = {
status: AuthStatus; status: AuthStatus;
user: Developer; user: Developer;
key: string; key: string;
}; };

View file

@ -7,6 +7,7 @@ import urlJoin from 'url-join';
export const baseUrl = 'https://api.tea.xyz/v1'; export const baseUrl = 'https://api.tea.xyz/v1';
export async function get<T>(path: string, query?: { [key: string]: string }) { export async function get<T>(path: string, query?: { [key: string]: string }) {
console.log(`GET /api/${path}`)
const [session, client] = await Promise.all([getSession(), getClient()]); const [session, client] = await Promise.all([getSession(), getClient()]);
const uri = urlJoin(baseUrl, path); const uri = urlJoin(baseUrl, path);

View file

@ -34,7 +34,7 @@
<div> <div>
<p> <p>
<span class="text-xs text-gray" <span class="text-xs text-gray"
>V&NonBreakingSpace;{pkg.version} {pkg?.bottles ? `| ${pkg.bottles} bottles` : ''}</span >V&NonBreakingSpace;{pkg.version} {pkg?.bottles?.length ? `| ${pkg.bottles.length} bottles` : ''}</span
> >
</p> </p>
</div> </div>

View file

@ -19,7 +19,15 @@ export interface Package {
dl_count: number; dl_count: number;
installs: number; installs: number;
reviews?: Review[]; reviews?: Review[];
bottles?: number; // TODO: where to get this? // metas
full_description?: string; // probably markdown
bottles?: Bottle[];
license?: string;
size_bytes?: number;
documentation_url?: string;
github_repository_url?: string;
owners?: Partial<Developer>[];
categories?: string[];
} }
export type AirtablePost = { export type AirtablePost = {