// Code generated by api_gen. DO NOT EDIT. /** * Auto-generated API Client * Generated from: atlas9.dev/c/demo/api */ class APIClient { constructor(baseURL = '', options = {}) { this.baseURL = baseURL; this.timeout = options.timeout || 30000; this.headers = options.headers || {}; this.onUnauthorized = options.onUnauthorized || null; } async request(method, path, body = null) { const url = this.baseURL + path; const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), this.timeout); try { const options = { method, headers: { 'Content-Type': 'application/json', ...this.headers }, credentials: 'same-origin', signal: controller.signal }; if (body !== null) { options.body = JSON.stringify(body); } const response = await fetch(url, options); clearTimeout(timeoutId); if (!response.ok) { let parsed = null; try { parsed = await response.json(); } catch (_) {} const err = new Error(`Request failed with status ${response.status}`); err.status = response.status; err.response = parsed; if (response.status === 401 && this.onUnauthorized) { this.onUnauthorized(err); } throw err; } const text = await response.text(); return text ? JSON.parse(text) : null; } catch (error) { clearTimeout(timeoutId); if (error.name === 'AbortError') { throw new Error('Request timeout'); } throw error; } } async Account_Register(req) { return this.request('POST', '/Account_Register', req); } async Account_RequestPasswordReset(req) { return this.request('POST', '/Account_RequestPasswordReset', req); } async Account_ResendVerification(req) { return this.request('POST', '/Account_ResendVerification', req); } async Account_ResetPassword(req) { return this.request('POST', '/Account_ResetPassword', req); } async Account_Task_SendEmailVerification(req) { return this.request('POST', '/Account_Task_SendEmailVerification', req); } async Account_Task_SendPasswordReset(req) { return this.request('POST', '/Account_Task_SendPasswordReset', req); } async Account_Verify(req) { return this.request('POST', '/Account_Verify', req); } async Audit_List(req) { return this.request('POST', '/Audit_List', req); } async Audit_ListByUser(req) { return this.request('POST', '/Audit_ListByUser', req); } async BotKeys_Create(req) { return this.request('POST', '/BotKeys_Create', req); } async BotKeys_Get(req) { return this.request('POST', '/BotKeys_Get', req); } async BotKeys_List(req) { return this.request('POST', '/BotKeys_List', req); } async BotKeys_SetExpiration(req) { return this.request('POST', '/BotKeys_SetExpiration', req); } async Bots_Delete(req) { return this.request('POST', '/Bots_Delete', req); } async Bots_Get(req) { return this.request('POST', '/Bots_Get', req); } async Bots_List(req) { return this.request('POST', '/Bots_List', req); } async Bots_Save(req) { return this.request('POST', '/Bots_Save', req); } async Domain_Create(req) { return this.request('POST', '/Domain_Create', req); } async Domain_Delete(req) { return this.request('POST', '/Domain_Delete', req); } async Domain_Get(req) { return this.request('POST', '/Domain_Get', req); } async Domain_List(req) { return this.request('POST', '/Domain_List', req); } async Domain_Verify(req) { return this.request('POST', '/Domain_Verify', req); } async Grants_Add(req) { return this.request('POST', '/Grants_Add', req); } async Grants_List(req) { return this.request('POST', '/Grants_List', req); } async Grants_ListByTenant(req) { return this.request('POST', '/Grants_ListByTenant', req); } async Grants_Remove(req) { return this.request('POST', '/Grants_Remove', req); } async Groups_AddMember(req) { return this.request('POST', '/Groups_AddMember', req); } async Groups_Delete(req) { return this.request('POST', '/Groups_Delete', req); } async Groups_Get(req) { return this.request('POST', '/Groups_Get', req); } async Groups_List(req) { return this.request('POST', '/Groups_List', req); } async Groups_ListByTenant(req) { return this.request('POST', '/Groups_ListByTenant', req); } async Groups_ListMemberGroups(req) { return this.request('POST', '/Groups_ListMemberGroups', req); } async Groups_ListMembers(req) { return this.request('POST', '/Groups_ListMembers', req); } async Groups_RemoveMember(req) { return this.request('POST', '/Groups_RemoveMember', req); } async Groups_Save(req) { return this.request('POST', '/Groups_Save', req); } async Health(req) { return this.request('GET', '/health', req); } async Identity_Login(req) { return this.request('POST', '/Identity_Login', req); } async Identity_Logout(req) { return this.request('POST', '/Identity_Logout', req); } async Profiles_Get(req) { return this.request('POST', '/Profiles_Get', req); } async Profiles_Save(req) { return this.request('POST', '/Profiles_Save', req); } async Roles_Delete(req) { return this.request('POST', '/Roles_Delete', req); } async Roles_Get(req) { return this.request('POST', '/Roles_Get', req); } async Roles_List(req) { return this.request('POST', '/Roles_List', req); } async Roles_ListByTenant(req) { return this.request('POST', '/Roles_ListByTenant', req); } async Roles_Save(req) { return this.request('POST', '/Roles_Save', req); } async Sso_Check(req) { return this.request('POST', '/Sso_Check', req); } async Sso_GetCallback(req) { return this.request('GET', '/auth/{tenant}/{id}/callback', req); } async Sso_Login(req) { return this.request('GET', '/auth/{tenant}/{id}/login', req); } async Sso_PostCallback(req) { return this.request('POST', '/auth/{tenant}/{id}/callback', req); } async TenantInvitations_Accept(req) { return this.request('POST', '/TenantInvitations_Accept', req); } async TenantInvitations_Create(req) { return this.request('POST', '/TenantInvitations_Create', req); } async TenantInvitations_Decline(req) { return this.request('POST', '/TenantInvitations_Decline', req); } async TenantInvitations_Delete(req) { return this.request('POST', '/TenantInvitations_Delete', req); } async TenantInvitations_List(req) { return this.request('POST', '/TenantInvitations_List', req); } async TenantInvitations_ListByEmail(req) { return this.request('POST', '/TenantInvitations_ListByEmail', req); } async TenantInvitations_Task_SendTenantInvitation(req) { return this.request('POST', '/TenantInvitations_Task_SendTenantInvitation', req); } async Tenants_Create(req) { return this.request('POST', '/Tenants_Create', req); } async Tenants_Delete(req) { return this.request('POST', '/Tenants_Delete', req); } async Tenants_Get(req) { return this.request('POST', '/Tenants_Get', req); } async Tenants_List(req) { return this.request('POST', '/Tenants_List', req); } async Tenants_Update(req) { return this.request('POST', '/Tenants_Update', req); } async Todos_AddToList(req) { return this.request('POST', '/Todos_AddToList', req); } async Todos_CreateItem(req) { return this.request('POST', '/Todos_CreateItem', req); } async Todos_CreateList(req) { return this.request('POST', '/Todos_CreateList', req); } async Todos_DeleteItem(req) { return this.request('POST', '/Todos_DeleteItem', req); } async Todos_DeleteList(req) { return this.request('POST', '/Todos_DeleteList', req); } async Todos_GetItem(req) { return this.request('POST', '/Todos_GetItem', req); } async Todos_GetList(req) { return this.request('POST', '/Todos_GetList', req); } async Todos_ListItems(req) { return this.request('POST', '/Todos_ListItems', req); } async Todos_ListLists(req) { return this.request('POST', '/Todos_ListLists', req); } async Todos_RemoveFromList(req) { return this.request('POST', '/Todos_RemoveFromList', req); } async Todos_UpdateItem(req) { return this.request('POST', '/Todos_UpdateItem', req); } async Todos_UpdateList(req) { return this.request('POST', '/Todos_UpdateList', req); } async Users_GetByEmail(req) { return this.request('POST', '/Users_GetByEmail', req); } async Users_List(req) { return this.request('POST', '/Users_List', req); } async Users_ListByTenant(req) { return this.request('POST', '/Users_ListByTenant', req); } } if (typeof module !== 'undefined' && module.exports) { module.exports = APIClient; } if (typeof window !== 'undefined') { window.APIClient = APIClient; }