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