mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-23 17:40:23 +03:00
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
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 = {
|
|
readonly baseUrl: string;
|
|
readonly apiKey: string;
|
|
|
|
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>;
|
|
};
|