Options
All
  • Public
  • Public/Protected
  • All
Menu

grunt-dojo2-extras

Index

Type aliases

OAuthScope

OAuthScope: "user" | "user:email" | "user:follow" | "public_repo" | "repo" | "repo_deployment" | "repo:status" | "delete_repo" | "notifications" | "gist" | "read:repo_hook" | "write:repo_hook" | "admin:repo_hook" | "admin:org_hook" | "read:org" | "write:org" | "admin:org" | "read:public_key" | "write:public_key" | "admin:public_key" | "read:gpg_key" | "write:gpg_key" | "admin:gpg_key"

GitHub OAuth scopes define permissions granted to a specific token

PublishMode

PublishMode: "publish" | "commit" | "skip"

Variables

decryptIvName

decryptIvName: "publish_deploy_iv" = "publish_deploy_iv"

the name of the environment variable holding the decryption iv value

decryptKeyName

decryptKeyName: "publish_deploy_key" = "publish_deploy_key"

the name of the environment variable holding the decryption key value

githubAuthName

githubAuthName: "GITHUB_AUTH" = "GITHUB_AUTH"

the name of the environment variable holding the github authentication for API calls

logger

logger: LoggerInstance = new Logger({level: 'info',transports: [new transports.Console({showLevel: false})]})

privateKeyName

privateKeyName: "PRIVATE_KEY" = "PRIVATE_KEY"

the name of the environment variable holding the private key to publish to GitHub

Functions

cleanupModuleMocks

  • cleanupModuleMocks(): void

commitMessage

  • commitMessage(): string

createDeployKey

  • createDeployKey(deployKeyFile?: string, encryptedKeyFile?: string): Promise<KeyPairFiles & object>

createHtmlApiMissingFilter

  • createHtmlApiMissingFilter(project: string, directory: string): TagFilter
  • Parameters

    • project: string

      project name

    • directory: string

      the base directory where html api docs are stored

    Returns TagFilter

    a filter for existing html api docs

createJsonApiMissingFilter

  • createJsonApiMissingFilter(project: string, directory: string): TagFilter
  • Parameters

    • project: string

      project name

    • directory: string

      the base directory where json api docs are stored

    Returns TagFilter

    a filter for existing json api docs

createKey

  • createKey(deployKeyFile?: string, keyComment?: string): Promise<KeyPairFiles>
  • Parameters

    • Default value deployKeyFile: string = env.keyFile()
    • Default value keyComment: string = "Automated Travis Deploy Key"

    Returns Promise<KeyPairFiles>

createVersionFilter

  • createVersionFilter(comp: string): TagFilter

currentBranch

  • currentBranch(): string

decryptData

  • decryptData(data: ReadableStream, key: string, iv: string): Decipher
  • Parameters

    • data: ReadableStream
    • key: string
    • iv: string

    Returns Decipher

decryptDeployKey

  • decryptDeployKey(encryptedFile?: string, key?: string, iv?: string, decryptedFile?: string): Promise<boolean>
  • decrypts a deployment key

    Parameters

    • Default value encryptedFile: string = env.encryptedKeyFile()
    • Default value key: string = process.env[env.decryptKeyName]
    • Default value iv: string = process.env[env.decryptIvName]
    • Default value decryptedFile: string = env.keyFile()

    Returns Promise<boolean>

    if decryption was carried out

encryptData

  • encryptData(data: ReadableStream, key?: string, iv?: string): EncryptResult
  • Parameters

    • data: ReadableStream
    • Default value key: string = randomUtf8(32)
    • Default value iv: string = randomUtf8(16)

    Returns EncryptResult

encryptedKeyFile

  • encryptedKeyFile(file?: string): any
  • Parameters

    • Default value file: string = keyFile()

    Returns any

    the name of the encrypted keyFile

equal

exec

  • exec(command: string, options?: ExecOptions): ChildProcess

getGithubSlug

  • getGithubSlug(options?: Options, grunt?: IGrunt): Slug

getHtmlApiPath

  • getHtmlApiPath(base: string, project: string, version: string): string
  • creates a path to HTML API docs

    Parameters

    • base: string
    • project: string
    • version: string

    Returns string

getJsonApiPath

  • getJsonApiPath(base: string, project: string, version: string): string
  • creates a path to JSON API docs

    Parameters

    • base: string
    • project: string
    • version: string

    Returns string

getTags

  • Get a list of GitHub tags that pass the supplied filters

    Parameters

    • repo: GitHub

      the GitHub repository

    • Default value filters: TagFilter[] = []

      Tag filters to apply to the tag

    Returns Promise<Tag[]>

    a list of tags

gitCommit

  • gitCommit(): string

githubAuth

  • githubAuth(authStr?: string): Auth
  • Parameters

    • Default value authStr: string = process.env[githubAuthName]

    Returns Auth

    OAuth credentials to be used in GitHub queries

hasGitCredentials

  • hasGitCredentials(keyFile?: undefined | string): boolean
  • Parameters

    • Optional keyFile: undefined | string

      the filename of the key file to use for git credentials

    Returns boolean

    if the current environment will be able to run git commands requiring credentials

hasKeyFile

  • hasKeyFile(file?: string): boolean
  • Parameters

    • Default value file: string = keyFile()

      the filename of the key file used ssh+git permissions

    Returns boolean

    if the defined key file exists

hexoRootOverride

  • hexoRootOverride(): any

initAuthorization

  • initAuthorization(repo: GitHub, travis?: Travis): Promise<void>

initDeployment

  • initDeployment(repo: GitHub, travis?: Travis, options?: Options): Promise<void>

installDependencies

  • installDependencies(dir: string): Promise<string>

isCronJob

  • isCronJob(): boolean

isRunningOnTravis

  • isRunningOnTravis(): boolean

keyFile

  • keyFile(): string

latestFilter

  • latestFilter(_tag: Tag, index: number, array: Tag[]): boolean
  • A filters only the latest

    Parameters

    • _tag: Tag
    • index: number

      the index of the tag

    • array: Tag[]

    Returns boolean

    if the tag is the latest

loadModule

  • loadModule<T>(require: NodeRequire, mid: string, mocks: any, returnDefault?: boolean): T
  • Type parameters

    • T

    Parameters

    • require: NodeRequire
    • mid: string
    • mocks: any
    • Default value returnDefault: boolean = true

    Returns T

makeTempDirectory

  • makeTempDirectory(base: string, prefix?: string): string
  • Parameters

    • base: string
    • Default value prefix: string = "tmp-"

    Returns string

promiseExec

  • promiseExec(command: string, options?: ExecOptions): Promise<ChildProcess>

promiseSpawn

  • promiseSpawn(command: string, args: string[], options?: SpawnOptions): Promise<ChildProcess>

promisify

  • promisify(proc: ChildProcess): Promise<ChildProcess>

publish

  • publish(options: Options): Promise<void>

publishMode

repositorySource

  • repositorySource(): string

setupWrappedAsyncStub

  • setupWrappedAsyncStub(this: any, stub: SinonStub, dfd: Deferred<any>, callback: function): void
  • Parameters

    • this: any
    • stub: SinonStub
    • dfd: Deferred<any>
    • callback: function
        • (): any
        • Returns any

    Returns void

spawn

  • spawn(command: string, args: string[], options?: SpawnOptions): ChildProcess

sync

  • sync(options: Options): Promise<void>

throwWithError

  • throwWithError(errorMessage?: string): (Anonymous function)
  • Parameters

    • Default value errorMessage: string = "Unexpected code path"

    Returns (Anonymous function)

tmpDirectory

  • tmpDirectory(): string

tmpFile

  • tmpFile(name?: string): string

toString

  • toString(stream: Readable): Promise<string>

typedoc

wrapAsyncTask

  • wrapAsyncTask<T>(task: function): (Anonymous function)
  • Type parameters

    • T

    Parameters

    • task: function
        • (this: IMultiTask<T>): Promise<any>
        • Parameters

          • this: IMultiTask<T>

          Returns Promise<any>

    Returns (Anonymous function)

Generated using TypeDoc