- Bun >= 1.3 (JavaScript runtime)
- Node.js >= 22.12.0 (for type checking in some tools)
- Git (for version control)
This is a Bun workspace monorepo containing three SDK packages:
packages/
├── admin-sdk/ # Administration API SDK
├── auth-sdk/ # Authentication API SDK
└── issuance-sdk/ # Issuance API SDK
bin/
├── generate.ts # SDK generation orchestration
├── download.ts # OpenAPI spec downloader
├── validate.ts # Package validation
├── clean.ts # Directory cleanup utility
└── lib.ts # Shared utilities
openapi/
├── administration.json # Administration API spec
├── authentication.json # Authentication API spec
└── issuance.json # Issuance API spec
tests/
├── admin.test.ts # Admin SDK tests
├── auth.test.ts # Auth SDK tests
└── issuance.test.ts # Issuance SDK tests
The SDKs use a functional API pattern (not class-based) with:
- Discriminated union types for type-safe response handling
- Runtime configuration via
defaultsobject from@oazapfts/runtime - Tree-shakeable exports - import only what you need
- ESM-only modules - no CommonJS support
const response = await createUserUsingPost({ userParms }, { baseUrl, headers });
if (response.status === 200) {
// response.data is typed as UserRead
console.log(response.data);
} else if (response.status === 400) {
// response.data is typed as ErrorInfo
console.error(response.data.errorMessage);
}Edit source files in bin/ or package README.md files as needed.
bun run buildThis will:
- Clean old generated code
- Generate TypeScript from OpenAPI specs
- Install dependencies for each package
- Bundle to ESM format
- Generate type declarations
bun run validateChecks package.json configuration and TypeScript type exports.
bun run lint:fixApplies consistent code formatting using Biome.
bun testExecutes end-to-end tests against the generated SDKs.
- AGENTS.md - Detailed documentation for AI agents and automated systems
- biome.json - Linting and formatting configuration
- package.json - Workspace configuration and dependency catalog
- tsconfig.json - TypeScript configuration
- bunfig.toml - Bun runtime configuration
Files like packages/*/index.ts are generated by oazapfts. Do not edit them directly. All changes should be made through:
- Modifying the OpenAPI specification (if needed)
- Updating generator scripts in
bin/ - Modifying README or configuration files
The project uses Bun's workspace catalog to centralize dependency versions:
- Update versions in root
package.jsoncatalog section - Run
bun installto apply changes - All SDK packages reference catalog versions via
"catalog:"protocol
Bun uses isolated installs (default since 1.3) for strict dependency isolation:
- Prevents phantom dependencies
- Ensures deterministic builds
- Each package has its own
node_modules/
To test SDKs against actual APIs:
- Set up credentials for your Entrust IDaaS environment
- Update test files in
tests/with your environment details - Run
bun test
See individual test files for required environment variables.
- Verify OpenAPI specs exist in
./openapi/ - Ensure specs are valid JSON/YAML
- Check that
oazapftsis up to date:bunx oazapfts --help
- Ensure
dist/directory exists in each package - Verify
package.jsonexports and files fields are correct - Check that type definitions were generated in
dist/index.d.ts
- Ensure you have valid credentials configured
- Check that the target APIs are accessible
- Verify the OpenAPI specs match your API version
See AGENTS.md for comprehensive documentation about the project architecture, workflows, and common development tasks.