mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-23 06:56:22 +00:00
Move all relevant API types to api-contract
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import type { ShortUrlData } from '../short-urls/data';
|
||||
import type {
|
||||
ShlinkCreateShortUrlData,
|
||||
ShlinkDomainRedirects,
|
||||
ShlinkDomainsResponse,
|
||||
ShlinkEditDomainRedirects,
|
||||
ShlinkEditShortUrlData,
|
||||
ShlinkHealth,
|
||||
ShlinkMercureInfo,
|
||||
ShlinkShortUrl,
|
||||
ShlinkShortUrlData,
|
||||
ShlinkShortUrlsListParams,
|
||||
ShlinkShortUrlsResponse,
|
||||
ShlinkTags,
|
||||
@@ -21,7 +21,7 @@ export type ShlinkApiClient = {
|
||||
|
||||
listShortUrls(params?: ShlinkShortUrlsListParams): Promise<ShlinkShortUrlsResponse>;
|
||||
|
||||
createShortUrl(options: ShortUrlData): Promise<ShlinkShortUrl>;
|
||||
createShortUrl(options: ShlinkCreateShortUrlData): Promise<ShlinkShortUrl>;
|
||||
|
||||
getShortUrlVisits(shortCode: string, query?: ShlinkVisitsParams): Promise<ShlinkVisits>;
|
||||
|
||||
@@ -42,7 +42,7 @@ export type ShlinkApiClient = {
|
||||
updateShortUrl(
|
||||
shortCode: string,
|
||||
domain: string | null | undefined,
|
||||
body: ShlinkShortUrlData,
|
||||
body: ShlinkEditShortUrlData,
|
||||
): Promise<ShlinkShortUrl>;
|
||||
|
||||
listTags(): Promise<ShlinkTags>;
|
||||
|
||||
@@ -31,6 +31,34 @@ export interface ShlinkShortUrl {
|
||||
forwardQuery?: boolean;
|
||||
}
|
||||
|
||||
export interface ShlinkEditShortUrlData {
|
||||
longUrl?: string;
|
||||
title?: string | null;
|
||||
tags?: string[];
|
||||
deviceLongUrls?: ShlinkDeviceLongUrls;
|
||||
crawlable?: boolean;
|
||||
forwardQuery?: boolean;
|
||||
validSince?: string | null;
|
||||
validUntil?: string | null;
|
||||
maxVisits?: number | null;
|
||||
|
||||
/** @deprecated */
|
||||
validateUrl?: boolean;
|
||||
}
|
||||
|
||||
export interface ShlinkCreateShortUrlData extends Omit<ShlinkEditShortUrlData, 'deviceLongUrls'> {
|
||||
longUrl: string;
|
||||
customSlug?: string;
|
||||
shortCodeLength?: number;
|
||||
domain?: string;
|
||||
findIfExists?: boolean;
|
||||
deviceLongUrls?: {
|
||||
android?: string;
|
||||
ios?: string;
|
||||
desktop?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export interface ShlinkShortUrlsResponse {
|
||||
data: ShlinkShortUrl[];
|
||||
pagination: ShlinkPaginator;
|
||||
@@ -106,20 +134,6 @@ export interface ShlinkVisitsParams {
|
||||
excludeBots?: boolean;
|
||||
}
|
||||
|
||||
export interface ShlinkShortUrlData {
|
||||
longUrl?: string;
|
||||
title?: string | null;
|
||||
/** @deprecated */
|
||||
validateUrl?: boolean;
|
||||
tags?: string[];
|
||||
deviceLongUrls?: ShlinkDeviceLongUrls;
|
||||
crawlable?: boolean;
|
||||
forwardQuery?: boolean;
|
||||
validSince?: string | null;
|
||||
validUntil?: string | null;
|
||||
maxVisits?: number | null;
|
||||
}
|
||||
|
||||
export interface ShlinkDomainRedirects {
|
||||
baseUrlRedirect: string | null;
|
||||
regular404Redirect: string | null;
|
||||
|
||||
Reference in New Issue
Block a user