export type InternetPackageDTO = {aff_amount?: number | undefined, caption?: string | undefined, ch_type?: number | undefined, expiry?: string | undefined, org_amount?: number | undefined, title?: string | undefined, trafic?: string | undefined}; export type InternetChargeCommand = {additionalData?: string | undefined, internetPackage: InternetPackageDTO, mobileNumber: string, reserveNumber?: number | undefined, useScore: boolean}; export type CreateApiApiUserInternetchargeDoArgs = {body: InternetChargeCommand}; export type CreateApiApiUserInternetchargeDoOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * internetCharge * * POST /api/user/internetcharge/do */ export const createApiApiUserInternetchargeDo = async (args: CreateApiApiUserInternetchargeDoArgs, options: CreateApiApiUserInternetchargeDoOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/user/internetcharge/do${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 res.blob() };