@lokalise/harmony 1.8.0 → 1.8.2
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 +0 -64
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +507 -923
- package/dist/types/src/node.d.ts +1 -2
- package/package.json +4 -20
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts +0 -10
- package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts +0 -1
- package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +0 -7
- package/dist/types/src/features/auth/core/jwtTokenPayload.test.d.ts +0 -1
- package/dist/types/src/features/auth/core/lokaliseAuthAddon.d.ts +0 -14
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +0 -13
- package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.test.d.ts +0 -1
- package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +0 -5
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +0 -42
- package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +0 -27
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +0 -2
- package/dist/types/src/features/auth/core/utils/makeAuthHeader.test.d.ts +0 -1
- package/dist/types/src/features/auth/frontend/addon/lokaliseAuthBrowserAddon.d.ts +0 -35
- package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +0 -20
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +0 -28
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +0 -18
- package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +0 -18
- package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +0 -12
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts +0 -14
- package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.test.d.ts +0 -1
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +0 -4
- package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.test.d.ts +0 -1
- package/dist/types/src/features/auth/node.d.ts +0 -9
- package/dist/types/src/features/node.d.ts +0 -2
- package/dist/types/src/features/publicApi/contributors.d.ts +0 -111
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +0 -76
- package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +0 -26
- package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +0 -20
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +0 -81
- package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +0 -34
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +0 -72
- package/dist/types/src/features/publicApi/node.d.ts +0 -16
- package/dist/types/src/features/publicApi/projects.d.ts +0 -1132
- package/dist/types/src/features/publicApi/teamUsers.d.ts +0 -61
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +0 -171
- package/dist/types/src/features/publicApi/types/languageTypes.d.ts +0 -29
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +0 -1061
- package/dist/types/src/features/publicApi/types/teamRoleTypes.d.ts +0 -3
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +0 -70
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +0 -26
- package/dist/types/src/features/publicApi/userToken.d.ts +0 -35
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.d.ts +0 -2
- package/dist/types/src/utils/testing/createMockFactoryWithDefaults.test.d.ts +0 -1
- package/dist/types/src/utils/testing/deepOverride.d.ts +0 -4
- package/dist/types/src/utils/testing/deepOverride.test.d.ts +0 -1
- package/dist/types/src/utils/types/apiMutationOverrides.d.ts +0 -2
- package/dist/types/src/utils/types/apiQueryOverrides.d.ts +0 -2
package/dist/types/src/node.d.ts
CHANGED
@@ -6,5 +6,4 @@ export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
|
|
6
6
|
export { Sidebar } from './components/Sidebar/Sidebar';
|
7
7
|
export { Breadcrumbs } from './components/NavigationPanel/components/Breadcrumbs/Breadcrumbs';
|
8
8
|
export { NavigationTabs } from './components/NavigationPanel/components/NavigationTabs/NavigationTabs';
|
9
|
-
export * from './
|
10
|
-
export * from './utils/node.ts';
|
9
|
+
export * from './utils/node';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lokalise/harmony",
|
3
|
-
"version": "1.8.
|
3
|
+
"version": "1.8.2",
|
4
4
|
"author": {
|
5
5
|
"name": "Lokalise",
|
6
6
|
"url": "https://lokalise.com/"
|
@@ -10,10 +10,7 @@
|
|
10
10
|
"type": "git",
|
11
11
|
"url": "git+https://github.com/lokalise/harmony.git"
|
12
12
|
},
|
13
|
-
"files": [
|
14
|
-
"dist/**",
|
15
|
-
"README.md"
|
16
|
-
],
|
13
|
+
"files": ["dist/**", "README.md"],
|
17
14
|
"type": "module",
|
18
15
|
"publishConfig": {
|
19
16
|
"access": "public"
|
@@ -33,17 +30,12 @@
|
|
33
30
|
"storybook:build": "storybook build"
|
34
31
|
},
|
35
32
|
"peerDependencies": {
|
36
|
-
"@lokalise/frontend-http-client": ">=3.2.1",
|
37
33
|
"@lokalise/louis": ">=26.0.0",
|
38
34
|
"@lokalise/token-dictionary": ">=2.42.1",
|
39
|
-
"@lokalise/universal-ts-utils": ">=3.4.0",
|
40
|
-
"@tanstack/react-query": ">=5.66.9",
|
41
35
|
"date-fns": ">=4.1",
|
42
36
|
"date-fns-tz": ">=3.2",
|
43
37
|
"react": "^18.0.0 || ^19.0.0",
|
44
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
45
|
-
"wretch": ">=2.11.0",
|
46
|
-
"zod": ">=3.23.8"
|
38
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
47
39
|
},
|
48
40
|
"devDependencies": {
|
49
41
|
"@biomejs/biome": "^1.9.4",
|
@@ -78,9 +70,7 @@
|
|
78
70
|
"eslint-plugin-i18next": "^6.0.9",
|
79
71
|
"eslint-plugin-storybook": "^0.11.4",
|
80
72
|
"eslint-plugin-testing-library": "^7.1.1",
|
81
|
-
"vitest-fail-on-console": "^0.7.1",
|
82
73
|
"jsdom": "26.0.0",
|
83
|
-
"mockttp": "^3.16.0",
|
84
74
|
"rimraf": "^6.0.1",
|
85
75
|
"semantic-release": "^24.2.3",
|
86
76
|
"storybook": "^8.6.0-alpha.1",
|
@@ -93,9 +83,7 @@
|
|
93
83
|
"main": "dist/harmony.cjs",
|
94
84
|
"module": "dist/harmony.mjs",
|
95
85
|
"types": "dist/types/index.d.ts",
|
96
|
-
"sideEffects": [
|
97
|
-
"*.css"
|
98
|
-
],
|
86
|
+
"sideEffects": ["*.css"],
|
99
87
|
"exports": {
|
100
88
|
".": {
|
101
89
|
"types": "./dist/types/index.d.ts",
|
@@ -107,9 +95,5 @@
|
|
107
95
|
"dependencies": {
|
108
96
|
"clsx": "^2.1.1",
|
109
97
|
"react-resize-detector": "^12.0.2"
|
110
|
-
},
|
111
|
-
"optionalDependencies": {
|
112
|
-
"@biomejs/cli-linux-x64": "^1.9.4",
|
113
|
-
"@rollup/rollup-linux-x64-gnu": "^4.34.9"
|
114
98
|
}
|
115
99
|
}
|
package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { JwtTokenPayload } from '../../core/types/jwtTokenPayload';
|
2
|
-
import { JwtToken } from '../../../publicApi/types/userTokenTypes';
|
3
|
-
type AuthenticatedSessionDetail = JwtToken & {
|
4
|
-
payload: JwtTokenPayload;
|
5
|
-
};
|
6
|
-
/**
|
7
|
-
* Returns the JWT tokens and parses the attached payload.
|
8
|
-
*/
|
9
|
-
export declare function getAuthenticatedSessionDetailFromRequest(): AuthenticatedSessionDetail | undefined;
|
10
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import { Wretch, WretchAddon } from 'wretch/types';
|
2
|
-
import { JwtAuthProps } from './middleware/jwtAuthMiddleware';
|
3
|
-
export interface LokaliseAuthAddon {
|
4
|
-
/**
|
5
|
-
* Add authentication and automatic token refresh to Lokalise requests.
|
6
|
-
*/
|
7
|
-
lokaliseAuth<T extends LokaliseAuthAddon>(this: T & Wretch<T>, props: JwtAuthProps): this;
|
8
|
-
}
|
9
|
-
/**
|
10
|
-
* Addon for Lokalise authentication.
|
11
|
-
* This will expose a method that can be used to authenticate requests to Lokalise.
|
12
|
-
* It will also handle refreshing the token when it expires.
|
13
|
-
*/
|
14
|
-
export declare const LokaliseAuthAddon: WretchAddon<LokaliseAuthAddon>;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { JwtToken } from '../../../publicApi/types/userTokenTypes';
|
2
|
-
import { ConfiguredMiddleware, Wretch } from 'wretch';
|
3
|
-
export type JwtAuthProps = {
|
4
|
-
/**
|
5
|
-
* This function should return the current JWT token if it exists.
|
6
|
-
*/
|
7
|
-
getCachedJwtToken: () => Promise<JwtToken | undefined>;
|
8
|
-
/**
|
9
|
-
* This function is called when a new JWT token is issued or if/when the token is refreshed.
|
10
|
-
*/
|
11
|
-
onNewJwtTokenIssued?: (jwtToken: JwtToken) => Promise<void>;
|
12
|
-
};
|
13
|
-
export declare function jwtAuthMiddleware<T>(client: Wretch<T>, props: JwtAuthProps): ConfiguredMiddleware;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { z } from 'zod';
|
2
|
-
export declare const JWT_TOKEN_PAYLOAD_SCHEMA: z.ZodObject<{
|
3
|
-
userId: z.ZodNumber;
|
4
|
-
userUuid: z.ZodString;
|
5
|
-
teamId: z.ZodNumber;
|
6
|
-
userTeamRole: z.ZodUnion<[z.ZodLiteral<"owner">, z.ZodLiteral<"admin">, z.ZodLiteral<"biller">, z.ZodLiteral<"member">]>;
|
7
|
-
userEmail: z.ZodString;
|
8
|
-
userName: z.ZodString;
|
9
|
-
userCurrentTeamId: z.ZodNumber;
|
10
|
-
planId: z.ZodNumber;
|
11
|
-
planName: z.ZodString;
|
12
|
-
isProviderAlpha: z.ZodBoolean;
|
13
|
-
isFullyAuthenticated: z.ZodBoolean;
|
14
|
-
exp: z.ZodNumber;
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
16
|
-
isProviderAlpha: boolean;
|
17
|
-
isFullyAuthenticated: boolean;
|
18
|
-
planId: number;
|
19
|
-
userTeamRole: "member" | "admin" | "biller" | "owner";
|
20
|
-
userEmail: string;
|
21
|
-
teamId: number;
|
22
|
-
userId: number;
|
23
|
-
userUuid: string;
|
24
|
-
userName: string;
|
25
|
-
userCurrentTeamId: number;
|
26
|
-
planName: string;
|
27
|
-
exp: number;
|
28
|
-
}, {
|
29
|
-
isProviderAlpha: boolean;
|
30
|
-
isFullyAuthenticated: boolean;
|
31
|
-
planId: number;
|
32
|
-
userTeamRole: "member" | "admin" | "biller" | "owner";
|
33
|
-
userEmail: string;
|
34
|
-
teamId: number;
|
35
|
-
userId: number;
|
36
|
-
userUuid: string;
|
37
|
-
userName: string;
|
38
|
-
userCurrentTeamId: number;
|
39
|
-
planName: string;
|
40
|
-
exp: number;
|
41
|
-
}>;
|
42
|
-
export type JwtTokenPayload = z.infer<typeof JWT_TOKEN_PAYLOAD_SCHEMA>;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
export declare const createMockJwtTokenPayload: (overrides?: {
|
2
|
-
isProviderAlpha?: boolean | undefined;
|
3
|
-
isFullyAuthenticated?: boolean | undefined;
|
4
|
-
planId?: number | undefined;
|
5
|
-
userTeamRole?: "member" | "admin" | "biller" | "owner" | undefined;
|
6
|
-
userEmail?: string | undefined;
|
7
|
-
teamId?: number | undefined;
|
8
|
-
userId?: number | undefined;
|
9
|
-
userUuid?: string | undefined;
|
10
|
-
userName?: string | undefined;
|
11
|
-
userCurrentTeamId?: number | undefined;
|
12
|
-
planName?: string | undefined;
|
13
|
-
exp?: number | undefined;
|
14
|
-
} | undefined, removeProperties?: ("isProviderAlpha" | "isFullyAuthenticated" | "planId" | "userTeamRole" | "userEmail" | "teamId" | "userId" | "userUuid" | "userName" | "userCurrentTeamId" | "planName" | "exp")[]) => {
|
15
|
-
isProviderAlpha: boolean;
|
16
|
-
isFullyAuthenticated: boolean;
|
17
|
-
planId: number;
|
18
|
-
userTeamRole: "member" | "admin" | "biller" | "owner";
|
19
|
-
userEmail: string;
|
20
|
-
teamId: number;
|
21
|
-
userId: number;
|
22
|
-
userUuid: string;
|
23
|
-
userName: string;
|
24
|
-
userCurrentTeamId: number;
|
25
|
-
planName: string;
|
26
|
-
exp: number;
|
27
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import { Wretch, WretchAddon } from 'wretch/types';
|
2
|
-
import { JwtAuthProps } from '../../core/middleware/jwtAuthMiddleware';
|
3
|
-
import { PromoteAuthProps } from '../middleware/promoteClassicSessionToJwtMiddleware';
|
4
|
-
type BrowserJwtAuthProps = Omit<JwtAuthProps, 'getCachedJwtToken'> & {
|
5
|
-
/**
|
6
|
-
* The browser implementation makes this optional, as it can be inferred from the cookie.
|
7
|
-
* You can still provide a custom implementation if you want to.
|
8
|
-
*/
|
9
|
-
getCachedJwtToken?: JwtAuthProps['getCachedJwtToken'];
|
10
|
-
};
|
11
|
-
type BrowserPromoteAuthProps = Omit<PromoteAuthProps, 'getCachedJwtToken' | 'getCsrfToken'> & {
|
12
|
-
/**
|
13
|
-
* The browser implementation makes this optional, as it can be inferred from the cookie.
|
14
|
-
* You can still provide a custom implementation if you want to.
|
15
|
-
*/
|
16
|
-
getCachedJwtToken?: PromoteAuthProps['getCachedJwtToken'];
|
17
|
-
/**
|
18
|
-
* The browser implementation makes this optional, as it can be inferred from the cookie.
|
19
|
-
* You can still provide a custom implementation if you want to.
|
20
|
-
*/
|
21
|
-
getCsrfToken?: PromoteAuthProps['getCsrfToken'];
|
22
|
-
};
|
23
|
-
export interface LokaliseAuthBrowserAddon {
|
24
|
-
lokaliseAuth<T extends LokaliseAuthBrowserAddon>(this: T & Wretch<T>, props?: BrowserJwtAuthProps): this;
|
25
|
-
promoteClassicSession<T extends LokaliseAuthBrowserAddon>(this: T & Wretch<T>, props: BrowserPromoteAuthProps): this;
|
26
|
-
}
|
27
|
-
/**
|
28
|
-
* A browser implementation of the LokaliseAuthAddon.
|
29
|
-
* This implementation provides default providers that uses cookies to retrieve the JWT token.
|
30
|
-
*
|
31
|
-
* It exposes another utility method to automatically promote a classic session to a JWT session
|
32
|
-
* when a request is made from an environment using class CSRF PHP token authentication.
|
33
|
-
*/
|
34
|
-
export declare const LokaliseAuthBrowserAddon: WretchAddon<LokaliseAuthBrowserAddon>;
|
35
|
-
export {};
|
@@ -1,20 +0,0 @@
|
|
1
|
-
import { JwtTokenPayload } from '../../core/types/jwtTokenPayload';
|
2
|
-
import { JwtToken } from '../../../publicApi/types/userTokenTypes';
|
3
|
-
type NewJwtIssuedEventDetail = {
|
4
|
-
token: JwtToken;
|
5
|
-
payload: JwtTokenPayload | undefined;
|
6
|
-
};
|
7
|
-
/**
|
8
|
-
* This event is emitted when a new JWT token is issued or refreshed.
|
9
|
-
*/
|
10
|
-
export declare class NewJwtIssuedEvent extends CustomEvent<NewJwtIssuedEventDetail> {
|
11
|
-
static readonly eventName: "new-jwt-issued";
|
12
|
-
constructor(token: JwtToken);
|
13
|
-
}
|
14
|
-
export declare const isNewJwtIssuedEvent: (event: Event) => event is NewJwtIssuedEvent;
|
15
|
-
declare global {
|
16
|
-
interface WindowEventMap {
|
17
|
-
[NewJwtIssuedEvent.eventName]: NewJwtIssuedEvent;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
export {};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { Wretch } from 'wretch';
|
2
|
-
/**
|
3
|
-
* Uses the payload attached to the JWT to request the contributor information
|
4
|
-
* of the provided project for the authenticated user.
|
5
|
-
* This required an active JWT token to be present in the cookie.
|
6
|
-
*
|
7
|
-
* @param wretchClient - Wretch instance configured to a public API instance.
|
8
|
-
* @param projectId - The ID of the project to retrieve the contributor information.
|
9
|
-
*/
|
10
|
-
export declare function useAuthenticatedProjectContributor<T>(wretchClient: Wretch<T>, projectId: string): import('@tanstack/react-query').UseQueryResult<{
|
11
|
-
contributors: {
|
12
|
-
email: string;
|
13
|
-
user_id: number;
|
14
|
-
fullname: string;
|
15
|
-
created_at: string;
|
16
|
-
created_at_timestamp: number;
|
17
|
-
admin_rights: string[];
|
18
|
-
languages: {
|
19
|
-
lang_id: number;
|
20
|
-
lang_iso: string;
|
21
|
-
lang_name: string;
|
22
|
-
is_writable: 0 | 1;
|
23
|
-
}[];
|
24
|
-
is_admin: boolean;
|
25
|
-
is_reviewer: boolean;
|
26
|
-
}[];
|
27
|
-
project_id: string;
|
28
|
-
}, undefined>;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A hook that will bring the cached JWT token into the React lifecycle.
|
3
|
-
* If the token is updated or removed, the hook will update the state.
|
4
|
-
*/
|
5
|
-
export declare function useAuthenticatedSessionPayload(): {
|
6
|
-
isProviderAlpha: boolean;
|
7
|
-
isFullyAuthenticated: boolean;
|
8
|
-
planId: number;
|
9
|
-
userTeamRole: "member" | "admin" | "biller" | "owner";
|
10
|
-
userEmail: string;
|
11
|
-
teamId: number;
|
12
|
-
userId: number;
|
13
|
-
userUuid: string;
|
14
|
-
userName: string;
|
15
|
-
userCurrentTeamId: number;
|
16
|
-
planName: string;
|
17
|
-
exp: number;
|
18
|
-
} | undefined;
|
@@ -1,18 +0,0 @@
|
|
1
|
-
import { Wretch } from 'wretch';
|
2
|
-
/**
|
3
|
-
* Uses the payload attached to the JWT to request the team-user information for the authenticated user.
|
4
|
-
* This required an active JWT token to be present in the cookie.
|
5
|
-
*
|
6
|
-
* @param wretchClient - Wretch instance configured to a public API instance.
|
7
|
-
*/
|
8
|
-
export declare function useAuthenticatedUser<T>(wretchClient: Wretch<T>): import('@tanstack/react-query').UseQueryResult<{
|
9
|
-
team_id: number;
|
10
|
-
team_user: {
|
11
|
-
role: "member" | "admin" | "biller" | "owner";
|
12
|
-
email: string;
|
13
|
-
user_id: number;
|
14
|
-
fullname: string;
|
15
|
-
created_at: string;
|
16
|
-
created_at_timestamp: number;
|
17
|
-
};
|
18
|
-
}, undefined>;
|
package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
import { Wretch } from 'wretch';
|
2
|
-
/**
|
3
|
-
* For use in environments that are authenticated with a classic CSRF PHP session (e.g. Expert).
|
4
|
-
* This hook will send that token to the public API, upgrade to a JWT session.
|
5
|
-
*
|
6
|
-
* @param wretchClient - Wretch instance configured to a public API instance.
|
7
|
-
* @param teamId - The team ID to get the JWT for.
|
8
|
-
*/
|
9
|
-
export declare function useGetPromotedClassicSessionJwtQuery<T>(wretchClient: Wretch<T>, teamId: number): import('@tanstack/react-query').UseQueryResult<{
|
10
|
-
accessToken: string;
|
11
|
-
refreshToken: string;
|
12
|
-
}, undefined>;
|
package/dist/types/src/features/auth/frontend/middleware/promoteClassicSessionToJwtMiddleware.d.ts
DELETED
@@ -1,14 +0,0 @@
|
|
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;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,4 +0,0 @@
|
|
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;
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,9 +0,0 @@
|
|
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';
|
@@ -1,111 +0,0 @@
|
|
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>;
|
@@ -1,76 +0,0 @@
|
|
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>;
|
@@ -1,26 +0,0 @@
|
|
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>;
|
@@ -1,20 +0,0 @@
|
|
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>;
|