export type CreateApiAppsSystemConfigOrgApacheFelixHttpArgs = {'org.apache.felix.https.nio'?: boolean | undefined, 'org.apache.felix.https.nio@TypeHint'?: string | undefined, 'org.apache.felix.https.keystore'?: string | undefined, 'org.apache.felix.https.keystore@TypeHint'?: string | undefined, 'org.apache.felix.https.keystore.password'?: string | undefined, 'org.apache.felix.https.keystore.password@TypeHint'?: string | undefined, 'org.apache.felix.https.keystore.key'?: string | undefined, 'org.apache.felix.https.keystore.key@TypeHint'?: string | undefined, 'org.apache.felix.https.keystore.key.password'?: string | undefined, 'org.apache.felix.https.keystore.key.password@TypeHint'?: string | undefined, 'org.apache.felix.https.truststore'?: string | undefined, 'org.apache.felix.https.truststore@TypeHint'?: string | undefined, 'org.apache.felix.https.truststore.password'?: string | undefined, 'org.apache.felix.https.truststore.password@TypeHint'?: string | undefined, 'org.apache.felix.https.clientcertificate'?: string | undefined, 'org.apache.felix.https.clientcertificate@TypeHint'?: string | undefined, 'org.apache.felix.https.enable'?: boolean | undefined, 'org.apache.felix.https.enable@TypeHint'?: string | undefined, 'org.osgi.service.http.port.secure'?: string | undefined, 'org.osgi.service.http.port.secure@TypeHint'?: string | undefined}; export type CreateApiAppsSystemConfigOrgApacheFelixHttpOptions = {baseUrl: string, aemAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * POST /apps/system/config/org.apache.felix.http */ export const createApiAppsSystemConfigOrgApacheFelixHttp = async (args: CreateApiAppsSystemConfigOrgApacheFelixHttpArgs, options: CreateApiAppsSystemConfigOrgApacheFelixHttpOptions) => { const {baseUrl, fetch: fetchFn = fetch, aemAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['org.apache.felix.https.nio'] != null) query.append("org.apache.felix.https.nio", String(args['org.apache.felix.https.nio'])) if (args['org.apache.felix.https.nio@TypeHint'] != null) query.append("org.apache.felix.https.nio@TypeHint", String(args['org.apache.felix.https.nio@TypeHint'])) if (args['org.apache.felix.https.keystore'] != null) query.append("org.apache.felix.https.keystore", String(args['org.apache.felix.https.keystore'])) if (args['org.apache.felix.https.keystore@TypeHint'] != null) query.append("org.apache.felix.https.keystore@TypeHint", String(args['org.apache.felix.https.keystore@TypeHint'])) if (args['org.apache.felix.https.keystore.password'] != null) query.append("org.apache.felix.https.keystore.password", String(args['org.apache.felix.https.keystore.password'])) if (args['org.apache.felix.https.keystore.password@TypeHint'] != null) query.append("org.apache.felix.https.keystore.password@TypeHint", String(args['org.apache.felix.https.keystore.password@TypeHint'])) if (args['org.apache.felix.https.keystore.key'] != null) query.append("org.apache.felix.https.keystore.key", String(args['org.apache.felix.https.keystore.key'])) if (args['org.apache.felix.https.keystore.key@TypeHint'] != null) query.append("org.apache.felix.https.keystore.key@TypeHint", String(args['org.apache.felix.https.keystore.key@TypeHint'])) if (args['org.apache.felix.https.keystore.key.password'] != null) query.append("org.apache.felix.https.keystore.key.password", String(args['org.apache.felix.https.keystore.key.password'])) if (args['org.apache.felix.https.keystore.key.password@TypeHint'] != null) query.append("org.apache.felix.https.keystore.key.password@TypeHint", String(args['org.apache.felix.https.keystore.key.password@TypeHint'])) if (args['org.apache.felix.https.truststore'] != null) query.append("org.apache.felix.https.truststore", String(args['org.apache.felix.https.truststore'])) if (args['org.apache.felix.https.truststore@TypeHint'] != null) query.append("org.apache.felix.https.truststore@TypeHint", String(args['org.apache.felix.https.truststore@TypeHint'])) if (args['org.apache.felix.https.truststore.password'] != null) query.append("org.apache.felix.https.truststore.password", String(args['org.apache.felix.https.truststore.password'])) if (args['org.apache.felix.https.truststore.password@TypeHint'] != null) query.append("org.apache.felix.https.truststore.password@TypeHint", String(args['org.apache.felix.https.truststore.password@TypeHint'])) if (args['org.apache.felix.https.clientcertificate'] != null) query.append("org.apache.felix.https.clientcertificate", String(args['org.apache.felix.https.clientcertificate'])) if (args['org.apache.felix.https.clientcertificate@TypeHint'] != null) query.append("org.apache.felix.https.clientcertificate@TypeHint", String(args['org.apache.felix.https.clientcertificate@TypeHint'])) if (args['org.apache.felix.https.enable'] != null) query.append("org.apache.felix.https.enable", String(args['org.apache.felix.https.enable'])) if (args['org.apache.felix.https.enable@TypeHint'] != null) query.append("org.apache.felix.https.enable@TypeHint", String(args['org.apache.felix.https.enable@TypeHint'])) if (args['org.osgi.service.http.port.secure'] != null) query.append("org.osgi.service.http.port.secure", String(args['org.osgi.service.http.port.secure'])) if (args['org.osgi.service.http.port.secure@TypeHint'] != null) query.append("org.osgi.service.http.port.secure@TypeHint", String(args['org.osgi.service.http.port.secure@TypeHint'])) if (aemAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${aemAuth.username}:${aemAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/apps/system/config/org.apache.felix.http${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };