mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2025-01-03 14:57:22 +03:00
Moved some types from short-url/data to api-contract
This commit is contained in:
parent
23daa2de72
commit
d97db9e17c
35 changed files with 79 additions and 79 deletions
|
@ -1,10 +1,11 @@
|
||||||
import type { ShlinkShortUrl, ShortUrlData } from '../short-urls/data';
|
import type { ShortUrlData } from '../short-urls/data';
|
||||||
import type {
|
import type {
|
||||||
ShlinkDomainRedirects,
|
ShlinkDomainRedirects,
|
||||||
ShlinkDomainsResponse,
|
ShlinkDomainsResponse,
|
||||||
ShlinkEditDomainRedirects,
|
ShlinkEditDomainRedirects,
|
||||||
ShlinkHealth,
|
ShlinkHealth,
|
||||||
ShlinkMercureInfo,
|
ShlinkMercureInfo,
|
||||||
|
ShlinkShortUrl,
|
||||||
ShlinkShortUrlData,
|
ShlinkShortUrlData,
|
||||||
ShlinkShortUrlsListParams,
|
ShlinkShortUrlsListParams,
|
||||||
ShlinkShortUrlsResponse,
|
ShlinkShortUrlsResponse,
|
||||||
|
|
|
@ -1,7 +1,36 @@
|
||||||
import type { Order } from '@shlinkio/shlink-frontend-kit';
|
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';
|
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<ShlinkDeviceLongUrls>, // 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<Nullable<ShlinkShortUrlMeta>>;
|
||||||
|
tags: string[];
|
||||||
|
domain: string | null;
|
||||||
|
title?: string | null;
|
||||||
|
crawlable?: boolean;
|
||||||
|
forwardQuery?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ShlinkShortUrlsResponse {
|
export interface ShlinkShortUrlsResponse {
|
||||||
data: ShlinkShortUrl[];
|
data: ShlinkShortUrl[];
|
||||||
pagination: ShlinkPaginator;
|
pagination: ShlinkPaginator;
|
||||||
|
|
|
@ -9,6 +9,7 @@ import type { ChangeEvent, FC } from 'react';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Button, FormGroup, Input, Row } from 'reactstrap';
|
import { Button, FormGroup, Input, Row } from 'reactstrap';
|
||||||
import type { InputType } from 'reactstrap/types/lib/Input';
|
import type { InputType } from 'reactstrap/types/lib/Input';
|
||||||
|
import type { ShlinkDeviceLongUrls } from '../api-contract';
|
||||||
import type { DomainSelectorProps } from '../domains/DomainSelector';
|
import type { DomainSelectorProps } from '../domains/DomainSelector';
|
||||||
import type { TagsSelectorProps } from '../tags/helpers/TagsSelector';
|
import type { TagsSelectorProps } from '../tags/helpers/TagsSelector';
|
||||||
import { IconInput } from '../utils/components/IconInput';
|
import { IconInput } from '../utils/components/IconInput';
|
||||||
|
@ -17,7 +18,7 @@ import { DateTimeInput } from '../utils/dates/DateTimeInput';
|
||||||
import { formatIsoDate } from '../utils/dates/helpers/date';
|
import { formatIsoDate } from '../utils/dates/helpers/date';
|
||||||
import { useFeature } from '../utils/features';
|
import { useFeature } from '../utils/features';
|
||||||
import { handleEventPreventingDefault, hasValue } from '../utils/helpers';
|
import { handleEventPreventingDefault, hasValue } from '../utils/helpers';
|
||||||
import type { ShlinkDeviceLongUrls, ShortUrlData } from './data';
|
import type { ShortUrlData } from './data';
|
||||||
import { ShortUrlFormCheckboxGroup } from './helpers/ShortUrlFormCheckboxGroup';
|
import { ShortUrlFormCheckboxGroup } from './helpers/ShortUrlFormCheckboxGroup';
|
||||||
import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon';
|
import { UseExistingIfFoundInfoIcon } from './UseExistingIfFoundInfoIcon';
|
||||||
import './ShortUrlForm.scss';
|
import './ShortUrlForm.scss';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import type { Order } from '@shlinkio/shlink-frontend-kit';
|
import type { Order } from '@shlinkio/shlink-frontend-kit';
|
||||||
import type { ShlinkShortUrlData, ShlinkVisitsSummary } from '../../api-contract';
|
import type { ShlinkShortUrl, ShlinkShortUrlData } from '../../api-contract';
|
||||||
import type { Nullable, OptionalString } from '../../utils/helpers';
|
import type { OptionalString } from '../../utils/helpers';
|
||||||
|
|
||||||
export interface ShortUrlData extends Omit<ShlinkShortUrlData, 'deviceLongUrls'> {
|
export interface ShortUrlData extends Omit<ShlinkShortUrlData, 'deviceLongUrls'> {
|
||||||
longUrl: string;
|
longUrl: string;
|
||||||
|
@ -15,35 +15,6 @@ export interface ShortUrlData extends Omit<ShlinkShortUrlData, 'deviceLongUrls'>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ShlinkDeviceLongUrls {
|
|
||||||
android?: OptionalString;
|
|
||||||
ios?: OptionalString;
|
|
||||||
desktop?: OptionalString;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ShlinkShortUrl {
|
|
||||||
shortCode: string;
|
|
||||||
shortUrl: string;
|
|
||||||
longUrl: string;
|
|
||||||
deviceLongUrls?: Required<ShlinkDeviceLongUrls>, // 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<Nullable<ShlinkShortUrlMeta>>;
|
|
||||||
tags: string[];
|
|
||||||
domain: string | null;
|
|
||||||
title?: string | null;
|
|
||||||
crawlable?: boolean;
|
|
||||||
forwardQuery?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ShlinkShortUrlMeta {
|
|
||||||
validSince?: string;
|
|
||||||
validUntil?: string;
|
|
||||||
maxVisits?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ShortUrlIdentifier {
|
export interface ShortUrlIdentifier {
|
||||||
shortCode: string;
|
shortCode: string;
|
||||||
domain?: OptionalString;
|
domain?: OptionalString;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import { useToggle } from '@shlinkio/shlink-frontend-kit';
|
import { useToggle } from '@shlinkio/shlink-frontend-kit';
|
||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { useCallback } 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 { ExportBtn } from '../../utils/components/ExportBtn';
|
||||||
import type { ReportExporter } from '../../utils/services/ReportExporter';
|
import type { ReportExporter } from '../../utils/services/ReportExporter';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
import { useShortUrlsQuery } from './hooks';
|
import { useShortUrlsQuery } from './hooks';
|
||||||
|
|
||||||
export interface ExportShortUrlsBtnProps {
|
export interface ExportShortUrlsBtnProps {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
import type { ShlinkShortUrl } from '../../api-contract';
|
||||||
import { useRoutesPrefix } from '../../utils/routesPrefix';
|
import { useRoutesPrefix } from '../../utils/routesPrefix';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
import { urlEncodeShortCode } from './index';
|
import { urlEncodeShortCode } from './index';
|
||||||
|
|
||||||
export type LinkSuffix = 'visits' | 'edit';
|
export type LinkSuffix = 'visits' | 'edit';
|
||||||
|
|
|
@ -5,8 +5,8 @@ import { useElementRef } from '@shlinkio/shlink-frontend-kit';
|
||||||
import { isBefore } from 'date-fns';
|
import { isBefore } from 'date-fns';
|
||||||
import type { FC, ReactNode } from 'react';
|
import type { FC, ReactNode } from 'react';
|
||||||
import { UncontrolledTooltip } from 'reactstrap';
|
import { UncontrolledTooltip } from 'reactstrap';
|
||||||
|
import type { ShlinkShortUrl } from '../../api-contract';
|
||||||
import { formatHumanFriendly, now, parseISO } from '../../utils/dates/helpers/date';
|
import { formatHumanFriendly, now, parseISO } from '../../utils/dates/helpers/date';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
|
|
||||||
interface ShortUrlStatusProps {
|
interface ShortUrlStatusProps {
|
||||||
shortUrl: ShlinkShortUrl;
|
shortUrl: ShlinkShortUrl;
|
||||||
|
|
|
@ -3,9 +3,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { useElementRef } from '@shlinkio/shlink-frontend-kit';
|
import { useElementRef } from '@shlinkio/shlink-frontend-kit';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { UncontrolledTooltip } from 'reactstrap';
|
import { UncontrolledTooltip } from 'reactstrap';
|
||||||
|
import type { ShlinkShortUrl } from '../../api-contract';
|
||||||
import { formatHumanFriendly, parseISO } from '../../utils/dates/helpers/date';
|
import { formatHumanFriendly, parseISO } from '../../utils/dates/helpers/date';
|
||||||
import { prettify } from '../../utils/helpers/numbers';
|
import { prettify } from '../../utils/helpers/numbers';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
import { ShortUrlDetailLink } from './ShortUrlDetailLink';
|
import { ShortUrlDetailLink } from './ShortUrlDetailLink';
|
||||||
import './ShortUrlVisitsCount.scss';
|
import './ShortUrlVisitsCount.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import { ExternalLink } from 'react-external-link';
|
import { ExternalLink } from 'react-external-link';
|
||||||
|
import type { ShlinkShortUrl } from '../../api-contract';
|
||||||
import { CopyToClipboardIcon } from '../../utils/components/CopyToClipboardIcon';
|
import { CopyToClipboardIcon } from '../../utils/components/CopyToClipboardIcon';
|
||||||
import { Time } from '../../utils/dates/Time';
|
import { Time } from '../../utils/dates/Time';
|
||||||
import type { TimeoutToggle } from '../../utils/helpers/hooks';
|
import type { TimeoutToggle } from '../../utils/helpers/hooks';
|
||||||
import type { ColorGenerator } from '../../utils/services/ColorGenerator';
|
import type { ColorGenerator } from '../../utils/services/ColorGenerator';
|
||||||
import { useSetting } from '../../utils/settings';
|
import { useSetting } from '../../utils/settings';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
import { useShortUrlsQuery } from './hooks';
|
import { useShortUrlsQuery } from './hooks';
|
||||||
import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu';
|
import type { ShortUrlsRowMenuType } from './ShortUrlsRowMenu';
|
||||||
import { ShortUrlStatus } from './ShortUrlStatus';
|
import { ShortUrlStatus } from './ShortUrlStatus';
|
||||||
|
|
|
@ -8,7 +8,8 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { RowDropdownBtn, useToggle } from '@shlinkio/shlink-frontend-kit';
|
import { RowDropdownBtn, useToggle } from '@shlinkio/shlink-frontend-kit';
|
||||||
import type { FC } from 'react';
|
import type { FC } from 'react';
|
||||||
import { DropdownItem } from 'reactstrap';
|
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';
|
import { ShortUrlDetailLink } from './ShortUrlDetailLink';
|
||||||
|
|
||||||
interface ShortUrlsRowMenuProps {
|
interface ShortUrlsRowMenuProps {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { isNil } from 'ramda';
|
import { isNil } from 'ramda';
|
||||||
|
import type { ShlinkShortUrl } from '../../api-contract';
|
||||||
import type { OptionalString } from '../../utils/helpers';
|
import type { OptionalString } from '../../utils/helpers';
|
||||||
import type { ShortUrlCreationSettings } from '../../utils/settings';
|
import type { ShortUrlCreationSettings } from '../../utils/settings';
|
||||||
import { DEFAULT_DOMAIN } from '../../visits/reducers/domainVisits';
|
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 => {
|
export const shortUrlMatches = (shortUrl: ShlinkShortUrl, shortCode: string, domain: OptionalString): boolean => {
|
||||||
if (isNil(domain)) {
|
if (isNil(domain)) {
|
||||||
|
@ -20,7 +21,10 @@ export const domainMatches = (shortUrl: ShlinkShortUrl, domain: string): boolean
|
||||||
return shortUrl.domain === domain;
|
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;
|
const validateUrl = settings?.validateUrls ?? false;
|
||||||
|
|
||||||
if (!shortUrl) {
|
if (!shortUrl) {
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { createSlice } 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 { parseApiError } from '../../api-contract/utils';
|
||||||
import { createAsyncThunk } from '../../utils/redux';
|
import { createAsyncThunk } from '../../utils/redux';
|
||||||
import type { ShlinkShortUrl, ShortUrlData } from '../data';
|
import type { ShortUrlData } from '../data';
|
||||||
|
|
||||||
const REDUCER_PREFIX = 'shlink/shortUrlCreation';
|
const REDUCER_PREFIX = 'shlink/shortUrlCreation';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { createAction, createSlice } from '@reduxjs/toolkit';
|
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 { parseApiError } from '../../api-contract/utils';
|
||||||
import { createAsyncThunk } from '../../utils/redux';
|
import { createAsyncThunk } from '../../utils/redux';
|
||||||
import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data';
|
import type { ShortUrlIdentifier } from '../data';
|
||||||
|
|
||||||
const REDUCER_PREFIX = 'shlink/shortUrlDeletion';
|
const REDUCER_PREFIX = 'shlink/shortUrlDeletion';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import type { PayloadAction } from '@reduxjs/toolkit';
|
import type { PayloadAction } from '@reduxjs/toolkit';
|
||||||
import { createSlice } 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 { parseApiError } from '../../api-contract/utils';
|
||||||
import { createAsyncThunk } from '../../utils/redux';
|
import { createAsyncThunk } from '../../utils/redux';
|
||||||
import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data';
|
import type { ShortUrlIdentifier } from '../data';
|
||||||
import { shortUrlMatches } from '../helpers';
|
import { shortUrlMatches } from '../helpers';
|
||||||
|
|
||||||
const REDUCER_PREFIX = 'shlink/shortUrlDetail';
|
const REDUCER_PREFIX = 'shlink/shortUrlDetail';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
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 { parseApiError } from '../../api-contract/utils';
|
||||||
import { createAsyncThunk } from '../../utils/redux';
|
import { createAsyncThunk } from '../../utils/redux';
|
||||||
import type { ShlinkShortUrl, ShortUrlIdentifier } from '../data';
|
import type { ShortUrlIdentifier } from '../data';
|
||||||
|
|
||||||
const REDUCER_PREFIX = 'shlink/shortUrlEdition';
|
const REDUCER_PREFIX = 'shlink/shortUrlEdition';
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { createSlice } from '@reduxjs/toolkit';
|
import { createSlice } from '@reduxjs/toolkit';
|
||||||
import { assocPath, last, pipe, reject } from 'ramda';
|
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 { createAsyncThunk } from '../../utils/redux';
|
||||||
import { createNewVisits } from '../../visits/reducers/visitCreation';
|
import { createNewVisits } from '../../visits/reducers/visitCreation';
|
||||||
import type { ShlinkShortUrl } from '../data';
|
|
||||||
import { shortUrlMatches } from '../helpers';
|
import { shortUrlMatches } from '../helpers';
|
||||||
import type { createShortUrl } from './shortUrlCreation';
|
import type { createShortUrl } from './shortUrlCreation';
|
||||||
import { shortUrlDeleted } from './shortUrlDeletion';
|
import { shortUrlDeleted } from './shortUrlDeletion';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
import type { FC, PropsWithChildren, ReactNode } from 'react';
|
||||||
import { Button, Card } from 'reactstrap';
|
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 { ShortUrlVisitsCount } from '../short-urls/helpers/ShortUrlVisitsCount';
|
||||||
import type { Visit } from './types';
|
import type { Visit } from './types';
|
||||||
|
|
||||||
|
|
|
@ -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';
|
import type { DateRange } from '../../utils/dates/helpers/dateIntervals';
|
||||||
|
|
||||||
export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404';
|
export type OrphanVisitType = 'base_url' | 'invalid_short_url' | 'regular_404';
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { screen, waitFor } from '@testing-library/react';
|
import { screen, waitFor } from '@testing-library/react';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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 { ErrorTypeV2, ErrorTypeV3 } from '../../../src/api-contract';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal';
|
import { DeleteShortUrlModal } from '../../../src/short-urls/helpers/DeleteShortUrlModal';
|
||||||
import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion';
|
import type { ShortUrlDeletion } from '../../../src/short-urls/reducers/shortUrlDeletion';
|
||||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { screen } from '@testing-library/react';
|
import { screen } from '@testing-library/react';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
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 { ExportShortUrlsBtn as createExportShortUrlsBtn } from '../../../src/short-urls/helpers/ExportShortUrlsBtn';
|
||||||
import type { ReportExporter } from '../../../src/utils/services/ReportExporter';
|
import type { ReportExporter } from '../../../src/utils/services/ReportExporter';
|
||||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
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 type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
|
||||||
import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
|
import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
|
||||||
import { RoutesPrefixProvider } from '../../../src/utils/routesPrefix';
|
import { RoutesPrefixProvider } from '../../../src/utils/routesPrefix';
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { render, screen, waitFor } from '@testing-library/react';
|
import { render, screen, waitFor } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import type { ShlinkVisitsSummary } from '../../../src/api-contract';
|
import type { ShlinkShortUrl, ShlinkShortUrlMeta, ShlinkVisitsSummary } from '../../../src/api-contract';
|
||||||
import type { ShlinkShortUrlMeta, ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus';
|
import { ShortUrlStatus } from '../../../src/short-urls/helpers/ShortUrlStatus';
|
||||||
|
|
||||||
describe('<ShortUrlStatus />', () => {
|
describe('<ShortUrlStatus />', () => {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { render, screen, waitFor } from '@testing-library/react';
|
import { render, screen, waitFor } from '@testing-library/react';
|
||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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';
|
import { ShortUrlVisitsCount } from '../../../src/short-urls/helpers/ShortUrlVisitsCount';
|
||||||
|
|
||||||
describe('<ShortUrlVisitsCount />', () => {
|
describe('<ShortUrlVisitsCount />', () => {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { addDays, formatISO, subDays } from 'date-fns';
|
||||||
import { last } from 'ramda';
|
import { last } from 'ramda';
|
||||||
import { MemoryRouter, useLocation } from 'react-router-dom';
|
import { MemoryRouter, useLocation } from 'react-router-dom';
|
||||||
import type { Settings } from '../../../src';
|
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 { ShortUrlsRow as createShortUrlsRow } from '../../../src/short-urls/helpers/ShortUrlsRow';
|
||||||
import { now, parseDate } from '../../../src/utils/dates/helpers/date';
|
import { now, parseDate } from '../../../src/utils/dates/helpers/date';
|
||||||
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
|
import type { TimeoutToggle } from '../../../src/utils/helpers/hooks';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { screen } from '@testing-library/react';
|
import { screen } from '@testing-library/react';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import { MemoryRouter } from 'react-router-dom';
|
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 { ShortUrlsRowMenu as createShortUrlsRowMenu } from '../../../src/short-urls/helpers/ShortUrlsRowMenu';
|
||||||
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
import { renderWithEvents } from '../../__helpers__/setUpTest';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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';
|
import { shortUrlDataFromShortUrl, urlDecodeShortCode, urlEncodeShortCode } from '../../../src/short-urls/helpers';
|
||||||
|
|
||||||
describe('helpers', () => {
|
describe('helpers', () => {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import type { ShlinkApiClient } from '../../../src/api-contract';
|
import type { ShlinkApiClient, ShlinkShortUrl } from '../../../src/api-contract';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import {
|
import {
|
||||||
createShortUrl as createShortUrlCreator,
|
createShortUrl as createShortUrlCreator,
|
||||||
shortUrlCreationReducerCreator,
|
shortUrlCreationReducerCreator,
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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 { RootState } from '../../../src/container/store';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail';
|
import { shortUrlDetailReducerCreator } from '../../../src/short-urls/reducers/shortUrlDetail';
|
||||||
import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList';
|
import type { ShortUrlsList } from '../../../src/short-urls/reducers/shortUrlsList';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
import type { ShlinkShortUrl } from '../../../src/api-contract';
|
||||||
import {
|
import {
|
||||||
editShortUrl as editShortUrlCreator,
|
editShortUrl as editShortUrlCreator,
|
||||||
shortUrlEditionReducerCreator,
|
shortUrlEditionReducerCreator,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import type { ShlinkApiClient, ShlinkShortUrlsResponse } from '../../../src/api-contract';
|
import type { ShlinkApiClient, ShlinkShortUrl, ShlinkShortUrlsResponse } from '../../../src/api-contract';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
|
import { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
|
||||||
import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion';
|
import { shortUrlDeleted } from '../../../src/short-urls/reducers/shortUrlDeletion';
|
||||||
import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition';
|
import { editShortUrl as editShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlEdition';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
|
import type { ShlinkShortUrl } from '../../../src/api-contract';
|
||||||
import type { RootState } from '../../../src/container/store';
|
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 { createShortUrl as createShortUrlCreator } from '../../../src/short-urls/reducers/shortUrlCreation';
|
||||||
import { tagDeleted } from '../../../src/tags/reducers/tagDelete';
|
import { tagDeleted } from '../../../src/tags/reducers/tagDelete';
|
||||||
import { tagEdited } from '../../../src/tags/reducers/tagEdit';
|
import { tagEdited } from '../../../src/tags/reducers/tagEdit';
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
import { fromPartial } from '@total-typescript/shoehorn';
|
||||||
import { addDays, formatISO, subDays } from 'date-fns';
|
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 { RootState } from '../../../src/container/store';
|
||||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
|
||||||
import { formatIsoDate } from '../../../src/utils/dates/helpers/date';
|
import { formatIsoDate } from '../../../src/utils/dates/helpers/date';
|
||||||
import type { DateInterval } from '../../../src/utils/dates/helpers/dateIntervals';
|
import type { DateInterval } from '../../../src/utils/dates/helpers/dateIntervals';
|
||||||
import { rangeOf } from '../../../src/utils/helpers';
|
import { rangeOf } from '../../../src/utils/helpers';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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 { createNewVisits } from '../../../src/visits/reducers/visitCreation';
|
||||||
import type { Visit } from '../../../src/visits/types';
|
import type { Visit } from '../../../src/visits/types';
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import type {
|
||||||
ShlinkEditDomainRedirects,
|
ShlinkEditDomainRedirects,
|
||||||
ShlinkHealth,
|
ShlinkHealth,
|
||||||
ShlinkMercureInfo,
|
ShlinkMercureInfo,
|
||||||
|
ShlinkShortUrl,
|
||||||
ShlinkShortUrlData,
|
ShlinkShortUrlData,
|
||||||
ShlinkShortUrlsListNormalizedParams,
|
ShlinkShortUrlsListNormalizedParams,
|
||||||
ShlinkShortUrlsListParams,
|
ShlinkShortUrlsListParams,
|
||||||
|
@ -23,7 +24,7 @@ import {
|
||||||
ErrorTypeV3,
|
ErrorTypeV3,
|
||||||
} from '@shlinkio/shlink-web-component/api-contract';
|
} from '@shlinkio/shlink-web-component/api-contract';
|
||||||
import { isEmpty, isNil, reject } from 'ramda';
|
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 type { HttpClient } from '../../common/services/HttpClient';
|
||||||
import { replaceAuthorityFromUri } from '../../utils/helpers/uri';
|
import { replaceAuthorityFromUri } from '../../utils/helpers/uri';
|
||||||
import type { OptionalString } from '../../utils/utils';
|
import type { OptionalString } from '../../utils/utils';
|
||||||
|
|
|
@ -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 { ErrorTypeV2, ErrorTypeV3 } from '@shlinkio/shlink-web-component/api-contract';
|
||||||
import { fromPartial } from '@total-typescript/shoehorn';
|
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 { ShlinkApiClient } from '../../../src/api/services/ShlinkApiClient';
|
||||||
import type { HttpClient } from '../../../src/common/services/HttpClient';
|
import type { HttpClient } from '../../../src/common/services/HttpClient';
|
||||||
import type { OptionalString } from '../../../src/utils/utils';
|
import type { OptionalString } from '../../../src/utils/utils';
|
||||||
|
|
Loading…
Reference in a new issue