@lokalise/harmony 1.10.0 → 1.11.1
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/README.md +62 -0
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +923 -507
- package/dist/types/src/components/Sidebar/Sidebar.stories.d.ts +0 -84
- package/dist/types/src/components/Sidebar/Widgets/Avatar/Avatar.d.ts +6 -1
- package/dist/types/src/components/Sidebar/Widgets/IconLink/IconLink.d.ts +11 -1
- package/dist/types/src/components/Sidebar/Widgets/Menu/Menu.d.ts +15 -1
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.d.ts +20 -2
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileSettingsMenuItem/ProfileSettingsMenuItem.d.ts +32 -2
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/TeamMenuItem/TeamMenuItem.d.ts +26 -3
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/TeamSwitch/TeamSwitch.d.ts +20 -1
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/UpgradeMenuItem/UpgradeMenuItem.d.ts +19 -3
- package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/types.d.ts +7 -0
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts +10 -0
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +7 -0
- package/dist/types/src/features/auth/core/jwtTokenPayload.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/lokaliseAuthAddon.d.ts +14 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +13 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +5 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +42 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +27 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -0
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/addon/lokaliseAuthBrowserAddon.d.ts +35 -0
- package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +20 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +28 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +18 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +18 -0
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +12 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +14 -0
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts +1 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +4 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.test.d.ts +1 -0
- package/dist/types/src/features/auth/node.d.ts +9 -0
- package/dist/types/src/features/node.d.ts +2 -0
- package/dist/types/src/features/publicApi/contributors.d.ts +111 -0
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +76 -0
- package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +26 -0
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +20 -0
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +81 -0
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +34 -0
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +72 -0
- package/dist/types/src/features/publicApi/node.d.ts +16 -0
- package/dist/types/src/features/publicApi/projects.d.ts +1132 -0
- package/dist/types/src/features/publicApi/teamUsers.d.ts +61 -0
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +171 -0
- package/dist/types/src/features/publicApi/types/languageTypes.d.ts +29 -0
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +1061 -0
- package/dist/types/src/features/publicApi/types/teamRoleTypes.d.ts +3 -0
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +70 -0
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +26 -0
- package/dist/types/src/features/publicApi/userToken.d.ts +35 -0
- package/dist/types/src/node.d.ts +2 -1
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.d.ts +2 -0
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.test.d.ts +1 -0
- package/dist/types/src/utils/testing/deepOverride.d.ts +4 -0
- package/dist/types/src/utils/testing/deepOverride.test.d.ts +1 -0
- package/dist/types/src/utils/types/apiMutationOverrides.d.ts +2 -0
- package/dist/types/src/utils/types/apiQueryOverrides.d.ts +2 -0
- package/package.json +13 -2
package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ConfiguredMiddleware, Wretch } from 'wretch';
|
2
|
+
import { JwtAuthProps } from '../../core/middleware/jwtAuthMiddleware';
|
3
|
+
export type PromoteAuthProps = JwtAuthProps & {
|
4
|
+
/**
|
5
|
+
* Team ID is required to issue a new JWT token.
|
6
|
+
*/
|
7
|
+
getTeamId: () => Promise<number>;
|
8
|
+
/**
|
9
|
+
* The current CSRF token is required to issue a new JWT token.
|
10
|
+
* So this function should return the CSRF token for the current session.
|
11
|
+
*/
|
12
|
+
getCsrfToken: () => Promise<string | undefined>;
|
13
|
+
};
|
14
|
+
export declare function promoteClassicSessionToJwtMiddleware<T>(client: Wretch<T>, props: PromoteAuthProps): ConfiguredMiddleware;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { JwtToken } from '../../../publicApi/types/userTokenTypes';
|
2
|
+
export declare function getJwtTokenFromCookie(): JwtToken | undefined;
|
3
|
+
export declare function getCsrfTokenFromCookie(): string | undefined;
|
4
|
+
export declare function getCookie(cookies: string, name: string): string | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
export * from './frontend/hooks/useGetPromotedClassicSessionJwtQuery';
|
2
|
+
export * from './frontend/hooks/useAuthenticatedSessionPayload';
|
3
|
+
export * from './frontend/hooks/useAuthenticatedUser';
|
4
|
+
export * from './frontend/hooks/useAuthenticatedProjectContributor';
|
5
|
+
export * from './backend/services/getAuthenticatedSessionDetailFromRequest';
|
6
|
+
export { parseJwtTokenPayload } from './core/jwtTokenPayload';
|
7
|
+
export { publicApiHeadersMiddleware } from './core/middleware/publicApiHeadersMiddleware';
|
8
|
+
export { LokaliseAuthAddon } from './core/lokaliseAuthAddon';
|
9
|
+
export { LokaliseAuthBrowserAddon } from './frontend/addon/lokaliseAuthBrowserAddon';
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
/**
|
3
|
+
* Public API router definition for retrieving a project contributor
|
4
|
+
*/
|
5
|
+
export declare const retrieveContributor: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
|
6
|
+
projectId: string;
|
7
|
+
contributorId: number;
|
8
|
+
}, z.ZodObject<{
|
9
|
+
project_id: z.ZodString;
|
10
|
+
contributors: z.ZodArray<z.ZodObject<{
|
11
|
+
user_id: z.ZodNumber;
|
12
|
+
email: z.ZodString;
|
13
|
+
fullname: z.ZodString;
|
14
|
+
created_at: z.ZodString;
|
15
|
+
created_at_timestamp: z.ZodNumber;
|
16
|
+
admin_rights: z.ZodArray<z.ZodString, "many">;
|
17
|
+
languages: z.ZodArray<z.ZodObject<{
|
18
|
+
lang_id: z.ZodNumber;
|
19
|
+
lang_iso: z.ZodString;
|
20
|
+
lang_name: z.ZodString;
|
21
|
+
is_writable: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
23
|
+
lang_id: number;
|
24
|
+
lang_iso: string;
|
25
|
+
lang_name: string;
|
26
|
+
is_writable: 0 | 1;
|
27
|
+
}, {
|
28
|
+
lang_id: number;
|
29
|
+
lang_iso: string;
|
30
|
+
lang_name: string;
|
31
|
+
is_writable: 0 | 1;
|
32
|
+
}>, "many">;
|
33
|
+
is_admin: z.ZodBoolean;
|
34
|
+
is_reviewer: z.ZodBoolean;
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
36
|
+
email: string;
|
37
|
+
user_id: number;
|
38
|
+
fullname: string;
|
39
|
+
created_at: string;
|
40
|
+
created_at_timestamp: number;
|
41
|
+
admin_rights: string[];
|
42
|
+
languages: {
|
43
|
+
lang_id: number;
|
44
|
+
lang_iso: string;
|
45
|
+
lang_name: string;
|
46
|
+
is_writable: 0 | 1;
|
47
|
+
}[];
|
48
|
+
is_admin: boolean;
|
49
|
+
is_reviewer: boolean;
|
50
|
+
}, {
|
51
|
+
email: string;
|
52
|
+
user_id: number;
|
53
|
+
fullname: string;
|
54
|
+
created_at: string;
|
55
|
+
created_at_timestamp: number;
|
56
|
+
admin_rights: string[];
|
57
|
+
languages: {
|
58
|
+
lang_id: number;
|
59
|
+
lang_iso: string;
|
60
|
+
lang_name: string;
|
61
|
+
is_writable: 0 | 1;
|
62
|
+
}[];
|
63
|
+
is_admin: boolean;
|
64
|
+
is_reviewer: boolean;
|
65
|
+
}>, "many">;
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
67
|
+
contributors: {
|
68
|
+
email: string;
|
69
|
+
user_id: number;
|
70
|
+
fullname: string;
|
71
|
+
created_at: string;
|
72
|
+
created_at_timestamp: number;
|
73
|
+
admin_rights: string[];
|
74
|
+
languages: {
|
75
|
+
lang_id: number;
|
76
|
+
lang_iso: string;
|
77
|
+
lang_name: string;
|
78
|
+
is_writable: 0 | 1;
|
79
|
+
}[];
|
80
|
+
is_admin: boolean;
|
81
|
+
is_reviewer: boolean;
|
82
|
+
}[];
|
83
|
+
project_id: string;
|
84
|
+
}, {
|
85
|
+
contributors: {
|
86
|
+
email: string;
|
87
|
+
user_id: number;
|
88
|
+
fullname: string;
|
89
|
+
created_at: string;
|
90
|
+
created_at_timestamp: number;
|
91
|
+
admin_rights: string[];
|
92
|
+
languages: {
|
93
|
+
lang_id: number;
|
94
|
+
lang_iso: string;
|
95
|
+
lang_name: string;
|
96
|
+
is_writable: 0 | 1;
|
97
|
+
}[];
|
98
|
+
is_admin: boolean;
|
99
|
+
is_reviewer: boolean;
|
100
|
+
}[];
|
101
|
+
project_id: string;
|
102
|
+
}>, z.ZodObject<{
|
103
|
+
projectId: z.ZodString;
|
104
|
+
contributorId: z.ZodNumber;
|
105
|
+
}, "strip", z.ZodTypeAny, {
|
106
|
+
projectId: string;
|
107
|
+
contributorId: number;
|
108
|
+
}, {
|
109
|
+
projectId: string;
|
110
|
+
contributorId: number;
|
111
|
+
}>, undefined, undefined, false, false>;
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import { ApiMutationOverrides } from '../../../utils/types/apiMutationOverrides';
|
2
|
+
import { Wretch } from 'wretch';
|
3
|
+
import { CreateProjectRequestBody, Project } from '../types/projectTypes';
|
4
|
+
/**
|
5
|
+
* A react-router wrapper about the createProject public API endpoint
|
6
|
+
*
|
7
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
8
|
+
* @param overrides - Additional options to pass to the query.
|
9
|
+
*/
|
10
|
+
export declare function useCreateProjectMutation<T>(wretchClient: Wretch<T>, overrides?: ApiMutationOverrides<Project, CreateProjectRequestBody>): import('@tanstack/react-query').UseMutationResult<{
|
11
|
+
name: string;
|
12
|
+
created_at: string;
|
13
|
+
created_at_timestamp: number;
|
14
|
+
team_id: number;
|
15
|
+
description: string;
|
16
|
+
project_id: string;
|
17
|
+
uuid: string;
|
18
|
+
project_type: "localization_files" | "paged_documents" | "marketing";
|
19
|
+
created_by: number;
|
20
|
+
created_by_email: string;
|
21
|
+
base_language_id: number;
|
22
|
+
base_language_iso: string;
|
23
|
+
settings: {
|
24
|
+
per_platform_key_names: boolean;
|
25
|
+
reviewing: boolean;
|
26
|
+
auto_toggle_unverified: boolean;
|
27
|
+
offline_translation: boolean;
|
28
|
+
key_editing: boolean;
|
29
|
+
inline_machine_translations: boolean;
|
30
|
+
custom_translation_statuses: boolean;
|
31
|
+
custom_translation_statuses_allow_multiple: boolean;
|
32
|
+
segmentation: boolean;
|
33
|
+
contributor_preview_download_enabled: boolean;
|
34
|
+
};
|
35
|
+
statistics: {
|
36
|
+
team: number;
|
37
|
+
languages: {
|
38
|
+
progress: number;
|
39
|
+
language_id: number;
|
40
|
+
language_iso: string;
|
41
|
+
words_to_do: number;
|
42
|
+
}[];
|
43
|
+
progress_total: number;
|
44
|
+
keys_total: number;
|
45
|
+
base_words: number;
|
46
|
+
qa_issues_total: number;
|
47
|
+
qa_issues: {
|
48
|
+
not_reviewed: number;
|
49
|
+
unverified: number;
|
50
|
+
spelling_grammar: number;
|
51
|
+
inconsistent_placeholders: number;
|
52
|
+
inconsistent_html: number;
|
53
|
+
different_number_of_urls: number;
|
54
|
+
different_urls: number;
|
55
|
+
leading_whitespace: number;
|
56
|
+
trailing_whitespace: number;
|
57
|
+
different_number_of_email_address: number;
|
58
|
+
different_email_address: number;
|
59
|
+
different_brackets: number;
|
60
|
+
different_numbers: number;
|
61
|
+
double_space: number;
|
62
|
+
special_placeholder: number;
|
63
|
+
unbalanced_brackets: number;
|
64
|
+
};
|
65
|
+
};
|
66
|
+
}, undefined, {
|
67
|
+
name: string;
|
68
|
+
team_id: string;
|
69
|
+
languages: {
|
70
|
+
lang_iso: string;
|
71
|
+
custom_iso?: string | undefined;
|
72
|
+
}[];
|
73
|
+
project_type: "localization_files" | "paged_documents" | "marketing";
|
74
|
+
base_lang_iso: string;
|
75
|
+
is_segmentation_enabled: boolean;
|
76
|
+
}, undefined>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { TeamUserResponse } from '../types/teamUserTypes';
|
2
|
+
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
|
+
import { Wretch } from 'wretch/types';
|
4
|
+
/**
|
5
|
+
* Factory for generating the query key for the getTeamUser public API endpoint
|
6
|
+
*/
|
7
|
+
export declare const getTeamUsersQueryKey: {
|
8
|
+
teamUserKey: (teamId: number, userId: number) => readonly ["GetTeamUsers", number, number];
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* A react-router wrapper about the getTeamUser public API endpoint
|
12
|
+
*
|
13
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
14
|
+
* @param overrides - Additional options to pass to the query.
|
15
|
+
*/
|
16
|
+
export declare const useGetTeamUsersQuery: <T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<TeamUserResponse, typeof getTeamUsersQueryKey>) => import('@tanstack/react-query').UseQueryResult<{
|
17
|
+
team_id: number;
|
18
|
+
team_user: {
|
19
|
+
role: "member" | "admin" | "biller" | "owner";
|
20
|
+
email: string;
|
21
|
+
user_id: number;
|
22
|
+
fullname: string;
|
23
|
+
created_at: string;
|
24
|
+
created_at_timestamp: number;
|
25
|
+
};
|
26
|
+
}, undefined>;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { JwtToken } from '../types/userTokenTypes';
|
2
|
+
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
|
+
import { Wretch } from 'wretch/types';
|
4
|
+
/**
|
5
|
+
* Factory for generating keys for the getUserToken public API endpoint
|
6
|
+
*/
|
7
|
+
export declare const getUserTokenKey: {
|
8
|
+
teamKeyCsrf: (teamId: number, csrf: string) => readonly ["getUserToken", "x-csrf-token", string, number];
|
9
|
+
teamKeyJwt: (teamId: number, refreshToken: string) => readonly ["getUserToken", "Authorization", `Bearer ${string}`, number];
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* A react-router wrapper about the getUserToken public API endpoint
|
13
|
+
*
|
14
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
15
|
+
* @param overrides - Additional options to pass to the query.
|
16
|
+
*/
|
17
|
+
export declare const useGetUserTokenQuery: <T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<JwtToken, typeof getUserTokenKey>) => import('@tanstack/react-query').UseQueryResult<{
|
18
|
+
accessToken: string;
|
19
|
+
refreshToken: string;
|
20
|
+
}, undefined>;
|
@@ -0,0 +1,81 @@
|
|
1
|
+
import { ListProjectsRequestQuery, ListProjectsSuccessResponseBody } from '../types/projectTypes';
|
2
|
+
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
|
+
import { Wretch } from 'wretch';
|
4
|
+
/**
|
5
|
+
* Factory for the listProjects public API endpoint key
|
6
|
+
*/
|
7
|
+
export declare const listProjectsKey: {
|
8
|
+
paramsKey: (params: ListProjectsRequestQuery) => readonly ["listProjects", {
|
9
|
+
page?: number | undefined;
|
10
|
+
project_type?: "localization_files" | "paged_documents" | "marketing" | undefined;
|
11
|
+
filter_team_id?: number | undefined;
|
12
|
+
filter_names?: string | undefined;
|
13
|
+
include_statistics?: boolean | undefined;
|
14
|
+
include_settings?: boolean | undefined;
|
15
|
+
limit?: number | undefined;
|
16
|
+
}];
|
17
|
+
};
|
18
|
+
/**
|
19
|
+
* A react-router wrapper about the listProjects public API endpoint
|
20
|
+
*
|
21
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
22
|
+
* @param overrides - Additional options to pass to the query.
|
23
|
+
*/
|
24
|
+
export declare function useListProjectsQuery<T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<ListProjectsSuccessResponseBody, typeof listProjectsKey>): import('@tanstack/react-query').UseQueryResult<({
|
25
|
+
name: string;
|
26
|
+
created_at: string;
|
27
|
+
created_at_timestamp: number;
|
28
|
+
team_id: number;
|
29
|
+
description: string;
|
30
|
+
project_id: string;
|
31
|
+
uuid: string;
|
32
|
+
project_type: "localization_files" | "paged_documents" | "marketing";
|
33
|
+
created_by: number;
|
34
|
+
created_by_email: string;
|
35
|
+
base_language_id: number;
|
36
|
+
base_language_iso: string;
|
37
|
+
} | {
|
38
|
+
settings?: {
|
39
|
+
per_platform_key_names: boolean;
|
40
|
+
reviewing: boolean;
|
41
|
+
auto_toggle_unverified: boolean;
|
42
|
+
offline_translation: boolean;
|
43
|
+
key_editing: boolean;
|
44
|
+
inline_machine_translations: boolean;
|
45
|
+
custom_translation_statuses: boolean;
|
46
|
+
custom_translation_statuses_allow_multiple: boolean;
|
47
|
+
segmentation: boolean;
|
48
|
+
contributor_preview_download_enabled: boolean;
|
49
|
+
} | undefined;
|
50
|
+
statistics?: {
|
51
|
+
team: number;
|
52
|
+
languages: {
|
53
|
+
progress: number;
|
54
|
+
language_id: number;
|
55
|
+
language_iso: string;
|
56
|
+
words_to_do: number;
|
57
|
+
}[];
|
58
|
+
progress_total: number;
|
59
|
+
keys_total: number;
|
60
|
+
base_words: number;
|
61
|
+
qa_issues_total: number;
|
62
|
+
qa_issues: {
|
63
|
+
not_reviewed: number;
|
64
|
+
unverified: number;
|
65
|
+
spelling_grammar: number;
|
66
|
+
inconsistent_placeholders: number;
|
67
|
+
inconsistent_html: number;
|
68
|
+
different_number_of_urls: number;
|
69
|
+
different_urls: number;
|
70
|
+
leading_whitespace: number;
|
71
|
+
trailing_whitespace: number;
|
72
|
+
different_number_of_email_address: number;
|
73
|
+
different_email_address: number;
|
74
|
+
different_brackets: number;
|
75
|
+
different_numbers: number;
|
76
|
+
double_space: number;
|
77
|
+
special_placeholder: number;
|
78
|
+
unbalanced_brackets: number;
|
79
|
+
};
|
80
|
+
} | undefined;
|
81
|
+
})[], undefined>;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { RetrieveContributorsResponse } from '../types/contributorTypes';
|
2
|
+
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
|
+
import { Wretch } from 'wretch';
|
4
|
+
/**
|
5
|
+
* Factory for creating keys for the useRetrieveContributorQuery hook
|
6
|
+
*/
|
7
|
+
export declare const retrieveContributorKeys: {
|
8
|
+
projectUserKey: (projectId: string, userId: number) => readonly ["RetrieveContributor", string, number];
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* A react-router wrapper about the retrieveContributor public API endpoint
|
12
|
+
*
|
13
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
14
|
+
* @param overrides - Additional options to pass to the query.
|
15
|
+
*/
|
16
|
+
export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<RetrieveContributorsResponse, typeof retrieveContributorKeys>) => import('@tanstack/react-query').UseQueryResult<{
|
17
|
+
contributors: {
|
18
|
+
email: string;
|
19
|
+
user_id: number;
|
20
|
+
fullname: string;
|
21
|
+
created_at: string;
|
22
|
+
created_at_timestamp: number;
|
23
|
+
admin_rights: string[];
|
24
|
+
languages: {
|
25
|
+
lang_id: number;
|
26
|
+
lang_iso: string;
|
27
|
+
lang_name: string;
|
28
|
+
is_writable: 0 | 1;
|
29
|
+
}[];
|
30
|
+
is_admin: boolean;
|
31
|
+
is_reviewer: boolean;
|
32
|
+
}[];
|
33
|
+
project_id: string;
|
34
|
+
}, undefined>;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
2
|
+
import { Wretch } from 'wretch';
|
3
|
+
import { Project } from '../types/projectTypes';
|
4
|
+
/**
|
5
|
+
* Factory function to create the query key for the retrieveProject query
|
6
|
+
*/
|
7
|
+
export declare const retrieveProjectQueryKey: {
|
8
|
+
projectIdKey: (projectId: string) => string[];
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* A react-router wrapper about the retrieveProject public API endpoint
|
12
|
+
*
|
13
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
14
|
+
* @param overrides - Additional options to pass to the query.
|
15
|
+
*/
|
16
|
+
export declare function useRetrieveProjectQuery<T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<Project, typeof retrieveProjectQueryKey>): import('@tanstack/react-query').UseQueryResult<{
|
17
|
+
name: string;
|
18
|
+
created_at: string;
|
19
|
+
created_at_timestamp: number;
|
20
|
+
team_id: number;
|
21
|
+
description: string;
|
22
|
+
project_id: string;
|
23
|
+
uuid: string;
|
24
|
+
project_type: "localization_files" | "paged_documents" | "marketing";
|
25
|
+
created_by: number;
|
26
|
+
created_by_email: string;
|
27
|
+
base_language_id: number;
|
28
|
+
base_language_iso: string;
|
29
|
+
settings: {
|
30
|
+
per_platform_key_names: boolean;
|
31
|
+
reviewing: boolean;
|
32
|
+
auto_toggle_unverified: boolean;
|
33
|
+
offline_translation: boolean;
|
34
|
+
key_editing: boolean;
|
35
|
+
inline_machine_translations: boolean;
|
36
|
+
custom_translation_statuses: boolean;
|
37
|
+
custom_translation_statuses_allow_multiple: boolean;
|
38
|
+
segmentation: boolean;
|
39
|
+
contributor_preview_download_enabled: boolean;
|
40
|
+
};
|
41
|
+
statistics: {
|
42
|
+
team: number;
|
43
|
+
languages: {
|
44
|
+
progress: number;
|
45
|
+
language_id: number;
|
46
|
+
language_iso: string;
|
47
|
+
words_to_do: number;
|
48
|
+
}[];
|
49
|
+
progress_total: number;
|
50
|
+
keys_total: number;
|
51
|
+
base_words: number;
|
52
|
+
qa_issues_total: number;
|
53
|
+
qa_issues: {
|
54
|
+
not_reviewed: number;
|
55
|
+
unverified: number;
|
56
|
+
spelling_grammar: number;
|
57
|
+
inconsistent_placeholders: number;
|
58
|
+
inconsistent_html: number;
|
59
|
+
different_number_of_urls: number;
|
60
|
+
different_urls: number;
|
61
|
+
leading_whitespace: number;
|
62
|
+
trailing_whitespace: number;
|
63
|
+
different_number_of_email_address: number;
|
64
|
+
different_email_address: number;
|
65
|
+
different_brackets: number;
|
66
|
+
different_numbers: number;
|
67
|
+
double_space: number;
|
68
|
+
special_placeholder: number;
|
69
|
+
unbalanced_brackets: number;
|
70
|
+
};
|
71
|
+
};
|
72
|
+
}, undefined>;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export * from './contributors';
|
2
|
+
export * from './projects';
|
3
|
+
export * from './teamUsers';
|
4
|
+
export * from './userToken';
|
5
|
+
export type { LanguageStatistics, LanguageIso } from './types/languageTypes';
|
6
|
+
export type { Project, ProjectQaIssues, ProjectType, ProjectSettings } from './types/projectTypes';
|
7
|
+
export type { TeamRole } from './types/teamRoleTypes';
|
8
|
+
export type { Contributor, ContributorLanguage } from './types/contributorTypes';
|
9
|
+
export type { TeamUser } from './types/teamUserTypes';
|
10
|
+
export type { AuthenticatedRequestHeader, JwtToken } from './types/userTokenTypes';
|
11
|
+
export * from './hooks/useCreateProjectMutation';
|
12
|
+
export * from './hooks/useGetTeamUsersQuery';
|
13
|
+
export * from './hooks/useGetUserTokenQuery';
|
14
|
+
export * from './hooks/useListProjectsQuery';
|
15
|
+
export * from './hooks/useRetrieveContributorQuery';
|
16
|
+
export * from './hooks/useRetrieveProjectQuery';
|