Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CocoonAPI

Hierarchy

  • CocoonAPI

Index

Accessors

Static credentials

Methods

Static checkAPIAccess

  • checkAPIAccess(): boolean
  • Checks if the API access works.

    Returns boolean

    If the API access works.

Static closeAPIAccess

  • closeAPIAccess(): void
  • Removes the stored credentials.

    Returns void

Static getCocoonTemplates

  • Get a list of the available templates for Cocoon.io projects from the API.

    Returns Promise<ICocoonTemplate[]>

    Promise of the list of the available templates for Cocoon.io projects.

Static getCocoonVersions

  • Get a list of the available Cocoon.io versions.

    Returns Promise<ICocoonVersion[]>

    Promise of the list of the available Cocoon.io versions.

Static request

  • request(options: RequestOptions, addCredentials?: boolean): Request
  • Make a request to the API with your credentials.

    Parameters

    • options: RequestOptions

      HTTP options of the request.

    • Default value addCredentials: boolean = true

      Set to false in case you don't want to automatically add your credentials to the API.

    Returns Request

Static setupAPIAccess

  • setupAPIAccess(accessToken: string, refreshToken: string, expiration?: number, apiURL?: string): void
  • Prepares the API to be used. After successfully setting up the API access, you can use the whole SDK.

    Parameters

    • accessToken: string

      Access token provided by the Cocoon.io server.

    • refreshToken: string

      Refresh token provided by the Cocoon.io server.

    • Optional expiration: number

      Time, in seconds, the access token is valid.

    • Optional apiURL: string

      URL where the Cocoon.io API is located.

    Returns void

Generated using TypeDoc