Shared TypeScript types for Alliance B2B Travel Portal
npm install alliance-shared-typesbash
From the frontend or backend project
npm install ../alliance-shared-types
`
$3
Once published to npm:
`bash
npm install alliance-shared-types
`
$3
You can also install directly from GitHub:
`bash
npm install git+https://github.com/yourusername/alliance-shared-types.git
`
Usage
`typescript
// Import specific types
import { UserData, AuthResponse, USER_ROLES } from 'alliance-shared-types';
// Use in your code
const user: UserData = {
userId: '123',
email: 'user@example.com',
role: USER_ROLES.ADMIN,
agentId: '456',
status: 'active'
};
`
Available Types
$3
- UserCredentials - Login credentials
- AuthResponse - Authentication response with token and user data
- UserData - User information
- JwtPayload - JWT token payload structure
- TokenData - Token data with expiration
$3
- UserRole and USER_ROLES - User role types and constants
- UserStatus and USER_STATUSES - User status types and constants
- AgentType and AGENT_TYPES - Agent type types and constants
- KycStatus and KYC_STATUSES - KYC status types and constants
- AgentStatus and AGENT_STATUSES - Agent status types and constants
Development
To build the package:
`bash
npm run build
`
Publishing
`bash
npm login
npm publish
``