This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Smartling Translation API SDK for Node.js, providing TypeScript interfaces for interacting with Smartling's translation services. The SDK covers all major API endpoints including files, jobs, locales, projects, and translation management.
npm run build- Production build (TypeScript compilation tobuilt/directory)npm run build:dev- Development build (includes test files)
npm test- Run full test suite with lint, build, and coveragenpm run test:dev- Run tests without JUnit reporting (for development)
npm run pretest- Run ESLint on all TypeScript files- ESLint configuration in
.eslintrcwith TypeScript, Airbnb, and custom rules
Run individual test files using Mocha directly:
npm run build:dev && npx mocha built/test/[specific-test].spec.js- API Layer: Organized by feature domains (
/api/)auth/- Authentication and token managementfiles/- File upload/download operationsjobs/- Translation job managementlocales/- Language and locale handlingprojects/- Project managementstrings/- String resource managementcontext/- Context matching for translationsjob-batches/- Batch job processingpublished-files/- Published file managementfile-translations/- File translation servicesmt/- Machine translation services
Each API domain follows a consistent pattern:
index.ts- Main API client classdto/- Data transfer objects (response/request types)params/- Parameter classes for API calls
- SmartlingApiClientBuilder: Main entry point for creating API clients
- AccessTokenProvider: Interface for authentication (with StaticAccessTokenProvider implementation)
- SmartlingListResponse: Generic wrapper for paginated API responses
- Logger: Centralized logging utility
- Uses
tsconfig.jsonfor production builds - Uses
tsconfig.dev.jsonfor development (includes test files) - Targets ES6 with CommonJS modules
- Generates declaration files and source maps
- Mocha test runner with TypeScript support
- Sinon for mocking and stubbing
- NYC for code coverage reporting
- Tests located in
/test/directory matching API structure