@lokalise/harmony 1.6.0-exp-jwtutils.22 → 1.8.0

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.
Files changed (57) hide show
  1. package/README.md +64 -0
  2. package/dist/harmony.cjs +1 -1
  3. package/dist/harmony.mjs +547 -552
  4. package/dist/types/src/components/Sidebar/Sidebar.d.ts +5 -2
  5. package/dist/types/src/components/Sidebar/Sidebar.stories.d.ts +1 -0
  6. package/dist/types/src/components/Sidebar/Widgets/Avatar/Avatar.d.ts +3 -0
  7. package/dist/types/src/components/Sidebar/Widgets/IconLink/IconLink.d.ts +3 -0
  8. package/dist/types/src/components/Sidebar/Widgets/Menu/Menu.d.ts +3 -0
  9. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileMenu.d.ts +4 -0
  10. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/ProfileSettingsMenuItem/ProfileSettingsMenuItem.d.ts +4 -0
  11. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/TeamMenuItem/TeamMenuItem.d.ts +5 -0
  12. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/TeamSwitch/TeamSwitch.d.ts +3 -0
  13. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/UpgradeMenuItem/UpgradeMenuItem.d.ts +5 -0
  14. package/dist/types/src/components/Sidebar/Widgets/ProfileMenu/types.d.ts +9 -6
  15. package/dist/types/src/features/auth/backend/services/getAuthenticatedSessionDetailFromRequest.d.ts +10 -0
  16. package/dist/types/src/features/auth/core/jwtTokenPayload.d.ts +7 -14
  17. package/dist/types/src/features/auth/core/lokaliseAuthAddon.d.ts +8 -0
  18. package/dist/types/src/features/auth/core/middleware/jwtAuthMiddleware.d.ts +1 -1
  19. package/dist/types/src/features/auth/core/middleware/publicApiHeadersMiddleware.d.ts +3 -0
  20. package/dist/types/src/features/auth/core/types/jwtTokenPayload.d.ts +4 -4
  21. package/dist/types/src/features/auth/core/types/jwtTokenPayload.fixture.d.ts +5 -5
  22. package/dist/types/src/features/auth/core/utils/makeAuthHeader.d.ts +2 -3
  23. package/dist/types/src/features/auth/frontend/addon/lokaliseAuthBrowserAddon.d.ts +7 -0
  24. package/dist/types/src/features/auth/frontend/events/NewJwtIssuedEvent.d.ts +1 -1
  25. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedProjectContributor.d.ts +9 -1
  26. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedSessionPayload.d.ts +2 -2
  27. package/dist/types/src/features/auth/frontend/hooks/useAuthenticatedUser.d.ts +7 -1
  28. package/dist/types/src/features/auth/frontend/hooks/useGetPromotedClassicSessionJwtQuery.d.ts +11 -202
  29. package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.d.ts +4 -0
  30. package/dist/types/src/features/auth/frontend/utils/cookieTokenUtils.test.d.ts +1 -0
  31. package/dist/types/src/features/auth/{index.d.ts → node.d.ts} +1 -11
  32. package/dist/types/src/features/node.d.ts +2 -0
  33. package/dist/types/src/features/publicApi/contributors.d.ts +3 -97
  34. package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +11 -6
  35. package/dist/types/src/features/publicApi/hooks/useGetTeamUsersQuery.d.ts +11 -2
  36. package/dist/types/src/features/publicApi/hooks/useGetUserTokenQuery.d.ts +11 -2
  37. package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +13 -4
  38. package/dist/types/src/features/publicApi/hooks/useRetrieveContributorQuery.d.ts +11 -2
  39. package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +13 -4
  40. package/dist/types/src/features/publicApi/{index.d.ts → node.d.ts} +6 -3
  41. package/dist/types/src/features/publicApi/projects.d.ts +259 -784
  42. package/dist/types/src/features/publicApi/teamUsers.d.ts +3 -70
  43. package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +171 -0
  44. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +1061 -0
  45. package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +70 -0
  46. package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +26 -0
  47. package/dist/types/src/features/publicApi/userToken.d.ts +0 -11
  48. package/dist/types/src/node.d.ts +3 -6
  49. package/dist/types/tests/utils.d.ts +1 -6
  50. package/package.json +23 -18
  51. package/dist/types/src/features/auth/bff/services/getAuthenticatedSessionDetailFromRequest.d.ts +0 -18
  52. package/dist/types/src/features/auth/frontend/utils/cookieToken.d.ts +0 -4
  53. package/dist/types/src/features/publicApi/types/project.d.ts +0 -522
  54. /package/dist/types/src/{features/auth/bff/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts → components/Sidebar/Widgets/ProfileMenu/ProfileMenu.test.d.ts} +0 -0
  55. /package/dist/types/src/features/auth/{frontend/utils/cookieToken.test.d.ts → backend/services/getAuthenticatedSessionPayloadFromRequest.test.d.ts} +0 -0
  56. /package/dist/types/src/features/publicApi/types/{language.d.ts → languageTypes.d.ts} +0 -0
  57. /package/dist/types/src/features/publicApi/types/{teamRole.d.ts → teamRoleTypes.d.ts} +0 -0
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ export declare const TEAM_USER_SCHEMA: z.ZodObject<{
3
+ user_id: z.ZodNumber;
4
+ email: z.ZodString;
5
+ fullname: z.ZodString;
6
+ created_at: z.ZodString;
7
+ created_at_timestamp: z.ZodNumber;
8
+ role: z.ZodUnion<[z.ZodLiteral<"owner">, z.ZodLiteral<"admin">, z.ZodLiteral<"biller">, z.ZodLiteral<"member">]>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ role: "member" | "admin" | "biller" | "owner";
11
+ email: string;
12
+ user_id: number;
13
+ fullname: string;
14
+ created_at: string;
15
+ created_at_timestamp: number;
16
+ }, {
17
+ role: "member" | "admin" | "biller" | "owner";
18
+ email: string;
19
+ user_id: number;
20
+ fullname: string;
21
+ created_at: string;
22
+ created_at_timestamp: number;
23
+ }>;
24
+ export type TeamUser = z.infer<typeof TEAM_USER_SCHEMA>;
25
+ export declare const TEAM_USER_RESPONSE_SCHEMA: z.ZodObject<{
26
+ team_id: z.ZodNumber;
27
+ team_user: z.ZodObject<{
28
+ user_id: z.ZodNumber;
29
+ email: z.ZodString;
30
+ fullname: z.ZodString;
31
+ created_at: z.ZodString;
32
+ created_at_timestamp: z.ZodNumber;
33
+ role: z.ZodUnion<[z.ZodLiteral<"owner">, z.ZodLiteral<"admin">, z.ZodLiteral<"biller">, z.ZodLiteral<"member">]>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ role: "member" | "admin" | "biller" | "owner";
36
+ email: string;
37
+ user_id: number;
38
+ fullname: string;
39
+ created_at: string;
40
+ created_at_timestamp: number;
41
+ }, {
42
+ role: "member" | "admin" | "biller" | "owner";
43
+ email: string;
44
+ user_id: number;
45
+ fullname: string;
46
+ created_at: string;
47
+ created_at_timestamp: number;
48
+ }>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ team_id: number;
51
+ team_user: {
52
+ role: "member" | "admin" | "biller" | "owner";
53
+ email: string;
54
+ user_id: number;
55
+ fullname: string;
56
+ created_at: string;
57
+ created_at_timestamp: number;
58
+ };
59
+ }, {
60
+ team_id: number;
61
+ team_user: {
62
+ role: "member" | "admin" | "biller" | "owner";
63
+ email: string;
64
+ user_id: number;
65
+ fullname: string;
66
+ created_at: string;
67
+ created_at_timestamp: number;
68
+ };
69
+ }>;
70
+ export type TeamUserResponse = z.infer<typeof TEAM_USER_RESPONSE_SCHEMA>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const JWT_TOKEN_SCHEMA: z.ZodObject<{
3
+ accessToken: z.ZodString;
4
+ refreshToken: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ accessToken: string;
7
+ refreshToken: string;
8
+ }, {
9
+ accessToken: string;
10
+ refreshToken: string;
11
+ }>;
12
+ export type JwtToken = z.infer<typeof JWT_TOKEN_SCHEMA>;
13
+ export declare const AUTHENTICATED_REQUEST_HEADER: z.ZodUnion<[z.ZodObject<{
14
+ Authorization: z.ZodString;
15
+ }, "strip", z.ZodTypeAny, {
16
+ Authorization: string;
17
+ }, {
18
+ Authorization: string;
19
+ }>, z.ZodObject<{
20
+ 'x-csrf-token': z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ 'x-csrf-token': string;
23
+ }, {
24
+ 'x-csrf-token': string;
25
+ }>]>;
26
+ export type AuthenticatedRequestHeader = z.infer<typeof AUTHENTICATED_REQUEST_HEADER>;
@@ -1,15 +1,4 @@
1
1
  import { z } from 'zod';
2
- export declare const JWT_TOKEN_SCHEMA: z.ZodObject<{
3
- accessToken: z.ZodString;
4
- refreshToken: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- accessToken: string;
7
- refreshToken: string;
8
- }, {
9
- accessToken: string;
10
- refreshToken: string;
11
- }>;
12
- export type JwtToken = z.infer<typeof JWT_TOKEN_SCHEMA>;
13
2
  /**
14
3
  * A method of getting a JWT token for a user.
15
4
  * You can call this with either a refresh token or from within the scope of a classic CSRF cookie session.
@@ -1,13 +1,10 @@
1
1
  /**
2
2
  * COMPONENTS EXPORTS
3
3
  */
4
+ export * from './components/Sidebar/Widgets/ProfileMenu/types';
4
5
  export { NavigationPanel } from './components/NavigationPanel/NavigationPanel';
5
6
  export { Sidebar } from './components/Sidebar/Sidebar';
6
7
  export { Breadcrumbs } from './components/NavigationPanel/components/Breadcrumbs/Breadcrumbs';
7
8
  export { NavigationTabs } from './components/NavigationPanel/components/NavigationTabs/NavigationTabs';
8
- /**
9
- * FEATURES
10
- */
11
- export * from './features/auth';
12
- export * from './features/publicApi';
13
- export * from './utils/node';
9
+ export * from './features/node';
10
+ export * from './utils/node.ts';
@@ -1,7 +1,2 @@
1
- import { RenderOptions } from '@testing-library/react';
2
1
  import { ReactElement } from 'react';
3
- interface ExtendedRenderOptions extends RenderOptions {
4
- theme?: 'light' | 'dark';
5
- }
6
- export declare const renderWithProviders: (ui: ReactElement, { theme, ...options }?: ExtendedRenderOptions) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
7
- export {};
2
+ export declare const renderWithProviders: (ui: ReactElement) => import('@testing-library/react').RenderResult<typeof import("@testing-library/dom/types/queries"), HTMLElement, HTMLElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.6.0-exp-jwtutils.22",
3
+ "version": "1.8.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"
@@ -8,9 +8,12 @@
8
8
  "homepage": "https://github.com/lokalise/harmony",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/lokalise/harmony.git"
11
+ "url": "git+https://github.com/lokalise/harmony.git"
12
12
  },
13
- "files": ["dist/**", "README.md"],
13
+ "files": [
14
+ "dist/**",
15
+ "README.md"
16
+ ],
14
17
  "type": "module",
15
18
  "publishConfig": {
16
19
  "access": "public"
@@ -32,7 +35,6 @@
32
35
  "peerDependencies": {
33
36
  "@lokalise/frontend-http-client": ">=3.2.1",
34
37
  "@lokalise/louis": ">=26.0.0",
35
- "@lokalise/styled": ">=3.0.0",
36
38
  "@lokalise/token-dictionary": ">=2.42.1",
37
39
  "@lokalise/universal-ts-utils": ">=3.4.0",
38
40
  "@tanstack/react-query": ">=5.66.9",
@@ -45,8 +47,8 @@
45
47
  },
46
48
  "devDependencies": {
47
49
  "@biomejs/biome": "^1.9.4",
48
- "@chromatic-com/storybook": "^3.2.4",
49
- "@faker-js/faker": "^9.5.0",
50
+ "@chromatic-com/storybook": "^3.2.5",
51
+ "@faker-js/faker": "^9.6.0",
50
52
  "@lokalise/biome-config": "^1.6.1",
51
53
  "@semantic-release/changelog": "^6.0.3",
52
54
  "@semantic-release/commit-analyzer": "^13.0.1",
@@ -54,12 +56,13 @@
54
56
  "@semantic-release/github": "^11.0.1",
55
57
  "@semantic-release/npm": "^12.0.1",
56
58
  "@semantic-release/release-notes-generator": "^14.0.3",
57
- "@storybook/addon-essentials": "^8.6.0-alpha.4",
58
- "@storybook/addon-interactions": "^8.6.0-alpha.4",
59
- "@storybook/addon-onboarding": "^8.6.0-alpha.4",
59
+ "@storybook/addon-essentials": "^8.6.4",
60
+ "@storybook/addon-interactions": "^8.6.4",
61
+ "@storybook/addon-onboarding": "^8.6.4",
62
+ "@storybook/addon-themes": "^8.6.4",
60
63
  "@storybook/blocks": "^8.6.0-alpha.1",
61
- "@storybook/react": "^8.6.0-alpha.4",
62
- "@storybook/react-vite": "^8.6.0-alpha.4",
64
+ "@storybook/react": "^8.6.4",
65
+ "@storybook/react-vite": "^8.6.4",
63
66
  "@storybook/test": "^8.6.0-alpha.1",
64
67
  "@testing-library/jest-dom": "^6.4.6",
65
68
  "@testing-library/react": "^16.2.0",
@@ -67,30 +70,32 @@
67
70
  "@types/node": "^22.13.1",
68
71
  "@types/react": "^18.3.18",
69
72
  "@types/react-dom": "18.3.0",
70
- "@typescript-eslint/parser": "^8.23.0",
73
+ "@typescript-eslint/parser": "^8.26.1",
71
74
  "@vitejs/plugin-react": "^4.3.4",
72
- "@vitest/coverage-v8": "^3.0.5",
75
+ "@vitest/coverage-v8": "^3.0.8",
73
76
  "bundlesize2": "^0.0.34",
74
77
  "conventional-changelog-conventionalcommits": "^8.0.0",
75
78
  "eslint-plugin-i18next": "^6.0.9",
76
- "eslint-plugin-storybook": "^0.11.2",
79
+ "eslint-plugin-storybook": "^0.11.4",
77
80
  "eslint-plugin-testing-library": "^7.1.1",
78
81
  "vitest-fail-on-console": "^0.7.1",
79
82
  "jsdom": "26.0.0",
80
83
  "mockttp": "^3.16.0",
81
84
  "rimraf": "^6.0.1",
82
- "semantic-release": "^24.2.1",
85
+ "semantic-release": "^24.2.3",
83
86
  "storybook": "^8.6.0-alpha.1",
84
87
  "typescript": "^5.7.3",
85
- "vite": "^6.0.11",
86
- "vite-plugin-dts": "^4.5.0",
88
+ "vite": "^6.2.1",
89
+ "vite-plugin-dts": "^4.5.3",
87
90
  "vite-plugin-tsconfig-paths": "^1.4.1",
88
91
  "vitest": "^3.0.3"
89
92
  },
90
93
  "main": "dist/harmony.cjs",
91
94
  "module": "dist/harmony.mjs",
92
95
  "types": "dist/types/index.d.ts",
93
- "sideEffects": ["*.css"],
96
+ "sideEffects": [
97
+ "*.css"
98
+ ],
94
99
  "exports": {
95
100
  ".": {
96
101
  "types": "./dist/types/index.d.ts",
@@ -1,18 +0,0 @@
1
- export declare function getAuthenticatedSessionDetailFromRequest(): Promise<{
2
- readonly payload: {
3
- isProviderAlpha: boolean;
4
- planId: number;
5
- userEmail: string;
6
- teamId: number;
7
- userId: number;
8
- userUuid: string;
9
- userTeamRole: "member" | "admin" | "biller" | "owner";
10
- userName: string;
11
- userCurrentTeamId: number;
12
- planName: string;
13
- isFullyAuthenticated: boolean;
14
- exp: number;
15
- };
16
- readonly accessToken: string;
17
- readonly refreshToken: string;
18
- } | undefined>;
@@ -1,4 +0,0 @@
1
- import { JwtToken } from '../../../publicApi';
2
- export declare function getJwtTokenFromCookie(): Promise<JwtToken | undefined>;
3
- export declare function getCsrfTokenFromCookie(): Promise<string | undefined>;
4
- export declare function getCookie(cookies: string, name: string): string | undefined;