@rosschiu/kiban-sdk
    Preparing search index...

    Interface OrgClient

    Typed client over org's gateway-exposed HTTP surface: meCompanies, memberDirectory, and the superadmin-only admin* position/group methods.

    interface OrgClient {
        adminAddGroupMember(
            groupId: string,
            memberId: string,
        ): Promise<OrgGroupMember>;
        adminAssignPosition(
            positionId: string,
            memberId: string,
        ): Promise<OrgAssignment>;
        adminCreateGroup(
            companyId: string,
            input: { code: string; name: string },
        ): Promise<OrgGroup>;
        adminCreatePosition(
            companyId: string,
            input: { code: string; title: string },
        ): Promise<OrgPosition>;
        adminEndAssignment(assignmentId: string): Promise<OrgAssignment>;
        adminListGroupMembers(groupId: string): Promise<OrgGroupMember[]>;
        adminListGroups(
            companyId: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<OrgGroupWithMemberCount>>;
        adminListPositions(
            companyId: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<OrgPositionWithHolder>>;
        adminRemoveGroupMember(
            groupId: string,
            memberId: string,
        ): Promise<{ groupId: string; memberId: string }>;
        meCompanies(): Promise<OrgMeCompany[]>;
        memberDirectory(
            companyId: string,
            q?: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<MemberDirectoryEntry>>;
    }
    Index
    • POST /api/org/admin/groups/{id}/members {memberId} — add a member. 409 GROUP_EXTERNALLY_MANAGED if the group's source isn't "kiban" (the single-writer invariant).

      Parameters

      • groupId: string
      • memberId: string

      Returns Promise<OrgGroupMember>

    • POST /api/org/admin/positions/{id}/assignments {memberId} — assign-NOW (server-dated).

      Parameters

      • positionId: string
      • memberId: string

      Returns Promise<OrgAssignment>

    • POST /api/org/admin/companies/{companyId}/groups {code,name} — companyId comes from the PATH only; the group is always created with source="kiban" (the only source this surface can create).

      Parameters

      • companyId: string
      • input: { code: string; name: string }

      Returns Promise<OrgGroup>

    • POST /api/org/admin/companies/{companyId}/positions {code,title} — companyId comes from the PATH only; org-unit defaults to the company root.

      Parameters

      • companyId: string
      • input: { code: string; title: string }

      Returns Promise<OrgPosition>

    • POST /api/org/admin/assignments/{id}/end — end-NOW, no body (server-dated).

      Parameters

      • assignmentId: string

      Returns Promise<OrgAssignment>

    • GET /api/org/admin/groups/{id}/members — the Groups admin page's own member-list read, needed to render a remove button per current member (add/remove alone can't drive a UI without knowing WHO to remove).

      Parameters

      • groupId: string

      Returns Promise<OrgGroupMember[]>

    • GET /api/org/admin/companies/{companyId}/groups — list, each row carrying its member count and source (externally-sourced groups render read-only with a source badge).

      Parameters

      • companyId: string
      • Optionalpage: number
      • OptionalpageSize: number

      Returns Promise<Page<OrgGroupWithMemberCount>>

    • GET /api/org/admin/companies/{companyId}/positions — list, each row carrying its CURRENT assignment (assignmentId/memberId/holderDisplayName — null when unassigned).

      Parameters

      • companyId: string
      • Optionalpage: number
      • OptionalpageSize: number

      Returns Promise<Page<OrgPositionWithHolder>>

    • DELETE /api/org/admin/groups/{id}/members/{memberId} — remove a member. Same 409 GROUP_EXTERNALLY_MANAGED refusal as adminAddGroupMember.

      Parameters

      • groupId: string
      • memberId: string

      Returns Promise<{ groupId: string; memberId: string }>

    • GET /api/org/me/companies — companies where the CALLER (kcSub-injected by the gateway) has an active membership in an active company; the company-switcher source.

      Returns Promise<OrgMeCompany[]>

    • GET /api/org/companies/{companyId}/members — the gateway-exposed, least-disclosure member picker (share-with/assign-to). q is an optional case-insensitive substring filter over displayName/email.

      Parameters

      • companyId: string
      • Optionalq: string
      • Optionalpage: number
      • OptionalpageSize: number

      Returns Promise<Page<MemberDirectoryEntry>>