corpushub-design-system 0.0.20 → 0.0.22
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/index.js +2 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/configs/index.js +1 -0
- package/dist/configs/localization/HeaderTexts.js +3 -3
- package/dist/features/AccessControl/AccessControlService.js +8 -8
- package/dist/features/Comments/CommentService.js +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import authApi from '../auth/authApi';
|
|
1
2
|
import { applyAuthErrorHandling } from './applyAuthErrorHandling';
|
|
2
3
|
import { createApiClient } from './createApiClient';
|
|
3
4
|
const platformApiBase = import.meta.env.VITE_APP_PLATFORM_API;
|
|
@@ -13,6 +14,7 @@ export const parserApiBase = import.meta.env.VITE_APP_PARSER_API ||
|
|
|
13
14
|
export const lexiconApiBase = import.meta.env.VITE_APP_LEXICON_API ||
|
|
14
15
|
import.meta.env.VITE_APP_URL_API;
|
|
15
16
|
const api = applyAuthErrorHandling(createApiClient({ baseURL: platformApiBase }), { authErrorHandling: 'redirect' });
|
|
17
|
+
applyAuthErrorHandling(authApi, { authErrorHandling: 'redirect' });
|
|
16
18
|
export { createApiClient } from './createApiClient';
|
|
17
19
|
export { installAuthRefreshInterceptor } from '../auth/installAuthRefreshInterceptor';
|
|
18
20
|
export { applyAuthErrorHandling } from './applyAuthErrorHandling';
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { applyAccessTokenFromApi, loginWithGoogle, loginWithPassword, logout, }
|
|
|
5
5
|
export { bootstrapAuthSession, clearSession, getAccessToken, LEGACY_JWT_COOKIE, mayHaveRefreshSession, REDIRECT_ACCESS_TOKEN_HASH_PARAM, refreshAccessToken, setAccessToken, } from './auth/session';
|
|
6
6
|
export { buildCrossAppRedirectUrl, clearLocalhostJwtHandoff, isLocalDevHost, persistLocalhostJwtHandoff, } from './auth/localDevHandoff';
|
|
7
7
|
export { installAuthRefreshInterceptor } from './auth/installAuthRefreshInterceptor';
|
|
8
|
+
export { default as authApi, configureAuthApiBaseUrl, } from './auth/authApi';
|
|
8
9
|
export type { TokenAuthResponse } from './auth/authApi';
|
|
9
10
|
export { commonLocalization, commonResources, featureResources, mergeResources, } from './Localization';
|
|
10
11
|
export { applyAuthErrorHandling, createApiClient, dispatchAccessDeniedError, dispatchApiError, dispatchClientError, dispatchServerApiError, isAccessDeniedApiError, isHandledApiError, isHandledAuthError, markApiErrorHandled, markAuthErrorHandled, parserApiBase, lexiconApiBase, platformApi, resolveAccessDeniedMessage, } from './api';
|
package/dist/configs/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { applyAccessTokenFromApi, loginWithGoogle, loginWithPassword, logout, }
|
|
|
5
5
|
export { bootstrapAuthSession, clearSession, getAccessToken, LEGACY_JWT_COOKIE, mayHaveRefreshSession, REDIRECT_ACCESS_TOKEN_HASH_PARAM, refreshAccessToken, setAccessToken, } from './auth/session';
|
|
6
6
|
export { buildCrossAppRedirectUrl, clearLocalhostJwtHandoff, isLocalDevHost, persistLocalhostJwtHandoff, } from './auth/localDevHandoff';
|
|
7
7
|
export { installAuthRefreshInterceptor } from './auth/installAuthRefreshInterceptor';
|
|
8
|
+
export { default as authApi, configureAuthApiBaseUrl, } from './auth/authApi';
|
|
8
9
|
export { commonLocalization, commonResources, featureResources, mergeResources, } from './Localization';
|
|
9
10
|
export { applyAuthErrorHandling, createApiClient, dispatchAccessDeniedError, dispatchApiError, dispatchClientError, dispatchServerApiError, isAccessDeniedApiError, isHandledApiError, isHandledAuthError, markApiErrorHandled, markAuthErrorHandled, parserApiBase, lexiconApiBase, platformApi, resolveAccessDeniedMessage, } from './api';
|
|
10
11
|
export { brandAssetBase, brandFromEnv, createBrand, resolveBrandLogo, resolveBrandLogoShort, resolveBrandYoutube, } from './brand';
|
|
@@ -6,7 +6,7 @@ export const HeaderTexts = {
|
|
|
6
6
|
'label.my.settings': 'My Settings',
|
|
7
7
|
'label.choose': 'Choose a corpus',
|
|
8
8
|
'tooltip.keyboard': 'Open Virtual Keyboard',
|
|
9
|
-
'tooltip.tutorials': '
|
|
9
|
+
'tooltip.tutorials': 'Help Center',
|
|
10
10
|
'replace.all.tooltip': 'Replace All',
|
|
11
11
|
'replace.find.placeholder': 'Find',
|
|
12
12
|
'replace.placeholder': 'Replace',
|
|
@@ -28,7 +28,7 @@ export const HeaderTexts = {
|
|
|
28
28
|
'label.my.settings': 'Minhas Configurações',
|
|
29
29
|
'label.choose': 'Escolha um corpus',
|
|
30
30
|
'tooltip.keyboard': 'Abrir Teclado Virtual',
|
|
31
|
-
'tooltip.tutorials': '
|
|
31
|
+
'tooltip.tutorials': 'Central de Ajuda',
|
|
32
32
|
'replace.all.tooltip': 'Substituir Todos',
|
|
33
33
|
'replace.find.placeholder': 'Procurar',
|
|
34
34
|
'replace.placeholder': 'Substituir',
|
|
@@ -50,7 +50,7 @@ export const HeaderTexts = {
|
|
|
50
50
|
'label.my.settings': 'Le mie impostazioni',
|
|
51
51
|
'label.choose': 'Scegli un corpus',
|
|
52
52
|
'tooltip.keyboard': 'Apri tastiera virtuale',
|
|
53
|
-
'tooltip.tutorials': '
|
|
53
|
+
'tooltip.tutorials': 'Centro assistenza',
|
|
54
54
|
'replace.all.tooltip': 'Sostituisci tutto',
|
|
55
55
|
'replace.find.placeholder': 'Trova',
|
|
56
56
|
'replace.placeholder': 'Sostituisci',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import api, { lexiconApiBase, parserApiBase, platformApi } from '../../configs/api';
|
|
2
|
+
import authApi from '../../configs/auth/authApi';
|
|
2
3
|
import { convertPageable } from '../../common';
|
|
3
|
-
const AUTH_API = () => import.meta.env.VITE_APP_AUTH_API;
|
|
4
4
|
const APP_BY_MODE = {
|
|
5
5
|
corpus: 'CORPUS',
|
|
6
6
|
parser: 'PARSER',
|
|
@@ -10,20 +10,20 @@ function resourceKey(mode) {
|
|
|
10
10
|
return mode;
|
|
11
11
|
}
|
|
12
12
|
function updatePortal(user, corpus, request) {
|
|
13
|
-
return
|
|
13
|
+
return authApi.patch(`/portal/${user}`, {
|
|
14
14
|
corpus,
|
|
15
15
|
...request,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function update(mode, resourceUid, user, request) {
|
|
19
|
-
return
|
|
19
|
+
return authApi.patch(`/access/${resourceUid}`, {
|
|
20
20
|
user,
|
|
21
21
|
...request,
|
|
22
22
|
app: APP_BY_MODE[mode],
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
function revoke(mode, user, resourceUid) {
|
|
26
|
-
return
|
|
26
|
+
return authApi.delete(`/${resourceUid}/${user}/${mode}`);
|
|
27
27
|
}
|
|
28
28
|
function grant(mode, access, resourceUid) {
|
|
29
29
|
const flags = mode === 'corpus'
|
|
@@ -31,7 +31,7 @@ function grant(mode, access, resourceUid) {
|
|
|
31
31
|
: mode === 'parser'
|
|
32
32
|
? { corpus: false }
|
|
33
33
|
: { corpus: false, lexicon: true, parser: false };
|
|
34
|
-
return
|
|
34
|
+
return authApi.post(`/${resourceUid}`, {
|
|
35
35
|
...access,
|
|
36
36
|
...flags,
|
|
37
37
|
});
|
|
@@ -41,10 +41,10 @@ function page(mode, resourceUid, filter) {
|
|
|
41
41
|
[resourceKey(mode)]: resourceUid,
|
|
42
42
|
...convertPageable(filter),
|
|
43
43
|
};
|
|
44
|
-
return
|
|
44
|
+
return authApi.post('/access', data);
|
|
45
45
|
}
|
|
46
46
|
function search(mode, text, resourceUid) {
|
|
47
|
-
return
|
|
47
|
+
return authApi.get('/search', {
|
|
48
48
|
params: {
|
|
49
49
|
text,
|
|
50
50
|
[resourceKey(mode)]: resourceUid,
|
|
@@ -53,7 +53,7 @@ function search(mode, text, resourceUid) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
function searchAll(text) {
|
|
56
|
-
return
|
|
56
|
+
return authApi.get('/search', {
|
|
57
57
|
params: { text },
|
|
58
58
|
});
|
|
59
59
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import api from '../../configs/api';
|
|
2
|
+
import authApi from '../../configs/auth/authApi';
|
|
2
3
|
import StorybookUtils from '../../functions/StorybookUtils';
|
|
3
4
|
import { mockCommentUsers, mockComments } from './CommentService.mock';
|
|
4
5
|
let storybookComments = mockComments.map((c) => ({ ...c }));
|
|
@@ -109,7 +110,7 @@ function findAvailableUsers(uid, mode) {
|
|
|
109
110
|
if (StorybookUtils.isStorybook()) {
|
|
110
111
|
return mockResponse(mockCommentUsers);
|
|
111
112
|
}
|
|
112
|
-
return
|
|
113
|
+
return authApi.get(`/${mode}/${uid}`);
|
|
113
114
|
}
|
|
114
115
|
const CommentService = {
|
|
115
116
|
add,
|