@lokalise/harmony 1.18.0 → 1.18.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.
Files changed (25) hide show
  1. package/README.md +1 -1
  2. package/dist/harmony.cjs +1 -1
  3. package/dist/harmony.mjs +493 -471
  4. package/dist/types/src/components/Sidebar/Sidebar.d.ts +1 -1
  5. package/dist/types/src/components/Sidebar/Sidebar.test.d.ts +1 -0
  6. package/dist/types/src/components/Sidebar/Widgets/Avatar/Avatar.d.ts +1 -1
  7. package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +1 -1
  8. package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +1 -1
  9. package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.test.d.ts +1 -0
  10. package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.test.d.ts +1 -0
  11. package/dist/types/src/features/auth/core/headers/createHeaderBuilderMiddleware.d.ts +3 -3
  12. package/dist/types/src/features/auth/core/headers/headerBuilder.d.ts +13 -13
  13. package/dist/types/src/features/auth/core/middleware/jwtAuthHeaderBuilderMiddleware.d.ts +1 -1
  14. package/dist/types/src/features/publicApi/contributors.d.ts +0 -6
  15. package/dist/types/src/features/publicApi/languages.d.ts +0 -12
  16. package/dist/types/src/features/publicApi/projects.d.ts +0 -24
  17. package/dist/types/src/features/publicApi/teamUsers.d.ts +0 -6
  18. package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +0 -6
  19. package/dist/types/src/features/publicApi/types/projectTypes.d.ts +0 -6
  20. package/dist/types/src/features/publicApi/types/sharedTypes.d.ts +0 -18
  21. package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +0 -6
  22. package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +0 -6
  23. package/dist/types/src/features/publicApi/userToken.d.ts +0 -6
  24. package/dist/types/tests/mocks/sidebar/tasks.d.ts +3 -1
  25. package/package.json +1 -1
@@ -9,7 +9,7 @@ declare const Sidebar: {
9
9
  ({ children, ...navProps }: SidebarProps): import("react/jsx-runtime").JSX.Element;
10
10
  Top: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
11
11
  Bottom: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
12
- Avatar: ({ src, href, ariaLabel, alt }: {
12
+ Avatar: ({ src, href, ariaLabel, alt, }: {
13
13
  src: string;
14
14
  href?: string;
15
15
  ariaLabel?: string;
@@ -12,5 +12,5 @@ type AvatarProps = {
12
12
  * Display company main avatar / logo in the top section of the Sidebar.
13
13
  * Used as the main branding element and home navigation link.
14
14
  */
15
- export declare const Avatar: ({ src, href, ariaLabel, alt }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const Avatar: ({ src, href, ariaLabel, alt, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export {};
@@ -2,4 +2,4 @@ import { SidebarTask } from '../types';
2
2
  export type TaskProps = {
3
3
  task: SidebarTask;
4
4
  };
5
- export declare const TaskOverview: ({ task }: TaskProps) => import("react/jsx-runtime").JSX.Element | null;
5
+ export declare const TaskOverview: ({ task }: TaskProps) => import("react/jsx-runtime").JSX.Element;
@@ -79,7 +79,7 @@ export type SidebarTasksConfig = {
79
79
  langProgressOnClick?: SidebarDefaultFn;
80
80
  };
81
81
  export type SidebarTasksContextProps = Pick<SidebarTasksConfig, 'onTasksWidgetOpen' | 'getProjectUrl' | 'taskTitleOnClick' | 'langNameOnClick' | 'langProgressOnClick' | 'onLanguageCompleteConfirm'> & {
82
- fetchTasks: () => Promise<void>;
82
+ fetchTasks: () => Promise<SidebarTask[]>;
83
83
  tasks: SidebarTask[];
84
84
  tasksCount: number;
85
85
  loadingTasks: boolean;
@@ -16,14 +16,14 @@ export type { HeaderBuilderMiddleware };
16
16
  * ```typescript
17
17
  * const authMiddleware = createHeaderBuilderMiddleware(async (builder) => {
18
18
  * const token = await fetchToken()
19
- * return builder.add('Authorization', `Bearer ${token}`)
19
+ * return builder.add('authorization', `Bearer ${token}`)
20
20
  * })
21
21
  *
22
22
  * const builder = HeaderBuilder.create()
23
23
  * .with(authMiddleware)
24
24
  *
25
- * const headers = await builder.resolve() // Type of headers is { 'Authorization': string }
26
- * console.log(headers) // { 'Authorization': 'Bearer <token>' }
25
+ * const headers = await builder.resolve() // Type of headers is { 'authorization': string }
26
+ * console.log(headers) // { 'authorization': 'Bearer <token>' }
27
27
  */
28
28
  declare class HeaderBuilderMiddleware<const H extends Headers> {
29
29
  private readonly middleware;
@@ -11,7 +11,7 @@ type NoHeaders = {};
11
11
  * ```typescript
12
12
  * const authMiddleware = createHeaderBuilderMiddleware(async (builder) => {
13
13
  * const token = await fetchToken()
14
- * return builder.add('Authorization', `Bearer ${token}`)
14
+ * return builder.add('authorization', `Bearer ${token}`)
15
15
  * })
16
16
  *
17
17
  * const builder = HeaderBuilder.create()
@@ -25,7 +25,7 @@ type NoHeaders = {};
25
25
  * // 'Content-Type': 'application/json',
26
26
  * // 'X-Custom-Header': 'custom',
27
27
  * // 'X-Another-Header': 'another',
28
- * // 'Authorization': 'Bearer <token>'
28
+ * // 'authorization': 'Bearer <token>'
29
29
  * // }
30
30
  */
31
31
  export declare class HeaderBuilder<H extends Headers = NoHeaders> {
@@ -60,11 +60,11 @@ export declare class HeaderBuilder<H extends Headers = NoHeaders> {
60
60
  * ```typescript
61
61
  * const builder = HeaderBuilder.create()
62
62
  * .add('Content-Type', 'application/json')
63
- * .add('Authorization', 'Bearer token')
63
+ * .add('authorization', 'Bearer token')
64
64
  *
65
65
  * const headers = await builder.resolve()
66
66
  * console.log(headers)
67
- * // { 'Content-Type': 'application/json', 'Authorization': 'Bearer token' }
67
+ * // { 'Content-Type': 'application/json', 'authorization': 'Bearer token' }
68
68
  * ```
69
69
  *
70
70
  * @param key - The key of the header
@@ -79,14 +79,14 @@ export declare class HeaderBuilder<H extends Headers = NoHeaders> {
79
79
  * @example
80
80
  * ```typescript
81
81
  * const builder = HeaderBuilder.create()
82
- * .and({ 'Content-Type': 'application/json', 'Authorization': 'Bearer token' })
82
+ * .and({ 'Content-Type': 'application/json', 'authorization': 'Bearer token' })
83
83
  * .and(Promise.resolve({ 'X-Custom-Header': 'custom', 'X-Another-Header': 'another' }))
84
84
  *
85
85
  * const headers = await builder.resolve()
86
86
  * console.log(headers)
87
87
  * // Prints: {
88
88
  * // 'Content-Type': 'application/json',
89
- * // 'Authorization': 'Bearer token',
89
+ * // 'authorization': 'Bearer token',
90
90
  * // 'X-Custom-Header': 'custom',
91
91
  * // 'X-Another-Header': 'another'
92
92
  * // }
@@ -104,11 +104,11 @@ export declare class HeaderBuilder<H extends Headers = NoHeaders> {
104
104
  * const builder = HeaderBuilder.create()
105
105
  * .from(async () => {
106
106
  * const token = await fetchToken()
107
- * return { 'Authorization': `Bearer ${token}` }
107
+ * return { 'authorization': `Bearer ${token}` }
108
108
  * })
109
109
  *
110
110
  * const headers = await builder.resolve()
111
- * console.log(headers) // { 'Authorization': 'Bearer <token>' }
111
+ * console.log(headers) // { 'authorization': 'Bearer <token>' }
112
112
  * ```
113
113
  *
114
114
  * @param factory - A function that returns a promise of headers
@@ -121,14 +121,14 @@ export declare class HeaderBuilder<H extends Headers = NoHeaders> {
121
121
  * ```typescript
122
122
  * const authMiddleware = createHeaderBuilderMiddleware(async (builder) => {
123
123
  * const token = await fetchToken()
124
- * return builder.add('Authorization', `Bearer ${token}`)
124
+ * return builder.add('authorization', `Bearer ${token}`)
125
125
  * })
126
126
  *
127
127
  * const builder = HeaderBuilder.create()
128
128
  * .with(authMiddleware)
129
129
  *
130
- * const headers = await builder.resolve() // Type of headers is { 'Authorization': string }
131
- * console.log(headers) // { 'Authorization': 'Bearer <token>' }
130
+ * const headers = await builder.resolve() // Type of headers is { 'authorization': string }
131
+ * console.log(headers) // { 'authorization': 'Bearer <token>' }
132
132
  * ```
133
133
  *
134
134
  * @param middleware
@@ -143,13 +143,13 @@ export declare class HeaderBuilder<H extends Headers = NoHeaders> {
143
143
  * .add('Content-Type', 'application/json')
144
144
  *
145
145
  * const builderB = HeaderBuilder.create()
146
- * .add('Authorization', 'Bearer token')
146
+ * .add('authorization', 'Bearer token')
147
147
  *
148
148
  * const mergedBuilder = builderA.merge(builderB)
149
149
  *
150
150
  * const headers = await mergedBuilder.resolve()
151
151
  * console.log(headers)
152
- * // { 'Content-Type': 'application/json', 'Authorization': 'Bearer token' }
152
+ * // { 'Content-Type': 'application/json', 'authorization': 'Bearer token' }
153
153
  * ```
154
154
  *
155
155
  * @param builder - The builder to merge with
@@ -6,5 +6,5 @@ export type JwtAuthHeaderBuilderMiddlewareProps = {
6
6
  onNewTokenIssued?: (token: JwtToken) => void;
7
7
  };
8
8
  export declare function JwtAuthHeaderBuilderMiddleware(props: JwtAuthHeaderBuilderMiddlewareProps): import('../headers/createHeaderBuilderMiddleware').HeaderBuilderMiddleware<{
9
- Authorization: `Bearer ${string}`;
9
+ authorization: `Bearer ${string}`;
10
10
  }>;
@@ -109,12 +109,6 @@ export declare const retrieveContributor: import('@lokalise/universal-ts-utils/n
109
109
  projectId: string;
110
110
  contributorId: number;
111
111
  }>, undefined, z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
112
- Authorization: z.ZodString;
113
- }, "strip", z.ZodTypeAny, {
114
- Authorization: string;
115
- }, {
116
- Authorization: string;
117
- }>, z.ZodObject<{
118
112
  authorization: z.ZodString;
119
113
  }, "strip", z.ZodTypeAny, {
120
114
  authorization: string;
@@ -49,12 +49,6 @@ export declare const listProjectLanguages: import('@lokalise/universal-ts-utils/
49
49
  }, {
50
50
  projectId: string;
51
51
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[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
52
  authorization: import('zod').ZodString;
59
53
  }, "strip", import('zod').ZodTypeAny, {
60
54
  authorization: string;
@@ -145,12 +139,6 @@ export declare const bulkUpdateProjectLanguages: import('@lokalise/universal-ts-
145
139
  }, {
146
140
  projectId: string;
147
141
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
148
- Authorization: import('zod').ZodString;
149
- }, "strip", import('zod').ZodTypeAny, {
150
- Authorization: string;
151
- }, {
152
- Authorization: string;
153
- }>, import('zod').ZodObject<{
154
142
  authorization: import('zod').ZodString;
155
143
  }, "strip", import('zod').ZodTypeAny, {
156
144
  authorization: string;
@@ -332,12 +332,6 @@ export declare const createProject: import('@lokalise/universal-ts-utils/node').
332
332
  };
333
333
  } | undefined;
334
334
  }>, undefined, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[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
335
  authorization: import('zod').ZodString;
342
336
  }, "strip", import('zod').ZodTypeAny, {
343
337
  authorization: string;
@@ -832,12 +826,6 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
832
826
  include_settings?: 0 | 1 | undefined;
833
827
  limit?: number | undefined;
834
828
  }>, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
835
- Authorization: import('zod').ZodString;
836
- }, "strip", import('zod').ZodTypeAny, {
837
- Authorization: string;
838
- }, {
839
- Authorization: string;
840
- }>, import('zod').ZodObject<{
841
829
  authorization: import('zod').ZodString;
842
830
  }, "strip", import('zod').ZodTypeAny, {
843
831
  authorization: string;
@@ -1198,12 +1186,6 @@ export declare const retrieveProject: import('@lokalise/universal-ts-utils/node'
1198
1186
  }, {
1199
1187
  project_id: string;
1200
1188
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
1201
- Authorization: import('zod').ZodString;
1202
- }, "strip", import('zod').ZodTypeAny, {
1203
- Authorization: string;
1204
- }, {
1205
- Authorization: string;
1206
- }>, import('zod').ZodObject<{
1207
1189
  authorization: import('zod').ZodString;
1208
1190
  }, "strip", import('zod').ZodTypeAny, {
1209
1191
  authorization: string;
@@ -1573,12 +1555,6 @@ export declare const updateProject: import('@lokalise/universal-ts-utils/node').
1573
1555
  }, {
1574
1556
  project_id: string;
1575
1557
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
1576
- Authorization: import('zod').ZodString;
1577
- }, "strip", import('zod').ZodTypeAny, {
1578
- Authorization: string;
1579
- }, {
1580
- Authorization: string;
1581
- }>, import('zod').ZodObject<{
1582
1558
  authorization: import('zod').ZodString;
1583
1559
  }, "strip", import('zod').ZodTypeAny, {
1584
1560
  authorization: string;
@@ -59,12 +59,6 @@ export declare const getTeamUser: import('@lokalise/universal-ts-utils/node').Ge
59
59
  userId: number;
60
60
  teamId: number;
61
61
  }>, undefined, z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
62
- Authorization: z.ZodString;
63
- }, "strip", z.ZodTypeAny, {
64
- Authorization: string;
65
- }, {
66
- Authorization: string;
67
- }>, z.ZodObject<{
68
62
  authorization: z.ZodString;
69
63
  }, "strip", z.ZodTypeAny, {
70
64
  authorization: string;
@@ -1,11 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const CONTRIBUTOR_API_BASE_HEADER_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
3
- Authorization: z.ZodString;
4
- }, "strip", z.ZodTypeAny, {
5
- Authorization: string;
6
- }, {
7
- Authorization: string;
8
- }>, z.ZodObject<{
9
3
  authorization: z.ZodString;
10
4
  }, "strip", z.ZodTypeAny, {
11
5
  authorization: string;
@@ -1,11 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const PROJECT_API_BASE_HEADERS_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
3
- Authorization: z.ZodString;
4
- }, "strip", z.ZodTypeAny, {
5
- Authorization: string;
6
- }, {
7
- Authorization: string;
8
- }>, z.ZodObject<{
9
3
  authorization: z.ZodString;
10
4
  }, "strip", z.ZodTypeAny, {
11
5
  authorization: string;
@@ -1,11 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const AUTHORIZATION_HEADER_SCHEMA: z.ZodUnion<[z.ZodObject<{
3
- Authorization: z.ZodString;
4
- }, "strip", z.ZodTypeAny, {
5
- Authorization: string;
6
- }, {
7
- Authorization: string;
8
- }>, z.ZodObject<{
9
3
  authorization: z.ZodString;
10
4
  }, "strip", z.ZodTypeAny, {
11
5
  authorization: string;
@@ -44,12 +38,6 @@ export declare const APU_TOKEN_AUTH_HEADER_SCHEMA: z.ZodUnion<[z.ZodObject<{
44
38
  'X-API-TOKEN': string;
45
39
  }>]>;
46
40
  export declare const AUTHENTICATION_HEADERS_SCHEMA: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
47
- Authorization: z.ZodString;
48
- }, "strip", z.ZodTypeAny, {
49
- Authorization: string;
50
- }, {
51
- Authorization: string;
52
- }>, z.ZodObject<{
53
41
  authorization: z.ZodString;
54
42
  }, "strip", z.ZodTypeAny, {
55
43
  authorization: string;
@@ -108,12 +96,6 @@ export declare const API_PLUGIN_HEADER_SCHEMA: z.ZodUnion<[z.ZodObject<{
108
96
  }>]>;
109
97
  export type ApiPluginHeader = z.infer<typeof API_PLUGIN_HEADER_SCHEMA>;
110
98
  export declare const BASE_API_ENDPOINT_HEADER_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
111
- Authorization: z.ZodString;
112
- }, "strip", z.ZodTypeAny, {
113
- Authorization: string;
114
- }, {
115
- Authorization: string;
116
- }>, z.ZodObject<{
117
99
  authorization: z.ZodString;
118
100
  }, "strip", z.ZodTypeAny, {
119
101
  authorization: string;
@@ -1,11 +1,5 @@
1
1
  import { z } from 'zod';
2
2
  export declare const TEAM_USER_API_BASE_HEADERS_SCHEMA: z.ZodIntersection<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
3
- Authorization: z.ZodString;
4
- }, "strip", z.ZodTypeAny, {
5
- Authorization: string;
6
- }, {
7
- Authorization: string;
8
- }>, z.ZodObject<{
9
3
  authorization: z.ZodString;
10
4
  }, "strip", z.ZodTypeAny, {
11
5
  authorization: string;
@@ -11,12 +11,6 @@ export declare const JWT_TOKEN_SCHEMA: z.ZodObject<{
11
11
  }>;
12
12
  export type JwtToken = z.infer<typeof JWT_TOKEN_SCHEMA>;
13
13
  export declare const USER_TOKEN_REQUEST_HEADER_SCHEMA: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
14
- Authorization: z.ZodString;
15
- }, "strip", z.ZodTypeAny, {
16
- Authorization: string;
17
- }, {
18
- Authorization: string;
19
- }>, z.ZodObject<{
20
14
  authorization: z.ZodString;
21
15
  }, "strip", z.ZodTypeAny, {
22
16
  authorization: string;
@@ -21,12 +21,6 @@ export declare const getUserToken: import('@lokalise/universal-ts-utils/node').P
21
21
  }, {
22
22
  teamId: number;
23
23
  }>, undefined, z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
24
- Authorization: z.ZodString;
25
- }, "strip", z.ZodTypeAny, {
26
- Authorization: string;
27
- }, {
28
- Authorization: string;
29
- }>, z.ZodObject<{
30
24
  authorization: z.ZodString;
31
25
  }, "strip", z.ZodTypeAny, {
32
26
  authorization: string;
@@ -1,2 +1,4 @@
1
- import { SidebarTask } from '../../../src/components/Sidebar/Widgets/Tasks/types';
1
+ import { SidebarTask, SidebarTaskLanguage, SidebarTaskStyleGuide } from '../../../src/components/Sidebar/Widgets/Tasks/types';
2
+ export declare const createTaskLanguage: () => SidebarTaskLanguage;
2
3
  export declare const createTask: () => SidebarTask;
4
+ export declare const createStyleGuide: () => SidebarTaskStyleGuide;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.18.0",
3
+ "version": "1.18.2",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"