chore: Bump API (#263)

This commit is contained in:
oSumAtrIX 2024-11-06 01:36:41 +01:00 committed by GitHub
parent 486e9ef62e
commit 68f8c1fd59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 37 additions and 39 deletions

View File

@ -41,6 +41,15 @@ async function patches(): Promise<PatchesData> {
const json = await get_json('v3/patches/list');
const packagesWithCount: { [key: string]: number } = {};
json.forEach((patch) => {
if (!patch.compatiblePackages) return;
patch.compatiblePackages = Object.keys(patch.compatiblePackages).map((name) => ({
name,
versions: patch.compatiblePackages[name]
}));
});
// gets packages and patch count
for (let i = 0; i < json.length; i++) {
json[i].compatiblePackages?.forEach((pkg: CompatiblePackage) => {

View File

@ -7,41 +7,38 @@ export interface Contributor {
export interface Contributable {
name: string;
url: string;
contributors: Contributor[];
}
export interface Patch {
name: string;
description: string;
compatiblePackages: CompatiblePackage[];
use: boolean;
requiresIntegrations: boolean;
compatiblePackages: CompatiblePackage[] | null;
options: PatchOption[];
}
export interface CompatiblePackage {
name: string;
versions: string[];
versions: string[] | null;
}
export interface PatchOption {
key: string;
default: any;
title: string;
title: string | null;
description: string;
required: boolean;
}
export interface Asset {
name: string;
download_url: string;
type: string;
default: any | null;
values: any[] | null;
}
export interface Release {
version: string;
created_at: string;
description: string;
assets: Asset[];
download_url: string;
}
export interface TeamMember {
@ -52,7 +49,7 @@ export interface TeamMember {
gpg_key: GpgKey;
}
expose interface GpgKey {
export interface GpgKey {
id: string;
url: string;
}

View File

@ -52,9 +52,9 @@
</div>
<div class="repos">
<Query {query} let:data>
{#each data.contributables as { contributors, name: repo }}
{#each data.contributables as { name, url, contributors }}
<div in:fly={{ y: 10, easing: quintOut, duration: 750 }}>
<ContributorHost {contributors} {repo} />
<ContributorHost {name} {url} {contributors} />
</div>
{/each}
</Query>

View File

@ -1,16 +1,16 @@
<script lang="ts">
import { friendlyName } from '$util/friendlyName';
import { slide } from 'svelte/transition';
import { quintOut } from 'svelte/easing';
import type { Contributor } from '$lib/types';
import ContributorButton from './ContributorPerson.svelte';
export let contributors: Contributor[];
export let repo: string;
export let name: string;
export let url: string;
let expanded = true;
let bots = ['semantic-release-bot', 'revanced-bot'];
let repo_name = friendlyName(repo);
</script>
<div class="section-container">
@ -20,8 +20,8 @@
on:click={() => (expanded = !expanded)}
on:keypress={() => (expanded = !expanded)}
>
<a href="https://github.com/ReVanced/{repo}" rel="noreferrer" target="_blank" on:click|stopPropagation>
<h4>{repo_name}</h4>
<a href="{url}" rel="noreferrer" target="_blank" on:click|stopPropagation>
<h4>{name}</h4>
</a>
<img
id="arrow"

View File

@ -31,22 +31,22 @@
</a>
<div class="verified-badge">
<ToolTip
content="<p><b>{member.name}</b> is verified with this GPG Key ID:</p> <a class='gpg-url' href={member
.gpg_key.url} rel='noreferrer' target='_blank'>{member.gpg_key.id}</a>"
content="<p>GPG key ID:</p> <a class='gpg-url' href={member.gpg_key
.url} rel='noreferrer' target='_blank'>{member.gpg_key.id}</a>"
html={true}
>
<div class="desktop-verified">
<div class="desktop">
<a href={member.gpg_key.url} rel="noreferrer" target="_blank">
<Svg svgHeight={16} viewBoxHeight={16}>
<path d={verifiedIconPath} />
</Svg>
</a>
</div>
<div class="mobile-verified">
<div class="mobile">
<Svg svgHeight={16} viewBoxHeight={16}>
<path d={verifiedIconPath} />
</Svg>
<h5>Verified</h5>
<h5>GPG key</h5>
</div>
</ToolTip>
</div>
@ -90,18 +90,18 @@
.verified-badge {
display: flex;
align-items: center;
fill: var(--secondary);
fill: var(--secondary) !important;
line-height: 16px;
height: 16px;
.mobile-verified {
.mobile {
display: none;
}
@media screen and (width <= 768px) {
.desktop-verified {
.desktop {
display: none;
}
.mobile-verified {
.mobile {
display: flex;
flex-direction: row;
justify-content: center;

View File

@ -75,7 +75,7 @@
<Query {query} let:data>
<Button
type="text"
href={data.release.assets[0].download_url}
href={data.release.download_url}
on:click={() => (warningDialogue = false)}>Okay</Button
>
</Query>
@ -97,7 +97,7 @@
on:click={handleClick}
type="filled"
icon="download"
href={data.release.assets[0].download_url}
href={data.release.download_url}
>
{data.release.version}
</Button>

View File

@ -35,7 +35,7 @@
<h5>{patch.description}</h5>
{/if}
<ul class="info-container">
{#if !patch.compatiblePackages?.length}
{#if !patch.compatiblePackages}
<li class="patch-info">🌎 Universal patch</li>
{:else}
{#each patch.compatiblePackages as pkg}

View File

@ -1,8 +0,0 @@
export function friendlyName(text: string): string {
return text
.replace(/-/g, ' ')
.replace(/\brevanced\b/g, 'ReVanced')
.replace(/\bcli\b/g, 'CLI')
.replace(/api/g, 'API')
.replace(/(?:^|\s)\S/g, (x: string) => x.toUpperCase());
}