src/nodes/
directory with the name you provided.
NanoService
base class from the @nanoservice-ts/runner
package. Here’s the template generated by the CLI:
InputType
: Defines the structure of data the Node expects to receive.OutputType
for better type safety of the response data.Context
object and the typed inputs.NanoServiceResponse
containing either success data or an error.GlobalError
class.config.json
file that defines its metadata, input/output schemas, and examples:
package.json
file with dependencies and scripts:
helper.ts
file provides a mock Context object for testing:
index.test.ts
file contains basic tests for your Node:
package.json
:
ctx
) object is a crucial part of the Blok framework. It’s passed to each Node’s handle
method and provides:
GlobalError
class for standardized error reporting:
src/Nodes.ts
file:
@nanoservice-ts/api-call
:
@nanoservice-ts/if-else
:
GlobalError
class for standardized error reporting.