@ptkl/sdk - v1.18.0
    Preparing search index...

    Base client for the platform API Classes that extend PlatformBaseClient have intentins of only working in platform context

    PlatformBaseClient

    The axios instance to use for the client

    // if sdk is used in the forge app that is running in the platform context
    const utils = new ComponentUtils()
    // this won't work outside of platform context because client needs authtorization to communicate with the API.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • Optionaloptions: { env?: string; host?: string; token?: string }

      Returns default

    Properties

    client: AxiosInstance
    env: null | string = null
    host: null | string = null
    token: null | string = null

    Methods

    • Parameters

      • username: string
      • password: string
      • project: string

      Returns Promise<AxiosResponse<any, any>>

    • Create a new role

      Parameters

      Returns Promise<AxiosResponse<Role, any>>

    • Delete a role

      Parameters

      • uuid: string

        Role UUID

      Returns Promise<AxiosResponse<{ status: boolean }, any>>

    • Edit user profile

      Parameters

      • data: any

        Profile update data

      Returns Promise<AxiosResponse<any, any>>

    • Edit a role

      Parameters

      • uuid: string

        Role UUID

      • data: EditRoleRequest

        Role update data including permissions, workspaces, and level

      Returns Promise<AxiosResponse<Role, any>>

    • Get current user's claims

      Returns Promise<AxiosResponse<UserClaims, any>>

    • Get the current token's permissions.

      Returns the resolved permission set carried by the calling token. For a forge actor token this is the scoped intersection minted at launch time — see getPrincipalPermissions() for the underlying user's full set.

      Returns Promise<AxiosResponse<Permissions, any>>

    • Get the FULL permissions of the user the current token is acting on behalf of (the "principal").

      When a forge app runs under an actor token, getPermissions() returns only the token's scoped permissions — the intersection of the app's declared runtime permissions and the user's permissions. This instead returns the complete permission set of the underlying user, so the app can check what that user is actually allowed to do, independent of what the app itself was granted. The token scope is unchanged: this exposes knowledge, not capability.

      For a normal user session (no actor token) it returns the caller's own permissions, identical to getPermissions()'s scope.

      Returns Promise<AxiosResponse<Permissions, any>>

    • Get role details by UUID

      Parameters

      • uuid: string

        Role UUID

      Returns Promise<AxiosResponse<RoleModel, any>>

    • Get current user's model

      Returns Promise<AxiosResponse<UserModel, any>>

    • Get list of available permissions

      Returns Promise<AxiosResponse<Permission[], any>>

    • List all roles

      Returns Promise<AxiosResponse<Role[], any>>

    • Returns Promise<AxiosResponse<any, any>>

      Use getPermissions() instead

    • Request password reset email This only sends an email with a reset link, does not expose or change passwords

      Parameters

      • email: string

        User email

      Returns Promise<AxiosResponse<any, any>>

    • Resend confirmation email

      Parameters

      • email: string

        User email

      Returns Promise<AxiosResponse<any, any>>

    • Parameters

      • client: AxiosInstance

      Returns default