mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2024-12-24 18:08:19 +03:00
63 lines
1.8 KiB
TypeScript
63 lines
1.8 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 = {
|
||
|
baseUrl: string;
|
||
|
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>;
|
||
|
};
|