export type AwsSnsSmsProviderConfiguration = {type: string, accessKeyId?: string | undefined, secretAccessKey?: string | undefined, region?: string | undefined}; export type SmppSmsProviderConfiguration = {type: string, protocolVersion: '3.3, 3.4', host: string, port: number, systemId: string, password: string, systemType?: string | undefined, bindType?: ('TX' | 'RX' | 'TRX') | undefined, serviceType?: string | undefined, sourceAddress?: string | undefined, sourceTon?: string | undefined, sourceNpi?: string | undefined, destinationTon?: string | undefined, destinationNpi?: string | undefined, addressRange?: string | undefined, codingScheme?: ('0-10' | '13-14') | undefined}; export type TwilioSmsProviderConfiguration = {type: string, accountSid?: string | undefined, accountToken?: string | undefined, numberFrom?: string | undefined}; export type TestSmsRequest = {providerConfiguration?: (AwsSnsSmsProviderConfiguration | SmppSmsProviderConfiguration | TwilioSmsProviderConfiguration) | undefined, numberTo?: string | undefined, message?: string | undefined}; export type CreateApiApiAdminSettingsTestSmsArgs = {body: TestSmsRequest}; export type CreateApiApiAdminSettingsTestSmsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send test sms (sendTestSms) * * POST /api/admin/settings/testSms */ export const createApiApiAdminSettingsTestSms = async (args: CreateApiApiAdminSettingsTestSmsArgs, options?: CreateApiApiAdminSettingsTestSmsOptions) => { 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/testSms${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 };