@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

    • Accept an invite

      Parameters

      • uuid: string

        Invite UUID

      Returns Promise<AxiosResponse<any, any>>

    • Archive a project

      Returns Promise<AxiosResponse<any, any>>

    • Create a new project

      Parameters

      • data: { description?: string; name: string; [key: string]: any }

        Project creation data

      Returns Promise<AxiosResponse<any, any>>

    • Create a new workspace

      Parameters

      • data: { description?: string; name: string; [key: string]: any }

        Workspace data

      Returns Promise<AxiosResponse<any, any>>

    • Delete a user from the project

      Parameters

      • uuid: string

        User UUID

      Returns Promise<AxiosResponse<any, any>>

    • Delete a workspace

      Parameters

      • uuid: string

        Workspace UUID

      Returns Promise<AxiosResponse<any, any>>

    • Get available templates

      Returns Promise<AxiosResponse<any, any>>

    • Get a specific invite by UUID

      Parameters

      • uuid: string

        Invite UUID

      Returns Promise<AxiosResponse<any, any>>

    • Get list of project invites

      Returns Promise<AxiosResponse<any, any>>

    • Get template by ID

      Parameters

      • id: string

        Template ID

      Returns Promise<AxiosResponse<any, any>>

    • Get template by activation code

      Parameters

      • code: string

        Activation code

      Returns Promise<AxiosResponse<any, any>>

    • Get a specific project user

      Parameters

      • uuid: string

        User UUID

      Returns Promise<AxiosResponse<any, any>>

    • Get list of project users

      Returns Promise<AxiosResponse<any, any>>

    • Get templates for a workspace

      Returns Promise<AxiosResponse<any, any>>

    • Get information about a specific project

      Returns Promise<AxiosResponse<any, any>>

    • Install a template.

      POST /v1/project/template/install decodes body TemplateInstall = { id, data, activation_code } and resolves the target workspace from the X-Workspace-Uuid request header (not the body) — see platform-api's template_install.go. This method keeps the ergonomic object-arg signature but maps it onto that contract: template_id becomes body id, workspace_uuid is sent as the X-Workspace-Uuid header, and any data/activation_code passed in are forwarded in the body as-is.

      Parameters

      • data: { template_id: string; workspace_uuid: string; [key: string]: any }

        { template_id, workspace_uuid, data?, activation_code? }

      Returns Promise<AxiosResponse<any, any>>

    • Invite one or more users to the project.

      POST /v1/project/invite only accepts a single email per request (see InviteToProject in platform-api's internal/project/controllers/invite.go), so this method issues one request per entry in emails, sequentially, with body { email, role_uuid: roles, subject?, comment? }.

      Return shape (always a single AxiosResponse, so existing callers that do (await project.invite(...)).data keep compiling/working unchanged):

      • Exactly one email: the raw AxiosResponse from that single request (.data is that invite's response body, as before).
      • More than one email: a response shaped like the last request's AxiosResponse, but with .data replaced by an array of each individual request's .data, in the same order as emails.

      Parameters

      • emails: string[]

        Array of email addresses to invite

      • roles: string[]

        Array of role UUIDs to grant every invitee

      • Optionalextra: { comment?: string; subject?: string }

        Optional subject/comment applied to every invite

      Returns Promise<AxiosResponse<any, any>>

    • Get list of all projects for the current user

      Returns Promise<AxiosResponse<any, any>>

    • Register through an invite

      Parameters

      • uuid: string

        Invite UUID

      • data: any

        Registration data

      Returns Promise<AxiosResponse<any, any>>

    • Revoke an invite

      Parameters

      • uuid: string

        Invite UUID

      Returns Promise<AxiosResponse<any, any>>

    • Search for templates

      Parameters

      • query: any

        Search query

      Returns Promise<AxiosResponse<any, any>>

    • Parameters

      • client: AxiosInstance

      Returns default

    • Uninstall a template.

      POST /v1/project/template/uninstall decodes body TemplateInstall = { id, data, activation_code } and resolves the target workspace from the X-Workspace-Uuid request header (not the body) — see platform-api's template_uninstall.go. See installTemplate for the mapping.

      Parameters

      • data: { template_id: string; workspace_uuid: string; [key: string]: any }

        { template_id, workspace_uuid, data?, activation_code? }

      Returns Promise<AxiosResponse<any, any>>

    • Update project settings

      Parameters

      • settings: any

        Settings data

      Returns Promise<AxiosResponse<any, any>>

    • Update a project user

      Parameters

      • uuid: string

        User UUID

      • data: any

        Update data

      Returns Promise<AxiosResponse<any, any>>

    • Update a workspace

      Parameters

      • uuid: string

        Workspace UUID

      • data: any

        Update data

      Returns Promise<AxiosResponse<any, any>>

    • Upgrade a template.

      POST /v1/project/template/upgrade decodes body TemplateInstall = { id, data, activation_code } and resolves the target workspace from the X-Workspace-Uuid request header (not the body) — see platform-api's template_upgrade.go. See installTemplate for the mapping.

      Parameters

      • data: { template_id: string; workspace_uuid: string; [key: string]: any }

        { template_id, workspace_uuid, data?, activation_code? }

      Returns Promise<AxiosResponse<any, any>>