ADT Toolkit - TypeScript libraries for SAP ABAP Development Tools (ADT) REST APIs.
A complete ADT toolkit providing:
- CLI - Command-line interface for SAP ADT operations
- Client - Type-safe HTTP client library for ADT REST APIs
- MCP - Model Context Protocol server for AI integration (future)
This project is in PoC phase, focusing on technical implementation and architecture validation. The goal is to establish a solid foundation with:
- Contract-first API design using
speci+ts-xsd - Type-safe XML handling with automatic schema generation
- Clean separation between contracts, client, and CLI layers
AI-Driven Development: This project is actively developed using AI assistants. APIs may change, and some features are experimental.
The architecture prioritizes type safety and contract-first design:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ADT CLI β
β (User Interface Layer) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β adt-client-v2 β
β (HTTP Client + Request Execution) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β adt-contracts β
β (REST API Contracts using speci + ts-xsd) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β adt-schemas-xsd β
β (TypeScript schemas from SAP XSD definitions) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β ts-xsd β speci β
β (XSD β TypeScript types) β (Contract specification) β
ββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
Contract-First Design solves the fundamental problem of SAP ADT integration:
- SAP provides XSD schemas - Official XML schema definitions for ADT APIs
- ts-xsd generates TypeScript - Automatic type generation from XSD
- speci defines contracts - Type-safe REST endpoint definitions
- adt-contracts combines them - Declarative API contracts with full type inference
- adt-client-v2 executes - HTTP client that understands contracts
- adt-cli exposes - User-friendly command-line interface
Benefits:
- β Single source of truth - XSD schemas define types once
- β Full type safety - TypeScript types flow from schema to CLI
- β No manual type definitions - Generated from official SAP schemas
- β Easy to extend - Add new endpoints by defining contracts
- β Testable - Contracts are pure data, easy to mock
| Package | Purpose | Status |
|---|---|---|
| ts-xsd | XSD β TypeScript schema generation | β Active |
| speci | Contract specification system | β Active |
| adt-schemas-xsd | SAP ADT schemas (generated from XSD) | β Active |
| adt-contracts | REST API contracts (speci + ts-xsd) | π§ Development |
| adt-client-v2 | HTTP client using contracts | π§ Development |
| adt-cli | Command-line interface | β Active |
| Package | Purpose | Status |
|---|---|---|
| adt-auth | Authentication (Basic, SLC, OAuth) | β Active |
| adt-config | Configuration loader | β Active |
| browser-auth | Browser-based SSO | β Active |
| adt-puppeteer | Puppeteer SSO adapter | β Active |
| adk | ABAP Development Kit - object modeling | π§ Development |
| Package | Replacement | Notes |
|---|---|---|
| adt-client | adt-client-v2 | Original client without contract support |
| ts-xml | ts-xsd | Earlier XML schema approach |
β οΈ Legacy packages will be removed once migration to the new architecture is complete.
- Node.js 18+
- npm (not pnpm or yarn - important!)
- Git
# Clone the repository
git clone https://github.com/your-org/abapify-js.git
cd abapify-js
# Install dependencies
npm install
# Build all packages
npx nx build
# Run tests
npx nx test
# Type checking
npx nx typecheckabapify-js/
βββ packages/
β βββ ts-xsd/ # XSD β TypeScript (foundation)
β βββ speci/ # Contract specification (foundation)
β βββ adt-schemas-xsd/ # SAP ADT schemas (generated)
β βββ adt-contracts/ # REST API contracts
β βββ adt-client-v2/ # HTTP client (new)
β βββ adt-cli/ # Command-line interface
β βββ adt-auth/ # Authentication
β βββ adt-config/ # Configuration
β βββ adk/ # ABAP object modeling
β βββ adt-client/ # β οΈ Legacy - to be removed
β βββ ts-xml/ # β οΈ Legacy - to be removed
βββ docs/ # Documentation
βββ e2e/ # End-to-end tests
βββ tmp/ # Temporary files (gitignored)
# Build specific package
npx nx build adt-cli
npx nx build adt-client
# Run tests for specific package
npx nx test adk
npx nx test adt-cli
# Build all packages
npx nx run-many --target=build
# Run all tests
npx nx run-many --target=test
# Lint all packages
npx nx run-many --target=lint- @nx/node - Node.js library support
- @nx/eslint - ESLint integration
- @nx/vite - Vite build tool integration
- Strict Mode: All packages use TypeScript strict mode
- ESNext: Prefer native Node.js APIs over external dependencies
- Async/Await: Use async patterns over callbacks or sync operations
// β
Good - PascalCase for types, camelCase for variables
interface AdtClientConfig {
serviceKeyPath: string;
}
const createClient = async (config: AdtClientConfig) => {
// Implementation
};
// β
Good - Use native APIs
const response = await fetch(url, options);
const fileContent = await readFile(path, 'utf-8');- CLI-First: Design for command-line usage and automation
- Modular: Small, focused packages with clear boundaries
- Type-Safe: Comprehensive TypeScript support
- Testable: High test coverage with Vitest
// β
Cross-package imports
import { AdtClientImpl } from '@abapify/adt-client';
// β
Internal imports (extensionless for bundlers)
import { parseXml } from '../utils/xml-parser';
// β
External packages
import { Command } from 'commander';-
Fork and Clone
git clone https://github.com/your-username/abapify-js.git cd abapify-js npm install -
Create Feature Branch
git checkout -b feature/your-feature-name
-
Make Changes
- Write tests first (TDD approach)
- Implement your changes
- Ensure all tests pass:
npx nx test
-
Submit PR
- Push branch:
git push origin feature/your-feature-name - Open PR with clear description
- Push branch:
# Install dependencies
npm install
# Build and test everything
npx nx build && npx nx test
# Work on specific package
npx nx build adt-cli
npx nx test adt-cli --watch
# Create new package
npx nx g @nx/node:library packages/my-package- Current Work: See current-sprint.md
- Project Status: See abap-code-review.md
- Roadmap: See roadmap.md
MIT License - see LICENSE for details.
The combination of ts-xsd and speci provides a powerful contract specification system:
ts-xsd converts XSD schemas to TypeScript:
// Generated from SAP's official XSD
const TransportSchema = {
ns: 'http://www.sap.com/adt/cts',
root: 'request',
elements: {
request: {
sequence: [
{ name: 'requestHeader', type: 'requestHeader' },
{ name: 'tasks', type: 'tasks' },
],
},
// ... full type definitions
},
} as const;
// TypeScript type is automatically inferred!
type Transport = InferXsd<typeof TransportSchema>;speci defines REST contracts:
import { http } from 'speci/rest';
import { schemas } from 'adt-schemas-xsd';
const ctsContract = {
getTransport: (id: string) =>
http.get(`/sap/bc/adt/cts/transportrequests/${id}`, {
responses: { 200: schemas.transportmanagment },
}),
};Result: Full type safety from XSD to API response, with zero manual type definitions.
Traditional XML parsers force you into their data format:
// fast-xml-parser output - awkward structure
const data = {
"cts:request": {
"@_xmlns:cts": "http://www.sap.com/adt/cts",
"cts:requestHeader": { ... }
}
};With ts-xsd, you get clean domain objects:
// ts-xsd output - clean TypeScript types
const data: Transport = {
requestHeader: { trRequestId: 'DEVK900001', ... },
tasks: [...]
};- Current (PoC): Contract-first architecture with ts-xsd + speci
- Next: Complete adt-contracts coverage for core ADT APIs
- Future: MCP server for AI-assisted ABAP development
Built for the SAP development community π