export type QPilotCoreModelsSubscriptionTierType = 0 | 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256; export type QPilotCoreModelsDtoEntitiesUserPermissionDto = {pageId?: number | undefined, roles?: (Array | null) | undefined}; export type CreateApiUsersPermissionsArgs = {body: QPilotCoreModelsDtoEntitiesUserPermissionDto}; export type CreateApiUsersPermissionsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /UsersPermissions */ export const createApiUsersPermissions = async (args: CreateApiUsersPermissionsArgs, options?: CreateApiUsersPermissionsOptions) => { const {baseUrl = "https://api.qpilot.cloud", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/UsersPermissions${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 };