mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-28 18:33:37 +00:00
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:
@@ -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(),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user