fetch patrons remotely

This commit is contained in:
ThatOneCalculator 2022-11-18 23:54:50 -08:00
parent 5606cdae55
commit 58badd7ec6
5 changed files with 39 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{
"name": "calckey",
"version": "12.119.0-calc.15.3",
"version": "12.119.0-calc.15.4",
"codename": "aqua",
"repository": {
"type": "git",

View file

@ -275,6 +275,7 @@ import * as ep___pinnedUsers from './endpoints/pinned-users.js';
import * as ep___customMOTD from './endpoints/custom-motd.js';
import * as ep___customSplashIcons from './endpoints/custom-splash-icons.js';
import * as ep___latestVersion from './endpoints/latest-version.js';
import * as ep___patrons from './endpoints/patrons.js';
import * as ep___promo_read from './endpoints/promo/read.js';
import * as ep___requestResetPassword from './endpoints/request-reset-password.js';
import * as ep___resetDb from './endpoints/reset-db.js';
@ -599,6 +600,7 @@ const eps = [
['custom-motd', ep___customMOTD],
['custom-splash-icons', ep___customSplashIcons],
['latest-version', ep___latestVersion],
['patrons', ep___patrons],
['promo/read', ep___promo_read],
['request-reset-password', ep___requestResetPassword],
['reset-db', ep___resetDb],

View file

@ -0,0 +1,28 @@
import define from '../define.js';
export const meta = {
tags: ['meta'],
requireCredential: false,
requireCredentialPrivateMode: false,
} as const;
export const paramDef = {
type: 'object',
properties: {},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async () => {
let patrons;
await fetch('https://codeberg.org/thatonecalculator/calckey/raw/branch/develop/patrons.json')
.then((response) => response.json())
.then((data) => {
patrons = data[0];
});
return {
patrons,
};
});

View file

@ -69,11 +69,7 @@ import { defaultStore } from '@/store';
import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
const patrons = [
'@atomicpoet@vancity.social',
'@shoq@newsroom.social',
'@pikadude@erisly.social',
];
const patrons = await os.api('patrons');
let easterEggReady = false;
let easterEggEmojis = $ref([]);

7
patrons.json Normal file
View file

@ -0,0 +1,7 @@
[{
[
"@atomicpoet@vancity.social"
"@shoq@newsroom.social"
"@pikadude@erisly.social"
]
}]