export type AdminSettingsId = {id: string, entityType: 'ADMIN_SETTINGS'}; export type TenantId = {id: string, entityType: 'TENANT'}; export type JsonNode = unknown; export type AdminSettings = {id?: AdminSettingsId | undefined, createdTime?: number | undefined, tenantId?: TenantId | undefined, key?: string | undefined, jsonValue?: JsonNode | undefined}; export type CreateApiApiAdminSettingsTestMailArgs = {body: AdminSettings}; export type CreateApiApiAdminSettingsTestMailOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send test email (sendTestMail) * * POST /api/admin/settings/testMail */ export const createApiApiAdminSettingsTestMail = async (args: CreateApiApiAdminSettingsTestMailArgs, options?: CreateApiApiAdminSettingsTestMailOptions) => { const {baseUrl = "https://demo.thingsboard.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/admin/settings/testMail${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 };