@cabin-interactive/qrz-api-client
Version:
A TypeScript wrapper for the QRZ.com API
54 lines (53 loc) • 1.43 kB
TypeScript
export type QrzAction = 'STATUS' | 'INSERT' | 'DELETE' | 'FETCH';
export type QrzResultType = 'OK' | 'FAIL' | 'AUTH' | 'REPLACE';
export interface QrzAuthTestResult {
isValid: boolean;
error?: string;
}
export interface QrzClientConfig {
apiKey: string;
userAgent: string;
proxyUrl?: string;
}
export interface QrzBaseParams {
action: QrzAction;
adif?: string;
option?: string;
logIds?: string;
[key: string]: string | undefined;
}
interface QrzBaseResponse {
result: QrzResultType;
reason?: string;
[key: string]: string | undefined;
}
export interface QrzSuccessResponse extends QrzBaseResponse {
result: 'OK' | 'REPLACE';
logIds?: string;
logId?: string;
count?: string;
data?: string;
}
export interface QrzFailResponse extends QrzBaseResponse {
result: 'FAIL';
reason: string;
}
export interface QrzAuthResponse extends QrzBaseResponse {
result: 'AUTH';
reason: string;
}
export type QrzResponse = QrzSuccessResponse | QrzFailResponse | QrzAuthResponse;
export interface QsoUploadOptions {
/**
* If true, automatically overwrites any existing duplicate QSOs.
* WARNING: This WILL overwrite confirmed QSOs with unconfirmed ones
* if they match the same QSO criteria.
*/
replace?: boolean;
}
export interface QsoUploadResponse {
logId: string;
status: 'OK' | 'REPLACE';
count: number;
}
export {};