export type BulkImportCommunityMemberDto = {wallets: Array, tags: Array}; export type CreateApiCommunityIdMemberBulkArgs = {id: string, body: BulkImportCommunityMemberDto}; export type CreateApiCommunityIdMemberBulkOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Bulk add community members * * POST /community/{id}/member/bulk */ export const createApiCommunityIdMemberBulk = async (args: CreateApiCommunityIdMemberBulkArgs, options?: CreateApiCommunityIdMemberBulkOptions) => { const {baseUrl = "https://api.openpage.fun/v1", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set("X-Api-Key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/community/${encodeURIComponent(String(args.id))}/member/bulk${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 undefined };