mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
chore: generate types
This commit is contained in:
@@ -1965,6 +1965,10 @@ export type GetScheduleNotificationsResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -1990,10 +1994,6 @@ export type GetScheduleNotificationsResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2053,6 +2053,10 @@ export type UpdateScheduleNotificationsResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2078,10 +2082,6 @@ export type UpdateScheduleNotificationsResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2130,6 +2130,10 @@ export type ListNotificationDestinationsResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2155,10 +2159,6 @@ export type ListNotificationDestinationsResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2191,6 +2191,10 @@ export type CreateNotificationDestinationData = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2216,10 +2220,6 @@ export type CreateNotificationDestinationData = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2251,6 +2251,10 @@ export type CreateNotificationDestinationResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2276,10 +2280,6 @@ export type CreateNotificationDestinationResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2358,6 +2358,10 @@ export type GetNotificationDestinationResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2383,10 +2387,6 @@ export type GetNotificationDestinationResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2419,6 +2419,10 @@ export type UpdateNotificationDestinationData = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2444,10 +2448,6 @@ export type UpdateNotificationDestinationData = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
@@ -2489,6 +2489,10 @@ export type UpdateNotificationDestinationResponses = {
|
|||||||
type: 'pushover';
|
type: 'pushover';
|
||||||
userKey: string;
|
userKey: string;
|
||||||
devices?: string;
|
devices?: string;
|
||||||
|
} | {
|
||||||
|
botToken: string;
|
||||||
|
chatId: string;
|
||||||
|
type: 'telegram';
|
||||||
} | {
|
} | {
|
||||||
from: string;
|
from: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -2514,10 +2518,6 @@ export type UpdateNotificationDestinationResponses = {
|
|||||||
} | {
|
} | {
|
||||||
shoutrrrUrl: string;
|
shoutrrrUrl: string;
|
||||||
type: 'custom';
|
type: 'custom';
|
||||||
} | {
|
|
||||||
type: 'telegram';
|
|
||||||
botToken: string;
|
|
||||||
chatId: string;
|
|
||||||
} | {
|
} | {
|
||||||
type: 'discord';
|
type: 'discord';
|
||||||
webhookUrl: string;
|
webhookUrl: string;
|
||||||
|
|||||||
@@ -645,9 +645,7 @@ export const CreateNotificationForm = ({ onSubmit, mode = "create", initialValue
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} placeholder="-1231234567890" />
|
<Input {...field} placeholder="-1231234567890" />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
<FormDescription>Telegram chat ID to send notifications to.</FormDescription>
|
||||||
Telegram chat ID to send notifications to.
|
|
||||||
</FormDescription>
|
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -171,13 +171,7 @@ export default function NotificationDetailsPage({ loaderData }: Route.ComponentP
|
|||||||
</AlertDescription>
|
</AlertDescription>
|
||||||
</Alert>
|
</Alert>
|
||||||
)}
|
)}
|
||||||
<CreateNotificationForm
|
<CreateNotificationForm mode="update" formId={formId} onSubmit={handleSubmit} initialValues={data.config} />
|
||||||
mode="update"
|
|
||||||
formId={formId}
|
|
||||||
onSubmit={handleSubmit}
|
|
||||||
initialValues={data.config}
|
|
||||||
loading={updateDestination.isPending}
|
|
||||||
/>
|
|
||||||
<div className="flex justify-end gap-2 pt-4 border-t">
|
<div className="flex justify-end gap-2 pt-4 border-t">
|
||||||
<Button type="submit" form={formId} loading={updateDestination.isPending}>
|
<Button type="submit" form={formId} loading={updateDestination.isPending}>
|
||||||
Save Changes
|
Save Changes
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
import type { NotificationConfig } from "~/schemas/notifications";
|
import type { NotificationConfig } from "~/schemas/notifications";
|
||||||
|
|
||||||
export function buildTelegramShoutrrrUrl(config: Extract<NotificationConfig, { type: "telegram" }>): string {
|
export function buildTelegramShoutrrrUrl(config: Extract<NotificationConfig, { type: "telegram" }>): string {
|
||||||
// Shoutrrr format: telegram://bottoken@telegram?channels=chatid1,chatid2
|
return `telegram://${config.botToken}@telegram?channels=${config.chatId}`;
|
||||||
// config: { type: 'telegram', botToken: string, chatId: string }
|
|
||||||
// Do NOT encode botToken or chatId; Shoutrrr expects raw values (colon, dash, etc.)
|
|
||||||
return `telegram://${config.botToken}@telegram?channels=${config.chatId}`;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user