@viatick/jarvis-apis-sdk
v2.3.1
Published
This package is generated by the monorepo custom SDK generator.
Readme
Jarvis APIs SDK
This package is generated by the monorepo custom SDK generator.
Generate the SDK from an exported OpenAPI JSON file only. Do not generate from a running local REST server endpoint.
Get The API JSON
# Export the OpenAPI JSON from main-rest-server
yarn workspace @viatick/jarvis-rest-server openapi:exportDefault output:
packages/apis-sdk/fixtures/main-rest-server.openapi.jsonCommands
# Generate the SDK from the exported API JSON file
yarn workspace @viatick/jarvis-apis-sdk generate --input fixtures/main-rest-server.openapi.json
# Refresh the temporary local schema allowlist from the same API JSON file
yarn workspace @viatick/jarvis-apis-sdk sync:local-schema-allowlist --input fixtures/main-rest-server.openapi.json
# Refresh the local enum allowlist after regeneration
yarn workspace @viatick/jarvis-apis-sdk sync:local-enum-allowlist
# Run generator tests
yarn workspace @viatick/jarvis-apis-sdk test:generator
# Build the published SDK output
yarn workspace @viatick/jarvis-apis-sdk build
# Recommended repo-level check
CI=1 yarn build:projects @viatick/jarvis-apis-sdk @viatick/jarvis-main-platform
# Stage a self-contained npm package under tmp/publish/apis-sdk
yarn apis-sdk:stage:npm
# Create an npm tarball from the staged package
yarn apis-sdk:pack:npm
# Publish the staged package to npm
yarn apis-sdk:publish:npmNotes
- If generation fails because a schema or enum should come from shared types, update
src/generator-config/schema-type-map.ts. - Keep temporary local schema ownership in
src/generator-config/local-schema-allowlist.ts. - Keep intentional local enums in
src/generator-config/local-enum-allowlist.ts. - The npm publish flow stages a separate self-contained package under
tmp/publish/apis-sdkand does not change the normal monorepobuildoutput.
Roadmap
- Keep moving shared enum ownership into
@viatick/jarvis-shared-typeswhen the contract is already stable. - Reduce compatibility wrappers to only the legacy cases that still need them.
- Gradually move more request and response DTO ownership out of local generated SDK models where shared types are the source of truth.
