import { Organization, OrganizationMember, UserGroup, Invitation, Store, Warehouse, StoreMember, WarehouseMember, StoreWarehouse, OrganizationRole, CreateOrganizationDto, UpdateOrganizationDto, AddMemberDto, UpdateMemberDto, CreateGroupDto, InviteMemberDto, CreateStoreDto, UpdateStoreDto, CreateWarehouseDto, UpdateWarehouseDto, AddStoreMemberDto, AddWarehouseMemberDto, LinkStoreWarehouseDto, CreateRoleDto, UpdateRoleDto } from './types'; export interface OrganizationClientConfig { baseUrl: string; getToken: () => string | Promise; /** Optional URL for the Upfiles service (defaults to http://localhost:4021) */ upfilesUrl?: string; } /** * Organization Client * * Client for interacting with the organization service API. * Supports both client-side and server-side usage. * * @see {@link https://ktw-organization-docs.netlify.app/ | Full Documentation} * * @example * ```typescript * const client = new OrganizationClient({ * baseUrl: 'http://localhost:4111', * getToken: () => localStorage.getItem('token') || '', * }); * * const organizations = await client.getMyOrganizations(); * ``` */ export declare class OrganizationClient { private baseUrl; private getToken; constructor(config: OrganizationClientConfig); private request; createOrganization(data: CreateOrganizationDto): Promise; getOrganization(id: string): Promise; getMyOrganizations(): Promise; updateOrganization(id: string, data: UpdateOrganizationDto): Promise; deleteOrganization(id: string): Promise; addMember(organizationId: string, data: AddMemberDto): Promise; getMembers(organizationId: string): Promise; updateMember(memberId: string, data: UpdateMemberDto): Promise; removeMember(memberId: string): Promise; createGroup(organizationId: string, data: CreateGroupDto): Promise; getGroups(organizationId: string): Promise; addMemberToGroup(groupId: string, memberId: string): Promise; removeMemberFromGroup(groupId: string, memberId: string): Promise; deleteGroup(groupId: string): Promise; inviteMember(organizationId: string, data: InviteMemberDto): Promise; acceptInvitation(token: string): Promise; getInvitations(organizationId: string): Promise; cancelInvitation(invitationId: string): Promise<{ success: boolean; }>; resendInvitation(invitationId: string, frontendUrl?: string): Promise; /** * Get pending invitations for the current user * Used to check if user has pending invitations after signup/login */ getMyPendingInvitations(): Promise; /** * Accept all pending invitations for the current user * Called after user signs up or logs in to auto-join organizations */ acceptMyPendingInvitations(): Promise<{ success: boolean; acceptedCount: number; organizations: Organization[]; }>; createStore(data: CreateStoreDto): Promise; getStore(id: string): Promise; getStores(organizationId?: string): Promise; updateStore(id: string, data: UpdateStoreDto): Promise; deleteStore(id: string): Promise; addStoreMember(storeId: string, data: AddStoreMemberDto): Promise; getStoreMembers(storeId: string): Promise; removeStoreMember(memberId: string): Promise; linkStoreWarehouse(storeId: string, data: LinkStoreWarehouseDto): Promise; unlinkStoreWarehouse(storeId: string, warehouseId: string): Promise; createWarehouse(data: CreateWarehouseDto): Promise; getWarehouse(id: string): Promise; getWarehouses(organizationId?: string): Promise; updateWarehouse(id: string, data: UpdateWarehouseDto): Promise; deleteWarehouse(id: string): Promise; addWarehouseMember(warehouseId: string, data: AddWarehouseMemberDto): Promise; getWarehouseMembers(warehouseId: string): Promise; removeWarehouseMember(memberId: string): Promise; /** * Get all roles for an organization (including system roles like ADMIN, MANAGER) */ getRoles(organizationId: string): Promise; /** * Get roles available for inviting members (for dropdown selection) */ getInvitableRoles(organizationId: string): Promise; /** * Create a custom role for an organization * Only ADMIN or MANAGER can create roles */ createRole(organizationId: string, data: CreateRoleDto): Promise; /** * Update a custom role * System roles (ADMIN, MANAGER) cannot be modified */ updateRole(roleId: string, data: UpdateRoleDto): Promise; /** * Delete a custom role * System roles cannot be deleted * Roles with assigned members cannot be deleted */ deleteRole(roleId: string): Promise; }