-
feat(audio-api): @nech/api — fully-generated TS client + Verdaccio runbook (#44) · ed77ee9e
The hand-written nech.ts was always interim; this replaces it with a client GENERATED from the OpenAPI spec, so the SDK can never drift from the API. Source-of-truth fixes (the spec drives the ergonomics): - Clean operationIds on all 13 routes (operation_id="analyzeEmotion" etc.) so the generator emits `audio.analyzeEmotion({file})`, not the default `analyzeEmotionAnalyzeEmotionPost`. Also cleans /docs. - One router tag ["audio"] so the generated class is AudioApi, not DefaultApi. - refresh_openapi.py: the canonical snapshot dump. app.openapi() omits the public `servers` block (only injected when served behind root_path), and the old README recipe silently dropped it — test_openapi_snapshot guards it, so the refresh now injects https://api.nech.pl/audio/v1 itself. The package (@nech/api, clients/nech-api/): - typescript-fetch generator → src/audio/ (checked in; regenerate via codegen.sh), bundled with tsup to a single ESM file + .d.ts. - Umbrella package, per-domain SUBPATH exports: `import {AudioApi} from '@nech/api/audio'` — one install/version, tree-shakeable, geo/iris slot in as siblings later (codegen.sh + exports map have the stubs). - Build via tsup not bare tsc: the generated code uses extensionless relative imports (./runtime) that Node ESM can't resolve from plain tsc output; bundling sidesteps it entirely. Verified end-to-end: `@nech/api/audio` resolves through the exports map, 13/13 methods present. - publishConfig + .npmrc point the @nech scope at https://npm.nech.pl. VERDACCIO.md: copy-paste runbook to stand the private registry up on erable (container :4873, nginx TLS vhost for npm.nech.pl, seed publisher + lock signups, publish). NOT yet run — `ssh erable` failed with publickey from the build host; needs the key loaded. DNS for npm.nech.pl is already set. README reframed: @nech/api is the official client; nech.ts stays documented as the working drop-in until the registry is live, then it's retired. Scrubbed a $DOUANIER_TOKEN codename leak in the curl example. 67 API tests still green.PLN (Algolia) authoreded77ee9e
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| HTTPValidationError.ts | Loading commit data... | |
| LocationInner.ts | Loading commit data... | |
| ValidationError.ts | Loading commit data... | |
| index.ts | Loading commit data... |