diff --git a/shlink-web-component/src/api-contract/ShlinkApiClient.ts b/shlink-web-component/src/api-contract/ShlinkApiClient.ts index dcd1c5d7..2d8a6805 100644 --- a/shlink-web-component/src/api-contract/ShlinkApiClient.ts +++ b/shlink-web-component/src/api-contract/ShlinkApiClient.ts @@ -1,10 +1,11 @@ -import type { ShlinkShortUrl, ShortUrlData } from '../short-urls/data'; +import type { ShortUrlData } from '../short-urls/data'; import type { ShlinkDomainRedirects, ShlinkDomainsResponse, ShlinkEditDomainRedirects, ShlinkHealth, ShlinkMercureInfo, + ShlinkShortUrl, ShlinkShortUrlData, ShlinkShortUrlsListParams, ShlinkShortUrlsResponse, diff --git a/shlink-web-component/src/api-contract/types.ts b/shlink-web-component/src/api-contract/types.ts index ddc61d51..d889f7b9 100644 --- a/shlink-web-component/src/api-contract/types.ts +++ b/shlink-web-component/src/api-contract/types.ts @@ -1,7 +1,36 @@ import type { Order } from '@shlinkio/shlink-frontend-kit'; -import type { ShlinkDeviceLongUrls, ShlinkShortUrl } from '../short-urls/data'; +import type { Nullable, OptionalString } from '../utils/helpers'; import type { Visit } from '../visits/types'; +export interface ShlinkDeviceLongUrls { + android?: OptionalString; + ios?: OptionalString; + desktop?: OptionalString; +} + +export interface ShlinkShortUrlMeta { + validSince?: string; + validUntil?: string; + maxVisits?: number; +} + +export interface ShlinkShortUrl { + shortCode: string; + shortUrl: string; + longUrl: string; + deviceLongUrls?: Required, // Optional only before Shlink 3.5.0 + dateCreated: string; + /** @deprecated */ + visitsCount: number; // Deprecated since Shlink 3.4.0 + visitsSummary?: ShlinkVisitsSummary; // Optional only before Shlink 3.4.0 + meta: Required>; + tags: string[]; + domain: string | null; + title?: string | null; + crawlable?: boolean; + forwardQuery?: boolean; +} + export interface ShlinkShortUrlsResponse { data: ShlinkShortUrl[]; pagination: ShlinkPaginator; diff --git a/shlink-web-component/src/short-urls/ShortUrlForm.tsx b/shlink-web-component/src/short-urls/ShortUrlForm.tsx index 801ab447..36da839e 100644 --- a/shlink-web-component/src/short-urls/ShortUrlForm.tsx +++ b/shlink-web-component/src/short-urls/ShortUrlForm.tsx @@ -9,6 +9,7 @@ import type { ChangeEvent, FC } from 'react'; import { useEffect, useState } from 'react'; import { Button, FormGroup, Input, Row } from 'reactstrap'; import type { InputType } from 'reactstrap/types/lib/Input'; +import type { ShlinkDeviceLongUrls } from '../api-contract'; import type { DomainSelectorProps } from '../domains/DomainSelector'; import type { TagsSelectorProps } from '../tags/helpers/TagsSelector'; import { IconInput } from '../utils/components/IconInput'; @@ -17,7 +18,7 @@ import { DateTimeInput } from '../utils/dates/DateTimeInput'; import { formatIsoDate } from '../utils/dates/helpers/date'; import { useFeature } from '../utils/features'; import { handleEventPreventingDefault, hasValue } from '../utils/helpers'; -import type { ShlinkDeviceLongUrls, ShortUrlData } from './data'; +import type { ShortUrlData } from './data'; import { ShortUrlFormCheckboxGroup } from './helpers/ShortUrlFormCheckboxGroup'; import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon'; import './ShortUrlForm.scss'; diff --git a/shlink-web-component/src/short-urls/data/index.ts b/shlink-web-component/src/short-urls/data/index.ts index 255f6751..ec3063ca 100644 --- a/shlink-web-component/src/short-urls/data/index.ts +++ b/shlink-web-component/src/short-urls/data/index.ts @@ -1,6 +1,6 @@ import type { Order } from '@shlinkio/shlink-frontend-kit'; -import type { ShlinkShortUrlData, ShlinkVisitsSummary } from '../../api-contract'; -import type { Nullable, OptionalString } from '../../utils/helpers'; +import type { ShlinkShortUrl, ShlinkShortUrlData } from '../../api-contract'; +import type { OptionalString } from '../../utils/helpers'; export interface ShortUrlData extends Omit { longUrl: string; @@ -15,35 +15,6 @@ export interface ShortUrlData extends Omit } } -export interface ShlinkDeviceLongUrls { - android?: OptionalString; - ios?: OptionalString; - desktop?: OptionalString; -} - -export interface ShlinkShortUrl { - shortCode: string; - shortUrl: string; - longUrl: string; - deviceLongUrls?: Required, // Optional only before Shlink 3.5.0 - dateCreated: string; - /** @deprecated */ - visitsCount: number; // Deprecated since Shlink 3.4.0 - visitsSummary?: ShlinkVisitsSummary; // Optional only before Shlink 3.4.0 - meta: Required>; - tags: string[]; - domain: string | null; - title?: string | null; - crawlable?: boolean; - forwardQuery?: boolean; -} - -export interface ShlinkShortUrlMeta { - validSince?: string; - validUntil?: string; - maxVisits?: number; -} - export interface ShortUrlIdentifier { shortCode: string; domain?: OptionalString; diff --git a/shlink-web-component/src/short-urls/helpers/ExportShortUrlsBtn.tsx b/shlink-web-component/src/short-urls/helpers/ExportShortUrlsBtn.tsx index 0146ab72..073f846a 100644 --- a/shlink-web-component/src/short-urls/helpers/ExportShortUrlsBtn.tsx +++ b/shlink-web-component/src/short-urls/helpers/ExportShortUrlsBtn.tsx @@ -1,10 +1,9 @@ import { useToggle } from '@shlinkio/shlink-frontend-kit'; import type { FC } from 'react'; import { useCallback } from 'react'; -import type { ShlinkApiClient } from '../../api-contract'; +import type { ShlinkApiClient, ShlinkShortUrl } from '../../api-contract'; import { ExportBtn } from '../../utils/components/ExportBtn'; import type { ReportExporter } from '../../utils/services/ReportExporter'; -import type { ShlinkShortUrl } from '../data'; import { useShortUrlsQuery } from './hooks'; export interface ExportShortUrlsBtnProps { diff --git a/shlink-web-component/src/short-urls/helpers/ShortUrlDetailLink.tsx b/shlink-web-component/src/short-urls/helpers/ShortUrlDetailLink.tsx index d3b5c531..0f45e8a5 100644 --- a/shlink-web-component/src/short-urls/helpers/ShortUrlDetailLink.tsx +++ b/shlink-web-component/src/short-urls/helpers/ShortUrlDetailLink.tsx @@ -1,7 +1,7 @@ import type { FC } from 'react'; import { Link } from 'react-router-dom'; +import type { ShlinkShortUrl } from '../../api-contract'; import { useRoutesPrefix } from '../../utils/routesPrefix'; -import type { ShlinkShortUrl } from '../data'; import { urlEncodeShortCode } from './index'; export type LinkSuffix = 'visits' | 'edit'; diff --git a/shlink-web-component/src/short-urls/helpers/ShortUrlStatus.tsx b/shlink-web-component/src/short-urls/helpers/ShortUrlStatus.tsx index 4790304c..419706f0 100644 --- a/shlink-web-component/src/short-urls/helpers/ShortUrlStatus.tsx +++ b/shlink-web-component/src/short-urls/helpers/ShortUrlStatus.tsx @@ -5,8 +5,8 @@ import { useElementRef } from '@shlinkio/shlink-frontend-kit'; import { isBefore } from 'date-fns'; import type { FC, ReactNode } from 'react'; import { UncontrolledTooltip } from 'reactstrap'; +import type { ShlinkShortUrl } from '../../api-contract'; import { formatHumanFriendly, now, parseISO } from '../../utils/dates/helpers/date'; -import type { ShlinkShortUrl } from '../data'; interface ShortUrlStatusProps { shortUrl: ShlinkShortUrl; diff --git a/shlink-web-component/src/short-urls/helpers/ShortUrlVisitsCount.tsx b/shlink-web-component/src/short-urls/helpers/ShortUrlVisitsCount.tsx index 0dd7ce2d..a66e16f9 100644 --- a/shlink-web-component/src/short-urls/helpers/ShortUrlVisitsCount.tsx +++ b/shlink-web-component/src/short-urls/helpers/ShortUrlVisitsCount.tsx @@ -3,9 +3,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useElementRef } from '@shlinkio/shlink-frontend-kit'; import classNames from 'classnames'; import { UncontrolledTooltip } from 'reactstrap'; +import type { ShlinkShortUrl } from '../../api-contract'; import { formatHumanFriendly, parseISO } from '../../utils/dates/helpers/date'; import { prettify } from '../../utils/helpers/numbers'; -import type { ShlinkShortUrl } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; import './ShortUrlVisitsCount.scss'; diff --git a/shlink-web-component/src/short-urls/helpers/ShortUrlsRow.tsx b/shlink-web-component/src/short-urls/helpers/ShortUrlsRow.tsx index 038b008f..41f736a0 100644 --- a/shlink-web-component/src/short-urls/helpers/ShortUrlsRow.tsx +++ b/shlink-web-component/src/short-urls/helpers/ShortUrlsRow.tsx @@ -1,12 +1,12 @@ import type { FC } from 'react'; import { useEffect, useRef } from 'react'; import { ExternalLink } from 'react-external-link'; +import type { ShlinkShortUrl } from '../../api-contract'; import { CopyToClipboardIcon } from '../../utils/components/CopyToClipboardIcon'; import { Time } from '../../utils/dates/Time'; import type { TimeoutToggle } from '../../utils/helpers/hooks'; import type { ColorGenerator } from '../../utils/services/ColorGenerator'; import { useSetting } from '../../utils/settings'; -import type { ShlinkShortUrl } from '../data'; import { useShortUrlsQuery } from './hooks'; import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu'; import { ShortUrlStatus } from './ShortUrlStatus'; diff --git a/shlink-web-component/src/short-urls/helpers/ShortUrlsRowMenu.tsx b/shlink-web-component/src/short-urls/helpers/ShortUrlsRowMenu.tsx index d18bc8db..35273bed 100644 --- a/shlink-web-component/src/short-urls/helpers/ShortUrlsRowMenu.tsx +++ b/shlink-web-component/src/short-urls/helpers/ShortUrlsRowMenu.tsx @@ -8,7 +8,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { RowDropdownBtn, useToggle } from '@shlinkio/shlink-frontend-kit'; import type { FC } from 'react'; import { DropdownItem } from 'reactstrap'; -import type { ShlinkShortUrl, ShortUrlModalProps } from '../data'; +import type { ShlinkShortUrl } from '../../api-contract'; +import type { ShortUrlModalProps } from '../data'; import { ShortUrlDetailLink } from './ShortUrlDetailLink'; interface ShortUrlsRowMenuProps { diff --git a/shlink-web-component/src/short-urls/helpers/index.ts b/shlink-web-component/src/short-urls/helpers/index.ts index c1e7cbc1..a5ab7fd8 100644 --- a/shlink-web-component/src/short-urls/helpers/index.ts +++ b/shlink-web-component/src/short-urls/helpers/index.ts @@ -1,8 +1,9 @@ import { isNil } from 'ramda'; +import type { ShlinkShortUrl } from '../../api-contract'; import type { OptionalString } from '../../utils/helpers'; import type { ShortUrlCreationSettings } from '../../utils/settings'; import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits'; -import type { ShlinkShortUrl, ShortUrlData } from '../data'; +import type { ShortUrlData } from '../data'; export const shortUrlMatches = (shortUrl: ShlinkShortUrl, shortCode: string, domain: OptionalString): boolean => { if (isNil(domain)) { @@ -20,7 +21,10 @@ export const domainMatches = (shortUrl: ShlinkShortUrl, domain: string): boolean return shortUrl.domain === domain; }; -export const shortUrlDataFromShortUrl = (shortUrl?: ShlinkShortUrl, settings?: ShortUrlCreationSettings): ShortUrlData => { +export const shortUrlDataFromShortUrl = ( + shortUrl?: ShlinkShortUrl, + settings?: ShortUrlCreationSettings, +): ShortUrlData => { const validateUrl = settings?.validateUrls ?? false; if (!shortUrl) { diff --git a/shlink-web-component/src/short-urls/reducers/shortUrlCreation.ts b/shlink-web-component/src/short-urls/reducers/shortUrlCreation.ts index 3fa49b35..a8a7bc7e 100644 --- a/shlink-web-component/src/short-urls/reducers/shortUrlCreation.ts +++ b/shlink-web-component/src/short-urls/reducers/shortUrlCreation.ts @@ -1,9 +1,9 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; +import type { ProblemDetailsError, ShlinkApiClient, ShlinkShortUrl } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import { createAsyncThunk } from '../../utils/redux'; -import type { ShlinkShortUrl, ShortUrlData } from '../data'; +import type { ShortUrlData } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlCreation'; diff --git a/shlink-web-component/src/short-urls/reducers/shortUrlDeletion.ts b/shlink-web-component/src/short-urls/reducers/shortUrlDeletion.ts index 13c67d10..91ff93ef 100644 --- a/shlink-web-component/src/short-urls/reducers/shortUrlDeletion.ts +++ b/shlink-web-component/src/short-urls/reducers/shortUrlDeletion.ts @@ -1,8 +1,8 @@ import { createAction, createSlice } from '@reduxjs/toolkit'; -import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; +import type { ProblemDetailsError, ShlinkApiClient, ShlinkShortUrl } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import { createAsyncThunk } from '../../utils/redux'; -import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data'; +import type { ShortUrlIdentifier } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlDeletion'; diff --git a/shlink-web-component/src/short-urls/reducers/shortUrlDetail.ts b/shlink-web-component/src/short-urls/reducers/shortUrlDetail.ts index 7a035bfc..f9426a81 100644 --- a/shlink-web-component/src/short-urls/reducers/shortUrlDetail.ts +++ b/shlink-web-component/src/short-urls/reducers/shortUrlDetail.ts @@ -1,9 +1,9 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import { createSlice } from '@reduxjs/toolkit'; -import type { ProblemDetailsError, ShlinkApiClient } from '../../api-contract'; +import type { ProblemDetailsError, ShlinkApiClient, ShlinkShortUrl } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import { createAsyncThunk } from '../../utils/redux'; -import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data'; +import type { ShortUrlIdentifier } from '../data'; import { shortUrlMatches } from '../helpers'; const REDUCER_PREFIX = 'shlink/shortUrlDetail'; diff --git a/shlink-web-component/src/short-urls/reducers/shortUrlEdition.ts b/shlink-web-component/src/short-urls/reducers/shortUrlEdition.ts index 3a6efa81..6ddc4db3 100644 --- a/shlink-web-component/src/short-urls/reducers/shortUrlEdition.ts +++ b/shlink-web-component/src/short-urls/reducers/shortUrlEdition.ts @@ -1,8 +1,8 @@ import { createSlice } from '@reduxjs/toolkit'; -import type { ProblemDetailsError, ShlinkApiClient, ShlinkShortUrlData } from '../../api-contract'; +import type { ProblemDetailsError, ShlinkApiClient, ShlinkShortUrl, ShlinkShortUrlData } from '../../api-contract'; import { parseApiError } from '../../api-contract/utils'; import { createAsyncThunk } from '../../utils/redux'; -import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data'; +import type { ShortUrlIdentifier } from '../data'; const REDUCER_PREFIX = 'shlink/shortUrlEdition'; diff --git a/shlink-web-component/src/short-urls/reducers/shortUrlsList.ts b/shlink-web-component/src/short-urls/reducers/shortUrlsList.ts index 61b026d4..c33a81af 100644 --- a/shlink-web-component/src/short-urls/reducers/shortUrlsList.ts +++ b/shlink-web-component/src/short-urls/reducers/shortUrlsList.ts @@ -1,9 +1,8 @@ import { createSlice } from '@reduxjs/toolkit'; import { assocPath, last, pipe, reject } from 'ramda'; -import type { ShlinkApiClient, ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api-contract'; +import type { ShlinkApiClient, ShlinkShortUrl, ShlinkShortUrlsListParams, ShlinkShortUrlsResponse } from '../../api-contract'; import { createAsyncThunk } from '../../utils/redux'; import { createNewVisits } from '../../visits/reducers/visitCreation'; -import type { ShlinkShortUrl } from '../data'; import { shortUrlMatches } from '../helpers'; import type { createShortUrl } from './shortUrlCreation'; import { shortUrlDeleted } from './shortUrlDeletion'; diff --git a/shlink-web-component/src/visits/VisitsHeader.tsx b/shlink-web-component/src/visits/VisitsHeader.tsx index b23007ff..f9471bcd 100644 --- a/shlink-web-component/src/visits/VisitsHeader.tsx +++ b/shlink-web-component/src/visits/VisitsHeader.tsx @@ -2,7 +2,7 @@ import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import type { FC, PropsWithChildren, ReactNode } from 'react'; import { Button, Card } from 'reactstrap'; -import type { ShlinkShortUrl } from '../short-urls/data'; +import type { ShlinkShortUrl } from '../api-contract'; import { ShortUrlVisitsCount } from '../short-urls/helpers/ShortUrlVisitsCount'; import type { Visit } from './types'; diff --git a/shlink-web-component/src/visits/types/index.ts b/shlink-web-component/src/visits/types/index.ts index 619f66b2..d10829a8 100644 --- a/shlink-web-component/src/visits/types/index.ts +++ b/shlink-web-component/src/visits/types/index.ts @@ -1,4 +1,4 @@ -import type { ShlinkShortUrl } from '../../short-urls/data'; +import type { ShlinkShortUrl } from '../../api-contract'; import type { DateRange } from '../../utils/dates/helpers/dateIntervals'; export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404'; diff --git a/shlink-web-component/test/short-urls/helpers/DeleteShortUrlModal.test.tsx b/shlink-web-component/test/short-urls/helpers/DeleteShortUrlModal.test.tsx index e725dd27..448d46bb 100644 --- a/shlink-web-component/test/short-urls/helpers/DeleteShortUrlModal.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/DeleteShortUrlModal.test.tsx @@ -1,8 +1,7 @@ import { screen, waitFor } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { InvalidShortUrlDeletion } from '../../../src/api-contract'; +import type { InvalidShortUrlDeletion, ShlinkShortUrl } from '../../../src/api-contract'; import { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api-contract'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal'; import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/shlink-web-component/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx b/shlink-web-component/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx index af7c0660..c4f21519 100644 --- a/shlink-web-component/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ExportShortUrlsBtn.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn'; import type { ReportExporter } from '../../../src/utils/services/ReportExporter'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/shlink-web-component/test/short-urls/helpers/ShortUrlDetailLink.test.tsx b/shlink-web-component/test/short-urls/helpers/ShortUrlDetailLink.test.tsx index 0646c92b..0ad7f412 100644 --- a/shlink-web-component/test/short-urls/helpers/ShortUrlDetailLink.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ShortUrlDetailLink.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink'; import { RoutesPrefixProvider } from '../../../src/utils/routesPrefix'; diff --git a/shlink-web-component/test/short-urls/helpers/ShortUrlStatus.test.tsx b/shlink-web-component/test/short-urls/helpers/ShortUrlStatus.test.tsx index e68311fb..40ced0af 100644 --- a/shlink-web-component/test/short-urls/helpers/ShortUrlStatus.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ShortUrlStatus.test.tsx @@ -1,8 +1,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkVisitsSummary } from '../../../src/api-contract'; -import type { ShlinkShortUrlMeta, ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl, ShlinkShortUrlMeta, ShlinkVisitsSummary } from '../../../src/api-contract'; import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus'; describe('', () => { diff --git a/shlink-web-component/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx b/shlink-web-component/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx index cb8e7304..2c0c5517 100644 --- a/shlink-web-component/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ShortUrlVisitsCount.test.tsx @@ -1,7 +1,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount'; describe('', () => { diff --git a/shlink-web-component/test/short-urls/helpers/ShortUrlsRow.test.tsx b/shlink-web-component/test/short-urls/helpers/ShortUrlsRow.test.tsx index 9a306a55..0331e2db 100644 --- a/shlink-web-component/test/short-urls/helpers/ShortUrlsRow.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ShortUrlsRow.test.tsx @@ -4,7 +4,7 @@ import { addDays, formatISO, subDays } from 'date-fns'; import { last } from 'ramda'; import { MemoryRouter, useLocation } from 'react-router-dom'; import type { Settings } from '../../../src'; -import type { ShlinkShortUrlMeta, ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl, ShlinkShortUrlMeta } from '../../../src/api-contract'; import { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow'; import { now, parseDate } from '../../../src/utils/dates/helpers/date'; import type { TimeoutToggle } from '../../../src/utils/helpers/hooks'; diff --git a/shlink-web-component/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx b/shlink-web-component/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx index e7624d31..413369c7 100644 --- a/shlink-web-component/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx +++ b/shlink-web-component/test/short-urls/helpers/ShortUrlsRowMenu.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { fromPartial } from '@total-typescript/shoehorn'; import { MemoryRouter } from 'react-router-dom'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu'; import { renderWithEvents } from '../../__helpers__/setUpTest'; diff --git a/shlink-web-component/test/short-urls/helpers/index.test.ts b/shlink-web-component/test/short-urls/helpers/index.test.ts index 7c5fe988..ff3c1344 100644 --- a/shlink-web-component/test/short-urls/helpers/index.test.ts +++ b/shlink-web-component/test/short-urls/helpers/index.test.ts @@ -1,5 +1,5 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/short-urls/helpers'; describe('helpers', () => { diff --git a/shlink-web-component/test/short-urls/reducers/shortUrlCreation.test.ts b/shlink-web-component/test/short-urls/reducers/shortUrlCreation.test.ts index 3d4929c6..c547f623 100644 --- a/shlink-web-component/test/short-urls/reducers/shortUrlCreation.test.ts +++ b/shlink-web-component/test/short-urls/reducers/shortUrlCreation.test.ts @@ -1,6 +1,5 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api-contract'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkApiClient, ShlinkShortUrl } from '../../../src/api-contract'; import { createShortUrl as createShortUrlCreator, shortUrlCreationReducerCreator, diff --git a/shlink-web-component/test/short-urls/reducers/shortUrlDetail.test.ts b/shlink-web-component/test/short-urls/reducers/shortUrlDetail.test.ts index 460450b3..ce7afc60 100644 --- a/shlink-web-component/test/short-urls/reducers/shortUrlDetail.test.ts +++ b/shlink-web-component/test/short-urls/reducers/shortUrlDetail.test.ts @@ -1,7 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient } from '../../../src/api-contract'; +import type { ShlinkApiClient, ShlinkShortUrl } from '../../../src/api-contract'; import type { RootState } from '../../../src/container/store'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail'; import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList'; diff --git a/shlink-web-component/test/short-urls/reducers/shortUrlEdition.test.ts b/shlink-web-component/test/short-urls/reducers/shortUrlEdition.test.ts index 4e36eb99..96cfa681 100644 --- a/shlink-web-component/test/short-urls/reducers/shortUrlEdition.test.ts +++ b/shlink-web-component/test/short-urls/reducers/shortUrlEdition.test.ts @@ -1,5 +1,5 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { editShortUrl as editShortUrlCreator, shortUrlEditionReducerCreator, diff --git a/shlink-web-component/test/short-urls/reducers/shortUrlsList.test.ts b/shlink-web-component/test/short-urls/reducers/shortUrlsList.test.ts index 2925d511..a758ab50 100644 --- a/shlink-web-component/test/short-urls/reducers/shortUrlsList.test.ts +++ b/shlink-web-component/test/short-urls/reducers/shortUrlsList.test.ts @@ -1,6 +1,5 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkApiClient, ShlinkShortUrlsResponse } from '../../../src/api-contract'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkApiClient, ShlinkShortUrl, ShlinkShortUrlsResponse } from '../../../src/api-contract'; import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion'; import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition'; diff --git a/shlink-web-component/test/tags/reducers/tagsList.test.ts b/shlink-web-component/test/tags/reducers/tagsList.test.ts index c36b9720..9fedfd3b 100644 --- a/shlink-web-component/test/tags/reducers/tagsList.test.ts +++ b/shlink-web-component/test/tags/reducers/tagsList.test.ts @@ -1,6 +1,6 @@ import { fromPartial } from '@total-typescript/shoehorn'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import type { RootState } from '../../../src/container/store'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation'; import { tagDeleted } from '../../../src/tags/reducers/tagDelete'; import { tagEdited } from '../../../src/tags/reducers/tagEdit'; diff --git a/shlink-web-component/test/visits/reducers/domainVisits.test.ts b/shlink-web-component/test/visits/reducers/domainVisits.test.ts index 5ff7d1bd..7f0e9f2d 100644 --- a/shlink-web-component/test/visits/reducers/domainVisits.test.ts +++ b/shlink-web-component/test/visits/reducers/domainVisits.test.ts @@ -1,8 +1,7 @@ import { fromPartial } from '@total-typescript/shoehorn'; import { addDays, formatISO, subDays } from 'date-fns'; -import type { ShlinkApiClient, ShlinkVisits } from '../../../src/api-contract'; +import type { ShlinkApiClient, ShlinkShortUrl, ShlinkVisits } from '../../../src/api-contract'; import type { RootState } from '../../../src/container/store'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; import { formatIsoDate } from '../../../src/utils/dates/helpers/date'; import type { DateInterval } from '../../../src/utils/dates/helpers/dateIntervals'; import { rangeOf } from '../../../src/utils/helpers'; diff --git a/shlink-web-component/test/visits/reducers/visitCreation.test.ts b/shlink-web-component/test/visits/reducers/visitCreation.test.ts index 607ab8af..0a16b7a4 100644 --- a/shlink-web-component/test/visits/reducers/visitCreation.test.ts +++ b/shlink-web-component/test/visits/reducers/visitCreation.test.ts @@ -1,5 +1,5 @@ import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkShortUrl } from '../../../src/short-urls/data'; +import type { ShlinkShortUrl } from '../../../src/api-contract'; import { createNewVisits } from '../../../src/visits/reducers/visitCreation'; import type { Visit } from '../../../src/visits/types'; diff --git a/src/api/services/ShlinkApiClient.ts b/src/api/services/ShlinkApiClient.ts index 40e4f9d0..0f3d03c5 100644 --- a/src/api/services/ShlinkApiClient.ts +++ b/src/api/services/ShlinkApiClient.ts @@ -7,6 +7,7 @@ import type { ShlinkEditDomainRedirects, ShlinkHealth, ShlinkMercureInfo, + ShlinkShortUrl, ShlinkShortUrlData, ShlinkShortUrlsListNormalizedParams, ShlinkShortUrlsListParams, @@ -23,7 +24,7 @@ import { ErrorTypeV3, } from '@shlinkio/shlink-web-component/api-contract'; import { isEmpty, isNil, reject } from 'ramda'; -import type { ShlinkShortUrl, ShortUrlData } from '../../../shlink-web-component/src/short-urls/data'; +import type { ShortUrlData } from '../../../shlink-web-component/src/short-urls/data'; import type { HttpClient } from '../../common/services/HttpClient'; import { replaceAuthorityFromUri } from '../../utils/helpers/uri'; import type { OptionalString } from '../../utils/utils'; diff --git a/test/api/services/ShlinkApiClient.test.ts b/test/api/services/ShlinkApiClient.test.ts index 06c4cdee..05ac098b 100644 --- a/test/api/services/ShlinkApiClient.test.ts +++ b/test/api/services/ShlinkApiClient.test.ts @@ -1,7 +1,7 @@ -import type { ShlinkDomain, ShlinkVisits, ShlinkVisitsOverview } from '@shlinkio/shlink-web-component/api-contract'; +import type { ShlinkDomain, ShlinkShortUrl, ShlinkVisits, ShlinkVisitsOverview } from '@shlinkio/shlink-web-component/api-contract'; import { ErrorTypeV2, ErrorTypeV3 } from '@shlinkio/shlink-web-component/api-contract'; import { fromPartial } from '@total-typescript/shoehorn'; -import type { ShlinkShortUrl, ShortUrlsOrder } from '../../../shlink-web-component/src/short-urls/data'; +import type { ShortUrlsOrder } from '../../../shlink-web-component/src/short-urls/data'; import { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient'; import type { HttpClient } from '../../../src/common/services/HttpClient'; import type { OptionalString } from '../../../src/utils/utils';