commandbox.system.util

Class ForgeBox

lucee.Component
    extended by commandbox.system.util.ForgeBox

ForgeBox API REST Wrapper

Class Attributes:
  • output : false
  •  
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
    Property Summary
    type property default serializable required
    any APIURL


    • access = public
    • returntype = any
    true false
    any CommandBoxlogger


    • access = public
    • returntype = any
    • inject = logbox:logger:{this}
    true false
    any configService


    • access = public
    • returntype = any
    • inject = configService
    true false
    any endpointName


    • access = public
    • returntype = any
    true false
    any endpointURL


    • access = public
    • returntype = any
    true false
    any progressBar


    • access = public
    • returntype = any
    • inject = ProgressBar
    true false
    any progressableDownloader


    • access = public
    • returntype = any
    • inject = ProgressableDownloader
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    string getAPIURL()
    any getCachedTypes([boolean force='false'], [string APIToken=''])
         Get an array of entry types, locally first else goes and retrieves them.
    string getCommandBoxlogger()
    string getConfigService()
    string getEndpointName()
    string getEndpointURL()
    any getEntries([string orderBy='[runtime expression]'], [numeric maxrows='0'], [numeric startRow='1'], [string typeSlug=''], [string searchTerm=''], [string APIToken=''])
         Get entries.
    struct getEntry(string slug='', [string APIToken=''])
         Get an entry from forgebox by slug.
    string getProgressBar()
    string getProgressableDownloader()
    any getStorageLocation(string slug, string version, string APIToken)
    any getTypes([string APIToken=''])
         Get an array of entry types.
    boolean isSlugAvailable(string slug='', [string APIToken=''])
         Verifies if a slug is available.
    any login(string username, string password)
         Authenticates a user in ForgeBox.
    private struct makeRequest([string method='GET'], [string resource=''], [any body=''], [struct headers='[runtime expression]'], [struct parameters='[runtime expression]'], [numeric timeout='20'], [struct formFields='[runtime expression]'], [struct files='[runtime expression]'], [boolean multipart='false'])
         Invoke a ForgeBox REST Call.
    any publish(string slug, boolean private, string version, string boxJSON, string isStable='true', [string description=''], [string descriptionFormat='text'], [string installInstructions=''], [string installInstructionsFormat='text'], [string changeLog=''], [string changeLogFormat='text'], string APIToken, [string zipPath=''], [boolean forceUpload='false'])
         Publishes a package in ForgeBox.
    any recordDownload(string slug, [string version], [string APIToken=''])
         Tracks a download.
    any recordInstall(string slug, [string version=''], [string APIToken=''])
         Tracks an install.
    any register(string username, string password, string email, string fName, string lName, [string APIToken=''])
         Registers a new user in ForgeBox.
    any setAPIURL(any APIURL)
    any setCommandBoxlogger(any CommandBoxlogger)
    any setConfigService(any configService)
    any setEndpointName(any endpointName)
    any setEndpointURL(any endpointURL)
    any setProgressBar(any progressBar)
    any setProgressableDownloader(any progressableDownloader)
    any slugSearch(string searchTerm, [string typeSlug=''], [string APIToken=''])
         Autocomplete for slugs.
    any unpublish(string slug, [string version=''], string APIToken)
         Unpublishes a package.
    any whoami(string APIToken)
         Look up user based on API Token.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    APIURL

    property any APIURL

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    CommandBoxlogger

    property any CommandBoxlogger

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:{this}
    serializable - true

    configService

    property any configService

    Attributes:
    access - public
    required - false
    returntype - any
    inject - configService
    serializable - true

    endpointName

    property any endpointName

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    endpointURL

    property any endpointURL

    Attributes:
    access - public
    required - false
    returntype - any
    serializable - true

    progressBar

    property any progressBar

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ProgressBar
    serializable - true

    progressableDownloader

    property any progressableDownloader

    Attributes:
    access - public
    required - false
    returntype - any
    inject - ProgressableDownloader
    serializable - true

    Method Detail

    getAPIURL

    public string getAPIURL()


    getCachedTypes

    public any getCachedTypes([boolean force='false'], [string APIToken=''])

    Get an array of entry types, locally first else goes and retrieves them

    Parameters:
    force
    APIToken

    getCommandBoxlogger

    public string getCommandBoxlogger()


    getConfigService

    public string getConfigService()


    getEndpointName

    public string getEndpointName()


    getEndpointURL

    public string getEndpointURL()


    getEntries

    public any getEntries([string orderBy='[runtime expression]'], [numeric maxrows='0'], [numeric startRow='1'], [string typeSlug=''], [string searchTerm=''], [string APIToken=''])

    Get entries

    Parameters:
    orderBy - The type to order by, look at this.ORDERBY
    maxrows - Max rows to return
    startRow - StartRow
    typeSlug - The type slug to filter on
    searchTerm - String to search on
    APIToken

    getEntry

    public struct getEntry(string slug='', [string APIToken=''])

    Get an entry from forgebox by slug

    Parameters:
    slug - The entry slug to retreive
    APIToken

    getProgressBar

    public string getProgressBar()


    getProgressableDownloader

    public string getProgressableDownloader()


    getStorageLocation

    public any getStorageLocation(string slug, string version, string APIToken)

    Parameters:
    slug
    version
    APIToken

    getTypes

    public any getTypes([string APIToken=''])

    Get an array of entry types

    Parameters:
    APIToken

    isSlugAvailable

    public boolean isSlugAvailable(string slug='', [string APIToken=''])

    Verifies if a slug is available

    Parameters:
    slug - The entry slug to verify
    APIToken

    login

    public any login(string username, string password)

    Authenticates a user in ForgeBox

    Parameters:
    username
    password

    makeRequest

    private struct makeRequest([string method='GET'], [string resource=''], [any body=''], [struct headers='[runtime expression]'], [struct parameters='[runtime expression]'], [numeric timeout='20'], [struct formFields='[runtime expression]'], [struct files='[runtime expression]'], [boolean multipart='false'])

    Invoke a ForgeBox REST Call

    Parameters:
    method - The HTTP method to invoke
    resource - The resource to hit in the forgebox service.
    body - The body content of the request if passed.
    headers - An struct of HTTP headers to send
    parameters - An struct of HTTP URL parameters to send in the request
    timeout - The default call timeout
    formFields - A struct of form fields to send
    files - A struct of files to send
    multipart - Whether the request needs to be multipart/form-data

    publish

    public any publish(string slug, boolean private, string version, string boxJSON, string isStable='true', [string description=''], [string descriptionFormat='text'], [string installInstructions=''], [string installInstructionsFormat='text'], [string changeLog=''], [string changeLogFormat='text'], string APIToken, [string zipPath=''], [boolean forceUpload='false'])

    Publishes a package in ForgeBox

    Parameters:
    slug
    private
    version
    boxJSON
    isStable
    description
    descriptionFormat
    installInstructions
    installInstructionsFormat
    changeLog
    changeLogFormat
    APIToken
    zipPath
    forceUpload

    recordDownload

    public any recordDownload(string slug, [string version], [string APIToken=''])

    Tracks a download

    Parameters:
    slug
    version
    APIToken

    recordInstall

    public any recordInstall(string slug, [string version=''], [string APIToken=''])

    Tracks an install

    Parameters:
    slug
    version
    APIToken

    register

    public any register(string username, string password, string email, string fName, string lName, [string APIToken=''])

    Registers a new user in ForgeBox

    Parameters:
    username
    password
    email
    fName
    lName
    APIToken

    setAPIURL

    public any setAPIURL(any APIURL)

    Parameters:
    APIURL

    setCommandBoxlogger

    public any setCommandBoxlogger(any CommandBoxlogger)

    Parameters:
    CommandBoxlogger

    setConfigService

    public any setConfigService(any configService)

    Parameters:
    configService

    setEndpointName

    public any setEndpointName(any endpointName)

    Parameters:
    endpointName

    setEndpointURL

    public any setEndpointURL(any endpointURL)

    Parameters:
    endpointURL

    setProgressBar

    public any setProgressBar(any progressBar)

    Parameters:
    progressBar

    setProgressableDownloader

    public any setProgressableDownloader(any progressableDownloader)

    Parameters:
    progressableDownloader

    slugSearch

    public any slugSearch(string searchTerm, [string typeSlug=''], [string APIToken=''])

    Autocomplete for slugs

    Parameters:
    searchTerm
    typeSlug
    APIToken

    unpublish

    public any unpublish(string slug, [string version=''], string APIToken)

    Unpublishes a package

    Parameters:
    slug
    version
    APIToken

    whoami

    public any whoami(string APIToken)

    Look up user based on API Token

    Parameters:
    APIToken