{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "reference-app-core-core-code",
  "title": "TypeScript",
  "section": "Library asset reference",
  "description": "Reusable TypeScript transformation. Duplicate it in the library and define your own sockets.",
  "kind": "node",
  "url": "/wiki/reference-app-core-core-code/",
  "markdown": "/wiki/reference-app-core-core-code/index.md",
  "json": "/wiki/reference-app-core-core-code/index.json",
  "headings": [
    {
      "id": "sockets-and-configuration",
      "title": "Sockets and configuration",
      "depth": 2
    },
    {
      "id": "example",
      "title": "Example",
      "depth": 2
    },
    {
      "id": "behavior-and-boundaries",
      "title": "Behavior and boundaries",
      "depth": 2
    },
    {
      "id": "catalog-identity",
      "title": "Catalog identity",
      "depth": 2
    },
    {
      "id": "inputs",
      "title": "Inputs",
      "depth": 2
    },
    {
      "id": "outputs",
      "title": "Outputs",
      "depth": 2
    },
    {
      "id": "configuration-schema",
      "title": "Configuration schema",
      "depth": 2
    },
    {
      "id": "source-and-installed-versions",
      "title": "Source and installed versions",
      "depth": 2
    }
  ],
  "sources": [
    "../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"
  ],
  "family": "app-core",
  "contract": {
    "key": "app.core.core.code",
    "slug": "app-core-core-code",
    "name": "TypeScript",
    "kind": "node",
    "family": "app-core",
    "packId": null,
    "category": "Code",
    "description": "Reusable TypeScript transformation. Duplicate it in the library and define your own sockets.",
    "inputs": [
      {
        "id": "exec",
        "name": "Execute",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "value",
        "name": "Value",
        "type": "any",
        "typeName": "Any",
        "required": false
      }
    ],
    "outputs": [
      {
        "id": "next",
        "name": "Next",
        "type": "control",
        "typeName": "Control",
        "required": false
      },
      {
        "id": "result",
        "name": "Result",
        "type": "any",
        "typeName": "Any",
        "required": false
      }
    ],
    "configSchema": {},
    "documentation": "# TypeScript\n\nA 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.\n\n## Sockets and configuration\n- **exec** (control, Execute): optional execution dependency selected by an upstream route.\n- **value** (any, optional): data to pass through.\n- **result** (any): unchanged inputs.value.\n- **next** (control): automatic success route.\n- No asset-specific configuration schema.\n\n## Example\nFor 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.\n\n## Behavior and boundaries\nThe 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.\n\nThe 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.",
    "tags": [
      "builtin",
      "node"
    ],
    "source": "app-builtin-catalog"
  }
}
