@folderharbor/sdk
    Preparing search index...

    Class AdminResource

    Methods for administering a FolderHarbor server.

    Constructors

    Properties

    Methods

    • Read the server's audit log.

      Parameters

      • Optionalpage: number

        Page number to look at, defaults to page 1 (the latest logs)

      Returns Promise<FHLogs>

      The log entries on that page (capping out at 20), as well as the total number of pages

      logs:read

      If your session is invalid, expired, or for a locked account

      If you don't have permission to take this admin action

      If anything else went wrong, either in the process of requesting, or in the response from the server

      const latestLogs = await client.admin.logs();
      const oldestLogs = await client.admin.logs(latestLogs.pageCount);
    • Gets a list of permissions that can be applied to users or roles.

      Returns Promise<FHPermissions>

      A list of key-value pairs with permission nodes and their descriptions

      If your session is invalid, expired, or for a locked account

      If anything else went wrong, either in the process of requesting, or in the response from the server

      const permList = await client.admin.permissions();
      
    • Revokes a session token for any user.

      Parameters

      • sessionID: number

        The session ID for the session you want to revoke

      Returns Promise<void>

      users:edit

      If your session is invalid, expired, or for a locked account

      If you don't have permission to take this admin action

      If anything else went wrong, either in the process of requesting, or in the response from the server

      await client.admin.revokeSession(6);