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

    Interface AppClient

    The app's backend view of Kiban: decisions, tuples, members, registration.

    interface AppClient {
        api: ApiClient;
        anchorTuple(objectType: string, objectId: string, companyId: string): Tuple;
        batchCan(
            userBearer: string,
            request: EffectiveAccessRequest,
            items: EffectiveAccessBatchItem[],
        ): Promise<EffectiveAccessBatchResult[]>;
        batchCanService(
            request: EffectiveAccessRequest,
            items: EffectiveAccessBatchItem[],
        ): Promise<EffectiveAccessBatchResult[]>;
        can(
            userBearer: string,
            request: EffectiveAccessRequest,
        ): Promise<EffectiveAccessDecision>;
        canService(
            request: EffectiveAccessRequest,
        ): Promise<EffectiveAccessDecision>;
        grant(companyId: string, tuples: Tuple[]): Promise<void>;
        groupDirectory(
            companyId: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<GroupDirectoryEntry>>;
        groupMembers(companyId: string, groupId: string): Promise<OrgGroupMember[]>;
        meCompanies(userBearer: string): Promise<OrgMeCompany[]>;
        memberBySubject(companyId: string, subject: string): Promise<MemberFact>;
        memberDirectory(
            companyId: string,
            q?: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<MemberDirectoryEntry>>;
        positionDirectory(
            companyId: string,
            page?: number,
            pageSize?: number,
        ): Promise<Page<PositionDirectoryEntry>>;
        positionHolder(
            companyId: string,
            positionId: string,
            date?: string,
        ): Promise<OrgAssignment>;
        registerApp(superadminBearer: string, manifest: AppManifest): Promise<void>;
        revoke(companyId: string, tuples: Tuple[]): Promise<void>;
    }
    Index

    The underlying client, authenticated as the service account, for any other route.

    • The company_module anchor tuple binding an object of the app to a company.

      Parameters

      • objectType: string
      • objectId: string
      • companyId: string

      Returns Tuple

    • Writes tuples on the app's own object types in a company. Every object must carry its anchor (AppClient.anchorTuple) in the same or an earlier call.

      Parameters

      • companyId: string
      • tuples: Tuple[]

      Returns Promise<void>

    • The company's active groups (id, code, name), as the app's service account.

      Parameters

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

      Returns Promise<Page<GroupDirectoryEntry>>

    • The companies the user behind userBearer may see: active memberships in active companies.

      Parameters

      • userBearer: string

      Returns Promise<OrgMeCompany[]>

    • Asks org whether a subject is an active member of a company.

      Parameters

      • companyId: string
      • subject: string

      Returns Promise<MemberFact>

    • One page of the company's active members, as the app's service account (which must be a member of the company); q filters on a substring of display name or email.

      Parameters

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

      Returns Promise<Page<MemberDirectoryEntry>>

    • The company's positions (id, code, title), as the app's service account, for a share-with or assign-to picker.

      Parameters

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

      Returns Promise<Page<PositionDirectoryEntry>>

    • Who holds the position on date (YYYY-MM-DD, default today); a 404 means nobody.

      Parameters

      • companyId: string
      • positionId: string
      • Optionaldate: string

      Returns Promise<OrgAssignment>

    • Registers (or re-registers) the app with a superadmin's bearer.

      Parameters

      Returns Promise<void>

    • Removes tuples the app wrote.

      Parameters

      • companyId: string
      • tuples: Tuple[]

      Returns Promise<void>