Add Shlink prefix to api-contract models

This commit is contained in:
Alejandro Celaya
2023-08-06 21:27:57 +02:00
parent 47dd105cd6
commit 23daa2de72
35 changed files with 160 additions and 159 deletions

View File

@@ -1,4 +1,4 @@
import type { ShortUrl, ShortUrlData } from '../short-urls/data';
import type { ShlinkShortUrl, ShortUrlData } from '../short-urls/data';
import type {
ShlinkDomainRedirects,
ShlinkDomainsResponse,
@@ -20,7 +20,7 @@ export type ShlinkApiClient = {
listShortUrls(params?: ShlinkShortUrlsListParams): Promise<ShlinkShortUrlsResponse>;
createShortUrl(options: ShortUrlData): Promise<ShortUrl>;
createShortUrl(options: ShortUrlData): Promise<ShlinkShortUrl>;
getShortUrlVisits(shortCode: string, query?: ShlinkVisitsParams): Promise<ShlinkVisits>;
@@ -34,7 +34,7 @@ export type ShlinkApiClient = {
getVisitsOverview(): Promise<ShlinkVisitsOverview>;
getShortUrl(shortCode: string, domain?: string | null): Promise<ShortUrl>;
getShortUrl(shortCode: string, domain?: string | null): Promise<ShlinkShortUrl>;
deleteShortUrl(shortCode: string, domain?: string | null): Promise<void>;
@@ -42,7 +42,7 @@ export type ShlinkApiClient = {
shortCode: string,
domain: string | null | undefined,
body: ShlinkShortUrlData,
): Promise<ShortUrl>;
): Promise<ShlinkShortUrl>;
listTags(): Promise<ShlinkTags>;

View File

@@ -1,9 +1,9 @@
import type { Order } from '@shlinkio/shlink-frontend-kit';
import type { ShortUrl, ShortUrlMeta } from '../short-urls/data';
import type { ShlinkDeviceLongUrls, ShlinkShortUrl } from '../short-urls/data';
import type { Visit } from '../visits/types';
export interface ShlinkShortUrlsResponse {
data: ShortUrl[];
data: ShlinkShortUrl[];
pagination: ShlinkPaginator;
}
@@ -77,11 +77,18 @@ export interface ShlinkVisitsParams {
excludeBots?: boolean;
}
export interface ShlinkShortUrlData extends ShortUrlMeta {
export interface ShlinkShortUrlData {
longUrl?: string;
title?: 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 {