tycho-components 0.22.2 → 0.22.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/api.d.ts +8 -0
- package/dist/configs/api.js +13 -3
- package/dist/configs/services/ParserListService.js +3 -3
- package/dist/features/DocumentDrawer/Actions/Actions.js +2 -2
- package/dist/features/DocumentDrawer/Inconsistency/Inconsistency.js +2 -2
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.d.ts +1 -5
- package/dist/features/DocumentDrawer/Inconsistency/InconsistencyService.js +0 -8
- package/dist/features/DocumentDrawer/services/AutomaticParserService.js +3 -3
- package/dist/features/DocumentDrawer/services/BoundingBoxService.js +4 -4
- package/dist/features/DocumentDrawer/services/LexiconService.d.ts +1 -4
- package/dist/features/DocumentDrawer/services/LexiconService.js +2 -5
- package/dist/features/DocumentDrawer/services/MetadataService.d.ts +1 -5
- package/dist/features/DocumentDrawer/services/MetadataService.js +0 -8
- package/dist/features/DocumentDrawer/services/SentenceService.js +2 -2
- package/dist/features/Participants/ParticipantService.js +6 -4
- package/dist/shell/Header/HeaderCorpora/HeaderCorpora.js +1 -1
- package/package.json +1 -1
package/dist/configs/api.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/** Platform API roots (formerly separate env vars per service). */
|
|
2
|
+
export declare const platformApi: {
|
|
3
|
+
base: string;
|
|
4
|
+
revision: string;
|
|
5
|
+
catalog: string;
|
|
6
|
+
editor: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const parserApiBase: string;
|
|
1
9
|
declare const api: import("axios").AxiosInstance;
|
|
2
10
|
export default api;
|
package/dist/configs/api.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import CookieStorage from './CookieStorage';
|
|
3
|
+
const platformApiBase = import.meta.env.VITE_APP_PLATFORM_API;
|
|
4
|
+
/** Platform API roots (formerly separate env vars per service). */
|
|
5
|
+
export const platformApi = {
|
|
6
|
+
base: platformApiBase,
|
|
7
|
+
revision: `${platformApiBase}/revision`,
|
|
8
|
+
catalog: `${platformApiBase}/catalog`,
|
|
9
|
+
editor: `${platformApiBase}/editor`,
|
|
10
|
+
};
|
|
11
|
+
export const parserApiBase = import.meta.env.VITE_APP_PARSER_API;
|
|
3
12
|
const api = axios.create({
|
|
4
13
|
headers: {
|
|
5
14
|
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
@@ -7,10 +16,11 @@ const api = axios.create({
|
|
|
7
16
|
'Content-Type': 'application/json',
|
|
8
17
|
Accept: 'application/json',
|
|
9
18
|
},
|
|
10
|
-
baseURL:
|
|
19
|
+
baseURL: platformApiBase,
|
|
11
20
|
});
|
|
12
21
|
const isStorybook = () => typeof window !== 'undefined' &&
|
|
13
|
-
(window.location.port === '6006' ||
|
|
22
|
+
(window.location.port === '6006' ||
|
|
23
|
+
window.__STORYBOOK__);
|
|
14
24
|
api.interceptors.response.use((response) => response, async (error) => {
|
|
15
25
|
if (error.response?.status === 401) {
|
|
16
26
|
CookieStorage.removeJwtToken();
|
|
@@ -21,7 +31,7 @@ api.interceptors.response.use((response) => response, async (error) => {
|
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
33
|
else if (error.response?.status === 403 && !isStorybook()) {
|
|
24
|
-
window.location.href =
|
|
34
|
+
window.location.href = import.meta.env.VITE_APP_UNAUTHORIZED_URL;
|
|
25
35
|
}
|
|
26
36
|
else if (error.status === null) {
|
|
27
37
|
console.log(JSON.stringify(error));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import api from '../api';
|
|
1
|
+
import api, { parserApiBase } from '../api';
|
|
2
2
|
function listParsers() {
|
|
3
|
-
return api.get(`${
|
|
3
|
+
return api.get(`${parserApiBase}/open/list`);
|
|
4
4
|
}
|
|
5
5
|
function listUDParsers() {
|
|
6
|
-
return api.get(`${
|
|
6
|
+
return api.get(`${parserApiBase}/open/ud/list`);
|
|
7
7
|
}
|
|
8
8
|
const ParserListService = { listParsers, listUDParsers };
|
|
9
9
|
export default ParserListService;
|
|
@@ -27,11 +27,11 @@ export default function Actions({ document, setOpenFile, setFilter, handleClickD
|
|
|
27
27
|
dispatchError({ err: 'warning.syntactic.review', t });
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
navigateSameWindow(`${import.meta.env.
|
|
30
|
+
navigateSameWindow(`${import.meta.env.VITE_APP_REVISION_URL}/tree/${r.data.uid}`);
|
|
31
31
|
});
|
|
32
32
|
};
|
|
33
33
|
const handleReview = () => {
|
|
34
|
-
const baseUrl = import.meta.env.
|
|
34
|
+
const baseUrl = import.meta.env.VITE_APP_REVISION_URL;
|
|
35
35
|
const url = document.defaultTool === 'DESIGN'
|
|
36
36
|
? `${baseUrl}/box/${document.uid}`
|
|
37
37
|
: `${baseUrl}/${document.uid}`;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { AppModal } from '../deps';
|
|
5
|
-
import { inconsistencies } from './InconsistencyResponse';
|
|
5
|
+
import { inconsistencies, } from './InconsistencyResponse';
|
|
6
6
|
import './style.scss';
|
|
7
7
|
export default function Inconsistency({ data, onClose }) {
|
|
8
8
|
const { t } = useTranslation('inconsistency');
|
|
@@ -12,7 +12,7 @@ export default function Inconsistency({ data, onClose }) {
|
|
|
12
12
|
return !arr ? (_jsx("span", { children: "0" })) : (_jsx("span", { className: "pointer", onClick: () => setPages(pages.length > 0 ? [] : arr.pages), children: arr.total }));
|
|
13
13
|
};
|
|
14
14
|
const openPage = (uid) => {
|
|
15
|
-
window.open(`${import.meta.env.
|
|
15
|
+
window.open(`${import.meta.env.VITE_APP_CATALOG_URL}/${uid}`);
|
|
16
16
|
};
|
|
17
17
|
return (_jsxs(AppModal, { title: t('modal.inconsistency.title'), className: "modal-inconsistency", hideFooter: true, close: onClose, children: [_jsx("p", { children: t('modal.inconsistency.description') }), _jsxs("table", { className: "inconsistency-table", children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: t('table.header.type') }), _jsx("th", { children: t('table.header.words') }), _jsx("th", { children: t('table.header.severity') }), _jsx("th", { children: t('table.header.action') })] }) }), _jsx("tbody", { children: inconsistencies.map((item, idx) => (_jsxs("tr", { children: [_jsx("td", { children: t(`type.label.${item.key}`) }), _jsx("td", { children: getTotal(item.key) }), _jsx("td", { children: t(`severity.label.${item.severity}`) }), _jsx("td", { children: t(`action.label.${item.auto}`) })] }, idx.valueOf()))) })] }), _jsx("div", { className: "inconsistency-warning", children: t('modal.inconsistency.warning') }), pages.length > 0 && (_jsx("div", { className: "links", children: pages.map((page) => (_jsxs("span", { onClick: () => openPage(page), children: [t('action.label.page'), page] }, page))) }))] }));
|
|
18
18
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import InconsistencyResponse
|
|
1
|
+
import InconsistencyResponse from './InconsistencyResponse';
|
|
2
2
|
declare function verifyForDocument(uid: string): Promise<import("axios").AxiosResponse<InconsistencyResponse, any, {}>>;
|
|
3
|
-
declare function verifyForPage(uid: string): Promise<import("axios").AxiosResponse<InconsistencyPageResponse, any, {}>>;
|
|
4
|
-
declare function fixForPage(uid: string): Promise<import("axios").AxiosResponse<InconsistencyPageResponse, any, {}>>;
|
|
5
3
|
declare const InconsistencyService: {
|
|
6
4
|
verifyForDocument: typeof verifyForDocument;
|
|
7
|
-
verifyForPage: typeof verifyForPage;
|
|
8
|
-
fixForPage: typeof fixForPage;
|
|
9
5
|
};
|
|
10
6
|
export default InconsistencyService;
|
|
@@ -2,15 +2,7 @@ import api from '../../../configs/api';
|
|
|
2
2
|
function verifyForDocument(uid) {
|
|
3
3
|
return api.get(`${import.meta.env.VITE_APP_FUNCTIONS_API}/inconsistency/document/${uid}`);
|
|
4
4
|
}
|
|
5
|
-
function verifyForPage(uid) {
|
|
6
|
-
return api.get(`${import.meta.env.VITE_APP_FUNCTIONS_API}/inconsistency/page/${uid}`);
|
|
7
|
-
}
|
|
8
|
-
function fixForPage(uid) {
|
|
9
|
-
return api.get(`${import.meta.env.VITE_APP_FUNCTIONS_API}/inconsistency/fix/${uid}`);
|
|
10
|
-
}
|
|
11
5
|
const InconsistencyService = {
|
|
12
6
|
verifyForDocument,
|
|
13
|
-
verifyForPage,
|
|
14
|
-
fixForPage,
|
|
15
7
|
};
|
|
16
8
|
export default InconsistencyService;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { parserApiBase } from '../../../configs/api';
|
|
2
2
|
function executeAutomaticParsing(uid, request) {
|
|
3
|
-
return api.post(`${
|
|
3
|
+
return api.post(`${parserApiBase}/auto/execute/${uid}`, request);
|
|
4
4
|
}
|
|
5
5
|
function checkParsingStatus(uid) {
|
|
6
|
-
return api.get(`${
|
|
6
|
+
return api.get(`${parserApiBase}/auto/status/${uid}`);
|
|
7
7
|
}
|
|
8
8
|
const AutomaticParserService = { executeAutomaticParsing, checkParsingStatus };
|
|
9
9
|
export default AutomaticParserService;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../../configs/api';
|
|
2
2
|
function remove(box) {
|
|
3
|
-
return api.delete(`${
|
|
3
|
+
return api.delete(`${platformApi.editor}/box/${box.uid}`);
|
|
4
4
|
}
|
|
5
5
|
function create(uid, corpus) {
|
|
6
|
-
return api.post(`${
|
|
6
|
+
return api.post(`${platformApi.editor}/box/${uid}/${corpus.uid}`);
|
|
7
7
|
}
|
|
8
8
|
function page(document, index, size) {
|
|
9
9
|
const data = {
|
|
10
10
|
page: index,
|
|
11
11
|
size,
|
|
12
12
|
};
|
|
13
|
-
return api.post(`${
|
|
13
|
+
return api.post(`${platformApi.editor}/box/document/${document.uid}`, data);
|
|
14
14
|
}
|
|
15
15
|
const BoundingBoxService = {
|
|
16
16
|
page,
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import Lexicon from '../types/Lexicon';
|
|
2
1
|
import LexiconResponse from '../types/LexiconResponse';
|
|
3
2
|
import { Document } from '../deps';
|
|
4
|
-
|
|
5
|
-
declare function available(): Promise<import("axios").AxiosResponse<Lexicon[], any, {}>>;
|
|
3
|
+
declare function list(document: Document): Promise<import("axios").AxiosResponse<LexiconResponse[], any, {}>>;
|
|
6
4
|
declare const LexiconService: {
|
|
7
5
|
list: typeof list;
|
|
8
|
-
available: typeof available;
|
|
9
6
|
};
|
|
10
7
|
export default LexiconService;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import api from '../../../configs/api';
|
|
2
|
-
|
|
2
|
+
function list(document) {
|
|
3
3
|
return api.get(`/lexicon/document/${document.uid}`);
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
return api.get(`${import.meta.env.VITE_APP_LEXICON_API}/available/admin`);
|
|
7
|
-
}
|
|
8
|
-
const LexiconService = { list, available };
|
|
5
|
+
const LexiconService = { list };
|
|
9
6
|
export default LexiconService;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import Metadata from '../types/Metadata';
|
|
2
|
-
import {
|
|
2
|
+
import { Document } from '../deps';
|
|
3
3
|
declare function list(document: Document): Promise<import("axios").AxiosResponse<Metadata[], any, {}>>;
|
|
4
4
|
declare function update(uid: string, request: Record<string, string>): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
5
|
-
declare function findBySymbol(corpus: Corpus, symbol: string): Promise<import("axios").AxiosResponse<Metadata, any, {}>>;
|
|
6
|
-
declare function findByCorpus(corpus: string): Promise<import("axios").AxiosResponse<Metadata[], any, {}>>;
|
|
7
5
|
declare function suggestValues(corpus: string, metadataUid: string, q: string): Promise<import("axios").AxiosResponse<string[], any, {}>>;
|
|
8
6
|
declare const MetadataService: {
|
|
9
7
|
list: typeof list;
|
|
10
8
|
update: typeof update;
|
|
11
|
-
findBySymbol: typeof findBySymbol;
|
|
12
|
-
findByCorpus: typeof findByCorpus;
|
|
13
9
|
suggestValues: typeof suggestValues;
|
|
14
10
|
};
|
|
15
11
|
export default MetadataService;
|
|
@@ -5,12 +5,6 @@ function list(document) {
|
|
|
5
5
|
function update(uid, request) {
|
|
6
6
|
return api.patch(`/metadata/${uid}`, request);
|
|
7
7
|
}
|
|
8
|
-
function findBySymbol(corpus, symbol) {
|
|
9
|
-
return api.get(`/metadata/symbol/${corpus.uid}/${symbol}`);
|
|
10
|
-
}
|
|
11
|
-
function findByCorpus(corpus) {
|
|
12
|
-
return api.get(`/metadata/corpus/${corpus}`);
|
|
13
|
-
}
|
|
14
8
|
function suggestValues(corpus, metadataUid, q) {
|
|
15
9
|
return api.get(`/metadata/values/${corpus}/${metadataUid}`, {
|
|
16
10
|
params: { q },
|
|
@@ -19,8 +13,6 @@ function suggestValues(corpus, metadataUid, q) {
|
|
|
19
13
|
const MetadataService = {
|
|
20
14
|
list,
|
|
21
15
|
update,
|
|
22
|
-
findBySymbol,
|
|
23
|
-
findByCorpus,
|
|
24
16
|
suggestValues,
|
|
25
17
|
};
|
|
26
18
|
export default MetadataService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import api from '../../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../../configs/api';
|
|
2
2
|
function resume(uid) {
|
|
3
|
-
return api.get(`${
|
|
3
|
+
return api.get(`${platformApi.revision}/sentence/resume/${uid}`);
|
|
4
4
|
}
|
|
5
5
|
const SentenceService = { resume };
|
|
6
6
|
export default SentenceService;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import api from '../../configs/api';
|
|
1
|
+
import api, { platformApi } from '../../configs/api';
|
|
2
2
|
function add(uid, request) {
|
|
3
|
-
return api.post(`${
|
|
3
|
+
return api.post(`${platformApi.catalog}/participant/${uid}`, request);
|
|
4
4
|
}
|
|
5
5
|
function update(field) {
|
|
6
|
-
return api.patch(`${
|
|
6
|
+
return api.patch(`${platformApi.catalog}/participant/update`, field);
|
|
7
7
|
}
|
|
8
8
|
function remove(document, code, transfer) {
|
|
9
9
|
const request = {
|
|
10
10
|
code,
|
|
11
11
|
transfer,
|
|
12
12
|
};
|
|
13
|
-
return api.delete(`${
|
|
13
|
+
return api.delete(`${platformApi.catalog}/participant/${document}`, {
|
|
14
|
+
data: request,
|
|
15
|
+
});
|
|
14
16
|
}
|
|
15
17
|
const ParticipantService = { add, update, remove };
|
|
16
18
|
export default ParticipantService;
|
|
@@ -30,7 +30,7 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, use
|
|
|
30
30
|
if (uid) {
|
|
31
31
|
const selectedCorpus = r.data.find((c) => c.uid === uid);
|
|
32
32
|
if (!selectedCorpus) {
|
|
33
|
-
window.location.href =
|
|
33
|
+
window.location.href = import.meta.env.VITE_APP_UNAUTHORIZED_URL;
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
navigateCorpora && navigateCorpora(selectedCorpus.uid);
|