@cobaltio/cobalt-js
    Preparing search index...

    Class Cobalt

    Index

    Constructors

    • Cobalt Frontend SDK

      Parameters

      • options: CobaltOptions = {}

        The options to configure the Cobalt SDK.

        • OptionalbaseUrl?: string

          The base URL of the Cobalt API. You don't need to set this.

        • Optionaltoken?: string

          The session token.

      Returns Cobalt

    Properties

    token: string

    Methods

    • Connects the specified application using the provided authentication type and optional auth data.

      Parameters

      • params: { payload?: Record<string, string>; slug: string; type?: AuthType }

        The parameters for connecting the application.

        • Optionalpayload?: Record<string, string>

          key-value pairs of authentication data required for the specified auth type.

        • slug: string

          The application slug.

        • Optionaltype?: AuthType

          The authentication type to use. If not provided, it defaults to keybased if payload is provided, otherwise oauth2.

      Returns Promise<boolean>

      A promise that resolves to true if the connection was successful, otherwise false.

      Throws an error if the authentication type is invalid or the connection fails.

    • Create a public workflow for the linked account.

      Parameters

      • params: PublicWorkflowPayload

        The payload for creating a public workflow for the linked account.

        • Optionaldescription?: string

          The workflow description.

        • name: string

          The workflow name.

        • Optionalslug?: string

          The application slug in which this workflow should be created.

      Returns Promise<PublicWorkflow>

      The created public workflow.

    • Delete the specified config.

      Parameters

      • slug: string

        The application slug.

      • OptionalconfigId: string

        The unique ID of the config.

      Returns Promise<unknown>

    • Delete the specified config field value.

      Parameters

      • slug: string

        The application slug.

      • fieldId: string

        The unique ID of the field.

      • OptionalworkflowId: string

        The unique ID of the workflow.

      Returns Promise<unknown>

    • Delete the specified public workflow.

      Parameters

      • workflowId: string

        The workflow ID.

      Returns Promise<unknown>

    • Disconnect the specified application and remove any associated data from Cobalt.

      Parameters

      • slug: string

        The application slug.

      • Optionaltype: AuthType

        The authentication type to use. If not provided, it'll remove all the connected accounts.

      Returns Promise<unknown>

    • Execute the specified public workflow.

      Parameters

      • options: ExecuteWorkflowPayload

        The execution payload.

        • Optionalpayload?: Record<string, any>

          The payload to execute the workflow.

        • Optionalslug?: string

          The application's slug this workflow belongs to.

        • Optionalsync_execution?: boolean

          Whether to execute the workflow synchronously.

        • worklfow: string

          The workflow id or alias.

      Returns Promise<unknown>

    • Returns the list of enabled applications and their details.

      Returns Promise<Application[]>

      The list of applications.

    • Returns the application details for the specified application, provided the application is enabled in Cobalt.

      Parameters

      • slug: string

        The application slug.

      Returns Promise<Application>

      The application details.

    • Returns the specified config.

      Parameters

      • slug: string

        The application slug.

      • OptionalconfigId: string

        The unique ID of the config.

      Returns Promise<Config>

      The specified config.

    • Returns the specified field of the config.

      Parameters

      • slug: string

        The application slug.

      • fieldId: string

        The unique ID of the field.

      • OptionalworkflowId: string

        The unique ID of the workflow.

      Returns Promise<Config>

      The specified config field.

    • Returns the configs created for the specified application.

      Parameters

      • slug: string

        The application slug.

      Returns Promise<{ config_id: string }[]>

      The configs created for the specified application.

    • Returns the specified workflow execution log.

      Parameters

      • executionId: string

        The execution ID.

      Returns Promise<Execution>

      The specified execution log.

    • Returns the workflow execution logs for the linked account.

      Parameters

      • Optionalparams: PaginationProps = {}
        • page
        • limit

      Returns Promise<PaginatedResponse<Execution>>

      The paginated workflow execution logs.

    • Returns the options for the specified field.

      Parameters

      • lhs: string

        The selected value of the lhs field.

      • slug: string

        The application slug.

      • fieldId: string

        The unique ID of the field.

      • OptionalworkflowId: string

        The unique ID of the workflow, if this is a workflow field.

      Returns Promise<RuleOptions>

      The specified rule field's options.

    • Update the specified config field value.

      Parameters

      • slug: string

        The application slug.

      • fieldId: string

        The unique ID of the field.

      • value: null | string | number | boolean

        The new value for the field.

      • OptionalworkflowId: string

        The unique ID of the workflow.

      Returns Promise<Config>

      The updated config field.