ProtectedconstructorCreate an Adapter.
The blueprint to create the adapter.
Protected ReadonlyblueprintProtected ReadonlyhooksProtected ReadonlymiddlewareProtected ReadonlyresolvedProtectedapplyApply the resolved response as the process exit code (POSIX-normalized).
The raw response (an HTTP-ish status/exit code).
ProtectedbuildBuild the raw response.
The event context.
OptionaleventHandler: AdapterEventHandlerType<IncomingEvent, OutgoingResponse>
The event handler to be run.
The raw response wrapper.
ProtectedeventProcesses an incoming Node Cli event.
This method transforms the raw Node Cli event into a Stone.js IncomingEvent,
processes it through the pipeline, and generates a RawResponse to send back.
The raw Node Cli event to be processed.
The Node Cli execution context for the event.
A promise resolving to the processed RawResponse.
ProtectedexecuteExecute the event handler lifecycle hooks.
The hook to execute.
The event handler to be run.
ProtectedexecuteExecute adapter lifecycle hooks.
The hook's name.
Optionalcontext: NodeCliAdapterContext
The event context.
Optionalerror: any
The error to handle.
ProtectedhandleHandle error.
The error to handle.
The event context.
The raw response.
ProtectedhandleHandle the event.
The event context.
The event handler to be run.
The raw response wrapper.
ProtectedmakeCreate pipeline options for the Adapter.
The pipeline options for transforming the event.
ProtectedonProtectedresolveGet the error handler for the given error.
The error to get the handler for.
The error handler.
ProtectedresolveExecutes the adapter and provides an Node Cli-compatible handler function.
The run method processes events, manages context, and returns the appropriate response.
The type representing the Node Cli event handler function.
A promise resolving to the Node Cli handler function.
ProtectedsendSend the raw event through the destination.
The event context.
The event handler to be run.
Platform-specific response.
ProtectedtoNormalize an internal response code to a POSIX exit code (0-255).
Success (0 or a 2xx status) → 0; a "command not found" marker → 127; anything else that is not a finite in-range code → 1 (general failure). Codes already in the 0-255 range pass through so a command can return a precise POSIX code.
The raw response code.
The POSIX exit code.
ProtectedvalidateValidate the context and event handler.
The context to validate.
The event handler to validate.
StaticcreateCreates an instance of the NodeCliAdapter.
The application blueprint.
A new instance of NodeCliAdapter.
Node Cli Adapter for Stone.js.
The
NodeCliAdapterprovides seamless integration between Stone.js applications and the Node Cli environment. It processes incoming events from Node Cli, transforms them intoIncomingEventinstances, and returns aRawResponse.This adapter ensures compatibility with Node Cli's execution model and abstracts the event handling process for Stone.js developers.
Template: NodeCliEvent
The type of the raw event received from Node Cli.
Template: RawResponse
The type of the response to send back to Node Cli.
Template: NodeCliExecutionContext
The Node Cli execution context type.
Template: IncomingEvent
The type of the processed incoming event.
Template: IncomingEventOptions
Options used to create an incoming event.
Template: OutgoingResponse
The type of the outgoing response after processing.
Template: NodeCliAdapterContext
Context type specific to the adapter.
Example
See
Stone.js Documentation