web/settings/v4: add api key settings, remove override settings

This commit is contained in:
wukko 2024-11-23 19:08:24 +06:00
parent 5b60065c9f
commit baebeed488
No known key found for this signature in database
GPG key ID: 3E30B3F26C7B4AA2
4 changed files with 21 additions and 10 deletions

View file

@ -2,7 +2,7 @@ import { defaultLocale } from "$lib/i18n/translations";
import type { CobaltSettings } from "$lib/types/settings";
const defaultSettings: CobaltSettings = {
schemaVersion: 3,
schemaVersion: 4,
advanced: {
debug: false,
},
@ -33,10 +33,10 @@ const defaultSettings: CobaltSettings = {
disableAnalytics: false,
},
processing: {
allowDefaultOverride: false,
customInstanceURL: "",
customApiKey: "",
enableCustomInstances: false,
seenOverrideWarning: false,
enableCustomApiKey: false,
seenCustomWarning: false,
}
}

View file

@ -1,13 +1,15 @@
import type { RecursivePartial } from "$lib/types/generic";
import type { CobaltSettingsV2 } from "./settings/v2";
import type { CobaltSettingsV3 } from "./settings/v3";
import type { CobaltSettingsV2 } from "$lib/types/settings/v2";
import type { CobaltSettingsV3 } from "$lib/types/settings/v3";
import type { CobaltSettingsV4 } from "$lib/types/settings/v4";
export * from "./settings/v2";
export * from "./settings/v3";
export * from "$lib/types/settings/v2";
export * from "$lib/types/settings/v3";
export * from "$lib/types/settings/v4";
export type CobaltSettings = CobaltSettingsV3;
export type CobaltSettings = CobaltSettingsV4;
export type AnyCobaltSettings = CobaltSettingsV2 | CobaltSettings;
export type AnyCobaltSettings = CobaltSettingsV3 | CobaltSettingsV2 | CobaltSettings;
export type PartialSettings = RecursivePartial<CobaltSettings>;

View file

@ -1,5 +1,5 @@
import type { YoutubeLang } from "$lib/settings/youtube-lang";
import { type CobaltSettingsV2 } from "./v2";
import { type CobaltSettingsV2 } from "$lib/types/settings/v2";
export type CobaltSettingsV3 = Omit<CobaltSettingsV2, 'schemaVersion' | 'save'> & {
schemaVersion: 3,

View file

@ -0,0 +1,9 @@
import { type CobaltSettingsV3 } from "$lib/types/settings/v3";
export type CobaltSettingsV4 = Omit<CobaltSettingsV3, 'schemaVersion' | 'processing'> & {
schemaVersion: 4,
processing: Omit<CobaltSettingsV3['processing'], 'allowDefaultOverride' | 'seenOverrideWarning'> & {
customApiKey: string;
enableCustomApiKey: boolean;
};
};