{"_id":"@abeyjs/openapi","_rev":"3-d577434135896b0743f2f87fd6c44b41","name":"@abeyjs/openapi","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@abeyjs/openapi","version":"0.1.0","license":"MIT","_id":"@abeyjs/openapi@0.1.0","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"5521f68919444fc219928b9b50d766335576228a","tarball":"https://registry.npmjs.org/@abeyjs/openapi/-/openapi-0.1.0.tgz","fileCount":38,"integrity":"sha512-qkJm0ihaxWuMclA6QdpQ8vp1LmXPemY84nPrdCG5c2xeQ8ltaEZRAAkMX8FgKs/55yTTMIheD4mFg4i9TgyG7w==","signatures":[{"sig":"MEQCICRc4T7xrRRj2p5QDV4Kzd9rzbFg8L/n8bChlAkJwzoqAiBCSzqhzhmFM5+9RHoCfqyfckLJv7Hn31JerZSdSYyMCA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114652},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"24fe5ea792f5be4e8facf7c820025f89265c1467","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"10.8.2","description":"Browser-oriented **glue** between an **OpenAPI document** (`Record<string, unknown>` — typically parsed JSON) and **`OmegaRuntime`**: discovers collection paths that look like REST lists (**GET + POST**), builds **`ListViewDef` / `FormViewDef`** + a **Zod","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.24.0","@abeyjs/core":"0.1.0","@abeyjs/http":"0.1.0","@abeyjs/view":"0.1.0","@abeyjs/state":"0.1.0","@abeyjs/uikit":"0.1.0","@abeyjs/agents":"0.1.0","@abeyjs/runtime":"0.1.0","@abeyjs/validation":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/openapi_0.1.0_1777685078935_0.8721238807782989","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@abeyjs/openapi","version":"0.1.1","license":"MIT","_id":"@abeyjs/openapi@0.1.1","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"dist":{"shasum":"a98a8a6f7379014efc9c120acb01ed9aae1078d4","tarball":"https://registry.npmjs.org/@abeyjs/openapi/-/openapi-0.1.1.tgz","fileCount":38,"integrity":"sha512-VZRJguqoNwo+YlRBicfq8TrUguU6GCEfuZ9H8RmCc8BXoIwzpEG937zoUN+tACJxDQocksQFKjJrtxNWR/OO7g==","signatures":[{"sig":"MEQCICf6fkQy97BHzmztufngEuJ0HR6alT/1Mab3OpsLYxrHAiA2Jp34g3WLVeM27yoy2NHK7FpDmHnm/byh5nlmhep8aA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114652},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8e89473e70d292931fe54ab9e184c613a03528d3","scripts":{"build":"tsc -p tsconfig.json"},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"_npmVersion":"10.8.2","description":"Browser-oriented **glue** between an **OpenAPI document** (`Record<string, unknown>` — typically parsed JSON) and **`OmegaRuntime`**: discovers collection paths that look like REST lists (**GET + POST**), builds **`ListViewDef` / `FormViewDef`** + a **Zod","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","dependencies":{"zod":"^3.24.0","@abeyjs/core":"0.1.0","@abeyjs/http":"0.1.0","@abeyjs/view":"0.1.1","@abeyjs/state":"0.1.0","@abeyjs/uikit":"0.1.0","@abeyjs/agents":"0.1.0","@abeyjs/runtime":"0.1.0","@abeyjs/validation":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/openapi_0.1.1_1777734439154_0.649704774857446","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@abeyjs/openapi","version":"0.1.2","license":"MIT","publishConfig":{"access":"public"},"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc -p tsconfig.json"},"dependencies":{"@abeyjs/agents":"0.1.1","@abeyjs/core":"0.1.1","@abeyjs/runtime":"0.1.1","@abeyjs/state":"0.1.1","@abeyjs/http":"0.1.1","@abeyjs/uikit":"0.1.1","@abeyjs/validation":"0.1.1","@abeyjs/view":"0.1.2","zod":"^3.24.0"},"devDependencies":{"typescript":"^5.7.0"},"_id":"@abeyjs/openapi@0.1.2","gitHead":"8e89473e70d292931fe54ab9e184c613a03528d3","description":"Browser-oriented **glue** between an **OpenAPI document** (`Record<string, unknown>` — typically parsed JSON) and **`OmegaRuntime`**: discovers collection paths that look like REST lists (**GET + POST**), builds **`ListViewDef` / `FormViewDef`** + a **Zod","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-7e25Qw5Yp4dkW9Px/K6/cQnraEghz4b28GqYv/T7yEONk8yy4SsmdKpHWzDApIyuSBTfcdQ4K0/uOWcoV+Du7w==","shasum":"0d3b1c06f1f7aeecf13626f3dd0dc884efffda78","tarball":"https://registry.npmjs.org/@abeyjs/openapi/-/openapi-0.1.2.tgz","fileCount":20,"unpackedSize":61944,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC4FpZTS+6AJeRa2E8LcjUVxTNgMlG1nqfqYAacSi/hawIhAPBUWGwQ07AFZSgPYNqjXGWFxo30cAJg/Bp50bQNYlWE"}]},"_npmUser":{"name":"abeyjs","email":"abeyjs98@gmail.com"},"directories":{},"maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/openapi_0.1.2_1777736172057_0.006643272158384894"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-02T01:24:38.867Z","modified":"2026-05-02T15:36:12.320Z","0.1.0":"2026-05-02T01:24:39.085Z","0.1.1":"2026-05-02T15:07:19.396Z","0.1.2":"2026-05-02T15:36:12.206Z"},"license":"MIT","description":"Browser-oriented **glue** between an **OpenAPI document** (`Record<string, unknown>` — typically parsed JSON) and **`OmegaRuntime`**: discovers collection paths that look like REST lists (**GET + POST**), builds **`ListViewDef` / `FormViewDef`** + a **Zod","maintainers":[{"name":"abeyjs","email":"abeyjs98@gmail.com"}],"readme":"# `@abeyjs/openapi`\r\n\r\nBrowser-oriented **glue** between an **OpenAPI document** (`Record<string, unknown>` — typically parsed JSON) and **`OmegaRuntime`**: discovers collection paths that look like REST lists (**GET + POST**), builds **`ListViewDef` / `FormViewDef`** + a **Zod** row schema, registers a **`DynamicCrudAgent`** with CRUD intents, and optionally **`mountOpenApiCrudView`** renders list + form + trace panel.\r\n\r\nHeavy lifting for **workflow + codegen lives in `@abeyjs/cli`** (`abeyjs connect`, `abeyjs generate views`, …). This package is what running apps **`import`** at runtime.\r\n\r\n---\r\n\r\n## Typical stack\r\n\r\n```\r\nOpenAPI JSON  →  discoverFirstCrud / discoverAllCrud  →  DiscoveredCrud\r\n                     ↓\r\n        registerOpenApiCrud(runtime, spec, http?)   →  DynamicCrudAgent + intents …/List, …/Create, …\r\n                     ↓\r\n        mountOpenApiCrudView({ root, agent, discovered, intents… })   →  DOM\r\n```\r\n\r\n **`OmegaHttp`** from `@abeyjs/http` is optional; omit it only when you rely on **`useMemoryOnApiFailure`** or purely local mocks.\r\n\r\n---\r\n\r\n## Public API (see `src/index.ts`)\r\n\r\n| Export | Role |\r\n|--------|------|\r\n| **`discoverFirstCrud`**, **`discoverAllCrud`** | Parse spec → **`DiscoveredCrud`** (path, entity name, list/form defs, Zod, row key, optional item/update/delete metadata, pagination hints). |\r\n| **`registerOpenApiCrud`**, **`registerWithDiscovered`**, **`registerOpenApiAllCrud`** | Register **`DynamicCrudAgent`** + **`Entity/List`**, **`Entity/Create`**, optional **`Update`** / **`Delete`** intents. |\r\n| **`DynamicCrudAgent`**, **`DynamicCrudViewState`**, **`OpenApiRow`** | Stateful agent: loads list (server paging when configured), applies create/update/delete intents, drives form validation from Zod. |\r\n| **`mountOpenApiCrudView`** | Mounts list + form + optional HTTP trace strip to a **`root` HTMLElement`. |\r\n| **`jsonObjectSchemaToZod`**, **`guessRowKeyFromSchema`** | Low-level JSON Schema → Zod for CRUD item rows (flat scalars + enums). |\r\n| **`OpenApiCrudListBehaviorOverrides`** | Type for advanced list behaviour hints (from **`crud-view-config-types.ts`**). |\r\n\r\n---\r\n\r\n## Discovery heuristics (`discover-crud.ts`)\r\n\r\n- Looks for **collection** paths where **GET** returns an array (or `data` / `items` / `results` / `value` wrapping an array) and **POST** accepts a JSON body.\r\n- **`$ref` / `components.schemas`** resolved via **`derefNode`** (`refs.ts`).\r\n- Sibling **`{id}`**-style item routes unlock **update** (PUT/PATCH) and **delete** when present in the spec.\r\n- Entity **PascalCase** name is derived from path segments (see **`pathToEntityPascal`**).\r\n\r\nWhen the spec does not match these patterns, discovery returns an **error** string or an **empty** array (`discoverAllCrud`).\r\n\r\n---\r\n\r\n## Intents & agent\r\n\r\nFor entity **`Product`** (example):\r\n\r\n| Intent | When registered |\r\n|--------|-----------------|\r\n| **`Product/List`** | `agent.loadList()` |\r\n| **`Product/Create`** | `applyCreateIntent(row)` |\r\n| **`Product/Update`** | If update path exists |\r\n| **`Product/Delete`** | If delete operation exists |\r\n\r\n**`registerWithDiscovered`** throws if `registerAgent` receives a channel different from **`runtime.channel`** (guards mis-wired runtimes).\r\n\r\n---\r\n\r\n## `mountOpenApiCrudView`\r\n\r\nExpects an **already registered** agent and the **`DiscoveredCrud`** + intent name strings returned from registration. Options include **`showToolbar`**, **`showTrace`**, **`showFlowMessage`** (defaults lean toward **on** except where noted in source).\r\n\r\nUI labels in the default mount are **Spanish** in the current implementation (toolbar / row actions); replace by forking the mount or generating views from the CLI for your locale.\r\n\r\n---\r\n\r\n## CLI companion (`@abeyjs/cli`)\r\n\r\n| Command | Relation to this package |\r\n|---------|--------------------------|\r\n| **`abeyjs add openapi`** | Adds **`@abeyjs/openapi`**, **`@abeyjs/http`**, Vite proxies, stubs; does not replace manual **`registerOpenApiCrud`** wiring unless the template already does so. |\r\n| **`abeyjs connect`** | Writes **`.abeyjs/connect.json`** (**`ConnectContract`** in **`cli/src/openapi-contract.ts`**) + **`abeyjs.connect.yml`** — input to **`abeyjs generate views`**, not consumed directly by **`@abeyjs/openapi`** at runtime unless you glue it yourself. |\r\n| **`abeyjs generate views`** | Emits OM/TS views from the contract; overlaps conceptually with **`mountOpenApiCrudView`** (different output path). |\r\n| **`abeyjs codegen`** | **`openapi-typescript`** types + stubs — orthogonal to **`DynamicCrudAgent`**. |\r\n\r\n---\r\n\r\n## Dependencies\r\n\r\nPulls **`@abeyjs/agents`**, **`@abeyjs/core`**, **`@abeyjs/runtime`**, **`@abeyjs/state`**, **`@abeyjs/http`**, **`@abeyjs/view`**, **`@abeyjs/uikit`**, **`@abeyjs/validation`**, **`zod`**.\r\n\r\n---\r\n\r\n## Build\r\n\r\n```bash\r\nnpm run build -w @abeyjs/openapi\r\n```\r\n","readmeFilename":"README.md"}