trainingpeaks-sdk
Version:
TypeScript SDK for TrainingPeaks API integration
10 lines • 817 B
TypeScript
import type { AuthToken as AuthTokenType } from '../../domain/schemas/entities.schema.js';
export type AuthToken = AuthTokenType;
export declare const createAuthToken: (accessToken: string, tokenType: string, expiresIn: number, expires: Date, refreshToken?: string) => AuthToken;
export declare const isTokenExpired: (token: AuthToken) => boolean;
export declare const isTokenValid: (token: AuthToken) => boolean;
export declare const refreshAuthToken: (token: AuthToken, newAccessToken: string, newExpires: Date, newRefreshToken?: string) => AuthToken;
export declare const shouldRefreshToken: (token: AuthToken) => boolean;
export declare const getRemainingValidityTime: (token: AuthToken) => number;
export declare const hasRefreshCapability: (token: AuthToken) => boolean;
//# sourceMappingURL=auth-token.d.ts.map