import {z} from 'zod' export type PatchApiPublicCommunitiesSubdomainQuestsQuestIdArgs = {subdomain: string, questId: string, 'x-api-key': string, body: {categoryId?: string | undefined, name?: string | undefined, published?: boolean | undefined, recurrence?: ('daily' | 'weekly' | 'monthly' | 'once') | undefined, conditionOperator?: ('AND' | 'OR') | undefined, retryAfter?: (number | number | number | number | number | number | number | number | null) | undefined, description?: ({type: string, text?: string | undefined, attrs?: {[key: string]: unknown} | undefined, marks?: (Array<{type: string, attrs?: ({href?: string | undefined, target?: ('_blank' | '_parent' | '_self' | '_top') | undefined, class?: (string | null) | undefined} | {[key: string]: unknown}) | undefined} | {[key: string]: unknown}>) | undefined, content: unknown} | {[key: string]: unknown} | null) | undefined, conditions?: (Array<{type: 'quest', operator: 'isCompleted' | 'isNotCompleted', value: string} | {type: 'level', operator: '>' | '<'} | {type: 'role', operator: '=' | '!=', value: string} | {type: 'date', operator: '>' | '<', value: string} | {type: 'nft', chain: 'polygon', contractAddress: string} | {type: 'twitterFollowers', operator: '>' | '<'}>) | undefined, position?: number | undefined, claimLimit?: number | undefined, sprintId?: string | undefined, rewards?: (Array<{type: 'xp', value: number | number, method?: ({id?: string | undefined, type: 'fcfs', max?: number | undefined, count?: number | undefined} | {type: 'all', id?: string | undefined} | {id?: string | undefined, type: 'raffle', amount?: number | undefined} | {id?: string | undefined, type: 'top', topN?: number | undefined, rankBy?: ('tweetViews' | 'tweetInteractions') | undefined} | {type: 'vote', id?: string | undefined}) | undefined} | {type: 'other', value: string, method?: ({id?: string | undefined, type: 'fcfs', max?: number | undefined, count?: number | undefined} | {type: 'all', id?: string | undefined} | {id?: string | undefined, type: 'raffle', amount?: number | undefined} | {id?: string | undefined, type: 'top', topN?: number | undefined, rankBy?: ('tweetViews' | 'tweetInteractions') | undefined} | {type: 'vote', id?: string | undefined}) | undefined} | {type: 'role', value: string, method?: ({id?: string | undefined, type: 'fcfs', max?: number | undefined, count?: number | undefined} | {type: 'all', id?: string | undefined} | {id?: string | undefined, type: 'raffle', amount?: number | undefined} | {id?: string | undefined, type: 'top', topN?: number | undefined, rankBy?: ('tweetViews' | 'tweetInteractions') | undefined} | {type: 'vote', id?: string | undefined}) | undefined} | {type: 'token', value: string, settings: {network: 'arb-mainnet', contract: string | '0'} | {network: 'base-mainnet', contract: string | '0'} | {network: 'eth-mainnet', contract: string | '0'} | {network: 'opt-mainnet', contract: string | '0'} | {network: 'polygon-mainnet', contract: string | '0'} | {network: 'sol-mainnet', contract: string | '0'} | {network: 'bnb-mainnet', contract: string | '0'} | {network: 'linea-mainnet', contract: string | '0'} | {network: 'avalanche-mainnet', contract: string | '0'} | {network: 'fantom-mainnet', contract: string | '0'} | {network: 'cronos-mainnet', contract: string | '0'} | {network: 'palm-mainnet', contract: string | '0'} | {network: 'gnosis-mainnet', contract: string | '0'} | {network: 'chiliz-mainnet', contract: string | '0'} | {network: 'moonbeam-mainnet', contract: string | '0'} | {network: 'zksync-mainnet', contract: string | '0'} | {network: 'polygonzkevm-mainnet', contract: string | '0'} | {network: 'ton-mainnet', contract: string}, method?: ({id?: string | undefined, type: 'fcfs', max?: number | undefined, count?: number | undefined} | {type: 'all', id?: string | undefined} | {id?: string | undefined, type: 'raffle', amount?: number | undefined} | {id?: string | undefined, type: 'top', topN?: number | undefined, rankBy?: ('tweetViews' | 'tweetInteractions') | undefined} | {type: 'vote', id?: string | undefined}) | undefined}>) | undefined, tasks?: (Array<{type: 'partnership', settings: {subdomain: string}, id?: string | undefined} | {type: 'onChain', settings: {title?: string | undefined, description?: string | undefined, endpoint: string, network: 'eth-mainnet' | 'opt-mainnet' | 'arb-mainnet' | 'polygon-mainnet' | 'base-mainnet' | 'sol-mainnet' | 'bnb-mainnet' | 'linea-mainnet' | 'avalanche-mainnet' | 'fantom-mainnet' | 'cronos-mainnet' | 'palm-mainnet' | 'gnosis-mainnet' | 'chiliz-mainnet' | 'moonbeam-mainnet' | 'polygonzkevm-mainnet' | 'zksync-mainnet' | 'ton-mainnet'}, id?: string | undefined} | {type: 'nft', settings: {network: 'arb-mainnet', contract: string, minBalance: number | null} | {network: 'base-mainnet', contract: string, minBalance: number | null} | {network: 'eth-mainnet', contract: string, minBalance: number | null} | {network: 'opt-mainnet', contract: string, minBalance: number | null} | {network: 'polygon-mainnet', contract: string, minBalance: number | null} | {network: 'sol-mainnet', contract: string, minBalance: number | null} | {network: 'bnb-mainnet', contract: string, minBalance: number | null} | {network: 'linea-mainnet', contract: string | '0', minBalance: number | null} | {network: 'avalanche-mainnet', contract: string | '0', minBalance: number | null} | {network: 'fantom-mainnet', contract: string | '0', minBalance: number | null} | {network: 'cronos-mainnet', contract: string | '0', minBalance: number | null} | {network: 'palm-mainnet', contract: string | '0', minBalance: number | null} | {network: 'gnosis-mainnet', contract: string | '0', minBalance: number | null} | {network: 'chiliz-mainnet', contract: string | '0', minBalance: number | null} | {network: 'moonbeam-mainnet', contract: string | '0', minBalance: number | null} | {network: 'zksync-mainnet', contract: string | '0', minBalance: number | null} | {network: 'polygonzkevm-mainnet', contract: string | '0', minBalance: number | null} | {network: 'ton-mainnet', contract: string, minBalance: number | null}, id?: string | undefined} | {type: 'token', settings: {network: 'arb-mainnet', contract: string | '0', minBalance: number | null} | {network: 'base-mainnet', contract: string | '0', minBalance: number | null} | {network: 'eth-mainnet', contract: string | '0', minBalance: number | null} | {network: 'opt-mainnet', contract: string | '0', minBalance: number | null} | {network: 'polygon-mainnet', contract: string | '0', minBalance: number | null} | {network: 'sol-mainnet', contract: string | '0', minBalance: number | null} | {network: 'bnb-mainnet', contract: string | '0', minBalance: number | null} | {network: 'linea-mainnet', contract: string | '0', minBalance: number | null} | {network: 'avalanche-mainnet', contract: string | '0', minBalance: number | null} | {network: 'fantom-mainnet', contract: string | '0', minBalance: number | null} | {network: 'cronos-mainnet', contract: string | '0', minBalance: number | null} | {network: 'palm-mainnet', contract: string | '0', minBalance: number | null} | {network: 'gnosis-mainnet', contract: string | '0', minBalance: number | null} | {network: 'chiliz-mainnet', contract: string | '0', minBalance: number | null} | {network: 'moonbeam-mainnet', contract: string | '0', minBalance: number | null} | {network: 'zksync-mainnet', contract: string | '0', minBalance: number | null} | {network: 'polygonzkevm-mainnet', contract: string | '0', minBalance: number | null} | {network: 'ton-mainnet', contract: string, minBalance: number | null}, id?: string | undefined} | {type: 'api', settings: {title?: string | undefined, description?: string | undefined, endpoint: string, apiKey?: string | undefined, identifications: Array<'email' | 'twitter' | 'discord' | 'wallet' | 'zealy-connect'>, network?: ('eth-mainnet' | 'opt-mainnet' | 'arb-mainnet' | 'polygon-mainnet' | 'base-mainnet' | 'sol-mainnet' | 'bnb-mainnet' | 'linea-mainnet' | 'avalanche-mainnet' | 'fantom-mainnet' | 'cronos-mainnet' | 'palm-mainnet' | 'gnosis-mainnet' | 'chiliz-mainnet' | 'moonbeam-mainnet' | 'polygonzkevm-mainnet' | 'zksync-mainnet' | 'ton-mainnet') | undefined, redirectUrl?: string | undefined}, id?: string | undefined} | {type: 'text', settings: {title?: string | undefined, description?: string | undefined, autoValidated: false} | {title?: string | undefined, description?: string | undefined, autoValidated: true, correctAnswer?: string | undefined}, id?: string | undefined} | {type: 'discord', settings: {inviteUrl: string}, id?: string | undefined} | {type: 'url', settings: {title?: string | undefined, description?: string | undefined, autoValidated: false} | {title?: string | undefined, description?: string | undefined, autoValidated: true, correctAnswer: '' | string}, id?: string | undefined} | {type: 'telegram', settings: {inviteUrl: string | string}, id?: string | undefined} | {type: 'invites', settings: {mandatoryQuests?: Array | undefined}, id?: string | undefined} | {type: 'quiz', settings: {title?: string | undefined, description?: string | undefined, multipleSelection?: boolean | undefined, shuffleOptionsOrder?: boolean | undefined, verticalAlignement?: boolean | undefined, withImage?: false | undefined, options: Array<{label: string, correctAnswer?: boolean | undefined}>}, id?: string | undefined} | {type: 'visitLink', settings: {linkUrl: string}, id?: string | undefined} | {type: 'file', settings: {restrictFileType: false, autoValidated?: boolean | undefined} | {restrictFileType: true, fileTypes: Array<'document' | 'presentation' | 'spreadsheet' | 'drawing' | 'pdf' | 'image' | 'video' | 'audio' | 'archive'>, autoValidated?: boolean | undefined}, id?: string | undefined} | {type: 'date', settings: {title?: string | undefined, description?: string | undefined, autoValidated: false} | {title?: string | undefined, description?: string | undefined, autoValidated: true, correctAnswer?: string | undefined}, id?: string | undefined} | {type: 'number', settings: {title?: string | undefined, description?: string | undefined, autoValidated: false} | {title?: string | undefined, description?: string | undefined, autoValidated: true, correctAnswer?: (number | unknown) | undefined}, id?: string | undefined} | {type: 'poll', settings: {title?: string | undefined, description?: string | undefined, multipleSelection?: boolean | undefined, shuffleOptionsOrder?: boolean | undefined, verticalAlignement?: boolean | undefined, autoValidated?: boolean | undefined, otherOption?: boolean | undefined, withImage?: false | undefined, options: Array<{label: string}>}, id?: string | undefined} | {type: 'opinion', settings: {title?: string | undefined, description?: string | undefined, scaleType: 'numerical', step: {start: number, end: number}, label?: ({start?: string | undefined, end?: string | undefined, middle?: string | undefined}) | undefined} | {title?: string | undefined, description?: string | undefined, scaleType: 'stars'}, id?: string | undefined} | {type: 'twitterFollow', settings: {username: string}, id?: string | undefined} | {type: 'twitterSpace', settings: {spaceUrl: string, password?: string | undefined}, id?: string | undefined} | {type: 'tweetReact', settings: {actions: Array<'like' | 'retweet' | 'reply'>, tweetUrl: string}, id?: string | undefined} | {type: 'tweet', settings: {defaultTweet?: string | undefined, tweetWords: Array}, id?: string | undefined} | {type: 'tiktok', settings: {descriptionWords: Array, minViewCount: number | null}, id?: string | undefined}>) | undefined, archived?: boolean | undefined, isAutomaticWhenEmpty?: boolean | undefined}}; export type PatchApiPublicCommunitiesSubdomainQuestsQuestIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; export const patchApiPublicCommunitiesSubdomainQuestsQuestIdResponse = z.object({id: z.string(), name: z.string(), recurrence: z.enum(["daily", "weekly", "monthly", "once"]), description: z.object({}).nullable(), retryAfter: z.number().nullable(), archived: z.boolean(), published: z.boolean(), communityId: z.string(), categoryId: z.string(), conditionOperator: z.enum(["AND", "OR"]), conditions: z.array(z.discriminatedUnion("type", [z.object({type: z.literal("quest"), operator: z.enum(["isCompleted", "isNotCompleted"]), value: z.string()}), z.object({type: z.literal("level"), operator: z.enum([">", "<"])}), z.object({type: z.literal("role"), operator: z.enum(["=", "!="]), value: z.string().min(1)}), z.object({type: z.literal("date"), operator: z.enum([">", "<"]), value: z.string()}), z.object({type: z.literal("nft"), chain: z.literal("polygon"), contractAddress: z.string()}), z.object({type: z.literal("twitterFollowers"), operator: z.enum([">", "<"])})])), rewards: z.array(z.discriminatedUnion("type", [z.object({type: z.literal("xp"), value: z.union([z.number().int().gte(0).lte(999999999999999), z.number().int().gte(-999999999999999).lte(0)])}), z.object({type: z.literal("other"), value: z.string().min(1)}), z.object({type: z.literal("role"), value: z.string().min(1), roleName: z.string().min(1).optional()}), z.object({type: z.literal("token"), value: z.string(), settings: z.discriminatedUnion("network", [z.object({network: z.literal("arb-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("base-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("eth-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("opt-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("polygon-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("sol-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("bnb-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("linea-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("avalanche-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("fantom-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("cronos-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("palm-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("gnosis-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("chiliz-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("moonbeam-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("zksync-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("polygonzkevm-mainnet"), contract: z.union([z.string(), z.literal("0")])}), z.object({network: z.literal("ton-mainnet"), contract: z.string()})]), metadata: z.object({name: z.string().nullable(), symbol: z.string().nullable(), decimals: z.number().nullable(), logo: z.string().nullable()}).optional()}), z.object({type: z.literal("nft"), value: z.string().optional()})])), tasks: z.array(z.union([z.object({id: z.string(), type: z.literal("partnership"), settings: z.object({subdomain: z.string().min(1)})}), z.object({id: z.string(), type: z.literal("onChain"), settings: z.object({title: z.string().optional(), description: z.string().optional(), endpoint: z.string(), network: z.enum(["eth-mainnet", "opt-mainnet", "arb-mainnet", "polygon-mainnet", "base-mainnet", "sol-mainnet", "bnb-mainnet", "linea-mainnet", "avalanche-mainnet", "fantom-mainnet", "cronos-mainnet", "palm-mainnet", "gnosis-mainnet", "chiliz-mainnet", "moonbeam-mainnet", "polygonzkevm-mainnet", "zksync-mainnet", "ton-mainnet"])})}), z.object({id: z.string(), type: z.literal("api"), settings: z.object({title: z.string().optional(), description: z.string().optional(), endpoint: z.string(), apiKey: z.string().optional(), identifications: z.array(z.enum(["email", "twitter", "discord", "wallet", "zealy-connect"])), network: z.enum(["eth-mainnet", "opt-mainnet", "arb-mainnet", "polygon-mainnet", "base-mainnet", "sol-mainnet", "bnb-mainnet", "linea-mainnet", "avalanche-mainnet", "fantom-mainnet", "cronos-mainnet", "palm-mainnet", "gnosis-mainnet", "chiliz-mainnet", "moonbeam-mainnet", "polygonzkevm-mainnet", "zksync-mainnet", "ton-mainnet"]).optional(), redirectUrl: z.string().optional()})}), z.object({id: z.string(), type: z.literal("text"), settings: z.union([z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(false)}), z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(true), correctAnswer: z.string().optional()})])}), z.object({id: z.string(), type: z.literal("url"), settings: z.union([z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(false)}), z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(true), correctAnswer: z.union([z.literal(""), z.string()])})])}), z.object({id: z.string(), type: z.literal("invites"), settings: z.object({mandatoryQuests: z.array(z.string()).optional()})}), z.object({id: z.string(), type: z.literal("quiz"), settings: z.object({title: z.string().optional(), description: z.string().optional(), multipleSelection: z.boolean().optional(), shuffleOptionsOrder: z.boolean().optional(), verticalAlignement: z.boolean().optional(), withImage: z.literal(false).optional(), options: z.array(z.object({label: z.string(), correctAnswer: z.boolean().optional()}))})}), z.object({id: z.string(), type: z.literal("visitLink"), settings: z.object({linkUrl: z.string()})}), z.object({id: z.string(), type: z.literal("file"), settings: z.union([z.object({restrictFileType: z.literal(false), autoValidated: z.boolean().optional()}), z.object({restrictFileType: z.literal(true), fileTypes: z.array(z.enum(["document", "presentation", "spreadsheet", "drawing", "pdf", "image", "video", "audio", "archive"])), autoValidated: z.boolean().optional()})])}), z.object({id: z.string(), type: z.literal("date"), settings: z.union([z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(false)}), z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(true), correctAnswer: z.string().optional()})])}), z.object({id: z.string(), type: z.literal("number"), settings: z.union([z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(false)}), z.object({title: z.string().optional(), description: z.string().optional(), autoValidated: z.literal(true), correctAnswer: z.union([z.number(), z.unknown()]).optional()})])}), z.object({id: z.string(), type: z.literal("poll"), settings: z.object({title: z.string().optional(), description: z.string().optional(), multipleSelection: z.boolean().optional(), shuffleOptionsOrder: z.boolean().optional(), verticalAlignement: z.boolean().optional(), autoValidated: z.boolean().optional(), otherOption: z.boolean().optional(), withImage: z.literal(false).optional(), options: z.array(z.object({label: z.string()}))})}), z.object({id: z.string(), type: z.literal("opinion"), settings: z.union([z.object({title: z.string().optional(), description: z.string().optional(), scaleType: z.literal("numerical"), step: z.object({start: z.number().int().gte(-10), end: z.number().int().lte(100)}), label: z.object({start: z.string().optional(), end: z.string().optional(), middle: z.string().optional()}).optional()}), z.object({title: z.string().optional(), description: z.string().optional(), scaleType: z.literal("stars")})])}), z.object({id: z.string(), type: z.literal("tweet"), settings: z.object({defaultTweet: z.string().optional(), tweetWords: z.array(z.string())})}), z.object({id: z.string(), type: z.literal("tiktok"), settings: z.object({descriptionWords: z.array(z.string()), minViewCount: z.number().int().gte(0).nullable()})}), z.object({id: z.string(), type: z.literal("token"), settings: z.union([z.object({network: z.literal("arb-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("base-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("eth-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("opt-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("polygon-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("sol-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("bnb-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("linea-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("avalanche-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("fantom-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("cronos-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("palm-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("gnosis-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("chiliz-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("moonbeam-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("zksync-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("polygonzkevm-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("ton-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()})]), metadata: z.object({name: z.string().nullable(), symbol: z.string().nullable(), decimals: z.number().nullable(), logo: z.string().nullable()}).optional()}), z.object({id: z.string(), type: z.literal("nft"), settings: z.union([z.object({network: z.literal("arb-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("base-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("eth-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("opt-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("polygon-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("sol-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("bnb-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("linea-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("avalanche-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("fantom-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("cronos-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("palm-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("gnosis-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("chiliz-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("moonbeam-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("zksync-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("polygonzkevm-mainnet"), contract: z.union([z.string(), z.literal("0")]), minBalance: z.number().gte(0).nullable()}), z.object({network: z.literal("ton-mainnet"), contract: z.string(), minBalance: z.number().gte(0).nullable()})]), metadata: z.object({name: z.string().optional(), image: z.string().optional(), description: z.string().optional(), link: z.string().optional()}).optional()}), z.object({id: z.string(), type: z.literal("twitterSpace"), settings: z.object({spaceUrl: z.string(), password: z.string().optional()}), metadata: z.union([z.object({spaceId: z.string(), title: z.string().optional(), creator: z.object({name: z.string(), imageUrl: z.string().optional(), username: z.string()}), status: z.literal("scheduled"), scheduledAt: z.string()}), z.object({spaceId: z.string(), title: z.string().optional(), creator: z.object({name: z.string(), imageUrl: z.string().optional(), username: z.string()}), status: z.literal("ended"), endedAt: z.string()}), z.object({spaceId: z.string(), title: z.string().optional(), creator: z.object({name: z.string(), imageUrl: z.string().optional(), username: z.string()}), status: z.literal("live")})]).optional()}), z.object({id: z.string(), type: z.literal("tweetReact"), settings: z.object({actions: z.array(z.enum(["like", "retweet", "reply"])), tweetUrl: z.string()}), metadata: z.object({tweetId: z.string(), content: z.string(), createdAt: z.string().optional(), creator: z.object({id: z.string(), username: z.string(), name: z.string(), imageUrl: z.string().optional()}).optional()}).optional()}), z.object({id: z.string(), type: z.literal("telegram"), settings: z.object({inviteUrl: z.union([z.string(), z.string()])}), metadata: z.object({name: z.string().optional(), description: z.string().optional(), imageUrl: z.string().optional()}).optional()}), z.object({id: z.string(), type: z.literal("discord"), settings: z.object({inviteUrl: z.string()}), metadata: z.object({guildId: z.string(), name: z.string(), description: z.string().optional(), imageUrl: z.string().optional()}).optional()}), z.object({id: z.string(), type: z.literal("twitterFollow"), settings: z.object({username: z.string()}), metadata: z.object({id: z.string(), name: z.string(), imageUrl: z.string().optional()}).optional()})])), claimLimit: z.number().gte(0).lte(2147483647), isAutomaticWhenEmpty: z.boolean().optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Update quest in a community * * PATCH /public/communities/{subdomain}/quests/{questId} */ export const patchApiPublicCommunitiesSubdomainQuestsQuestId = async (args: PatchApiPublicCommunitiesSubdomainQuestsQuestIdArgs, options?: PatchApiPublicCommunitiesSubdomainQuestsQuestIdOptions) => { const {baseUrl = "https://api-v2.zealy.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/public/communities/${encodeURIComponent(String(args.subdomain))}/quests/${encodeURIComponent(String(args.questId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(patchApiPublicCommunitiesSubdomainQuestsQuestIdResponse, await res.json()) };