commandbox.system.endpoints

Class ForgeBox

lucee.Component
    extended by commandbox.system.endpoints.ForgeBox
All Implemented Interfaces:
IEndpointInteractive

Copyright Since 2014 CommandBox by Ortus Solutions, Corp www.coldbox.org | www.ortussolutions.com I am the ForgeBox endpoint. I wrap CFML's coolest package repository EVER!

Class Attributes:
  • synchronized : false
  •  
  • accessors : true
  •  
  • persistent : false
  •  
  • author : Brad Wood, Luis Majano, Denny Valliant
  •  
    Property Summary
    type property default serializable required
    any CR


    • access = public
    • returntype = any
    • inject = CR@constants
    true false
    any artifactService


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


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


    • access = public
    • returntype = any
    • inject = logbox:logger:console
    true false
    any endpointService


    • access = public
    • returntype = any
    • inject = endpointService
    true false
    any fileEndpoint


    • access = public
    • returntype = any
    • inject = commandbox.system.endpoints.File
    true false
    any fileSystemUtil


    • access = public
    • returntype = any
    • inject = FileSystem
    true false
    any forgeBox


    • access = public
    • returntype = any
    • inject = ForgeBox
    true false
    any lexEndpoint


    • access = public
    • returntype = any
    • inject = commandbox.system.endpoints.Lex
    true false
    string namePrefixes


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


    • access = public
    • returntype = any
    • inject = packageService
    true false
    any pathPatternMatcher


    • access = public
    • returntype = any
    • inject = provider:pathPatternMatcher@globber
    true false
    any semanticVersion


    • access = public
    • returntype = any
    • inject = provider:semanticVersion@semver
    true false
    any tempDir


    • access = public
    • returntype = any
    • inject = tempDir@constants
    true false
    any wirebox


    • access = public
    • returntype = any
    • inject = wirebox
    true false
    Constructor Summary
    init()
          Constructor.
    Method Summary
    string createUser(string username, string password, string email, string firstName, string lastName)
         Create a new user in ForgeBox.
    any createZipFromPath(string path)
    any findSatisfyingVersion(string slug, string version, [struct entryData])
         Figures out what version of a package would be installed with a given semver range without actually going through the installation.
    private array generateIgnorePatterns([any boxJSON])
    any getAPIToken()
         Returns the correct API token based on the name of this forgebox-based endpoint.
    any getAPITokens()
         Returns the struct of all logged in tokens based on the name of this forgebox-based endpoint.
    string getArtifactService()
    string getCR()
    string getConfigService()
    string getConsoleLogger()
    any getDefaultName(string package)
         Get default name for a package.
    string getEndpointService()
    string getFileEndpoint()
    string getFileSystemUtil()
    string getForgeBox()
    string getLexEndpoint()
    string getNamePrefixes()
    private any getPackage([any slug], [any version], [any verbose='false'])
         Get a package path location.
    string getPackageService()
    string getPathPatternMatcher()
    string getSemanticVersion()
    string getTempDir()
    any getUpdate(string package, string version, [boolean verbose='false'])
         Get an update for a package.
    string getWirebox()
    string login(string userName, string password)
         Login a user into ForgeBox.
    any parseSlug(string package)
         Parses just the slug portion out of an endpoint ID.
    any parseVersion(string package)
         Parses just the version portion out of an endpoint ID.
    any publish(string path, [string zipPath=''], [boolean force='false'])
         Publish a package in ForgeBox.
    private array readGitIgnores()
    string resolvePackage(string package, [boolean verbose='false'])
         Resolve a package.
    any setArtifactService(any artifactService)
    any setCR(any CR)
    any setConfigService(any configService)
    any setConsoleLogger(any consoleLogger)
    any setDefaultAPIToken(string APIToken)
         Set the default APIToken to be used for this forgebox-based endpoint.
    any setEndpointService(any endpointService)
    any setFileEndpoint(any fileEndpoint)
    any setFileSystemUtil(any fileSystemUtil)
    any setForgeBox(any forgeBox)
    any setLexEndpoint(any lexEndpoint)
    any setNamePrefixes(string namePrefixes)
    any setPackageService(any packageService)
    any setPathPatternMatcher(any pathPatternMatcher)
    any setSemanticVersion(any semanticVersion)
    any setTempDir(any tempDir)
    any setWirebox(any wirebox)
    any storeAPIToken(string username, string APIToken)
         Store a new API Token.
    any unpublish(string path, [string version=''])
         Unpublish a package in ForgeBox.
     
    Methods inherited from class lucee.Component
    None

    Constructor Detail

    init

    public init()

    Constructor


    Property Detail

    CR

    property any CR

    Attributes:
    access - public
    required - false
    returntype - any
    inject - CR@constants
    serializable - true

    artifactService

    property any artifactService

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

    configService

    property any configService

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

    consoleLogger

    property any consoleLogger

    Attributes:
    access - public
    required - false
    returntype - any
    inject - logbox:logger:console
    serializable - true

    endpointService

    property any endpointService

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

    fileEndpoint

    property any fileEndpoint

    Attributes:
    access - public
    required - false
    returntype - any
    inject - commandbox.system.endpoints.File
    serializable - true

    fileSystemUtil

    property any fileSystemUtil

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

    forgeBox

    property any forgeBox

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

    lexEndpoint

    property any lexEndpoint

    Attributes:
    access - public
    required - false
    returntype - any
    inject - commandbox.system.endpoints.Lex
    serializable - true

    namePrefixes

    property string namePrefixes

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

    packageService

    property any packageService

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

    pathPatternMatcher

    property any pathPatternMatcher

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:pathPatternMatcher@globber
    serializable - true

    semanticVersion

    property any semanticVersion

    Attributes:
    access - public
    required - false
    returntype - any
    inject - provider:semanticVersion@semver
    serializable - true

    tempDir

    property any tempDir

    Attributes:
    access - public
    required - false
    returntype - any
    inject - tempDir@constants
    serializable - true

    wirebox

    property any wirebox

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

    Method Detail

    createUser

    public string createUser(string username, string password, string email, string firstName, string lastName)

    Create a new user in ForgeBox

    Specified by:
    createUser in interface IEndpointInteractive
    Parameters:
    username - ForgeBox username
    password - The password
    email - ForgeBox email
    firstName - First name
    lastName - Last Name
    Returns:
    The API Token of the registered user.

    createZipFromPath

    public any createZipFromPath(string path)

    Parameters:
    path

    findSatisfyingVersion

    public any findSatisfyingVersion(string slug, string version, [struct entryData])

    Figures out what version of a package would be installed with a given semver range without actually going through the installation.

    Parameters:
    slug - Slug of package
    version - Version range to satisfy
    entryData - Optional struct of entryData which skips the ForgeBox call.

    generateIgnorePatterns

    private array generateIgnorePatterns([any boxJSON])

    Parameters:
    boxJSON

    getAPIToken

    public any getAPIToken()

    Returns the correct API token based on the name of this forgebox-based endpoint


    getAPITokens

    public any getAPITokens()

    Returns the struct of all logged in tokens based on the name of this forgebox-based endpoint


    getArtifactService

    public string getArtifactService()


    getCR

    public string getCR()


    getConfigService

    public string getConfigService()


    getConsoleLogger

    public string getConsoleLogger()


    getDefaultName

    public any getDefaultName(string package)

    Get default name for a package

    Specified by:
    getDefaultName in interface IEndpoint
    Parameters:
    package - The package to resolve

    getEndpointService

    public string getEndpointService()


    getFileEndpoint

    public string getFileEndpoint()


    getFileSystemUtil

    public string getFileSystemUtil()


    getForgeBox

    public string getForgeBox()


    getLexEndpoint

    public string getLexEndpoint()


    getNamePrefixes

    public string getNamePrefixes()


    getPackage

    private any getPackage([any slug], [any version], [any verbose='false'])

    Get a package path location

    Parameters:
    slug - The package slug
    version - The package version
    verbose - Verbose flag or silent, defaults to false

    getPackageService

    public string getPackageService()


    getPathPatternMatcher

    public string getPathPatternMatcher()


    getSemanticVersion

    public string getSemanticVersion()


    getTempDir

    public string getTempDir()


    getUpdate

    public any getUpdate(string package, string version, [boolean verbose='false'])

    Get an update for a package

    Specified by:
    getUpdate in interface IEndpoint
    Parameters:
    package - The package name
    version - The package version
    verbose - Verbose flag or silent, defaults to false
    Returns:
    struct { isOutdated, version }

    getWirebox

    public string getWirebox()


    login

    public string login(string userName, string password)

    Login a user into ForgeBox

    Specified by:
    login in interface IEndpointInteractive
    Parameters:
    userName - The username
    password - The password to use
    Returns:
    The API Token of the registered user.

    parseSlug

    public any parseSlug(string package)

    Parses just the slug portion out of an endpoint ID

    Parameters:
    package - The full endpointID like foo@1.0.0

    parseVersion

    public any parseVersion(string package)

    Parses just the version portion out of an endpoint ID

    Parameters:
    package - The full endpointID like foo@1.0.0

    publish

    public any publish(string path, [string zipPath=''], [boolean force='false'])

    Publish a package in ForgeBox

    Specified by:
    publish in interface IEndpointInteractive
    Parameters:
    path - The path to publish
    zipPath
    force

    readGitIgnores

    private array readGitIgnores()


    resolvePackage

    public string resolvePackage(string package, [boolean verbose='false'])

    Resolve a package

    Specified by:
    resolvePackage in interface IEndpoint
    Parameters:
    package - The package to resolve
    verbose - Verbose flag or silent, defaults to false

    setArtifactService

    public any setArtifactService(any artifactService)

    Parameters:
    artifactService

    setCR

    public any setCR(any CR)

    Parameters:
    CR

    setConfigService

    public any setConfigService(any configService)

    Parameters:
    configService

    setConsoleLogger

    public any setConsoleLogger(any consoleLogger)

    Parameters:
    consoleLogger

    setDefaultAPIToken

    public any setDefaultAPIToken(string APIToken)

    Set the default APIToken to be used for this forgebox-based endpoint

    Parameters:
    APIToken

    setEndpointService

    public any setEndpointService(any endpointService)

    Parameters:
    endpointService

    setFileEndpoint

    public any setFileEndpoint(any fileEndpoint)

    Parameters:
    fileEndpoint

    setFileSystemUtil

    public any setFileSystemUtil(any fileSystemUtil)

    Parameters:
    fileSystemUtil

    setForgeBox

    public any setForgeBox(any forgeBox)

    Parameters:
    forgeBox

    setLexEndpoint

    public any setLexEndpoint(any lexEndpoint)

    Parameters:
    lexEndpoint

    setNamePrefixes

    public any setNamePrefixes(string namePrefixes)

    Parameters:
    namePrefixes

    setPackageService

    public any setPackageService(any packageService)

    Parameters:
    packageService

    setPathPatternMatcher

    public any setPathPatternMatcher(any pathPatternMatcher)

    Parameters:
    pathPatternMatcher

    setSemanticVersion

    public any setSemanticVersion(any semanticVersion)

    Parameters:
    semanticVersion

    setTempDir

    public any setTempDir(any tempDir)

    Parameters:
    tempDir

    setWirebox

    public any setWirebox(any wirebox)

    Parameters:
    wirebox

    storeAPIToken

    public any storeAPIToken(string username, string APIToken)

    Store a new API Token

    Parameters:
    username
    APIToken

    unpublish

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

    Unpublish a package in ForgeBox

    Specified by:
    unpublish in interface IEndpointInteractive
    Parameters:
    path - The path to publish
    version - The version to publish