@dynatrace/js-runtime
Version:
This package provides the Dynatrace JavaScript runtime used by the [Dynatrace App Toolkit](https://www.npmjs.com/package/dt-app).
61 lines (58 loc) • 1.86 kB
TypeScript
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
/** Specifies how the inspector server can be connected to. */
export const enum InspectorType {
/**
* An inspector that connects to VS Code.
*
* Connection details are read from the environment variable `VSCODE_INSPECTOR_OPTIONS`.
* Refer to <https://bitbucket.lab.dynatrace.org/projects/APPFW/repos/runtime/browse/proposals/2024_01_09_debugger_improvements.md>
* for more details.
*/
VsCode = 0,
/**
* An inspector that can be connected to with Google Chrome on `chrome://inspect`
* (and other clients that support the Chrome DevTools Protocol)
*/
Chrome = 1
}
/** Checks if this process is a debuggee running inside VS Code. */
export declare function isCurrentProcessDebuggedByVscode(): boolean
/**
* Starts an inspector server of the given type.
*
* If you're using `InspectorType.VsCode`, you should only call this function after checking
* whether `isCurrentProcessDebuggedByVsCode()` returns `true`.
*/
export declare function startInspectorServer(inspectorType: InspectorType): Promise<void>
export declare function executeFunctionLocal(task: ExecutionTask): Promise<any | null>
export interface ExecutionTask {
cwd: string
urlPathname: string
scriptName: string
code: Buffer
payload?: string
config: ContextConfiguration
sourceMap?: Buffer
/**
* The maximum execution time in seconds before the runtime is terminated
* A default timeout of 60 seconds is used if this property isn't set.
*/
timeoutSeconds?: number
}
export interface ContextConfiguration {
appId: string
appName: string
appVersion: string
devProxyUrl: string
environmentUrl: string
token: string
tenantId?: string
userDetails: UserDetailsNapi
}
export interface UserDetailsNapi {
id: string
name: string
email: string
}