bam-ticketing-sdk
Version:
SDK for B.A.M Ticketing API
33 lines (29 loc) • 679 B
text/typescript
import {
Jwt,
KeyPair,
UserPassword,
RefreshableJwt,
ServiceAccessData,
} from '..'
import { AuthService } from '../auth'
export enum CredentialType {
Jwt = 'jwt',
Guest = 'guest',
Wallet = 'wallet',
Service = 'service',
Password = 'password',
ApiKey = 'api-key',
Impersonate = 'impersonate'
}
export interface ICredentialData {
type: CredentialType
jwt: Jwt
keyPair?: KeyPair
credentials?: UserPassword | ServiceAccessData
}
export interface ICredential {
type: CredentialType
getToken(): Jwt | RefreshableJwt
authorize(authService: AuthService, organizer?: string): Promise<Jwt>
refreshToken(authService: AuthService, organizer?: string): Promise<Jwt>
}