export type RepositorySettings = {repositoryUri?: string | undefined, authMethod?: ('USERNAME_PASSWORD' | 'PRIVATE_KEY') | undefined, username?: string | undefined, password?: string | undefined, privateKeyFileName?: string | undefined, privateKey?: string | undefined, privateKeyPassword?: string | undefined, defaultBranch?: string | undefined, readOnly?: boolean | undefined, showMergeCommits?: boolean | undefined, localOnly?: boolean | undefined}; export type CreateApiApiAdminRepositorySettingsCheckAccessArgs = {body: RepositorySettings}; export type CreateApiApiAdminRepositorySettingsCheckAccessOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check repository access (checkRepositoryAccess) * * POST /api/admin/repositorySettings/checkAccess */ export const createApiApiAdminRepositorySettingsCheckAccess = async (args: CreateApiApiAdminRepositorySettingsCheckAccessArgs, options?: CreateApiApiAdminRepositorySettingsCheckAccessOptions) => { 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/repositorySettings/checkAccess${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 };