@lokalise/harmony 1.20.3 → 1.21.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.
@@ -11,7 +11,6 @@ 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;
15
14
  contributor: {
16
15
  email: string;
17
16
  user_id: number;
@@ -28,4 +27,5 @@ export declare function useAuthenticatedProjectContributor<T>(wretchClient: Wret
28
27
  is_admin: boolean;
29
28
  is_reviewer: boolean;
30
29
  };
30
+ project_id: string;
31
31
  }, undefined>;
@@ -2,8 +2,18 @@
2
2
  * Public API router definition for retrieving a project contributor
3
3
  */
4
4
  export declare const retrieveContributor: import('@lokalise/universal-ts-utils/node').GetRouteDefinition<{
5
- projectId: string;
6
- contributorId: number;
5
+ project: {
6
+ uuid: string;
7
+ } | {
8
+ id: string;
9
+ };
10
+ contributor: {
11
+ authenticatedUser: true;
12
+ } | {
13
+ uuid: string;
14
+ } | {
15
+ id: number;
16
+ };
7
17
  }, import('zod').ZodObject<{
8
18
  project_id: import('zod').ZodString;
9
19
  contributor: import('zod').ZodObject<{
@@ -63,7 +73,6 @@ export declare const retrieveContributor: import('@lokalise/universal-ts-utils/n
63
73
  is_reviewer: boolean;
64
74
  }>;
65
75
  }, "strip", import('zod').ZodTypeAny, {
66
- project_id: string;
67
76
  contributor: {
68
77
  email: string;
69
78
  user_id: number;
@@ -80,8 +89,8 @@ export declare const retrieveContributor: import('@lokalise/universal-ts-utils/n
80
89
  is_admin: boolean;
81
90
  is_reviewer: boolean;
82
91
  };
83
- }, {
84
92
  project_id: string;
93
+ }, {
85
94
  contributor: {
86
95
  email: string;
87
96
  user_id: number;
@@ -98,15 +107,66 @@ export declare const retrieveContributor: import('@lokalise/universal-ts-utils/n
98
107
  is_admin: boolean;
99
108
  is_reviewer: boolean;
100
109
  };
110
+ project_id: string;
101
111
  }>, import('zod').ZodObject<{
102
- projectId: import('zod').ZodString;
103
- contributorId: import('zod').ZodNumber;
112
+ project: import('zod').ZodUnion<[import('zod').ZodObject<{
113
+ uuid: import('zod').ZodString;
114
+ }, "strip", import('zod').ZodTypeAny, {
115
+ uuid: string;
116
+ }, {
117
+ uuid: string;
118
+ }>, import('zod').ZodObject<{
119
+ id: import('zod').ZodString;
120
+ }, "strip", import('zod').ZodTypeAny, {
121
+ id: string;
122
+ }, {
123
+ id: string;
124
+ }>]>;
125
+ contributor: import('zod').ZodUnion<[import('zod').ZodObject<{
126
+ authenticatedUser: import('zod').ZodLiteral<true>;
127
+ }, "strip", import('zod').ZodTypeAny, {
128
+ authenticatedUser: true;
129
+ }, {
130
+ authenticatedUser: true;
131
+ }>, import('zod').ZodObject<{
132
+ uuid: import('zod').ZodString;
133
+ }, "strip", import('zod').ZodTypeAny, {
134
+ uuid: string;
135
+ }, {
136
+ uuid: string;
137
+ }>, import('zod').ZodObject<{
138
+ id: import('zod').ZodNumber;
139
+ }, "strip", import('zod').ZodTypeAny, {
140
+ id: number;
141
+ }, {
142
+ id: number;
143
+ }>]>;
104
144
  }, "strip", import('zod').ZodTypeAny, {
105
- projectId: string;
106
- contributorId: number;
145
+ project: {
146
+ uuid: string;
147
+ } | {
148
+ id: string;
149
+ };
150
+ contributor: {
151
+ authenticatedUser: true;
152
+ } | {
153
+ uuid: string;
154
+ } | {
155
+ id: number;
156
+ };
107
157
  }, {
108
- projectId: string;
109
- contributorId: number;
158
+ project: {
159
+ uuid: string;
160
+ } | {
161
+ id: string;
162
+ };
163
+ contributor: {
164
+ authenticatedUser: true;
165
+ } | {
166
+ uuid: string;
167
+ } | {
168
+ id: number;
169
+ };
110
170
  }>, undefined, import('zod').ZodIntersection<import('zod').ZodUnion<[import('zod').ZodUnion<[import('zod').ZodObject<{
111
171
  authorization: import('zod').ZodString;
112
172
  }, "strip", import('zod').ZodTypeAny, {
@@ -15,8 +15,8 @@ export declare function useCreateProjectMutation<T>(wretchClient: Wretch<T>, hea
15
15
  created_at_timestamp: number;
16
16
  team_id: number;
17
17
  description: string;
18
- project_id: string;
19
18
  uuid: string;
19
+ project_id: string;
20
20
  project_type: "localization_files" | "paged_documents" | "marketing";
21
21
  created_by: number;
22
22
  created_by_email: string;
@@ -30,8 +30,8 @@ export declare function useListProjectsQuery<T>(wretchClient: Wretch<T>, headers
30
30
  created_at_timestamp: number;
31
31
  team_id: number;
32
32
  description: string;
33
- project_id: string;
34
33
  uuid: string;
34
+ project_id: string;
35
35
  project_type: "localization_files" | "paged_documents" | "marketing";
36
36
  created_by: number;
37
37
  created_by_email: string;
@@ -1,12 +1,25 @@
1
1
  import { HeaderBuilder } from '../../auth/core/headers/headerBuilder';
2
- import { ContributorApiBaseHeader, RetrieveContributorResponse } from '../types/contributorTypes';
2
+ import { ContributorApiBaseHeader, RetrieveContributorPathParams, RetrieveContributorResponse } from '../types/contributorTypes';
3
3
  import { ApiQueryOverrides } from '../../../utils/types/apiQueryOverrides';
4
4
  import { Wretch } from 'wretch';
5
5
  /**
6
6
  * Factory for creating keys for the useRetrieveContributorQuery hook
7
7
  */
8
8
  export declare const retrieveContributorKeys: {
9
- projectUserKey: (projectId: string, userId: number) => readonly ["RetrieveContributor", string, number];
9
+ projectUserKey: (params: RetrieveContributorPathParams) => readonly ["RetrieveContributor", {
10
+ project: {
11
+ uuid: string;
12
+ } | {
13
+ id: string;
14
+ };
15
+ contributor: {
16
+ authenticatedUser: true;
17
+ } | {
18
+ uuid: string;
19
+ } | {
20
+ id: number;
21
+ };
22
+ }];
10
23
  };
11
24
  /**
12
25
  * A react-router wrapper about the retrieveContributor public API endpoint
@@ -16,7 +29,6 @@ export declare const retrieveContributorKeys: {
16
29
  * @param overrides - Additional options to pass to the query.
17
30
  */
18
31
  export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, headers: HeaderBuilder<ContributorApiBaseHeader>, overrides: ApiQueryOverrides<RetrieveContributorResponse, typeof retrieveContributorKeys>) => import('@tanstack/react-query').UseQueryResult<{
19
- project_id: string;
20
32
  contributor: {
21
33
  email: string;
22
34
  user_id: number;
@@ -33,4 +45,5 @@ export declare const useRetrieveContributorQuery: <T>(wretchClient: Wretch<T>, h
33
45
  is_admin: boolean;
34
46
  is_reviewer: boolean;
35
47
  };
48
+ project_id: string;
36
49
  }, undefined>;
@@ -21,8 +21,8 @@ export declare function useRetrieveProjectQuery<T>(wretchClient: Wretch<T>, head
21
21
  created_at_timestamp: number;
22
22
  team_id: number;
23
23
  description: string;
24
- project_id: string;
25
24
  uuid: string;
25
+ project_id: string;
26
26
  project_type: "localization_files" | "paged_documents" | "marketing";
27
27
  created_by: number;
28
28
  created_by_email: string;
@@ -16,8 +16,8 @@ export declare function useUpdateProjectMutation<T>(wretchClient: Wretch<T>, hea
16
16
  created_at_timestamp: number;
17
17
  team_id: number;
18
18
  description: string;
19
- project_id: string;
20
19
  uuid: string;
20
+ project_id: string;
21
21
  project_type: "localization_files" | "paged_documents" | "marketing";
22
22
  created_by: number;
23
23
  created_by_email: string;
@@ -225,8 +225,8 @@ export declare const createProject: import('@lokalise/universal-ts-utils/node').
225
225
  created_at_timestamp: number;
226
226
  team_id: number;
227
227
  description: string;
228
- project_id: string;
229
228
  uuid: string;
229
+ project_id: string;
230
230
  project_type: "localization_files" | "paged_documents" | "marketing";
231
231
  created_by: number;
232
232
  created_by_email: string;
@@ -281,8 +281,8 @@ export declare const createProject: import('@lokalise/universal-ts-utils/node').
281
281
  created_at_timestamp: number;
282
282
  team_id: number;
283
283
  description: string;
284
- project_id: string;
285
284
  uuid: string;
285
+ project_id: string;
286
286
  project_type: "localization_files" | "paged_documents" | "marketing";
287
287
  created_by: number;
288
288
  created_by_email: string;
@@ -578,8 +578,8 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
578
578
  created_at_timestamp: number;
579
579
  team_id: number;
580
580
  description: string;
581
- project_id: string;
582
581
  uuid: string;
582
+ project_id: string;
583
583
  project_type: "localization_files" | "paged_documents" | "marketing";
584
584
  created_by: number;
585
585
  created_by_email: string;
@@ -634,8 +634,8 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
634
634
  created_at_timestamp: number;
635
635
  team_id: number;
636
636
  description: string;
637
- project_id: string;
638
637
  uuid: string;
638
+ project_id: string;
639
639
  project_type: "localization_files" | "paged_documents" | "marketing";
640
640
  created_by: number;
641
641
  created_by_email: string;
@@ -692,8 +692,8 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
692
692
  created_at_timestamp: number;
693
693
  team_id: number;
694
694
  description: string;
695
- project_id: string;
696
695
  uuid: string;
696
+ project_id: string;
697
697
  project_type: "localization_files" | "paged_documents" | "marketing";
698
698
  created_by: number;
699
699
  created_by_email: string;
@@ -750,8 +750,8 @@ export declare const listProjects: import('@lokalise/universal-ts-utils/node').G
750
750
  created_at_timestamp: number;
751
751
  team_id: number;
752
752
  description: string;
753
- project_id: string;
754
753
  uuid: string;
754
+ project_id: string;
755
755
  project_type: "localization_files" | "paged_documents" | "marketing";
756
756
  created_by: number;
757
757
  created_by_email: string;
@@ -1073,8 +1073,8 @@ export declare const retrieveProject: import('@lokalise/universal-ts-utils/node'
1073
1073
  created_at_timestamp: number;
1074
1074
  team_id: number;
1075
1075
  description: string;
1076
- project_id: string;
1077
1076
  uuid: string;
1077
+ project_id: string;
1078
1078
  project_type: "localization_files" | "paged_documents" | "marketing";
1079
1079
  created_by: number;
1080
1080
  created_by_email: string;
@@ -1129,8 +1129,8 @@ export declare const retrieveProject: import('@lokalise/universal-ts-utils/node'
1129
1129
  created_at_timestamp: number;
1130
1130
  team_id: number;
1131
1131
  description: string;
1132
- project_id: string;
1133
1132
  uuid: string;
1133
+ project_id: string;
1134
1134
  project_type: "localization_files" | "paged_documents" | "marketing";
1135
1135
  created_by: number;
1136
1136
  created_by_email: string;
@@ -1442,8 +1442,8 @@ export declare const updateProject: import('@lokalise/universal-ts-utils/node').
1442
1442
  created_at_timestamp: number;
1443
1443
  team_id: number;
1444
1444
  description: string;
1445
- project_id: string;
1446
1445
  uuid: string;
1446
+ project_id: string;
1447
1447
  project_type: "localization_files" | "paged_documents" | "marketing";
1448
1448
  created_by: number;
1449
1449
  created_by_email: string;
@@ -1498,8 +1498,8 @@ export declare const updateProject: import('@lokalise/universal-ts-utils/node').
1498
1498
  created_at_timestamp: number;
1499
1499
  team_id: number;
1500
1500
  description: string;
1501
- project_id: string;
1502
1501
  uuid: string;
1502
+ project_id: string;
1503
1503
  project_type: "localization_files" | "paged_documents" | "marketing";
1504
1504
  created_by: number;
1505
1505
  created_by_email: string;
@@ -129,15 +129,99 @@ export declare const CONTRIBUTOR_SCHEMA: z.ZodObject<{
129
129
  is_reviewer: boolean;
130
130
  }>;
131
131
  export type Contributor = z.infer<typeof CONTRIBUTOR_SCHEMA>;
132
+ declare const PROJECT_TARGET_SCHEMA: z.ZodUnion<[z.ZodObject<{
133
+ uuid: z.ZodString;
134
+ }, "strip", z.ZodTypeAny, {
135
+ uuid: string;
136
+ }, {
137
+ uuid: string;
138
+ }>, z.ZodObject<{
139
+ id: z.ZodString;
140
+ }, "strip", z.ZodTypeAny, {
141
+ id: string;
142
+ }, {
143
+ id: string;
144
+ }>]>;
145
+ export type ProjectTarget = z.infer<typeof PROJECT_TARGET_SCHEMA>;
146
+ declare const CONTRIBUTOR_TARGET_PATH_PARAMS_SCHEMA: z.ZodUnion<[z.ZodObject<{
147
+ authenticatedUser: z.ZodLiteral<true>;
148
+ }, "strip", z.ZodTypeAny, {
149
+ authenticatedUser: true;
150
+ }, {
151
+ authenticatedUser: true;
152
+ }>, z.ZodObject<{
153
+ uuid: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ uuid: string;
156
+ }, {
157
+ uuid: string;
158
+ }>, z.ZodObject<{
159
+ id: z.ZodNumber;
160
+ }, "strip", z.ZodTypeAny, {
161
+ id: number;
162
+ }, {
163
+ id: number;
164
+ }>]>;
165
+ export type ContributorTargetPathParams = z.infer<typeof CONTRIBUTOR_TARGET_PATH_PARAMS_SCHEMA>;
132
166
  export declare const RETRIEVE_CONTRIBUTOR_PATH_PARAMS_SCHEMA: z.ZodObject<{
133
- projectId: z.ZodString;
134
- contributorId: z.ZodNumber;
167
+ project: z.ZodUnion<[z.ZodObject<{
168
+ uuid: z.ZodString;
169
+ }, "strip", z.ZodTypeAny, {
170
+ uuid: string;
171
+ }, {
172
+ uuid: string;
173
+ }>, z.ZodObject<{
174
+ id: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ id: string;
177
+ }, {
178
+ id: string;
179
+ }>]>;
180
+ contributor: z.ZodUnion<[z.ZodObject<{
181
+ authenticatedUser: z.ZodLiteral<true>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ authenticatedUser: true;
184
+ }, {
185
+ authenticatedUser: true;
186
+ }>, z.ZodObject<{
187
+ uuid: z.ZodString;
188
+ }, "strip", z.ZodTypeAny, {
189
+ uuid: string;
190
+ }, {
191
+ uuid: string;
192
+ }>, z.ZodObject<{
193
+ id: z.ZodNumber;
194
+ }, "strip", z.ZodTypeAny, {
195
+ id: number;
196
+ }, {
197
+ id: number;
198
+ }>]>;
135
199
  }, "strip", z.ZodTypeAny, {
136
- projectId: string;
137
- contributorId: number;
200
+ project: {
201
+ uuid: string;
202
+ } | {
203
+ id: string;
204
+ };
205
+ contributor: {
206
+ authenticatedUser: true;
207
+ } | {
208
+ uuid: string;
209
+ } | {
210
+ id: number;
211
+ };
138
212
  }, {
139
- projectId: string;
140
- contributorId: number;
213
+ project: {
214
+ uuid: string;
215
+ } | {
216
+ id: string;
217
+ };
218
+ contributor: {
219
+ authenticatedUser: true;
220
+ } | {
221
+ uuid: string;
222
+ } | {
223
+ id: number;
224
+ };
141
225
  }>;
142
226
  export type RetrieveContributorPathParams = z.infer<typeof RETRIEVE_CONTRIBUTOR_PATH_PARAMS_SCHEMA>;
143
227
  export declare const RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA: z.ZodObject<{
@@ -199,7 +283,6 @@ export declare const RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA: z.ZodObject<{
199
283
  is_reviewer: boolean;
200
284
  }>;
201
285
  }, "strip", z.ZodTypeAny, {
202
- project_id: string;
203
286
  contributor: {
204
287
  email: string;
205
288
  user_id: number;
@@ -216,8 +299,8 @@ export declare const RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA: z.ZodObject<{
216
299
  is_admin: boolean;
217
300
  is_reviewer: boolean;
218
301
  };
219
- }, {
220
302
  project_id: string;
303
+ }, {
221
304
  contributor: {
222
305
  email: string;
223
306
  user_id: number;
@@ -234,5 +317,7 @@ export declare const RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA: z.ZodObject<{
234
317
  is_admin: boolean;
235
318
  is_reviewer: boolean;
236
319
  };
320
+ project_id: string;
237
321
  }>;
238
322
  export type RetrieveContributorResponse = z.infer<typeof RETRIEVE_CONTRIBUTOR_RESPONSE_SCHEMA>;
323
+ export {};
@@ -468,8 +468,8 @@ export declare const PROJECT_SCHEMA: z.ZodObject<{
468
468
  created_at_timestamp: number;
469
469
  team_id: number;
470
470
  description: string;
471
- project_id: string;
472
471
  uuid: string;
472
+ project_id: string;
473
473
  project_type: "localization_files" | "paged_documents" | "marketing";
474
474
  created_by: number;
475
475
  created_by_email: string;
@@ -524,8 +524,8 @@ export declare const PROJECT_SCHEMA: z.ZodObject<{
524
524
  created_at_timestamp: number;
525
525
  team_id: number;
526
526
  description: string;
527
- project_id: string;
528
527
  uuid: string;
528
+ project_id: string;
529
529
  project_type: "localization_files" | "paged_documents" | "marketing";
530
530
  created_by: number;
531
531
  created_by_email: string;
@@ -829,8 +829,8 @@ export declare const LIST_PROJECTS_SUCCESS_RESPONSE_BODY: z.ZodObject<{
829
829
  created_at_timestamp: number;
830
830
  team_id: number;
831
831
  description: string;
832
- project_id: string;
833
832
  uuid: string;
833
+ project_id: string;
834
834
  project_type: "localization_files" | "paged_documents" | "marketing";
835
835
  created_by: number;
836
836
  created_by_email: string;
@@ -885,8 +885,8 @@ export declare const LIST_PROJECTS_SUCCESS_RESPONSE_BODY: z.ZodObject<{
885
885
  created_at_timestamp: number;
886
886
  team_id: number;
887
887
  description: string;
888
- project_id: string;
889
888
  uuid: string;
889
+ project_id: string;
890
890
  project_type: "localization_files" | "paged_documents" | "marketing";
891
891
  created_by: number;
892
892
  created_by_email: string;
@@ -943,8 +943,8 @@ export declare const LIST_PROJECTS_SUCCESS_RESPONSE_BODY: z.ZodObject<{
943
943
  created_at_timestamp: number;
944
944
  team_id: number;
945
945
  description: string;
946
- project_id: string;
947
946
  uuid: string;
947
+ project_id: string;
948
948
  project_type: "localization_files" | "paged_documents" | "marketing";
949
949
  created_by: number;
950
950
  created_by_email: string;
@@ -1001,8 +1001,8 @@ export declare const LIST_PROJECTS_SUCCESS_RESPONSE_BODY: z.ZodObject<{
1001
1001
  created_at_timestamp: number;
1002
1002
  team_id: number;
1003
1003
  description: string;
1004
- project_id: string;
1005
1004
  uuid: string;
1005
+ project_id: string;
1006
1006
  project_type: "localization_files" | "paged_documents" | "marketing";
1007
1007
  created_by: number;
1008
1008
  created_by_email: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/harmony",
3
- "version": "1.20.3",
3
+ "version": "1.21.0",
4
4
  "author": {
5
5
  "name": "Lokalise",
6
6
  "url": "https://lokalise.com/"