fix: nextcloud-talk + mattermost type errors

- nextcloud-talk setup-core: cast input to NextcloudSetupInput before accessing .secret/.secretFile/.baseUrl
- mattermost monitor-websocket: add intermediate 'as unknown' for ZodRecord→ZodType<MattermostPost> cast
This commit is contained in:
Peter Steinberger
2026-03-27 04:23:15 +00:00
parent 2b55708f40
commit d8a1808bd6
2 changed files with 4 additions and 3 deletions

View File

@@ -36,7 +36,7 @@ export type MattermostWebSocketLike = {
export type MattermostWebSocketFactory = (url: string) => MattermostWebSocketLike;
const MattermostPostSchema = z.record(z.string(), z.unknown()) as z.ZodType<MattermostPost>;
const MattermostPostSchema = z.record(z.string(), z.unknown()) as unknown as z.ZodType<MattermostPost>;
const MattermostEventPayloadSchema = z.object({
event: z.string().optional(),

View File

@@ -186,10 +186,11 @@ export const nextcloudTalkSetupAdapter: ChannelSetupAdapter = {
defaultAccountOnlyEnvError:
"NEXTCLOUD_TALK_BOT_SECRET can only be used for the default account.",
validate: ({ accountId, input }) => {
if (!input.useEnv && !input.secret && !input.secretFile) {
const ncInput = input as NextcloudSetupInput;
if (!ncInput.useEnv && !ncInput.secret && !ncInput.secretFile) {
return "Nextcloud Talk requires bot secret or --secret-file (or --use-env).";
}
if (!input.baseUrl) {
if (!ncInput.baseUrl) {
return "Nextcloud Talk requires --base-url.";
}
return null;