{
  "schemaVersion": 1,
  "snapshotDate": "2026-10-23",
  "slug": "reference-app-storage-storage-codec-options-encode",
  "title": "Storage Options Encode",
  "section": "Library asset reference",
  "description": "Encode storage options with named typed sockets.",
  "kind": "node",
  "url": "/wiki/reference-app-storage-storage-codec-options-encode/",
  "markdown": "/wiki/reference-app-storage-storage-codec-options-encode/index.md",
  "json": "/wiki/reference-app-storage-storage-codec-options-encode/index.json",
  "headings": [
    {
      "id": "storage-options-encode",
      "title": "Storage Options Encode",
      "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-storage",
  "contract": {
    "key": "app.storage.storage.codec.options.encode",
    "slug": "app-storage-storage-codec-options-encode",
    "name": "Storage Options Encode",
    "kind": "node",
    "family": "app-storage",
    "packId": null,
    "category": "Storage codecs",
    "description": "Encode storage options with named typed sockets.",
    "inputs": [
      {
        "id": "rest",
        "name": "Rest",
        "type": "storage.type.options-rest",
        "typeName": "Storage Options Rest",
        "typeKey": "app.storage.storage.type.options-rest",
        "typeVersion": 1,
        "required": true
      },
      {
        "id": "item",
        "name": "Item",
        "type": "storage.type.option",
        "typeName": "Storage Option",
        "typeKey": "app.storage.storage.type.option",
        "typeVersion": 1,
        "required": false
      },
      {
        "id": "index",
        "name": "Index",
        "type": "number",
        "typeName": "Number",
        "required": false
      },
      {
        "id": "count",
        "name": "Count",
        "type": "number",
        "typeName": "Number",
        "required": false
      }
    ],
    "outputs": [
      {
        "id": "value",
        "name": "Value",
        "type": "storage.type.options",
        "typeName": "Storage Options",
        "typeKey": "app.storage.storage.type.options",
        "typeVersion": 1,
        "required": true
      }
    ],
    "configSchema": {},
    "documentation": "## Storage Options Encode\n\nConstructs the Storage Options contract.\n\nInputs: `rest` (storage.type.options-rest, required), `item` (storage.type.option, optional), `index` (number, optional), `count` (number, optional).\n\nOutputs: `value` (storage.type.options, required).\n\nDecode selects `config.index` (default 0), returning optional item, the remaining list, selected index and original count. Empty lists use index 0 and omit item. Encode inserts an optional item at index into rest and validates an optional count.\n\nPure transformation: no network calls, storage writes, namespace selection or persistent side effects. Codecs preserve explicitly present null values. A missing optional output stays absent; connecting that output to a dependent node can skip the dependent node. Invalid socket values fail schema validation.",
    "tags": [
      "builtin",
      "codec"
    ],
    "source": "app-builtin-catalog"
  }
}
