@lokalise/harmony 1.15.1 → 1.17.0-exp-jwtheaderfactorysharedauth.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 +31 -21
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.css +1 -1
- package/dist/harmony.mjs +1470 -847
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguage/TaskLanguage.d.ts +6 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskLanguageCompleted/TaskLanguageCompleted.d.ts +7 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +5 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/Tasks.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksContext.d.ts +3 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksPopover/TasksPopover.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TasksProvider.d.ts +10 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/index.d.ts +2 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +86 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.d.ts +16 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.d.ts +24 -0
- package/dist/types/src/features/auth/core/headers/headerBuilder.d.ts +199 -0
- package/dist/types/src/features/auth/core/middleware/jwtAuthHeaderBuilderMiddleware.d.ts +10 -0
- package/dist/types/src/features/auth/core/middleware/publicApiHeaderBuilderMiddleware.d.ts +3 -0
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +2 -2
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +3 -3
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -2
- package/dist/types/src/features/auth/errors/UnauthorizedError.d.ts +4 -0
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +4 -1
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +1 -1
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +4 -1
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +4 -2
- package/dist/types/src/features/auth/frontend/services/generateTokenFromClassicSession.d.ts +5 -0
- package/dist/types/src/features/auth/frontend/services/refreshExpiredToken.d.ts +6 -0
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +2 -2
- package/dist/types/src/features/auth/node.d.ts +6 -4
- package/dist/types/src/features/publicApi/contributors.d.ts +19 -1
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +6 -5
- package/dist/types/src/features/publicApi/hooks/useListProjectLanguagesQuery.d.ts +10 -1
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +4 -2
- package/dist/types/src/features/publicApi/hooks/useUpdateProjectMutation.d.ts +4 -2
- package/dist/types/src/features/publicApi/languages.d.ts +19 -1
- package/dist/types/src/features/publicApi/node.d.ts +1 -1
- package/dist/types/src/features/publicApi/projects.d.ts +76 -4
- package/dist/types/src/features/publicApi/teamUsers.d.ts +22 -4
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/sharedTypes.d.ts +57 -0
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +20 -0
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +2 -2
- package/dist/types/src/features/publicApi/userToken.d.ts +1 -1
- package/dist/types/src/node.d.ts +1 -0
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +2 -0
- package/package.json +1 -1
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +0 -17
- package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +0 -5
- package/dist/types/src/features/auth/frontend/middleware/clientSideJwtAuthMiddleware.d.ts +0 -9
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +0 -14
- /package/dist/types/src/{features/auth/core/middleware/jwtAuthMiddleware.test.d.ts → components/Sidebar/Widgets/Tasks/Tasks.test.d.ts} +0 -0
- /package/dist/types/src/features/auth/{frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts → core/headers/headerBuilder.test.d.ts} +0 -0
@@ -1,20 +1,21 @@
|
|
1
|
-
import {
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
2
|
+
import { JwtToken, UserTokenRequestHeader } from '../types/userTokenTypes';
|
2
3
|
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
4
|
import { Wretch } from 'wretch/types';
|
4
5
|
/**
|
5
6
|
* Factory for generating keys for the getUserToken public API endpoint
|
6
7
|
*/
|
7
8
|
export declare const getUserTokenKey: {
|
8
|
-
|
9
|
-
teamKeyJwt: (teamId: number, refreshToken: string) => readonly ["getUserToken", "Authorization", `Bearer ${string}`, number];
|
9
|
+
teamKey: (teamId: number) => readonly ["getUserToken", number];
|
10
10
|
};
|
11
11
|
/**
|
12
12
|
* A react-router wrapper about the getUserToken public API endpoint
|
13
13
|
*
|
14
14
|
* @param wretchClient - Wretch instance configured to a public API instance.
|
15
|
+
* @param headers - HeaderBuilder instance to resolve headers for the request.
|
15
16
|
* @param overrides - Additional options to pass to the query.
|
16
17
|
*/
|
17
|
-
export declare const useGetUserTokenQuery: <T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<JwtToken, typeof getUserTokenKey>) => import('@tanstack/react-query').UseQueryResult<{
|
18
|
+
export declare const useGetUserTokenQuery: <T>(wretchClient: Wretch<T>, headers: HeaderBuilder<UserTokenRequestHeader>, overrides: ApiQueryOverrides<JwtToken | null, typeof getUserTokenKey>) => import('@tanstack/react-query').UseQueryResult<{
|
18
19
|
accessToken: string;
|
19
20
|
refreshToken: string;
|
20
|
-
}, undefined>;
|
21
|
+
} | null, undefined>;
|
@@ -1,10 +1,19 @@
|
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
1
2
|
import { ListProjectLanguagesResponse } from '../types/languageTypes';
|
3
|
+
import { ProjectApiBaseHeaders } from '../types/projectTypes';
|
2
4
|
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
5
|
import { Wretch } from 'wretch/types';
|
4
6
|
export declare const listProjectLanguagesKey: {
|
5
7
|
projectIdKey: (projectId: string) => readonly ["listProjectLanguages", string];
|
6
8
|
};
|
7
|
-
|
9
|
+
/**
|
10
|
+
* A react-router wrapper about the listProjectLanguages public API endpoint
|
11
|
+
*
|
12
|
+
* @param wretchClient - Wretch instance configured to a public API instance.
|
13
|
+
* @param headers - A header builder instance to resolve the headers for the request.
|
14
|
+
* @param overrides - Additional options to pass to the query.
|
15
|
+
*/
|
16
|
+
export declare function useListProjectLanguagesQuery<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ProjectApiBaseHeaders>, overrides: ApiQueryOverrides<ListProjectLanguagesResponse, typeof listProjectLanguagesKey>): import('@tanstack/react-query').UseQueryResult<{
|
8
17
|
languages: {
|
9
18
|
lang_id: number;
|
10
19
|
lang_iso: string;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
2
|
+
import { ListProjectsRequestQuery, ListProjectsSuccessResponseBody, ProjectApiBaseHeaders } from '../types/projectTypes';
|
2
3
|
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
4
|
import { Wretch } from 'wretch';
|
4
5
|
/**
|
@@ -19,9 +20,10 @@ export declare const listProjectsKey: {
|
|
19
20
|
* A react-router wrapper about the listProjects public API endpoint
|
20
21
|
*
|
21
22
|
* @param wretchClient - Wretch instance configured to a public API instance.
|
23
|
+
* @param headers - A header builder instance to resolve the headers.
|
22
24
|
* @param overrides - Additional options to pass to the query.
|
23
25
|
*/
|
24
|
-
export declare function useListProjectsQuery<T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<ListProjectsSuccessResponseBody, typeof listProjectsKey>): import('@tanstack/react-query').UseQueryResult<{
|
26
|
+
export declare function useListProjectsQuery<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ProjectApiBaseHeaders>, overrides: ApiQueryOverrides<ListProjectsSuccessResponseBody, typeof listProjectsKey>): import('@tanstack/react-query').UseQueryResult<{
|
25
27
|
projects: {
|
26
28
|
name: string;
|
27
29
|
created_at: string;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
2
|
+
import { ContributorApiBaseHeader, RetrieveContributorsResponse } from '../types/contributorTypes';
|
2
3
|
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
3
4
|
import { Wretch } from 'wretch';
|
4
5
|
/**
|
@@ -11,9 +12,10 @@ export declare const retrieveContributorKeys: {
|
|
11
12
|
* A react-router wrapper about the retrieveContributor public API endpoint
|
12
13
|
*
|
13
14
|
* @param wretchClient - Wretch instance configured to a public API instance.
|
15
|
+
* @param headers - A header builder instance to resolve headers for the request.
|
14
16
|
* @param overrides - Additional options to pass to the query.
|
15
17
|
*/
|
16
|
-
export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<RetrieveContributorsResponse, typeof retrieveContributorKeys>) => import('@tanstack/react-query').UseQueryResult<{
|
18
|
+
export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ContributorApiBaseHeader>, overrides: ApiQueryOverrides<RetrieveContributorsResponse, typeof retrieveContributorKeys>) => import('@tanstack/react-query').UseQueryResult<{
|
17
19
|
contributors: {
|
18
20
|
email: string;
|
19
21
|
user_id: number;
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
1
2
|
import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
|
2
3
|
import { Wretch } from 'wretch';
|
3
|
-
import { Project } from '../types/projectTypes';
|
4
|
+
import { Project, ProjectApiBaseHeaders } from '../types/projectTypes';
|
4
5
|
/**
|
5
6
|
* Factory function to create the query key for the retrieveProject query
|
6
7
|
*/
|
@@ -11,9 +12,10 @@ export declare const retrieveProjectQueryKey: {
|
|
11
12
|
* A react-router wrapper about the retrieveProject public API endpoint
|
12
13
|
*
|
13
14
|
* @param wretchClient - Wretch instance configured to a public API instance.
|
15
|
+
* @param headers - A header builder instance to resolve the headers for the request.
|
14
16
|
* @param overrides - Additional options to pass to the query.
|
15
17
|
*/
|
16
|
-
export declare function useRetrieveProjectQuery<T>(wretchClient: Wretch<T>, overrides: ApiQueryOverrides<Project, typeof retrieveProjectQueryKey>): import('@tanstack/react-query').UseQueryResult<{
|
18
|
+
export declare function useRetrieveProjectQuery<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ProjectApiBaseHeaders>, overrides: ApiQueryOverrides<Project, typeof retrieveProjectQueryKey>): import('@tanstack/react-query').UseQueryResult<{
|
17
19
|
name: string;
|
18
20
|
created_at: string;
|
19
21
|
created_at_timestamp: number;
|
@@ -1,14 +1,16 @@
|
|
1
|
+
import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
|
1
2
|
import { ApiMutationOverrides } from '../../../utils/types/apiMutationOverrides';
|
2
3
|
import { Wretch } from 'wretch';
|
3
|
-
import { Project, UpdateProjectPathParams, UpdateProjectRequestBody } from '../types/projectTypes';
|
4
|
+
import { Project, ProjectApiBaseHeaders, UpdateProjectPathParams, UpdateProjectRequestBody } from '../types/projectTypes';
|
4
5
|
/**
|
5
6
|
* A react-query wrapper about the updateProject public API endpoint
|
6
7
|
*
|
7
8
|
* @param wretchClient - Wretch instance configured to a public API instance.
|
9
|
+
* @param headers - Headers to include in the request.
|
8
10
|
* @param params - URL parameters
|
9
11
|
* @param overrides - Additional options to pass to the query.
|
10
12
|
*/
|
11
|
-
export declare function useUpdateProjectMutation<T>(wretchClient: Wretch<T>, params: UpdateProjectPathParams, overrides?: ApiMutationOverrides<Project, UpdateProjectRequestBody>): import('@tanstack/react-query').UseMutationResult<{
|
13
|
+
export declare function useUpdateProjectMutation<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ProjectApiBaseHeaders>, params: UpdateProjectPathParams, overrides?: ApiMutationOverrides<Project, UpdateProjectRequestBody>): import('@tanstack/react-query').UseMutationResult<{
|
12
14
|
name: string;
|
13
15
|
created_at: string;
|
14
16
|
created_at_timestamp: number;
|
@@ -48,4 +48,22 @@ export declare const listProjectLanguages: import('@lokalise/universal-ts-utils/
|
|
48
48
|
projectId: string;
|
49
49
|
}, {
|
50
50
|
projectId: string;
|
51
|
-
}>, undefined,
|
51
|
+
}>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodObject<{
|
52
|
+
Authorization: import('zod').ZodString;
|
53
|
+
}, "strip", import('zod').ZodTypeAny, {
|
54
|
+
Authorization: string;
|
55
|
+
}, {
|
56
|
+
Authorization: string;
|
57
|
+
}>, import('zod').ZodObject<{
|
58
|
+
'X-API-Token': import('zod').ZodString;
|
59
|
+
}, "strip", import('zod').ZodTypeAny, {
|
60
|
+
'X-API-Token': string;
|
61
|
+
}, {
|
62
|
+
'X-API-Token': string;
|
63
|
+
}>]>, import('zod').ZodObject<{
|
64
|
+
'X-Lokalise-Plugin': import('zod').ZodString;
|
65
|
+
}, "strip", import('zod').ZodTypeAny, {
|
66
|
+
'X-Lokalise-Plugin': string;
|
67
|
+
}, {
|
68
|
+
'X-Lokalise-Plugin': string;
|
69
|
+
}>>, false, false>;
|
@@ -8,7 +8,7 @@ export type { Project, ProjectQaIssues, ProjectType, ProjectSettings } from './t
|
|
8
8
|
export type { TeamRole } from './types/teamRoleTypes';
|
9
9
|
export type { Contributor, ContributorLanguage } from './types/contributorTypes';
|
10
10
|
export type { TeamUser } from './types/teamUserTypes';
|
11
|
-
export type {
|
11
|
+
export type { UserTokenRequestHeader, JwtToken } from './types/userTokenTypes';
|
12
12
|
export * from './hooks/useCreateProjectMutation';
|
13
13
|
export * from './hooks/useGetTeamUsersQuery';
|
14
14
|
export * from './hooks/useGetUserTokenQuery';
|
@@ -331,7 +331,25 @@ export declare const createProject: import('@lokalise/universal-ts-utils/node').
|
|
331
331
|
unbalanced_brackets: number;
|
332
332
|
};
|
333
333
|
} | undefined;
|
334
|
-
}>, undefined, undefined,
|
334
|
+
}>, undefined, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodObject<{
|
335
|
+
Authorization: import('zod').ZodString;
|
336
|
+
}, "strip", import('zod').ZodTypeAny, {
|
337
|
+
Authorization: string;
|
338
|
+
}, {
|
339
|
+
Authorization: string;
|
340
|
+
}>, import('zod').ZodObject<{
|
341
|
+
'X-API-Token': import('zod').ZodString;
|
342
|
+
}, "strip", import('zod').ZodTypeAny, {
|
343
|
+
'X-API-Token': string;
|
344
|
+
}, {
|
345
|
+
'X-API-Token': string;
|
346
|
+
}>]>, import('zod').ZodObject<{
|
347
|
+
'X-Lokalise-Plugin': import('zod').ZodString;
|
348
|
+
}, "strip", import('zod').ZodTypeAny, {
|
349
|
+
'X-Lokalise-Plugin': string;
|
350
|
+
}, {
|
351
|
+
'X-Lokalise-Plugin': string;
|
352
|
+
}>>, false, false>;
|
335
353
|
/**
|
336
354
|
* Public API router definition for listing all projects
|
337
355
|
*/
|
@@ -771,7 +789,25 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
|
|
771
789
|
include_statistics?: 0 | 1 | undefined;
|
772
790
|
include_settings?: 0 | 1 | undefined;
|
773
791
|
limit?: number | undefined;
|
774
|
-
}>,
|
792
|
+
}>, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodObject<{
|
793
|
+
Authorization: import('zod').ZodString;
|
794
|
+
}, "strip", import('zod').ZodTypeAny, {
|
795
|
+
Authorization: string;
|
796
|
+
}, {
|
797
|
+
Authorization: string;
|
798
|
+
}>, import('zod').ZodObject<{
|
799
|
+
'X-API-Token': import('zod').ZodString;
|
800
|
+
}, "strip", import('zod').ZodTypeAny, {
|
801
|
+
'X-API-Token': string;
|
802
|
+
}, {
|
803
|
+
'X-API-Token': string;
|
804
|
+
}>]>, import('zod').ZodObject<{
|
805
|
+
'X-Lokalise-Plugin': import('zod').ZodString;
|
806
|
+
}, "strip", import('zod').ZodTypeAny, {
|
807
|
+
'X-Lokalise-Plugin': string;
|
808
|
+
}, {
|
809
|
+
'X-Lokalise-Plugin': string;
|
810
|
+
}>>, false, false>;
|
775
811
|
/**
|
776
812
|
* Public API router definition for retrieving a project
|
777
813
|
*/
|
@@ -1077,7 +1113,25 @@ export declare const retrieveProject: import('@lokalise/universal-ts-utils/node'
|
|
1077
1113
|
project_id: string;
|
1078
1114
|
}, {
|
1079
1115
|
project_id: string;
|
1080
|
-
}>, undefined,
|
1116
|
+
}>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodObject<{
|
1117
|
+
Authorization: import('zod').ZodString;
|
1118
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1119
|
+
Authorization: string;
|
1120
|
+
}, {
|
1121
|
+
Authorization: string;
|
1122
|
+
}>, import('zod').ZodObject<{
|
1123
|
+
'X-API-Token': import('zod').ZodString;
|
1124
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1125
|
+
'X-API-Token': string;
|
1126
|
+
}, {
|
1127
|
+
'X-API-Token': string;
|
1128
|
+
}>]>, import('zod').ZodObject<{
|
1129
|
+
'X-Lokalise-Plugin': import('zod').ZodString;
|
1130
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1131
|
+
'X-Lokalise-Plugin': string;
|
1132
|
+
}, {
|
1133
|
+
'X-Lokalise-Plugin': string;
|
1134
|
+
}>>, false, false>;
|
1081
1135
|
/**
|
1082
1136
|
* Public API router definition for updating a project
|
1083
1137
|
*/
|
@@ -1392,4 +1446,22 @@ export declare const updateProject: import('@lokalise/universal-ts-utils/node').
|
|
1392
1446
|
project_id: string;
|
1393
1447
|
}, {
|
1394
1448
|
project_id: string;
|
1395
|
-
}>, undefined,
|
1449
|
+
}>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodObject<{
|
1450
|
+
Authorization: import('zod').ZodString;
|
1451
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1452
|
+
Authorization: string;
|
1453
|
+
}, {
|
1454
|
+
Authorization: string;
|
1455
|
+
}>, import('zod').ZodObject<{
|
1456
|
+
'X-API-Token': import('zod').ZodString;
|
1457
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1458
|
+
'X-API-Token': string;
|
1459
|
+
}, {
|
1460
|
+
'X-API-Token': string;
|
1461
|
+
}>]>, import('zod').ZodObject<{
|
1462
|
+
'X-Lokalise-Plugin': import('zod').ZodString;
|
1463
|
+
}, "strip", import('zod').ZodTypeAny, {
|
1464
|
+
'X-Lokalise-Plugin': string;
|
1465
|
+
}, {
|
1466
|
+
'X-Lokalise-Plugin': string;
|
1467
|
+
}>>, false, false>;
|
@@ -3,8 +3,8 @@ import { z } from 'zod';
|
|
3
3
|
* Public API router definition for getting the details of a team user
|
4
4
|
*/
|
5
5
|
export declare const getTeamUser: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
|
6
|
-
teamId: number;
|
7
6
|
userId: number;
|
7
|
+
teamId: number;
|
8
8
|
}, z.ZodObject<{
|
9
9
|
team_id: z.ZodNumber;
|
10
10
|
team_user: z.ZodObject<{
|
@@ -53,9 +53,27 @@ export declare const getTeamUser: import('@lokalise/universal-ts-utils/node').Ge
|
|
53
53
|
teamId: z.ZodNumber;
|
54
54
|
userId: z.ZodNumber;
|
55
55
|
}, "strip", z.ZodTypeAny, {
|
56
|
-
teamId: number;
|
57
56
|
userId: number;
|
58
|
-
}, {
|
59
57
|
teamId: number;
|
58
|
+
}, {
|
60
59
|
userId: number;
|
61
|
-
|
60
|
+
teamId: number;
|
61
|
+
}>, undefined, z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
62
|
+
Authorization: z.ZodString;
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
64
|
+
Authorization: string;
|
65
|
+
}, {
|
66
|
+
Authorization: string;
|
67
|
+
}>, z.ZodObject<{
|
68
|
+
'X-API-Token': z.ZodString;
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
70
|
+
'X-API-Token': string;
|
71
|
+
}, {
|
72
|
+
'X-API-Token': string;
|
73
|
+
}>]>, z.ZodObject<{
|
74
|
+
'X-Lokalise-Plugin': z.ZodString;
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
76
|
+
'X-Lokalise-Plugin': string;
|
77
|
+
}, {
|
78
|
+
'X-Lokalise-Plugin': string;
|
79
|
+
}>>, false, false>;
|
@@ -1,4 +1,24 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
+
export declare const CONTRIBUTOR_API_BASE_HEADER_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
3
|
+
Authorization: z.ZodString;
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
5
|
+
Authorization: string;
|
6
|
+
}, {
|
7
|
+
Authorization: string;
|
8
|
+
}>, z.ZodObject<{
|
9
|
+
'X-API-Token': z.ZodString;
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
11
|
+
'X-API-Token': string;
|
12
|
+
}, {
|
13
|
+
'X-API-Token': string;
|
14
|
+
}>]>, z.ZodObject<{
|
15
|
+
'X-Lokalise-Plugin': z.ZodString;
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
17
|
+
'X-Lokalise-Plugin': string;
|
18
|
+
}, {
|
19
|
+
'X-Lokalise-Plugin': string;
|
20
|
+
}>>;
|
21
|
+
export type ContributorApiBaseHeader = z.infer<typeof CONTRIBUTOR_API_BASE_HEADER_SCHEMA>;
|
2
22
|
export declare const CONTRIBUTOR_LANGUAGE_SCHEMA: z.ZodObject<{
|
3
23
|
lang_id: z.ZodNumber;
|
4
24
|
lang_iso: z.ZodString;
|
@@ -1,4 +1,24 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
+
export declare const PROJECT_API_BASE_HEADERS_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
3
|
+
Authorization: z.ZodString;
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
5
|
+
Authorization: string;
|
6
|
+
}, {
|
7
|
+
Authorization: string;
|
8
|
+
}>, z.ZodObject<{
|
9
|
+
'X-API-Token': z.ZodString;
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
11
|
+
'X-API-Token': string;
|
12
|
+
}, {
|
13
|
+
'X-API-Token': string;
|
14
|
+
}>]>, z.ZodObject<{
|
15
|
+
'X-Lokalise-Plugin': z.ZodString;
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
17
|
+
'X-Lokalise-Plugin': string;
|
18
|
+
}, {
|
19
|
+
'X-Lokalise-Plugin': string;
|
20
|
+
}>>;
|
21
|
+
export type ProjectApiBaseHeaders = z.infer<typeof PROJECT_API_BASE_HEADERS_SCHEMA>;
|
2
22
|
export declare const PROJECT_TYPE_SCHEMA: z.ZodUnion<[z.ZodLiteral<"localization_files">, z.ZodLiteral<"paged_documents">, z.ZodLiteral<"marketing">]>;
|
3
23
|
export type ProjectType = z.infer<typeof PROJECT_TYPE_SCHEMA>;
|
4
24
|
export declare const PROJECT_SETTINGS_SCHEMA: z.ZodObject<{
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
export declare const AUTHORIZATION_HEADER_SCHEMA: z.ZodObject<{
|
3
|
+
Authorization: z.ZodString;
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
5
|
+
Authorization: string;
|
6
|
+
}, {
|
7
|
+
Authorization: string;
|
8
|
+
}>;
|
9
|
+
export declare const APU_TOKEN_AUTH_HEADER_SCHEMA: z.ZodObject<{
|
10
|
+
'X-API-Token': z.ZodString;
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
12
|
+
'X-API-Token': string;
|
13
|
+
}, {
|
14
|
+
'X-API-Token': string;
|
15
|
+
}>;
|
16
|
+
export declare const AUTHENTICATION_HEADERS_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
17
|
+
Authorization: z.ZodString;
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
19
|
+
Authorization: string;
|
20
|
+
}, {
|
21
|
+
Authorization: string;
|
22
|
+
}>, z.ZodObject<{
|
23
|
+
'X-API-Token': z.ZodString;
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
25
|
+
'X-API-Token': string;
|
26
|
+
}, {
|
27
|
+
'X-API-Token': string;
|
28
|
+
}>]>;
|
29
|
+
export type AuthenticationHeaders = z.infer<typeof AUTHENTICATION_HEADERS_SCHEMA>;
|
30
|
+
export declare const API_PLUGIN_HEADER_SCHEMA: z.ZodObject<{
|
31
|
+
'X-Lokalise-Plugin': z.ZodString;
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
33
|
+
'X-Lokalise-Plugin': string;
|
34
|
+
}, {
|
35
|
+
'X-Lokalise-Plugin': string;
|
36
|
+
}>;
|
37
|
+
export type ApiPluginHeader = z.infer<typeof API_PLUGIN_HEADER_SCHEMA>;
|
38
|
+
export declare const BASE_API_ENDPOINT_HEADER_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
39
|
+
Authorization: z.ZodString;
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
41
|
+
Authorization: string;
|
42
|
+
}, {
|
43
|
+
Authorization: string;
|
44
|
+
}>, z.ZodObject<{
|
45
|
+
'X-API-Token': z.ZodString;
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
47
|
+
'X-API-Token': string;
|
48
|
+
}, {
|
49
|
+
'X-API-Token': string;
|
50
|
+
}>]>, z.ZodObject<{
|
51
|
+
'X-Lokalise-Plugin': z.ZodString;
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
53
|
+
'X-Lokalise-Plugin': string;
|
54
|
+
}, {
|
55
|
+
'X-Lokalise-Plugin': string;
|
56
|
+
}>>;
|
57
|
+
export type BaseApiEndpointHeader = z.infer<typeof BASE_API_ENDPOINT_HEADER_SCHEMA>;
|
@@ -1,4 +1,24 @@
|
|
1
1
|
import { z } from 'zod';
|
2
|
+
export declare const TEAM_USER_API_BASE_HEADERS_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
3
|
+
Authorization: z.ZodString;
|
4
|
+
}, "strip", z.ZodTypeAny, {
|
5
|
+
Authorization: string;
|
6
|
+
}, {
|
7
|
+
Authorization: string;
|
8
|
+
}>, z.ZodObject<{
|
9
|
+
'X-API-Token': z.ZodString;
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
11
|
+
'X-API-Token': string;
|
12
|
+
}, {
|
13
|
+
'X-API-Token': string;
|
14
|
+
}>]>, z.ZodObject<{
|
15
|
+
'X-Lokalise-Plugin': z.ZodString;
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
17
|
+
'X-Lokalise-Plugin': string;
|
18
|
+
}, {
|
19
|
+
'X-Lokalise-Plugin': string;
|
20
|
+
}>>;
|
21
|
+
export type TeamUserApiBaseHeaders = z.infer<typeof TEAM_USER_API_BASE_HEADERS_SCHEMA>;
|
2
22
|
export declare const TEAM_USER_SCHEMA: z.ZodObject<{
|
3
23
|
user_id: z.ZodNumber;
|
4
24
|
email: z.ZodString;
|
@@ -10,7 +10,7 @@ export declare const JWT_TOKEN_SCHEMA: z.ZodObject<{
|
|
10
10
|
refreshToken: string;
|
11
11
|
}>;
|
12
12
|
export type JwtToken = z.infer<typeof JWT_TOKEN_SCHEMA>;
|
13
|
-
export declare const
|
13
|
+
export declare const USER_TOKEN_REQUEST_HEADER_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
14
14
|
Authorization: z.ZodString;
|
15
15
|
}, "strip", z.ZodTypeAny, {
|
16
16
|
Authorization: string;
|
@@ -23,4 +23,4 @@ export declare const AUTHENTICATED_REQUEST_HEADER: z.ZodUnion<[z.ZodObject<{
|
|
23
23
|
}, {
|
24
24
|
'x-csrf-token': string;
|
25
25
|
}>]>;
|
26
|
-
export type
|
26
|
+
export type UserTokenRequestHeader = z.infer<typeof USER_TOKEN_REQUEST_HEADER_SCHEMA>;
|
package/dist/types/src/node.d.ts
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
* COMPONENTS EXPORTS
|
3
3
|
*/
|
4
4
|
export * from './components/Sidebar/Widgets/ProfileMenu/types';
|
5
|
+
export * from './components/Sidebar/Widgets/Tasks/types';
|
5
6
|
export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
|
6
7
|
export { Sidebar } from './components/Sidebar/Sidebar';
|
7
8
|
export { Breadcrumbs } from './components/NavigationPanel/components/Breadcrumbs/Breadcrumbs';
|
package/package.json
CHANGED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { JwtToken } from '../../../publicApi/types/userTokenTypes';
|
2
|
-
import { ConfiguredMiddleware, Wretch } from 'wretch';
|
3
|
-
export type JwtAuthProps<T> = {
|
4
|
-
/**
|
5
|
-
* A configured Wretch client that is used to make requests to the authentication provider.
|
6
|
-
*/
|
7
|
-
authProviderWretchClient: Wretch<T>;
|
8
|
-
/**
|
9
|
-
* This function should return the current JWT token if it exists.
|
10
|
-
*/
|
11
|
-
getCachedJwtToken: () => Promise<JwtToken | undefined>;
|
12
|
-
/**
|
13
|
-
* This function is called when a new JWT token is issued or if/when the token is refreshed.
|
14
|
-
*/
|
15
|
-
onNewJwtTokenIssued?: (jwtToken: JwtToken) => Promise<void>;
|
16
|
-
};
|
17
|
-
export declare function jwtAuthMiddleware<T>(props: JwtAuthProps<T>): ConfiguredMiddleware;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { JwtAuthProps } from '../../core/middleware/jwtAuthMiddleware';
|
2
|
-
export type ClientSideJwtAuthProps<T> = Omit<JwtAuthProps<T>, 'getCachedJwtToken'> & {
|
3
|
-
/**
|
4
|
-
* The browser implementation makes this optional, as it can be inferred from the cookie.
|
5
|
-
* You can still provide a custom implementation if you want to.
|
6
|
-
*/
|
7
|
-
getCachedJwtToken?: JwtAuthProps<T>['getCachedJwtToken'];
|
8
|
-
};
|
9
|
-
export declare function clientSideJwtAuthMiddleware<T>(props: ClientSideJwtAuthProps<T>): import('wretch').ConfiguredMiddleware;
|
package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import { ClientSideJwtAuthProps } from './clientSideJwtAuthMiddleware';
|
2
|
-
import { ConfiguredMiddleware } from 'wretch';
|
3
|
-
export type PromoteAuthProps<T> = ClientSideJwtAuthProps<T> & {
|
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>(overrides: PromoteAuthProps<T>): ConfiguredMiddleware;
|
File without changes
|