From 0713535d65fca04bfd605cd4c6bf4043605b4348 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 5 Mar 2024 15:07:01 +0100 Subject: [PATCH] Move internal type out of api-contract types --- src/api-contract/types.ts | 7 ------- src/api/utils.ts | 13 ++++++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/api-contract/types.ts b/src/api-contract/types.ts index bd50b03..49a1c49 100644 --- a/src/api-contract/types.ts +++ b/src/api-contract/types.ts @@ -224,10 +224,3 @@ export type ShlinkShortUrlsListParams = { excludeMaxVisitsReached?: boolean; excludePastValidUntil?: boolean; }; - -export type ShlinkShortUrlsListNormalizedParams = - Omit & { - orderBy?: string; - excludeMaxVisitsReached?: 'true'; - excludePastValidUntil?: 'true'; - }; diff --git a/src/api/utils.ts b/src/api/utils.ts index 833c464..f0a4eac 100644 --- a/src/api/utils.ts +++ b/src/api/utils.ts @@ -1,8 +1,4 @@ -import type { - ShlinkShortUrlsListNormalizedParams, - ShlinkShortUrlsListParams, - ShlinkShortUrlsOrder, -} from '../api-contract'; +import type { ShlinkShortUrlsListParams, ShlinkShortUrlsOrder } from '../api-contract'; export type ApiVersion = 3; @@ -12,6 +8,13 @@ const shortUrlsOrderToString = (order: ShlinkShortUrlsOrder): string | undefined order.dir ? `${order.field}-${order.dir}` : undefined ); +type ShlinkShortUrlsListNormalizedParams = + Omit & { + orderBy?: string; + excludeMaxVisitsReached?: 'true'; + excludePastValidUntil?: 'true'; + }; + export const normalizeListParams = ( { orderBy = {}, excludeMaxVisitsReached, excludePastValidUntil, ...rest }: ShlinkShortUrlsListParams, ): ShlinkShortUrlsListNormalizedParams => ({