@rosschiu/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;
        can(
            userBearer: string,
            request: EffectiveAccessRequest,
        ): Promise<EffectiveAccessDecision>;
        canService(
            request: EffectiveAccessRequest,
        ): Promise<EffectiveAccessDecision>;
        grant(companyId: string, tuples: Tuple[]): Promise<void>;
        memberBySubject(companyId: string, subject: string): Promise<MemberFact>;
        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>

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

      Parameters

      • companyId: string
      • subject: string

      Returns Promise<MemberFact>

    • 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>