Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ApiMethodArguments

Arguments for an API method.

Hierarchy

Index

Properties

Optional compress

compress: boolean

Compress response (if possible) or not.

Optional content

content: any

The content to use instead of 'ApiMethodArguments.response'.

deploy

deploy: function

Deploys one or more file to a list of targets.

This requires 'extension.deploy.filesTo' command as available in extensions like 'vs-deploy' s. https://github.com/mkloubert/vs-deploy

param

One or more file to deploy.

param

One or more target (name) to deploy to.

returns

The promise.

Type declaration

    • (files: string | string[], targets: string | string[]): Promise<any>
    • Parameters

      • files: string | string[]
      • targets: string | string[]

      Returns Promise<any>

doNotEmitHook

doNotEmitHook: boolean

Do NOT emit hook automatically on success?

emitHook

emitHook: function

Emits hook(s).

param

The custom name of the hook.

param

One or more argument for the hook(s).

returns

Hooks were emitted or not.

Type declaration

    • (hook?: string, args?: any[]): boolean
    • Parameters

      • Optional hook: string
      • Optional args: any[]

      Returns boolean

encoding

encoding: string

The text encoding to use.

endpoint

endpoint: object

Information about the endpoint.

Type declaration

  • arguments: string[]

    The (decoded) parts of the URL path beside the endpoint name.

  • isRoot: boolean

    Indicates if this represents the "root" endpoint or not.

  • name: string

    The lower case name of the endpoint.

executeBuildIn

executeBuildIn: function

Executes a build method.

param

The custom endpoint to use.

param

The custom arguments to use.

returns

The promise.

Type declaration

extension

extension: vscode.ExtensionContext

The extension context.

getBody

getBody: function

Gets the body.

returns

The promise.

Type declaration

    • (): PromiseLike<Buffer>
    • Returns PromiseLike<Buffer>

getString

getString: function

Gets the body as string.

param

The custom text encoding to use.

returns

The promise.

Type declaration

    • (encoding?: string): PromiseLike<string>
    • Parameters

      • Optional encoding: string

      Returns PromiseLike<string>

globalState

globalState: Object

Gets the object to share data between all scripts of this type.

globals

globals: any

Gets the global data from the settings.

headers

headers: object

The response headers to send.

Type declaration

  • [key: string]: any

log

log: function

Logs a message.

param

The message to log.

chainable

Type declaration

openHtml

openHtml: function

Opens a HTML document in a new tab.

param

The HTML document (source code).

param

The custom title for the tab.

param

The custom ID for the document in the storage.

returns

The promise.

Type declaration

    • (html: string, title?: string, id?: any): PromiseLike<any>
    • Parameters

      • html: string
      • Optional title: string
      • Optional id: any

      Returns PromiseLike<any>

options

options: any

Options for the execution.

outputChannel

outputChannel: vscode.OutputChannel

The output channel that can be used.

package

package: PackageFile

Information about the extension.

parameters

parameters: object

The decoded URL parameters.

Type declaration

  • [name: string]: string

path

path: string

The path.

request

The request context.

require

require: function

Loads a module from the script / extension context.

Type declaration

    • (id: string): any
    • Parameters

      • id: string

      Returns any

response

response: ApiResponse

The response data.

sendError

sendError: function

Sends an error response.

param

The error.

chainable

Type declaration

sendForbidden

sendForbidden: function

Sets up the response for a 403 HTTP response.

chainable

Type declaration

sendMethodNotAllowed

sendMethodNotAllowed: function

Sets up the response for a 405 HTTP response.

chainable

Type declaration

sendNotFound

sendNotFound: function

Sets up the response for a 404 HTTP response.

chainable

Type declaration

sendResponse

sendResponse: function

Sets up a generic response.

param

The status code.

chainable

Type declaration

setContent

setContent: function

Sets the content of 'ApiMethodArguments.content'.

param

The new content to set.

param

The content / mime type.

chainable

Type declaration

state

state: any

Stores a permanent value for the current session for THIS script.

Optional statusCode

statusCode: number

The status code.

url

url: Url

The underlying URL.

whiteboard

Gets the underlying whiteboard (repository).

workspaceState

workspaceState: Object

Gets the workspace wide object to share data, between ALL scripts e.g.

write

write: function

Writes data to the response.

chainable

Type declaration

Methods

getJSON

  • getJSON<T>(encoding?: string): PromiseLike<T>
  • Gets the body as parsed JSON object.

    Type parameters

    • T

    Parameters

    • Optional encoding: string

    Returns PromiseLike<T>

    The promise.

Generated using TypeDoc