export type IntectWebAPIControllersModulesControllerModulePackageRequest = {PackageLevel?: number | undefined, ModuleIds?: Array | undefined, PackagePrice?: (number | null) | undefined, MonthlyPrice?: (number | null) | undefined, MonthlyPriceIsMinimum?: boolean | undefined, SupportMinutes?: (number | null) | undefined}; export type CreateApiApiModulesPackageArgs = {body: IntectWebAPIControllersModulesControllerModulePackageRequest}; export type CreateApiApiModulesPackageOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Sets package level for the active company, and optionally a list of modules. Note this has billing consequences. Please also note that all properties starting with "Enterprise" are only accessible to Intect staff. This includes changing packageLevel to or from the value 3. * * POST /api/modules/package * * Also accepts auth: ApiKey */ export const createApiApiModulesPackage = async (args: CreateApiApiModulesPackageArgs, options?: CreateApiApiModulesPackageOptions) => { const {baseUrl = "https://api.intect.app", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/modules/package${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 };