# TypeScript

Reusable TypeScript transformation. Duplicate it in the library and define your own sockets.

Canonical URL: https://opennodeflow.dev/wiki/reference-app-core-core-code/
JSON reference: https://opennodeflow.dev/wiki/reference-app-core-core-code/index.json
Source snapshot: 2026-10-23

# TypeScript

A starting point for a reusable TypeScript/JavaScript transformation. The shipped body logs its input and returns it unchanged. Duplicate it in the shared library, define meaningful sockets, and replace the body for a real transformation.

## Sockets and configuration
- **exec** (control, Execute): optional execution dependency selected by an upstream route.
- **value** (any, optional): data to pass through.
- **result** (any): unchanged inputs.value.
- **next** (control): automatic success route.
- No asset-specific configuration schema.

## Example
For a custom doubler, add a required number input named value and number output named result, then use `return {result: inputs.value * 2};`. Enter an async function body, not a module/exported function. TypeScript syntax is transpiled; runtime sockets/types provide data validation.

## Behavior and boundaries
The original logs `Received` plus the input. Avoid feeding credentials or sensitive full payloads into it just for experimentation. An absent optional input may disappear from serialized result; a consumer wired to a missing output skips. A wired Execute input gates this node; leaving it unwired lets data dependencies/root eligibility determine execution.

The original performs no network request, secret lookup or durable-state update. Custom code can use native fetch, `context.input`, state, secrets and routes under the host's trusted execution permissions. Errors/timeouts fail the node unless handled by a deliberately designed asset; this example has no error route. Publishing preserves existing graph pins until an explicit upgrade.

## Catalog identity

| Field | Value |
| --- | --- |
| Source key | `app.core.core.code` |
| Kind | node |
| Family | app-core |
| Pack | See library discovery |

[Integration guide](/wiki/first-workflow/) · [Browse the catalog](/wiki/integration-catalog/)

## Inputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `exec` | Execute | control | No |  |
| `value` | Value | any | No |  |

## Outputs

| Socket ID | Label | Type | Required | Meaning |
| --- | --- | --- | --- | --- |
| `next` | Next | control | No |  |
| `result` | Result | any | No |  |

## Configuration schema


```json
{}
```





## Source and installed versions

This reference describes the maintained source catalog snapshot, not a live export of your installation. Published definitions use immutable versions; installed graphs retain their exact pins. Discover and read the installed definition and selected version before wiring it. See [versioning](/wiki/versioning/), [connections](/wiki/connections/) and [integration setup](/wiki/integration-setup/).

---

## Documentation provenance

- `../OpenNodeFlow-Library/work/catalog-all.mjs`
- `../OpenNodeFlow-Library/work/azure-pack-consolidation-20261022/catalog-policy.mjs`
- `../OpenNodeFlow-Library/work/developer-packs-20261022/catalog.mjs`
- `shared/seed.ts`
- `shared/storage-library.ts`
- `shared/variable-library.ts`
- `shared/control-flow.ts`
- `shared/remote-routes.ts`
- `server/runtime-library.ts`
- `shared/error-library.ts`
- `shared/storage-model.ts`
- `shared/builtin-documentation.ts`

This page describes maintained source, not a live inventory or an authorization to perform actions.
