mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-29 10:40:35 +02:00
changelog data type
This commit is contained in:
parent
4d237600d5
commit
7bc184b252
|
@ -4,6 +4,7 @@ import log from "../log";
|
||||||
import pkg from "../../package.json";
|
import pkg from "../../package.json";
|
||||||
import ClientManager from "../clientManager";
|
import ClientManager from "../clientManager";
|
||||||
import Config from "../config";
|
import Config from "../config";
|
||||||
|
import {SharedChangelogData} from "../../shared/types/changelog";
|
||||||
|
|
||||||
const TIME_TO_LIVE = 15 * 60 * 1000; // 15 minutes, in milliseconds
|
const TIME_TO_LIVE = 15 * 60 * 1000; // 15 minutes, in milliseconds
|
||||||
|
|
||||||
|
@ -12,23 +13,7 @@ export default {
|
||||||
fetch,
|
fetch,
|
||||||
checkForUpdates,
|
checkForUpdates,
|
||||||
};
|
};
|
||||||
export type ChangelogData = {
|
const versions: SharedChangelogData = {
|
||||||
current: {
|
|
||||||
prerelease: boolean;
|
|
||||||
version: string;
|
|
||||||
changelog?: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
expiresAt: number;
|
|
||||||
latest?: {
|
|
||||||
prerelease: boolean;
|
|
||||||
version: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
packages?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
const versions: ChangelogData = {
|
|
||||||
current: {
|
current: {
|
||||||
prerelease: false,
|
prerelease: false,
|
||||||
version: `v${pkg.version}`,
|
version: `v${pkg.version}`,
|
||||||
|
@ -36,6 +21,8 @@ const versions: ChangelogData = {
|
||||||
url: "", // TODO: properly init
|
url: "", // TODO: properly init
|
||||||
},
|
},
|
||||||
expiresAt: -1,
|
expiresAt: -1,
|
||||||
|
latest: undefined,
|
||||||
|
packages: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
async function fetch() {
|
async function fetch() {
|
||||||
|
|
15
shared/types/changelog.ts
Normal file
15
shared/types/changelog.ts
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
export type SharedChangelogData = {
|
||||||
|
current: {
|
||||||
|
prerelease: boolean;
|
||||||
|
version: string;
|
||||||
|
changelog?: string;
|
||||||
|
url: string;
|
||||||
|
};
|
||||||
|
expiresAt: number;
|
||||||
|
latest?: {
|
||||||
|
prerelease: boolean;
|
||||||
|
version: string;
|
||||||
|
url: string;
|
||||||
|
};
|
||||||
|
packages?: boolean;
|
||||||
|
};
|
4
shared/types/socket-events.d.ts
vendored
4
shared/types/socket-events.d.ts
vendored
|
@ -3,7 +3,7 @@ import {SharedMention} from "../../shared/types/mention";
|
||||||
import {ChanState} from "../../shared/types/chan";
|
import {ChanState} from "../../shared/types/chan";
|
||||||
import {SharedMsg, ClientMessage} from "../../shared/types/msg";
|
import {SharedMsg, ClientMessage} from "../../shared/types/msg";
|
||||||
import {SharedUser} from "../../shared/types/user";
|
import {SharedUser} from "../../shared/types/user";
|
||||||
import {ChangelogData} from "../plugins/changelog";
|
import {SharedChangelogData} from "../../shared/types/changelog";
|
||||||
import {LinkPreview} from "../plugins/irc-events/link";
|
import {LinkPreview} from "../plugins/irc-events/link";
|
||||||
import {ClientConfiguration} from "../server";
|
import {ClientConfiguration} from "../server";
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ interface ServerToClientEvents {
|
||||||
|
|
||||||
"upload:auth": (token: string) => void;
|
"upload:auth": (token: string) => void;
|
||||||
|
|
||||||
changelog: (data: ChangelogData) => void;
|
changelog: (data: SharedChangelogData) => void;
|
||||||
"changelog:newversion": () => void;
|
"changelog:newversion": () => void;
|
||||||
|
|
||||||
"channel:state": (data: {chan: number; state: ChanState}) => void;
|
"channel:state": (data: {chan: number; state: ChanState}) => void;
|
||||||
|
|
Loading…
Reference in a new issue