@lokalise/harmony 1.24.2 → 1.25.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.
@@ -11,6 +11,7 @@ import { Wretch } from 'wretch';
11
11
  * @param projectId - The ID of the project to retrieve the contributor information.
12
12
  */
13
13
  export declare function useAuthenticatedProjectContributor<T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ContributorApiBaseHeader>, projectId: string): import('@tanstack/react-query').UseQueryResult<{
14
+ project_id: string;
14
15
  contributor: {
15
16
  email: string;
16
17
  user_id: number;
@@ -22,10 +23,9 @@ export declare function useAuthenticatedProjectContributor<T>(wretchClient: Wret
22
23
  lang_id: number;
23
24
  lang_iso: string;
24
25
  lang_name: string;
25
- is_writable: 0 | 1;
26
+ is_writable: boolean | 0 | 1;
26
27
  }[];
27
28
  is_admin: boolean;
28
29
  is_reviewer: boolean;
29
30
  };
30
- project_id: string;
31
31
  }, undefined>;
@@ -1,18 +1,202 @@
1
1
  /**
2
- * Public API router definition for retrieving a project contributor
2
+ * Public API router definition for retrieving a list of contributors
3
3
  */
4
- export declare const retrieveContributor: import('@lokalise/api-contracts').GetRouteDefinition<{
4
+ export declare const listContributors: import('@lokalise/api-contracts').GetRouteDefinition<{
5
5
  project: {
6
+ id: string;
7
+ } | {
6
8
  uuid: string;
9
+ };
10
+ }, import('zod').ZodObject<{
11
+ project_id: import('zod').ZodString;
12
+ contributors: import('zod').ZodArray<import('zod').ZodObject<{
13
+ user_id: import('zod').ZodNumber;
14
+ email: import('zod').ZodString;
15
+ fullname: import('zod').ZodString;
16
+ created_at: import('zod').ZodString;
17
+ created_at_timestamp: import('zod').ZodNumber;
18
+ admin_rights: import('zod').ZodArray<import('zod').ZodString, "many">;
19
+ languages: import('zod').ZodArray<import('zod').ZodObject<{
20
+ lang_id: import('zod').ZodNumber;
21
+ lang_iso: import('zod').ZodString;
22
+ lang_name: import('zod').ZodString;
23
+ is_writable: import('zod').ZodUnion<[import('zod').ZodLiteral<0>, import('zod').ZodLiteral<1>, import('zod').ZodBoolean]>;
24
+ }, "strip", import('zod').ZodTypeAny, {
25
+ lang_id: number;
26
+ lang_iso: string;
27
+ lang_name: string;
28
+ is_writable: boolean | 0 | 1;
29
+ }, {
30
+ lang_id: number;
31
+ lang_iso: string;
32
+ lang_name: string;
33
+ is_writable: boolean | 0 | 1;
34
+ }>, "many">;
35
+ is_admin: import('zod').ZodBoolean;
36
+ is_reviewer: import('zod').ZodBoolean;
37
+ }, "strip", import('zod').ZodTypeAny, {
38
+ email: string;
39
+ user_id: number;
40
+ fullname: string;
41
+ created_at: string;
42
+ created_at_timestamp: number;
43
+ admin_rights: string[];
44
+ languages: {
45
+ lang_id: number;
46
+ lang_iso: string;
47
+ lang_name: string;
48
+ is_writable: boolean | 0 | 1;
49
+ }[];
50
+ is_admin: boolean;
51
+ is_reviewer: boolean;
52
+ }, {
53
+ email: string;
54
+ user_id: number;
55
+ fullname: string;
56
+ created_at: string;
57
+ created_at_timestamp: number;
58
+ admin_rights: string[];
59
+ languages: {
60
+ lang_id: number;
61
+ lang_iso: string;
62
+ lang_name: string;
63
+ is_writable: boolean | 0 | 1;
64
+ }[];
65
+ is_admin: boolean;
66
+ is_reviewer: boolean;
67
+ }>, "many">;
68
+ }, "strip", import('zod').ZodTypeAny, {
69
+ contributors: {
70
+ email: string;
71
+ user_id: number;
72
+ fullname: string;
73
+ created_at: string;
74
+ created_at_timestamp: number;
75
+ admin_rights: string[];
76
+ languages: {
77
+ lang_id: number;
78
+ lang_iso: string;
79
+ lang_name: string;
80
+ is_writable: boolean | 0 | 1;
81
+ }[];
82
+ is_admin: boolean;
83
+ is_reviewer: boolean;
84
+ }[];
85
+ project_id: string;
86
+ }, {
87
+ contributors: {
88
+ email: string;
89
+ user_id: number;
90
+ fullname: string;
91
+ created_at: string;
92
+ created_at_timestamp: number;
93
+ admin_rights: string[];
94
+ languages: {
95
+ lang_id: number;
96
+ lang_iso: string;
97
+ lang_name: string;
98
+ is_writable: boolean | 0 | 1;
99
+ }[];
100
+ is_admin: boolean;
101
+ is_reviewer: boolean;
102
+ }[];
103
+ project_id: string;
104
+ }>, import('zod').ZodObject<{
105
+ project: import('zod').ZodUnion<[import('zod').ZodObject<{
106
+ uuid: import('zod').ZodString;
107
+ }, "strip", import('zod').ZodTypeAny, {
108
+ uuid: string;
109
+ }, {
110
+ uuid: string;
111
+ }>, import('zod').ZodObject<{
112
+ id: import('zod').ZodString;
113
+ }, "strip", import('zod').ZodTypeAny, {
114
+ id: string;
115
+ }, {
116
+ id: string;
117
+ }>]>;
118
+ }, "strip", import('zod').ZodTypeAny, {
119
+ project: {
120
+ id: string;
7
121
  } | {
122
+ uuid: string;
123
+ };
124
+ }, {
125
+ project: {
126
+ id: string;
127
+ } | {
128
+ uuid: string;
129
+ };
130
+ }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
131
+ authorization: import('zod').ZodString;
132
+ }, "strip", import('zod').ZodTypeAny, {
133
+ authorization: string;
134
+ }, {
135
+ authorization: string;
136
+ }>, import('zod').ZodObject<{
137
+ AUTHORIZATION: import('zod').ZodString;
138
+ }, "strip", import('zod').ZodTypeAny, {
139
+ AUTHORIZATION: string;
140
+ }, {
141
+ AUTHORIZATION: string;
142
+ }>]>, import('zod').ZodUnion<[import('zod').ZodObject<{
143
+ 'X-API-Token': import('zod').ZodString;
144
+ }, "strip", import('zod').ZodTypeAny, {
145
+ 'X-API-Token': string;
146
+ }, {
147
+ 'X-API-Token': string;
148
+ }>, import('zod').ZodObject<{
149
+ 'X-Api-Token': import('zod').ZodString;
150
+ }, "strip", import('zod').ZodTypeAny, {
151
+ 'X-Api-Token': string;
152
+ }, {
153
+ 'X-Api-Token': string;
154
+ }>, import('zod').ZodObject<{
155
+ 'x-api-token': import('zod').ZodString;
156
+ }, "strip", import('zod').ZodTypeAny, {
157
+ 'x-api-token': string;
158
+ }, {
159
+ 'x-api-token': string;
160
+ }>, import('zod').ZodObject<{
161
+ 'X-API-TOKEN': import('zod').ZodString;
162
+ }, "strip", import('zod').ZodTypeAny, {
163
+ 'X-API-TOKEN': string;
164
+ }, {
165
+ 'X-API-TOKEN': string;
166
+ }>]>]>, import('zod').ZodUnion<[import('zod').ZodObject<{
167
+ 'X-Lokalise-Plugin': import('zod').ZodString;
168
+ }, "strip", import('zod').ZodTypeAny, {
169
+ 'X-Lokalise-Plugin': string;
170
+ }, {
171
+ 'X-Lokalise-Plugin': string;
172
+ }>, import('zod').ZodObject<{
173
+ 'x-lokalise-plugin': import('zod').ZodString;
174
+ }, "strip", import('zod').ZodTypeAny, {
175
+ 'x-lokalise-plugin': string;
176
+ }, {
177
+ 'x-lokalise-plugin': string;
178
+ }>, import('zod').ZodObject<{
179
+ 'X-LOKALISE-PLUGIN': import('zod').ZodString;
180
+ }, "strip", import('zod').ZodTypeAny, {
181
+ 'X-LOKALISE-PLUGIN': string;
182
+ }, {
183
+ 'X-LOKALISE-PLUGIN': string;
184
+ }>]>>, false, false>;
185
+ /**
186
+ * Public API router definition for retrieving a project contributor
187
+ */
188
+ export declare const retrieveContributor: import('@lokalise/api-contracts').GetRouteDefinition<{
189
+ project: {
8
190
  id: string;
191
+ } | {
192
+ uuid: string;
9
193
  };
10
194
  contributor: {
11
- authenticatedUser: true;
195
+ id: number;
12
196
  } | {
13
197
  uuid: string;
14
198
  } | {
15
- id: number;
199
+ authenticatedUser: true;
16
200
  };
17
201
  }, import('zod').ZodObject<{
18
202
  project_id: import('zod').ZodString;
@@ -27,17 +211,17 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
27
211
  lang_id: import('zod').ZodNumber;
28
212
  lang_iso: import('zod').ZodString;
29
213
  lang_name: import('zod').ZodString;
30
- is_writable: import('zod').ZodUnion<[import('zod').ZodLiteral<0>, import('zod').ZodLiteral<1>]>;
214
+ is_writable: import('zod').ZodUnion<[import('zod').ZodLiteral<0>, import('zod').ZodLiteral<1>, import('zod').ZodBoolean]>;
31
215
  }, "strip", import('zod').ZodTypeAny, {
32
216
  lang_id: number;
33
217
  lang_iso: string;
34
218
  lang_name: string;
35
- is_writable: 0 | 1;
219
+ is_writable: boolean | 0 | 1;
36
220
  }, {
37
221
  lang_id: number;
38
222
  lang_iso: string;
39
223
  lang_name: string;
40
- is_writable: 0 | 1;
224
+ is_writable: boolean | 0 | 1;
41
225
  }>, "many">;
42
226
  is_admin: import('zod').ZodBoolean;
43
227
  is_reviewer: import('zod').ZodBoolean;
@@ -52,7 +236,7 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
52
236
  lang_id: number;
53
237
  lang_iso: string;
54
238
  lang_name: string;
55
- is_writable: 0 | 1;
239
+ is_writable: boolean | 0 | 1;
56
240
  }[];
57
241
  is_admin: boolean;
58
242
  is_reviewer: boolean;
@@ -67,12 +251,13 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
67
251
  lang_id: number;
68
252
  lang_iso: string;
69
253
  lang_name: string;
70
- is_writable: 0 | 1;
254
+ is_writable: boolean | 0 | 1;
71
255
  }[];
72
256
  is_admin: boolean;
73
257
  is_reviewer: boolean;
74
258
  }>;
75
259
  }, "strip", import('zod').ZodTypeAny, {
260
+ project_id: string;
76
261
  contributor: {
77
262
  email: string;
78
263
  user_id: number;
@@ -84,13 +269,13 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
84
269
  lang_id: number;
85
270
  lang_iso: string;
86
271
  lang_name: string;
87
- is_writable: 0 | 1;
272
+ is_writable: boolean | 0 | 1;
88
273
  }[];
89
274
  is_admin: boolean;
90
275
  is_reviewer: boolean;
91
276
  };
92
- project_id: string;
93
277
  }, {
278
+ project_id: string;
94
279
  contributor: {
95
280
  email: string;
96
281
  user_id: number;
@@ -102,12 +287,11 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
102
287
  lang_id: number;
103
288
  lang_iso: string;
104
289
  lang_name: string;
105
- is_writable: 0 | 1;
290
+ is_writable: boolean | 0 | 1;
106
291
  }[];
107
292
  is_admin: boolean;
108
293
  is_reviewer: boolean;
109
294
  };
110
- project_id: string;
111
295
  }>, import('zod').ZodObject<{
112
296
  project: import('zod').ZodUnion<[import('zod').ZodObject<{
113
297
  uuid: import('zod').ZodString;
@@ -143,29 +327,29 @@ export declare const retrieveContributor: import('@lokalise/api-contracts').GetR
143
327
  }>]>;
144
328
  }, "strip", import('zod').ZodTypeAny, {
145
329
  project: {
146
- uuid: string;
147
- } | {
148
330
  id: string;
331
+ } | {
332
+ uuid: string;
149
333
  };
150
334
  contributor: {
151
- authenticatedUser: true;
335
+ id: number;
152
336
  } | {
153
337
  uuid: string;
154
338
  } | {
155
- id: number;
339
+ authenticatedUser: true;
156
340
  };
157
341
  }, {
158
342
  project: {
159
- uuid: string;
160
- } | {
161
343
  id: string;
344
+ } | {
345
+ uuid: string;
162
346
  };
163
347
  contributor: {
164
- authenticatedUser: true;
348
+ id: number;
165
349
  } | {
166
350
  uuid: string;
167
351
  } | {
168
- id: number;
352
+ authenticatedUser: true;
169
353
  };
170
354
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
171
355
  authorization: import('zod').ZodString;
@@ -0,0 +1,42 @@
1
+ import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
2
+ import { ContributorApiBaseHeader, ListContributorsPathParams, ListContributorsResponse } from '../types/contributorTypes';
3
+ import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
4
+ import { Wretch } from 'wretch';
5
+ /**
6
+ * Factory for creating keys for the useRetrieveContributorQuery hook
7
+ */
8
+ export declare const listContributorsKeys: {
9
+ projectUserKey: (params: ListContributorsPathParams) => readonly ["ListContributors", {
10
+ project: {
11
+ id: string;
12
+ } | {
13
+ uuid: string;
14
+ };
15
+ }];
16
+ };
17
+ /**
18
+ * A react-router wrapper about the listContributors public API endpoint
19
+ *
20
+ * @param wretchClient - Wretch instance configured to a public API instance.
21
+ * @param headers - A header builder instance to resolve headers for the request.
22
+ * @param overrides - Additional options to pass to the query.
23
+ */
24
+ export declare const useListContributorsQuery: <T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ContributorApiBaseHeader>, overrides: ApiQueryOverrides<ListContributorsResponse, typeof listContributorsKeys>) => import('@tanstack/react-query').UseQueryResult<{
25
+ contributors: {
26
+ email: string;
27
+ user_id: number;
28
+ fullname: string;
29
+ created_at: string;
30
+ created_at_timestamp: number;
31
+ admin_rights: string[];
32
+ languages: {
33
+ lang_id: number;
34
+ lang_iso: string;
35
+ lang_name: string;
36
+ is_writable: boolean | 0 | 1;
37
+ }[];
38
+ is_admin: boolean;
39
+ is_reviewer: boolean;
40
+ }[];
41
+ project_id: string;
42
+ }, undefined>;
@@ -8,16 +8,16 @@ import { Wretch } from 'wretch';
8
8
  export declare const retrieveContributorKeys: {
9
9
  projectUserKey: (params: RetrieveContributorPathParams) => readonly ["RetrieveContributor", {
10
10
  project: {
11
- uuid: string;
12
- } | {
13
11
  id: string;
12
+ } | {
13
+ uuid: string;
14
14
  };
15
15
  contributor: {
16
- authenticatedUser: true;
16
+ id: number;
17
17
  } | {
18
18
  uuid: string;
19
19
  } | {
20
- id: number;
20
+ authenticatedUser: true;
21
21
  };
22
22
  }];
23
23
  };
@@ -29,6 +29,7 @@ export declare const retrieveContributorKeys: {
29
29
  * @param overrides - Additional options to pass to the query.
30
30
  */
31
31
  export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ContributorApiBaseHeader>, overrides: ApiQueryOverrides<RetrieveContributorResponse, typeof retrieveContributorKeys>) => import('@tanstack/react-query').UseQueryResult<{
32
+ project_id: string;
32
33
  contributor: {
33
34
  email: string;
34
35
  user_id: number;
@@ -40,10 +41,9 @@ export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, h
40
41
  lang_id: number;
41
42
  lang_iso: string;
42
43
  lang_name: string;
43
- is_writable: 0 | 1;
44
+ is_writable: boolean | 0 | 1;
44
45
  }[];
45
46
  is_admin: boolean;
46
47
  is_reviewer: boolean;
47
48
  };
48
- project_id: string;
49
49
  }, undefined>;