2023-07-24 18:30:58 +03:00
|
|
|
import type { ShortUrl, ShortUrlData } from '../short-urls/data';
|
|
|
|
import type {
|
|
|
|
ShlinkDomainRedirects,
|
|
|
|
ShlinkDomainsResponse,
|
|
|
|
ShlinkEditDomainRedirects,
|
|
|
|
ShlinkHealth,
|
|
|
|
ShlinkMercureInfo,
|
|
|
|
ShlinkShortUrlData,
|
|
|
|
ShlinkShortUrlsListParams,
|
|
|
|
ShlinkShortUrlsResponse,
|
|
|
|
ShlinkTags,
|
|
|
|
ShlinkVisits,
|
|
|
|
ShlinkVisitsOverview,
|
|
|
|
ShlinkVisitsParams,
|
|
|
|
} from './types';
|
|
|
|
|
|
|
|
export type ShlinkApiClient = {
|
2023-07-26 21:04:50 +03:00
|
|
|
readonly baseUrl: string;
|
|
|
|
readonly apiKey: string;
|
2023-07-24 18:30:58 +03:00
|
|
|
|
|
|
|
listShortUrls(params?: ShlinkShortUrlsListParams): Promise<ShlinkShortUrlsResponse>;
|
|
|
|
|
|
|
|
createShortUrl(options: ShortUrlData): Promise<ShortUrl>;
|
|
|
|
|
|
|
|
getShortUrlVisits(shortCode: string, query?: ShlinkVisitsParams): Promise<ShlinkVisits>;
|
|
|
|
|
|
|
|
getTagVisits(tag: string, query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits>;
|
|
|
|
|
|
|
|
getDomainVisits(domain: string, query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits>;
|
|
|
|
|
|
|
|
getOrphanVisits(query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits>;
|
|
|
|
|
|
|
|
getNonOrphanVisits(query?: Omit<ShlinkVisitsParams, 'domain'>): Promise<ShlinkVisits>;
|
|
|
|
|
|
|
|
getVisitsOverview(): Promise<ShlinkVisitsOverview>;
|
|
|
|
|
|
|
|
getShortUrl(shortCode: string, domain?: string | null): Promise<ShortUrl>;
|
|
|
|
|
|
|
|
deleteShortUrl(shortCode: string, domain?: string | null): Promise<void>;
|
|
|
|
|
|
|
|
updateShortUrl(
|
|
|
|
shortCode: string,
|
|
|
|
domain: string | null | undefined,
|
|
|
|
body: ShlinkShortUrlData,
|
|
|
|
): Promise<ShortUrl>;
|
|
|
|
|
|
|
|
listTags(): Promise<ShlinkTags>;
|
|
|
|
|
|
|
|
tagsStats(): Promise<ShlinkTags>;
|
|
|
|
|
|
|
|
deleteTags(tags: string[]): Promise<{ tags: string[] }>;
|
|
|
|
|
|
|
|
editTag(oldName: string, newName: string): Promise<{ oldName: string; newName: string }>;
|
|
|
|
|
|
|
|
health(authority?: string): Promise<ShlinkHealth>;
|
|
|
|
|
|
|
|
mercureInfo(): Promise<ShlinkMercureInfo>;
|
|
|
|
|
|
|
|
listDomains(): Promise<ShlinkDomainsResponse>;
|
|
|
|
|
|
|
|
editDomainRedirects(domainRedirects: ShlinkEditDomainRedirects): Promise<ShlinkDomainRedirects>;
|
|
|
|
};
|