@lokalise/chatter-api-contracts 0.1.6 → 0.1.8
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/dist/api/contracts/comments/delete-comment-reply.d.ts +6 -6
- package/dist/api/contracts/comments/delete-comment-reply.js +3 -3
- package/dist/api/contracts/comments/delete-comment.d.ts +4 -4
- package/dist/api/contracts/comments/delete-comment.js +2 -2
- package/dist/api/contracts/comments/get-comment-replies.d.ts +14 -14
- package/dist/api/contracts/comments/get-comment-replies.js +3 -3
- package/dist/api/contracts/comments/get-comment.d.ts +16 -16
- package/dist/api/contracts/comments/get-comment.js +2 -2
- package/dist/api/contracts/comments/get-comments.d.ts +4 -4
- package/dist/api/contracts/comments/get-comments.js +2 -2
- package/dist/api/contracts/comments/patch-comment-reply.d.ts +17 -8
- package/dist/api/contracts/comments/patch-comment-reply.js +5 -4
- package/dist/api/contracts/comments/patch-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/patch-comment.d.ts +15 -6
- package/dist/api/contracts/comments/patch-comment.js +4 -3
- package/dist/api/contracts/comments/patch-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comment-reply.d.ts +17 -8
- package/dist/api/contracts/comments/post-comment-reply.js +5 -4
- package/dist/api/contracts/comments/post-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/post-comment.d.ts +17 -8
- package/dist/api/contracts/comments/post-comment.js +5 -4
- package/dist/api/contracts/comments/post-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comments-actions-search.d.ts +18 -18
- package/dist/api/contracts/comments/post-comments-actions-search.js +3 -3
- package/dist/api/contracts/comments/put-comment-read-state.d.ts +4 -4
- package/dist/api/contracts/comments/put-comment-read-state.js +2 -2
- package/dist/api/contracts/comments/put-comment-subscription.d.ts +4 -4
- package/dist/api/contracts/comments/put-comment-subscription.js +2 -2
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/errors/index.js.map +1 -1
- package/dist/api/errors/mentioned-user-access-denied.d.ts +18 -0
- package/dist/api/errors/mentioned-user-access-denied.js +11 -0
- package/dist/api/errors/mentioned-user-access-denied.js.map +1 -0
- package/dist/api/objects/comment-reply.d.ts +4 -4
- package/dist/api/objects/comment-reply.js +3 -3
- package/dist/api/objects/comment.d.ts +6 -6
- package/dist/api/objects/comment.js +5 -5
- package/dist/api/objects/message.d.ts +3 -3
- package/dist/api/objects/message.js +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const DELETE_COMMENT_REPLY_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
5
|
-
replyId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
|
+
replyId: z.ZodGUID;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export type DeleteCommentReplyPathParams = z.infer<typeof DELETE_COMMENT_REPLY_PATH_PARAMS_SCHEMA>;
|
|
8
8
|
export declare const deleteCommentReplyContract: Omit<{
|
|
@@ -15,9 +15,9 @@ export declare const deleteCommentReplyContract: Omit<{
|
|
|
15
15
|
authorization: z.ZodString;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
17
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
18
|
-
teamId: z.
|
|
19
|
-
commentId: z.
|
|
20
|
-
replyId: z.
|
|
18
|
+
teamId: z.ZodGUID;
|
|
19
|
+
commentId: z.ZodGUID;
|
|
20
|
+
replyId: z.ZodGUID;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
readonly pathResolver: ({ teamId, commentId, replyId }: {
|
|
23
23
|
teamId: string;
|
|
@@ -7,9 +7,9 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
7
7
|
// DELETE /v1/teams/:teamId/comments/:commentId/replies/:replyId
|
|
8
8
|
// ------------------------------------------------------------
|
|
9
9
|
const DELETE_COMMENT_REPLY_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
10
|
-
teamId: z.
|
|
11
|
-
commentId: z.
|
|
12
|
-
replyId: z.
|
|
10
|
+
teamId: z.guid().describe('Id of the team'),
|
|
11
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
12
|
+
replyId: z.guid().describe('Id of the reply'),
|
|
13
13
|
}));
|
|
14
14
|
export const deleteCommentReplyContract = defineApiContract({
|
|
15
15
|
method: 'delete',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const DELETE_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type DeleteCommentPathParams = z.infer<typeof DELETE_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
export declare const deleteCommentContract: Omit<{
|
|
@@ -14,8 +14,8 @@ export declare const deleteCommentContract: Omit<{
|
|
|
14
14
|
authorization: z.ZodString;
|
|
15
15
|
}, z.core.$strip>;
|
|
16
16
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
17
|
-
teamId: z.
|
|
18
|
-
commentId: z.
|
|
17
|
+
teamId: z.ZodGUID;
|
|
18
|
+
commentId: z.ZodGUID;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
readonly pathResolver: ({ teamId, commentId }: {
|
|
21
21
|
teamId: string;
|
|
@@ -7,8 +7,8 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
7
7
|
// DELETE /v1/teams/:teamId/comments/:commentId
|
|
8
8
|
// ------------------------------------------------------------
|
|
9
9
|
const DELETE_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
10
|
-
teamId: z.
|
|
11
|
-
commentId: z.
|
|
10
|
+
teamId: z.guid().describe('Id of the team'),
|
|
11
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
12
12
|
}));
|
|
13
13
|
export const deleteCommentContract = defineApiContract({
|
|
14
14
|
method: 'delete',
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const GET_COMMENT_REPLIES_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type GetCommentRepliesPathParams = z.infer<typeof GET_COMMENT_REPLIES_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
declare const GET_COMMENT_REPLIES_QUERY_SCHEMA: z.ZodObject<{
|
|
8
8
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
9
|
-
after: z.ZodOptional<z.
|
|
9
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export type GetCommentRepliesQuery = z.infer<typeof GET_COMMENT_REPLIES_QUERY_SCHEMA>;
|
|
12
12
|
declare const GET_COMMENT_REPLIES_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
13
13
|
data: z.ZodArray<z.ZodObject<{
|
|
14
|
-
id: z.
|
|
15
|
-
commentId: z.
|
|
14
|
+
id: z.ZodGUID;
|
|
15
|
+
commentId: z.ZodGUID;
|
|
16
16
|
message: z.ZodObject<{
|
|
17
17
|
version: z.ZodLiteral<1>;
|
|
18
18
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -22,7 +22,7 @@ declare const GET_COMMENT_REPLIES_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
22
22
|
text: z.ZodString;
|
|
23
23
|
}, z.core.$strip>, z.ZodObject<{
|
|
24
24
|
type: z.ZodLiteral<"userMention">;
|
|
25
|
-
userId: z.
|
|
25
|
+
userId: z.ZodGUID;
|
|
26
26
|
}, z.core.$strip>, z.ZodObject<{
|
|
27
27
|
type: z.ZodLiteral<"link">;
|
|
28
28
|
href: z.ZodURL;
|
|
@@ -31,7 +31,7 @@ declare const GET_COMMENT_REPLIES_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
31
31
|
}, z.core.$strip>], "type">>;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
34
|
-
createdBy: z.
|
|
34
|
+
createdBy: z.ZodGUID;
|
|
35
35
|
createdAt: z.ZodISODateTime;
|
|
36
36
|
}, z.core.$strip>>;
|
|
37
37
|
meta: z.ZodObject<{
|
|
@@ -51,12 +51,12 @@ export declare const getCommentRepliesContract: Omit<{
|
|
|
51
51
|
authorization: z.ZodString;
|
|
52
52
|
}, z.core.$strip>;
|
|
53
53
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
54
|
-
teamId: z.
|
|
55
|
-
commentId: z.
|
|
54
|
+
teamId: z.ZodGUID;
|
|
55
|
+
commentId: z.ZodGUID;
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
readonly requestQuerySchema: z.ZodObject<{
|
|
58
58
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
59
|
-
after: z.ZodOptional<z.
|
|
59
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
60
60
|
}, z.core.$strip>;
|
|
61
61
|
readonly pathResolver: ({ teamId, commentId }: {
|
|
62
62
|
teamId: string;
|
|
@@ -67,8 +67,8 @@ export declare const getCommentRepliesContract: Omit<{
|
|
|
67
67
|
content: {
|
|
68
68
|
'application/json': z.ZodObject<{
|
|
69
69
|
data: z.ZodArray<z.ZodObject<{
|
|
70
|
-
id: z.
|
|
71
|
-
commentId: z.
|
|
70
|
+
id: z.ZodGUID;
|
|
71
|
+
commentId: z.ZodGUID;
|
|
72
72
|
message: z.ZodObject<{
|
|
73
73
|
version: z.ZodLiteral<1>;
|
|
74
74
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -78,7 +78,7 @@ export declare const getCommentRepliesContract: Omit<{
|
|
|
78
78
|
text: z.ZodString;
|
|
79
79
|
}, z.core.$strip>, z.ZodObject<{
|
|
80
80
|
type: z.ZodLiteral<"userMention">;
|
|
81
|
-
userId: z.
|
|
81
|
+
userId: z.ZodGUID;
|
|
82
82
|
}, z.core.$strip>, z.ZodObject<{
|
|
83
83
|
type: z.ZodLiteral<"link">;
|
|
84
84
|
href: z.ZodURL;
|
|
@@ -87,7 +87,7 @@ export declare const getCommentRepliesContract: Omit<{
|
|
|
87
87
|
}, z.core.$strip>], "type">>;
|
|
88
88
|
}, z.core.$strip>;
|
|
89
89
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
90
|
-
createdBy: z.
|
|
90
|
+
createdBy: z.ZodGUID;
|
|
91
91
|
createdAt: z.ZodISODateTime;
|
|
92
92
|
}, z.core.$strip>>;
|
|
93
93
|
meta: z.ZodObject<{
|
|
@@ -9,8 +9,8 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
9
9
|
// GET /v1/teams/:teamId/comments/:commentId/replies
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
const GET_COMMENT_REPLIES_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
12
|
-
teamId: z.
|
|
13
|
-
commentId: z.
|
|
12
|
+
teamId: z.guid().describe('Id of the team'),
|
|
13
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
14
14
|
}));
|
|
15
15
|
const COMMENT_REPLIES_DEFAULT_LIMIT = 100;
|
|
16
16
|
const COMMENT_REPLIES_MAX_LIMIT = 100;
|
|
@@ -23,7 +23,7 @@ const GET_COMMENT_REPLIES_QUERY_SCHEMA = z.compile(z.object({
|
|
|
23
23
|
.default(COMMENT_REPLIES_DEFAULT_LIMIT)
|
|
24
24
|
.describe('Number of replies to return per page'),
|
|
25
25
|
after: z
|
|
26
|
-
.
|
|
26
|
+
.guid()
|
|
27
27
|
.optional()
|
|
28
28
|
.describe('Cursor from the previous response `meta.cursor`. Omit to read the first page'),
|
|
29
29
|
}));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const GET_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type GetCommentPathParams = z.infer<typeof GET_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
declare const GET_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
8
8
|
data: z.ZodObject<{
|
|
9
|
-
id: z.
|
|
10
|
-
teamId: z.
|
|
11
|
-
projectId: z.ZodOptional<z.ZodNullable<z.
|
|
9
|
+
id: z.ZodGUID;
|
|
10
|
+
teamId: z.ZodGUID;
|
|
11
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
12
12
|
entityType: z.ZodEnum<{
|
|
13
13
|
readonly SEGMENT: 'SEGMENT';
|
|
14
14
|
}>;
|
|
@@ -26,7 +26,7 @@ declare const GET_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
26
26
|
text: z.ZodString;
|
|
27
27
|
}, z.core.$strip>, z.ZodObject<{
|
|
28
28
|
type: z.ZodLiteral<"userMention">;
|
|
29
|
-
userId: z.
|
|
29
|
+
userId: z.ZodGUID;
|
|
30
30
|
}, z.core.$strip>, z.ZodObject<{
|
|
31
31
|
type: z.ZodLiteral<"link">;
|
|
32
32
|
href: z.ZodURL;
|
|
@@ -35,13 +35,13 @@ declare const GET_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
35
35
|
}, z.core.$strip>], "type">>;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
38
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.
|
|
38
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
39
39
|
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
40
40
|
replyCount: z.ZodInt;
|
|
41
41
|
lastActivityAt: z.ZodISODateTime;
|
|
42
42
|
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
43
43
|
subscribed: z.ZodBoolean;
|
|
44
|
-
createdBy: z.
|
|
44
|
+
createdBy: z.ZodGUID;
|
|
45
45
|
createdAt: z.ZodISODateTime;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
47
|
}, z.core.$strip>;
|
|
@@ -56,8 +56,8 @@ export declare const getCommentContract: Omit<{
|
|
|
56
56
|
authorization: z.ZodString;
|
|
57
57
|
}, z.core.$strip>;
|
|
58
58
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
59
|
-
teamId: z.
|
|
60
|
-
commentId: z.
|
|
59
|
+
teamId: z.ZodGUID;
|
|
60
|
+
commentId: z.ZodGUID;
|
|
61
61
|
}, z.core.$strip>;
|
|
62
62
|
readonly pathResolver: ({ teamId, commentId }: {
|
|
63
63
|
teamId: string;
|
|
@@ -66,9 +66,9 @@ export declare const getCommentContract: Omit<{
|
|
|
66
66
|
readonly responsesByStatusCode: {
|
|
67
67
|
200: z.ZodObject<{
|
|
68
68
|
data: z.ZodObject<{
|
|
69
|
-
id: z.
|
|
70
|
-
teamId: z.
|
|
71
|
-
projectId: z.ZodOptional<z.ZodNullable<z.
|
|
69
|
+
id: z.ZodGUID;
|
|
70
|
+
teamId: z.ZodGUID;
|
|
71
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
72
72
|
entityType: z.ZodEnum<{
|
|
73
73
|
readonly SEGMENT: 'SEGMENT';
|
|
74
74
|
}>;
|
|
@@ -86,7 +86,7 @@ export declare const getCommentContract: Omit<{
|
|
|
86
86
|
text: z.ZodString;
|
|
87
87
|
}, z.core.$strip>, z.ZodObject<{
|
|
88
88
|
type: z.ZodLiteral<"userMention">;
|
|
89
|
-
userId: z.
|
|
89
|
+
userId: z.ZodGUID;
|
|
90
90
|
}, z.core.$strip>, z.ZodObject<{
|
|
91
91
|
type: z.ZodLiteral<"link">;
|
|
92
92
|
href: z.ZodURL;
|
|
@@ -95,13 +95,13 @@ export declare const getCommentContract: Omit<{
|
|
|
95
95
|
}, z.core.$strip>], "type">>;
|
|
96
96
|
}, z.core.$strip>;
|
|
97
97
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
98
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.
|
|
98
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
99
99
|
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
100
100
|
replyCount: z.ZodInt;
|
|
101
101
|
lastActivityAt: z.ZodISODateTime;
|
|
102
102
|
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
103
103
|
subscribed: z.ZodBoolean;
|
|
104
|
-
createdBy: z.
|
|
104
|
+
createdBy: z.ZodGUID;
|
|
105
105
|
createdAt: z.ZodISODateTime;
|
|
106
106
|
}, z.core.$strip>;
|
|
107
107
|
}, z.core.$strip>;
|
|
@@ -8,8 +8,8 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
8
8
|
// GET /v1/teams/:teamId/comments/:commentId
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
const GET_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
-
teamId: z.
|
|
12
|
-
commentId: z.
|
|
11
|
+
teamId: z.guid().describe('Id of the team'),
|
|
12
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
13
13
|
}));
|
|
14
14
|
const GET_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
15
15
|
data: COMMENT_SCHEMA,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const GET_COMMENTS_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export type GetCommentsPathParams = z.infer<typeof GET_COMMENTS_PATH_PARAMS_SCHEMA>;
|
|
6
6
|
declare const GET_COMMENTS_QUERY_SCHEMA: z.ZodObject<{
|
|
7
|
-
'filter-projectId': z.
|
|
7
|
+
'filter-projectId': z.ZodGUID;
|
|
8
8
|
'filter-entityType': z.ZodEnum<{
|
|
9
9
|
readonly SEGMENT: 'SEGMENT';
|
|
10
10
|
}>;
|
|
@@ -20,10 +20,10 @@ export declare const getCommentsContract: Omit<{
|
|
|
20
20
|
authorization: z.ZodString;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
23
|
-
teamId: z.
|
|
23
|
+
teamId: z.ZodGUID;
|
|
24
24
|
}, z.core.$strip>;
|
|
25
25
|
readonly requestQuerySchema: z.ZodObject<{
|
|
26
|
-
'filter-projectId': z.
|
|
26
|
+
'filter-projectId': z.ZodGUID;
|
|
27
27
|
'filter-entityType': z.ZodEnum<{
|
|
28
28
|
readonly SEGMENT: 'SEGMENT';
|
|
29
29
|
}>;
|
|
@@ -8,10 +8,10 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
8
8
|
// GET /v1/teams/:teamId/comments
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
const GET_COMMENTS_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
-
teamId: z.
|
|
11
|
+
teamId: z.guid().describe('Id of the team'),
|
|
12
12
|
}));
|
|
13
13
|
const GET_COMMENTS_QUERY_SCHEMA = z.compile(z.object({
|
|
14
|
-
'filter-projectId': z.
|
|
14
|
+
'filter-projectId': z.guid().describe('Only comments of this project'),
|
|
15
15
|
'filter-entityType': z
|
|
16
16
|
.enum(CommentEntityTypeEnum)
|
|
17
17
|
.describe('Only comments on this type of entity'),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
5
|
-
replyId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
|
+
replyId: z.ZodGUID;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export type PatchCommentReplyPathParams = z.infer<typeof PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA>;
|
|
8
8
|
declare const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
@@ -15,7 +15,7 @@ declare const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
15
15
|
text: z.ZodString;
|
|
16
16
|
}, z.core.$strip>, z.ZodObject<{
|
|
17
17
|
type: z.ZodLiteral<"userMention">;
|
|
18
|
-
userId: z.
|
|
18
|
+
userId: z.ZodGUID;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
20
20
|
type: z.ZodLiteral<"link">;
|
|
21
21
|
href: z.ZodURL;
|
|
@@ -35,9 +35,9 @@ export declare const patchCommentReplyContract: Omit<{
|
|
|
35
35
|
authorization: z.ZodString;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
38
|
-
teamId: z.
|
|
39
|
-
commentId: z.
|
|
40
|
-
replyId: z.
|
|
38
|
+
teamId: z.ZodGUID;
|
|
39
|
+
commentId: z.ZodGUID;
|
|
40
|
+
replyId: z.ZodGUID;
|
|
41
41
|
}, z.core.$strip>;
|
|
42
42
|
readonly requestBodySchema: z.ZodObject<{
|
|
43
43
|
message: z.ZodObject<{
|
|
@@ -49,7 +49,7 @@ export declare const patchCommentReplyContract: Omit<{
|
|
|
49
49
|
text: z.ZodString;
|
|
50
50
|
}, z.core.$strip>, z.ZodObject<{
|
|
51
51
|
type: z.ZodLiteral<"userMention">;
|
|
52
|
-
userId: z.
|
|
52
|
+
userId: z.ZodGUID;
|
|
53
53
|
}, z.core.$strip>, z.ZodObject<{
|
|
54
54
|
type: z.ZodLiteral<"link">;
|
|
55
55
|
href: z.ZodURL;
|
|
@@ -91,6 +91,15 @@ export declare const patchCommentReplyContract: Omit<{
|
|
|
91
91
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
92
92
|
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
93
93
|
}, z.core.$strip>;
|
|
94
|
+
422: z.ZodObject<{
|
|
95
|
+
message: z.ZodString;
|
|
96
|
+
code: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
97
|
+
errorCode: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
98
|
+
} & {
|
|
99
|
+
details: z.ZodObject<{
|
|
100
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
101
|
+
}, z.core.$strip>;
|
|
102
|
+
}, z.core.$strip>;
|
|
94
103
|
500: z.ZodObject<{
|
|
95
104
|
message: z.ZodString;
|
|
96
105
|
code: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { commentAuthorRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { commentAuthorRequiredErrorDefinition, mentionedUserAccessDeniedErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
5
5
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
6
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -8,9 +8,9 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
8
8
|
// PATCH /v1/teams/:teamId/comments/:commentId/replies/:replyId
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
const PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
-
teamId: z.
|
|
12
|
-
commentId: z.
|
|
13
|
-
replyId: z.
|
|
11
|
+
teamId: z.guid().describe('Id of the team'),
|
|
12
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
13
|
+
replyId: z.guid().describe('Id of the reply'),
|
|
14
14
|
}));
|
|
15
15
|
const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
16
16
|
message: MESSAGE_SCHEMA,
|
|
@@ -34,6 +34,7 @@ export const patchCommentReplyContract = defineApiContract({
|
|
|
34
34
|
commentAuthorRequiredErrorDefinition.schema,
|
|
35
35
|
]),
|
|
36
36
|
404: resourceNotFoundErrorDefinition.schema,
|
|
37
|
+
422: mentionedUserAccessDeniedErrorDefinition.schema,
|
|
37
38
|
500: ERROR_RESPONSE_SCHEMA,
|
|
38
39
|
},
|
|
39
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-comment-reply.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/patch-comment-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,E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O,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,cAAc;CACxB,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACzD,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,gBAAgB;IACzB,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,sCAAsC;IAC/D,iBAAiB,EAAE,uCAAuC;IAC1D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAC/C,aAAa,MAAM,aAAa,SAAS,YAAY,OAAO,EAAE;IAChE,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;QACrD,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;YACX,+BAA+B,CAAC,MAAM;YACtC,oCAAoC,CAAC,MAAM;SAC5C,CAAC;QACF,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,wCAAwC,CAAC,MAAM;QACpD,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const PATCH_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type PatchCommentPathParams = z.infer<typeof PATCH_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
declare const PATCH_COMMENT_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
@@ -14,7 +14,7 @@ declare const PATCH_COMMENT_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
14
14
|
text: z.ZodString;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"userMention">;
|
|
17
|
-
userId: z.
|
|
17
|
+
userId: z.ZodGUID;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
19
19
|
type: z.ZodLiteral<"link">;
|
|
20
20
|
href: z.ZodURL;
|
|
@@ -38,8 +38,8 @@ export declare const patchCommentContract: Omit<{
|
|
|
38
38
|
authorization: z.ZodString;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
41
|
-
teamId: z.
|
|
42
|
-
commentId: z.
|
|
41
|
+
teamId: z.ZodGUID;
|
|
42
|
+
commentId: z.ZodGUID;
|
|
43
43
|
}, z.core.$strip>;
|
|
44
44
|
readonly requestBodySchema: z.ZodObject<{
|
|
45
45
|
message: z.ZodOptional<z.ZodObject<{
|
|
@@ -51,7 +51,7 @@ export declare const patchCommentContract: Omit<{
|
|
|
51
51
|
text: z.ZodString;
|
|
52
52
|
}, z.core.$strip>, z.ZodObject<{
|
|
53
53
|
type: z.ZodLiteral<"userMention">;
|
|
54
|
-
userId: z.
|
|
54
|
+
userId: z.ZodGUID;
|
|
55
55
|
}, z.core.$strip>, z.ZodObject<{
|
|
56
56
|
type: z.ZodLiteral<"link">;
|
|
57
57
|
href: z.ZodURL;
|
|
@@ -96,6 +96,15 @@ export declare const patchCommentContract: Omit<{
|
|
|
96
96
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
97
97
|
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
98
98
|
}, z.core.$strip>;
|
|
99
|
+
422: z.ZodObject<{
|
|
100
|
+
message: z.ZodString;
|
|
101
|
+
code: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
102
|
+
errorCode: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
103
|
+
} & {
|
|
104
|
+
details: z.ZodObject<{
|
|
105
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>;
|
|
99
108
|
500: z.ZodObject<{
|
|
100
109
|
message: z.ZodString;
|
|
101
110
|
code: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { commentAuthorRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { commentAuthorRequiredErrorDefinition, mentionedUserAccessDeniedErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { CommentStatusEnum } from '../../objects/comment.js';
|
|
5
5
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
6
6
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
@@ -9,8 +9,8 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
9
9
|
// PATCH /v1/teams/:teamId/comments/:commentId
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
const PATCH_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
12
|
-
teamId: z.
|
|
13
|
-
commentId: z.
|
|
12
|
+
teamId: z.guid().describe('Id of the team'),
|
|
13
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
14
14
|
}));
|
|
15
15
|
const PATCH_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z
|
|
16
16
|
.object({
|
|
@@ -43,6 +43,7 @@ export const patchCommentContract = defineApiContract({
|
|
|
43
43
|
commentAuthorRequiredErrorDefinition.schema,
|
|
44
44
|
]),
|
|
45
45
|
404: resourceNotFoundErrorDefinition.schema,
|
|
46
|
+
422: mentionedUserAccessDeniedErrorDefinition.schema,
|
|
46
47
|
500: ERROR_RESPONSE_SCHEMA,
|
|
47
48
|
},
|
|
48
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patch-comment.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/patch-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,8CAA8C;AAC9C,+DAA+D;AAC/D,MAAM,gCAAgC,GAAG,CAAC,CAAC,OAAO,CAChD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CAClD,CAAC,CACH,CAAA;AAGD,MAAM,iCAAiC,GAAG,CAAC,CAAC,OAAO,CACjD,CAAC;KACE,MAAM,CAAC;IACN,OAAO,EAAE,cAAc,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,iBAAiB,CAAC;SACvB,QAAQ,EAAE;SACV,QAAQ,CAAC,qEAAqE,CAAC;CACnF,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE;IACzE,OAAO,EAAE,mDAAmD;CAC7D,CAAC,CACL,CAAA;AAGD,MAAM,CAAC,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;IACpD,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,iHAAiH;QACjH,kGAAkG;IACpG,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,gCAAgC;IACzD,iBAAiB,EAAE,iCAAiC;IACpD,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,EAAE;IACpF,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;QACvD,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;YACX,+BAA+B,CAAC,MAAM;YACtC,oCAAoC,CAAC,MAAM;SAC5C,CAAC;QACF,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"patch-comment.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/patch-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,oCAAoC,EACpC,wCAAwC,EACxC,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM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AE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,EAAE;IACpF,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;QACvD,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC;YACX,+BAA+B,CAAC,MAAM;YACtC,oCAAoC,CAAC,MAAM;SAC5C,CAAC;QACF,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,wCAAwC,CAAC,MAAM;QACpD,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type PostCommentReplyPathParams = z.infer<typeof POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
declare const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
@@ -14,7 +14,7 @@ declare const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
14
14
|
text: z.ZodString;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"userMention">;
|
|
17
|
-
userId: z.
|
|
17
|
+
userId: z.ZodGUID;
|
|
18
18
|
}, z.core.$strip>, z.ZodObject<{
|
|
19
19
|
type: z.ZodLiteral<"link">;
|
|
20
20
|
href: z.ZodURL;
|
|
@@ -26,7 +26,7 @@ declare const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
26
26
|
export type PostCommentReplyRequestBody = z.infer<typeof POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA>;
|
|
27
27
|
declare const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
28
28
|
data: z.ZodObject<{
|
|
29
|
-
id: z.
|
|
29
|
+
id: z.ZodGUID;
|
|
30
30
|
}, z.core.$strip>;
|
|
31
31
|
}, z.core.$strip>;
|
|
32
32
|
export type PostCommentReplyResponseBody = z.infer<typeof POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA>;
|
|
@@ -40,8 +40,8 @@ export declare const postCommentReplyContract: Omit<{
|
|
|
40
40
|
authorization: z.ZodString;
|
|
41
41
|
}, z.core.$strip>;
|
|
42
42
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
43
|
-
teamId: z.
|
|
44
|
-
commentId: z.
|
|
43
|
+
teamId: z.ZodGUID;
|
|
44
|
+
commentId: z.ZodGUID;
|
|
45
45
|
}, z.core.$strip>;
|
|
46
46
|
readonly requestBodySchema: z.ZodObject<{
|
|
47
47
|
message: z.ZodObject<{
|
|
@@ -53,7 +53,7 @@ export declare const postCommentReplyContract: Omit<{
|
|
|
53
53
|
text: z.ZodString;
|
|
54
54
|
}, z.core.$strip>, z.ZodObject<{
|
|
55
55
|
type: z.ZodLiteral<"userMention">;
|
|
56
|
-
userId: z.
|
|
56
|
+
userId: z.ZodGUID;
|
|
57
57
|
}, z.core.$strip>, z.ZodObject<{
|
|
58
58
|
type: z.ZodLiteral<"link">;
|
|
59
59
|
href: z.ZodURL;
|
|
@@ -69,7 +69,7 @@ export declare const postCommentReplyContract: Omit<{
|
|
|
69
69
|
readonly responsesByStatusCode: {
|
|
70
70
|
201: z.ZodObject<{
|
|
71
71
|
data: z.ZodObject<{
|
|
72
|
-
id: z.
|
|
72
|
+
id: z.ZodGUID;
|
|
73
73
|
}, z.core.$strip>;
|
|
74
74
|
}, z.core.$strip>;
|
|
75
75
|
400: z.ZodObject<{
|
|
@@ -94,6 +94,15 @@ export declare const postCommentReplyContract: Omit<{
|
|
|
94
94
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
95
95
|
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
96
96
|
}, z.core.$strip>;
|
|
97
|
+
422: z.ZodObject<{
|
|
98
|
+
message: z.ZodString;
|
|
99
|
+
code: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
100
|
+
errorCode: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
101
|
+
} & {
|
|
102
|
+
details: z.ZodObject<{
|
|
103
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
}, z.core.$strip>;
|
|
97
106
|
500: z.ZodObject<{
|
|
98
107
|
message: z.ZodString;
|
|
99
108
|
code: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { mentionedUserAccessDeniedErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
5
5
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
6
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -8,14 +8,14 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
8
8
|
// POST /v1/teams/:teamId/comments/:commentId/replies
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
const POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
-
teamId: z.
|
|
12
|
-
commentId: z.
|
|
11
|
+
teamId: z.guid().describe('Id of the team'),
|
|
12
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
13
13
|
}));
|
|
14
14
|
const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
15
15
|
message: MESSAGE_SCHEMA,
|
|
16
16
|
}));
|
|
17
17
|
const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
18
|
-
data: z.object({ id: z.
|
|
18
|
+
data: z.object({ id: z.guid().describe('Id of the new reply') }),
|
|
19
19
|
}));
|
|
20
20
|
export const postCommentReplyContract = defineApiContract({
|
|
21
21
|
method: 'post',
|
|
@@ -33,6 +33,7 @@ export const postCommentReplyContract = defineApiContract({
|
|
|
33
33
|
401: ERROR_RESPONSE_SCHEMA,
|
|
34
34
|
403: teamAccessDeniedErrorDefinition.schema,
|
|
35
35
|
404: resourceNotFoundErrorDefinition.schema,
|
|
36
|
+
422: mentionedUserAccessDeniedErrorDefinition.schema,
|
|
36
37
|
500: ERROR_RESPONSE_SCHEMA,
|
|
37
38
|
},
|
|
38
39
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-comment-reply.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comment-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,qDAAqD;AACrD,+DAA+D;AAC/D,MAAM,qCAAqC,GAAG,CAAC,CAAC,OAAO,CACrD,CAAC,CAAC,MAAM,CAAC;IACP,MA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AAE,YAAY;IACjC,uBAAuB,EAAE,qCAAqC;IAC9D,iBAAiB,EAAE,sCAAsC;IACzD,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,UAAU;IAC5F,qBAAqB,EAAE;QACrB,GAAG,EAAE,uCAAuC;QAC5C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,wCAAwC,CAAC,MAAM;QACpD,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const POST_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export type PostCommentPathParams = z.infer<typeof POST_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
6
6
|
declare const POST_COMMENT_REQUEST_BODY_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
7
|
entityType: z.ZodLiteral<"SEGMENT">;
|
|
8
8
|
entityId: z.ZodGUID;
|
|
9
|
-
projectId: z.
|
|
9
|
+
projectId: z.ZodGUID;
|
|
10
10
|
message: z.ZodObject<{
|
|
11
11
|
version: z.ZodLiteral<1>;
|
|
12
12
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -16,7 +16,7 @@ declare const POST_COMMENT_REQUEST_BODY_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
16
16
|
text: z.ZodString;
|
|
17
17
|
}, z.core.$strip>, z.ZodObject<{
|
|
18
18
|
type: z.ZodLiteral<"userMention">;
|
|
19
|
-
userId: z.
|
|
19
|
+
userId: z.ZodGUID;
|
|
20
20
|
}, z.core.$strip>, z.ZodObject<{
|
|
21
21
|
type: z.ZodLiteral<"link">;
|
|
22
22
|
href: z.ZodURL;
|
|
@@ -28,7 +28,7 @@ declare const POST_COMMENT_REQUEST_BODY_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
28
28
|
export type PostCommentRequestBody = z.infer<typeof POST_COMMENT_REQUEST_BODY_SCHEMA>;
|
|
29
29
|
declare const POST_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
30
30
|
data: z.ZodObject<{
|
|
31
|
-
id: z.
|
|
31
|
+
id: z.ZodGUID;
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
34
|
export type PostCommentResponseBody = z.infer<typeof POST_COMMENT_RESPONSE_BODY_SCHEMA>;
|
|
@@ -42,12 +42,12 @@ export declare const postCommentContract: Omit<{
|
|
|
42
42
|
authorization: z.ZodString;
|
|
43
43
|
}, z.core.$strip>;
|
|
44
44
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
45
|
-
teamId: z.
|
|
45
|
+
teamId: z.ZodGUID;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
47
|
readonly requestBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
48
48
|
entityType: z.ZodLiteral<"SEGMENT">;
|
|
49
49
|
entityId: z.ZodGUID;
|
|
50
|
-
projectId: z.
|
|
50
|
+
projectId: z.ZodGUID;
|
|
51
51
|
message: z.ZodObject<{
|
|
52
52
|
version: z.ZodLiteral<1>;
|
|
53
53
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -57,7 +57,7 @@ export declare const postCommentContract: Omit<{
|
|
|
57
57
|
text: z.ZodString;
|
|
58
58
|
}, z.core.$strip>, z.ZodObject<{
|
|
59
59
|
type: z.ZodLiteral<"userMention">;
|
|
60
|
-
userId: z.
|
|
60
|
+
userId: z.ZodGUID;
|
|
61
61
|
}, z.core.$strip>, z.ZodObject<{
|
|
62
62
|
type: z.ZodLiteral<"link">;
|
|
63
63
|
href: z.ZodURL;
|
|
@@ -72,7 +72,7 @@ export declare const postCommentContract: Omit<{
|
|
|
72
72
|
readonly responsesByStatusCode: {
|
|
73
73
|
201: z.ZodObject<{
|
|
74
74
|
data: z.ZodObject<{
|
|
75
|
-
id: z.
|
|
75
|
+
id: z.ZodGUID;
|
|
76
76
|
}, z.core.$strip>;
|
|
77
77
|
}, z.core.$strip>;
|
|
78
78
|
400: z.ZodObject<{
|
|
@@ -97,6 +97,15 @@ export declare const postCommentContract: Omit<{
|
|
|
97
97
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
98
98
|
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
99
99
|
}, z.core.$strip>;
|
|
100
|
+
422: z.ZodObject<{
|
|
101
|
+
message: z.ZodString;
|
|
102
|
+
code: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
103
|
+
errorCode: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
104
|
+
} & {
|
|
105
|
+
details: z.ZodObject<{
|
|
106
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
}, z.core.$strip>;
|
|
100
109
|
500: z.ZodObject<{
|
|
101
110
|
message: z.ZodString;
|
|
102
111
|
code: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
3
|
+
import { mentionedUserAccessDeniedErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
4
|
import { CommentEntityTypeEnum } from '../../objects/comment.js';
|
|
5
5
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
6
6
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
@@ -9,7 +9,7 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
9
9
|
// POST /v1/teams/:teamId/comments
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
const POST_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
12
|
-
teamId: z.
|
|
12
|
+
teamId: z.guid().describe('Id of the team'),
|
|
13
13
|
}));
|
|
14
14
|
// One option per entity type, as each type decides which fields it requires
|
|
15
15
|
const POST_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z.discriminatedUnion('entityType', [
|
|
@@ -19,13 +19,13 @@ const POST_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z.discriminatedUnion('entityT
|
|
|
19
19
|
.literal(CommentEntityTypeEnum.SEGMENT)
|
|
20
20
|
.describe('Type of the commented entity'),
|
|
21
21
|
entityId: z.guid().describe('Id of the commented entity'),
|
|
22
|
-
projectId: z.
|
|
22
|
+
projectId: z.guid().describe('Id of the project of the commented entity'),
|
|
23
23
|
message: MESSAGE_SCHEMA,
|
|
24
24
|
})
|
|
25
25
|
.describe('Comment on an entity'),
|
|
26
26
|
]));
|
|
27
27
|
const POST_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
28
|
-
data: z.object({ id: z.
|
|
28
|
+
data: z.object({ id: z.guid().describe('Id of the new comment') }),
|
|
29
29
|
}));
|
|
30
30
|
export const postCommentContract = defineApiContract({
|
|
31
31
|
method: 'post',
|
|
@@ -43,6 +43,7 @@ export const postCommentContract = defineApiContract({
|
|
|
43
43
|
401: ERROR_RESPONSE_SCHEMA,
|
|
44
44
|
403: teamAccessDeniedErrorDefinition.schema,
|
|
45
45
|
404: resourceNotFoundErrorDefinition.schema,
|
|
46
|
+
422: mentionedUserAccessDeniedErrorDefinition.schema,
|
|
46
47
|
500: ERROR_RESPONSE_SCHEMA,
|
|
47
48
|
},
|
|
48
49
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-comment.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,kCAAkC;AAClC,+DAA+D;AAC/D,MAAM,+BAA+B,GAAG,CAAC,CAAC,OAAO,CAC/C,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC5C,CAAC,CACH,CAAA;AAGD,4EAA4E;AAC5E,MAAM,gCAAgC,GAAG,CAAC,CAAC,OAAO,CAChD,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IACjC,CAAC;SACE,MAAM,CAAC;QACN,UAAU,EAAE,CAAC;aACV,OAAO,CAAC,qBAAqB,CAAC,OAAO,CAAC;aACtC,QAAQ,CAAC,8BAA8B,CAAC;QAC3C,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;QACzD,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACzE,OAAO,EAAE,cAAc;KACxB,CAAC;SACD,QAAQ,CAAC,sBAAsB,CAAC;CACpC,CAAC,CACH,CAAA;AAGD,MAAM,iCAA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,YAAY;IACjC,uBAAuB,EAAE,+BAA+B;IACxD,iBAAiB,EAAE,gCAAgC;IACnD,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,WAAW;IAC5D,qBAAqB,EAAE;QACrB,GAAG,EAAE,iCAAiC;QACtC,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,wCAAwC,CAAC,MAAM;QACpD,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
4
|
}, z.core.$strip>;
|
|
5
5
|
export type PostSearchCommentsPathParams = z.infer<typeof POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA>;
|
|
6
6
|
export declare const POST_SEARCH_COMMENTS_QUERY_SCHEMA: z.ZodObject<{
|
|
7
7
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
|
-
after: z.ZodOptional<z.
|
|
8
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
9
9
|
}, z.core.$strip>;
|
|
10
10
|
export type PostSearchCommentsQuery = z.infer<typeof POST_SEARCH_COMMENTS_QUERY_SCHEMA>;
|
|
11
11
|
declare const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
12
|
-
projectId: z.
|
|
12
|
+
projectId: z.ZodGUID;
|
|
13
13
|
entityTypes: z.ZodArray<z.ZodEnum<{
|
|
14
14
|
readonly SEGMENT: 'SEGMENT';
|
|
15
15
|
}>>;
|
|
@@ -18,9 +18,9 @@ declare const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
18
18
|
export type PostSearchCommentsRequestBody = z.infer<typeof POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA>;
|
|
19
19
|
declare const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
20
20
|
data: z.ZodArray<z.ZodObject<{
|
|
21
|
-
id: z.
|
|
22
|
-
teamId: z.
|
|
23
|
-
projectId: z.ZodOptional<z.ZodNullable<z.
|
|
21
|
+
id: z.ZodGUID;
|
|
22
|
+
teamId: z.ZodGUID;
|
|
23
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
24
24
|
entityType: z.ZodEnum<{
|
|
25
25
|
readonly SEGMENT: 'SEGMENT';
|
|
26
26
|
}>;
|
|
@@ -38,7 +38,7 @@ declare const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
38
38
|
text: z.ZodString;
|
|
39
39
|
}, z.core.$strip>, z.ZodObject<{
|
|
40
40
|
type: z.ZodLiteral<"userMention">;
|
|
41
|
-
userId: z.
|
|
41
|
+
userId: z.ZodGUID;
|
|
42
42
|
}, z.core.$strip>, z.ZodObject<{
|
|
43
43
|
type: z.ZodLiteral<"link">;
|
|
44
44
|
href: z.ZodURL;
|
|
@@ -47,13 +47,13 @@ declare const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
|
47
47
|
}, z.core.$strip>], "type">>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
50
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.
|
|
50
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
51
51
|
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
52
52
|
replyCount: z.ZodInt;
|
|
53
53
|
lastActivityAt: z.ZodISODateTime;
|
|
54
54
|
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
55
55
|
subscribed: z.ZodBoolean;
|
|
56
|
-
createdBy: z.
|
|
56
|
+
createdBy: z.ZodGUID;
|
|
57
57
|
createdAt: z.ZodISODateTime;
|
|
58
58
|
}, z.core.$strip>>;
|
|
59
59
|
meta: z.ZodObject<{
|
|
@@ -73,14 +73,14 @@ export declare const postSearchCommentsContract: Omit<{
|
|
|
73
73
|
authorization: z.ZodString;
|
|
74
74
|
}, z.core.$strip>;
|
|
75
75
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
76
|
-
teamId: z.
|
|
76
|
+
teamId: z.ZodGUID;
|
|
77
77
|
}, z.core.$strip>;
|
|
78
78
|
readonly requestQuerySchema: z.ZodObject<{
|
|
79
79
|
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
80
|
-
after: z.ZodOptional<z.
|
|
80
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
82
|
readonly requestBodySchema: z.ZodObject<{
|
|
83
|
-
projectId: z.
|
|
83
|
+
projectId: z.ZodGUID;
|
|
84
84
|
entityTypes: z.ZodArray<z.ZodEnum<{
|
|
85
85
|
readonly SEGMENT: 'SEGMENT';
|
|
86
86
|
}>>;
|
|
@@ -92,9 +92,9 @@ export declare const postSearchCommentsContract: Omit<{
|
|
|
92
92
|
readonly responsesByStatusCode: {
|
|
93
93
|
200: z.ZodObject<{
|
|
94
94
|
data: z.ZodArray<z.ZodObject<{
|
|
95
|
-
id: z.
|
|
96
|
-
teamId: z.
|
|
97
|
-
projectId: z.ZodOptional<z.ZodNullable<z.
|
|
95
|
+
id: z.ZodGUID;
|
|
96
|
+
teamId: z.ZodGUID;
|
|
97
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
98
98
|
entityType: z.ZodEnum<{
|
|
99
99
|
readonly SEGMENT: 'SEGMENT';
|
|
100
100
|
}>;
|
|
@@ -112,7 +112,7 @@ export declare const postSearchCommentsContract: Omit<{
|
|
|
112
112
|
text: z.ZodString;
|
|
113
113
|
}, z.core.$strip>, z.ZodObject<{
|
|
114
114
|
type: z.ZodLiteral<"userMention">;
|
|
115
|
-
userId: z.
|
|
115
|
+
userId: z.ZodGUID;
|
|
116
116
|
}, z.core.$strip>, z.ZodObject<{
|
|
117
117
|
type: z.ZodLiteral<"link">;
|
|
118
118
|
href: z.ZodURL;
|
|
@@ -121,13 +121,13 @@ export declare const postSearchCommentsContract: Omit<{
|
|
|
121
121
|
}, z.core.$strip>], "type">>;
|
|
122
122
|
}, z.core.$strip>;
|
|
123
123
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
124
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.
|
|
124
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
125
125
|
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
126
126
|
replyCount: z.ZodInt;
|
|
127
127
|
lastActivityAt: z.ZodISODateTime;
|
|
128
128
|
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
129
129
|
subscribed: z.ZodBoolean;
|
|
130
|
-
createdBy: z.
|
|
130
|
+
createdBy: z.ZodGUID;
|
|
131
131
|
createdAt: z.ZodISODateTime;
|
|
132
132
|
}, z.core.$strip>>;
|
|
133
133
|
meta: z.ZodObject<{
|
|
@@ -9,7 +9,7 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
9
9
|
// POST /v1/teams/:teamId/comments/actions/search
|
|
10
10
|
// ------------------------------------------------------------
|
|
11
11
|
const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
12
|
-
teamId: z.
|
|
12
|
+
teamId: z.guid().describe('Id of the team'),
|
|
13
13
|
}));
|
|
14
14
|
const COMMENTS_DEFAULT_LIMIT = 100;
|
|
15
15
|
const COMMENTS_MAX_LIMIT = 100;
|
|
@@ -22,13 +22,13 @@ export const POST_SEARCH_COMMENTS_QUERY_SCHEMA = z.compile(z.object({
|
|
|
22
22
|
.default(COMMENTS_DEFAULT_LIMIT)
|
|
23
23
|
.describe('Number of comments to return per page'),
|
|
24
24
|
after: z
|
|
25
|
-
.
|
|
25
|
+
.guid()
|
|
26
26
|
.optional()
|
|
27
27
|
.describe('Cursor from the previous response `meta.cursor`. Omit to read the first page'),
|
|
28
28
|
}));
|
|
29
29
|
const COMMENTS_MAX_FILTER_IDS = 100;
|
|
30
30
|
const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
31
|
-
projectId: z.
|
|
31
|
+
projectId: z.guid().describe('Only comments for this project'),
|
|
32
32
|
entityTypes: z
|
|
33
33
|
.array(z.enum(CommentEntityTypeEnum))
|
|
34
34
|
.min(1)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
declare const PUT_COMMENT_READ_STATE_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
-
teamId: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export type PutCommentReadStatePathParams = z.infer<typeof PUT_COMMENT_READ_STATE_PATH_PARAMS_SCHEMA>;
|
|
7
7
|
declare const PUT_COMMENT_READ_STATE_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
@@ -18,8 +18,8 @@ export declare const putCommentReadStateContract: Omit<{
|
|
|
18
18
|
authorization: z.ZodString;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
20
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
21
|
-
teamId: z.
|
|
22
|
-
commentId: z.
|
|
21
|
+
teamId: z.ZodGUID;
|
|
22
|
+
commentId: z.ZodGUID;
|
|
23
23
|
}, z.core.$strip>;
|
|
24
24
|
readonly requestBodySchema: z.ZodObject<{
|
|
25
25
|
lastReadAt: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -7,8 +7,8 @@ import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
|
7
7
|
// PUT /v1/teams/:teamId/comments/:commentId/read-state
|
|
8
8
|
// ------------------------------------------------------------
|
|
9
9
|
const PUT_COMMENT_READ_STATE_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
10
|
-
teamId: z.
|
|
11
|
-
commentId: z.
|
|
10
|
+
teamId: z.guid().describe('Id of the team'),
|
|
11
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
12
12
|
}));
|
|
13
13
|
const PUT_COMMENT_READ_STATE_REQUEST_BODY_SCHEMA = z.compile(z
|
|
14
14
|
.object({
|
|
@@ -5,8 +5,8 @@ export declare const CommentSubscriptionActionEnum: {
|
|
|
5
5
|
};
|
|
6
6
|
export type CommentSubscriptionAction = (typeof CommentSubscriptionActionEnum)[keyof typeof CommentSubscriptionActionEnum];
|
|
7
7
|
declare const PUT_COMMENT_SUBSCRIPTION_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
8
|
-
teamId: z.
|
|
9
|
-
commentId: z.
|
|
8
|
+
teamId: z.ZodGUID;
|
|
9
|
+
commentId: z.ZodGUID;
|
|
10
10
|
}, z.core.$strip>;
|
|
11
11
|
export type PutCommentSubscriptionPathParams = z.infer<typeof PUT_COMMENT_SUBSCRIPTION_PATH_PARAMS_SCHEMA>;
|
|
12
12
|
declare const PUT_COMMENT_SUBSCRIPTION_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
@@ -26,8 +26,8 @@ export declare const putCommentSubscriptionContract: Omit<{
|
|
|
26
26
|
authorization: z.ZodString;
|
|
27
27
|
}, z.core.$strip>;
|
|
28
28
|
readonly requestPathParamsSchema: z.ZodObject<{
|
|
29
|
-
teamId: z.
|
|
30
|
-
commentId: z.
|
|
29
|
+
teamId: z.ZodGUID;
|
|
30
|
+
commentId: z.ZodGUID;
|
|
31
31
|
}, z.core.$strip>;
|
|
32
32
|
readonly requestBodySchema: z.ZodObject<{
|
|
33
33
|
action: z.ZodEnum<{
|
|
@@ -11,8 +11,8 @@ export const CommentSubscriptionActionEnum = {
|
|
|
11
11
|
UNSUBSCRIBE: 'UNSUBSCRIBE',
|
|
12
12
|
};
|
|
13
13
|
const PUT_COMMENT_SUBSCRIPTION_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
14
|
-
teamId: z.
|
|
15
|
-
commentId: z.
|
|
14
|
+
teamId: z.guid().describe('Id of the team'),
|
|
15
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
16
16
|
}));
|
|
17
17
|
const PUT_COMMENT_SUBSCRIPTION_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
18
18
|
action: z
|
package/dist/api/errors/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './comment-author-required.js';
|
|
2
2
|
export * from './comment-delete-permission-required.js';
|
|
3
|
+
export * from './mentioned-user-access-denied.js';
|
|
3
4
|
export * from './resource-not-found.js';
|
|
4
5
|
export * from './team-access-denied.js';
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,mCAAmC,CAAA;AACjD,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
export declare const mentionedUserAccessDeniedErrorDefinition: {
|
|
3
|
+
readonly code: "MENTIONED_USER_ACCESS_DENIED";
|
|
4
|
+
readonly type: "unprocessable-entity";
|
|
5
|
+
readonly detailsSchema: z.ZodObject<{
|
|
6
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
} & {
|
|
9
|
+
schema: z.ZodObject<{
|
|
10
|
+
message: z.ZodString;
|
|
11
|
+
code: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
12
|
+
errorCode: z.ZodLiteral<"MENTIONED_USER_ACCESS_DENIED">;
|
|
13
|
+
} & {
|
|
14
|
+
details: z.ZodObject<{
|
|
15
|
+
userIds: z.ZodArray<z.ZodGUID>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { definePublicError, ErrorType } from '@lokalise/errors';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
// The message mentions users who can't access the project or the language of the comment
|
|
4
|
+
export const mentionedUserAccessDeniedErrorDefinition = definePublicError({
|
|
5
|
+
code: 'MENTIONED_USER_ACCESS_DENIED',
|
|
6
|
+
type: ErrorType.UNPROCESSABLE_ENTITY,
|
|
7
|
+
detailsSchema: z.object({
|
|
8
|
+
userIds: z.array(z.guid()).describe('Ids of the mentioned users without access'),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=mentioned-user-access-denied.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mentioned-user-access-denied.js","sourceRoot":"","sources":["../../../src/api/errors/mentioned-user-access-denied.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,yFAAyF;AACzF,MAAM,CAAC,MAAM,wCAAwC,GAAG,iBAAiB,CAAC;IACxE,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,SAAS,CAAC,oBAAoB;IACpC,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC;QACtB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,2CAA2C,CAAC;KACjF,CAAC;CACH,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod/v4';
|
|
2
2
|
export declare const COMMENT_REPLY_SCHEMA: z.ZodObject<{
|
|
3
|
-
id: z.
|
|
4
|
-
commentId: z.
|
|
3
|
+
id: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
5
|
message: z.ZodObject<{
|
|
6
6
|
version: z.ZodLiteral<1>;
|
|
7
7
|
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -11,7 +11,7 @@ export declare const COMMENT_REPLY_SCHEMA: z.ZodObject<{
|
|
|
11
11
|
text: z.ZodString;
|
|
12
12
|
}, z.core.$strip>, z.ZodObject<{
|
|
13
13
|
type: z.ZodLiteral<"userMention">;
|
|
14
|
-
userId: z.
|
|
14
|
+
userId: z.ZodGUID;
|
|
15
15
|
}, z.core.$strip>, z.ZodObject<{
|
|
16
16
|
type: z.ZodLiteral<"link">;
|
|
17
17
|
href: z.ZodURL;
|
|
@@ -20,7 +20,7 @@ export declare const COMMENT_REPLY_SCHEMA: z.ZodObject<{
|
|
|
20
20
|
}, z.core.$strip>], "type">>;
|
|
21
21
|
}, z.core.$strip>;
|
|
22
22
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
23
|
-
createdBy: z.
|
|
23
|
+
createdBy: z.ZodGUID;
|
|
24
24
|
createdAt: z.ZodISODateTime;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
26
|
export type CommentReply = z.infer<typeof COMMENT_REPLY_SCHEMA>;
|
|
@@ -2,14 +2,14 @@ import z from 'zod/v4';
|
|
|
2
2
|
import { MESSAGE_SCHEMA } from './message.js';
|
|
3
3
|
export const COMMENT_REPLY_SCHEMA = z.compile(z
|
|
4
4
|
.object({
|
|
5
|
-
id: z.
|
|
6
|
-
commentId: z.
|
|
5
|
+
id: z.guid().describe('Id of the reply'),
|
|
6
|
+
commentId: z.guid().describe('Id of the thread the reply belongs to'),
|
|
7
7
|
message: MESSAGE_SCHEMA,
|
|
8
8
|
messageUpdatedAt: z.iso
|
|
9
9
|
.datetime()
|
|
10
10
|
.nullish()
|
|
11
11
|
.describe('Last edit of the message. `null` if the message was never edited'),
|
|
12
|
-
createdBy: z.
|
|
12
|
+
createdBy: z.guid().describe('Id of the author'),
|
|
13
13
|
createdAt: z.iso.datetime().describe('Creation time'),
|
|
14
14
|
})
|
|
15
15
|
.describe('Reply in a thread'));
|
|
@@ -9,9 +9,9 @@ export declare const CommentStatusEnum: {
|
|
|
9
9
|
};
|
|
10
10
|
export type CommentStatus = (typeof CommentStatusEnum)[keyof typeof CommentStatusEnum];
|
|
11
11
|
export declare const COMMENT_SCHEMA: z.ZodObject<{
|
|
12
|
-
id: z.
|
|
13
|
-
teamId: z.
|
|
14
|
-
projectId: z.ZodOptional<z.ZodNullable<z.
|
|
12
|
+
id: z.ZodGUID;
|
|
13
|
+
teamId: z.ZodGUID;
|
|
14
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
15
15
|
entityType: z.ZodEnum<{
|
|
16
16
|
readonly SEGMENT: 'SEGMENT';
|
|
17
17
|
}>;
|
|
@@ -29,7 +29,7 @@ export declare const COMMENT_SCHEMA: z.ZodObject<{
|
|
|
29
29
|
text: z.ZodString;
|
|
30
30
|
}, z.core.$strip>, z.ZodObject<{
|
|
31
31
|
type: z.ZodLiteral<"userMention">;
|
|
32
|
-
userId: z.
|
|
32
|
+
userId: z.ZodGUID;
|
|
33
33
|
}, z.core.$strip>, z.ZodObject<{
|
|
34
34
|
type: z.ZodLiteral<"link">;
|
|
35
35
|
href: z.ZodURL;
|
|
@@ -38,13 +38,13 @@ export declare const COMMENT_SCHEMA: z.ZodObject<{
|
|
|
38
38
|
}, z.core.$strip>], "type">>;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
41
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.
|
|
41
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
42
42
|
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
43
43
|
replyCount: z.ZodInt;
|
|
44
44
|
lastActivityAt: z.ZodISODateTime;
|
|
45
45
|
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
46
46
|
subscribed: z.ZodBoolean;
|
|
47
|
-
createdBy: z.
|
|
47
|
+
createdBy: z.ZodGUID;
|
|
48
48
|
createdAt: z.ZodISODateTime;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
export type Comment = z.infer<typeof COMMENT_SCHEMA>;
|
|
@@ -9,10 +9,10 @@ export const CommentStatusEnum = {
|
|
|
9
9
|
};
|
|
10
10
|
export const COMMENT_SCHEMA = z.compile(z
|
|
11
11
|
.object({
|
|
12
|
-
id: z.
|
|
13
|
-
teamId: z.
|
|
12
|
+
id: z.guid().describe('Id of the comment. It is also the id of the thread'),
|
|
13
|
+
teamId: z.guid().describe('Id of the team that owns the comment'),
|
|
14
14
|
projectId: z
|
|
15
|
-
.
|
|
15
|
+
.guid()
|
|
16
16
|
.nullish()
|
|
17
17
|
.describe('Id of the project of the commented entity. `null` for entities without a project'),
|
|
18
18
|
entityType: z.enum(CommentEntityTypeEnum).describe('Type of the commented entity'),
|
|
@@ -24,7 +24,7 @@ export const COMMENT_SCHEMA = z.compile(z
|
|
|
24
24
|
.nullish()
|
|
25
25
|
.describe('Last edit of the message. `null` if the message was never edited'),
|
|
26
26
|
resolvedBy: z
|
|
27
|
-
.
|
|
27
|
+
.guid()
|
|
28
28
|
.nullish()
|
|
29
29
|
.describe('Id of the user who resolved the thread. `null` when open'),
|
|
30
30
|
resolvedAt: z.iso
|
|
@@ -40,7 +40,7 @@ export const COMMENT_SCHEMA = z.compile(z
|
|
|
40
40
|
.nullish()
|
|
41
41
|
.describe('Read watermark of the requesting user: thread activity after this time is unread. `null` if never read'),
|
|
42
42
|
subscribed: z.boolean().describe('Whether the requesting user is subscribed to the thread'),
|
|
43
|
-
createdBy: z.
|
|
43
|
+
createdBy: z.guid().describe('Id of the author'),
|
|
44
44
|
createdAt: z.iso.datetime().describe('Creation time'),
|
|
45
45
|
})
|
|
46
46
|
.describe('Root comment of a thread'));
|
|
@@ -4,7 +4,7 @@ declare const MESSAGE_CONTENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
4
4
|
text: z.ZodString;
|
|
5
5
|
}, z.core.$strip>, z.ZodObject<{
|
|
6
6
|
type: z.ZodLiteral<"userMention">;
|
|
7
|
-
userId: z.
|
|
7
|
+
userId: z.ZodGUID;
|
|
8
8
|
}, z.core.$strip>, z.ZodObject<{
|
|
9
9
|
type: z.ZodLiteral<"link">;
|
|
10
10
|
href: z.ZodURL;
|
|
@@ -18,7 +18,7 @@ declare const MESSAGE_BLOCK_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
18
18
|
text: z.ZodString;
|
|
19
19
|
}, z.core.$strip>, z.ZodObject<{
|
|
20
20
|
type: z.ZodLiteral<"userMention">;
|
|
21
|
-
userId: z.
|
|
21
|
+
userId: z.ZodGUID;
|
|
22
22
|
}, z.core.$strip>, z.ZodObject<{
|
|
23
23
|
type: z.ZodLiteral<"link">;
|
|
24
24
|
href: z.ZodURL;
|
|
@@ -35,7 +35,7 @@ export declare const MESSAGE_SCHEMA: z.ZodObject<{
|
|
|
35
35
|
text: z.ZodString;
|
|
36
36
|
}, z.core.$strip>, z.ZodObject<{
|
|
37
37
|
type: z.ZodLiteral<"userMention">;
|
|
38
|
-
userId: z.
|
|
38
|
+
userId: z.ZodGUID;
|
|
39
39
|
}, z.core.$strip>, z.ZodObject<{
|
|
40
40
|
type: z.ZodLiteral<"link">;
|
|
41
41
|
href: z.ZodURL;
|
|
@@ -10,7 +10,7 @@ const MESSAGE_CONTENT_SCHEMA = z
|
|
|
10
10
|
text: z.string().min(1).describe('Plain text, without formatting'),
|
|
11
11
|
}),
|
|
12
12
|
createBaseTypedSchema('userMention').extend({
|
|
13
|
-
userId: z.
|
|
13
|
+
userId: z.guid().describe('Id of the mentioned user. Names are never stored in the message'),
|
|
14
14
|
}),
|
|
15
15
|
createBaseTypedSchema('link').extend({
|
|
16
16
|
href: z
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/chatter-api-contracts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "API contracts for chatter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@lokalise/api-common": "^7.1.1",
|
|
24
24
|
"@lokalise/api-contracts": ">=9.0.0",
|
|
25
|
-
"@lokalise/errors": "^2.
|
|
25
|
+
"@lokalise/errors": "^2.2.0",
|
|
26
26
|
"@lokalise/zod-extras": "^3.0.2",
|
|
27
27
|
"zod": "^4.5.4"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@lokalise/api-common": "^7.1.1",
|
|
31
31
|
"@lokalise/api-contracts": "^9.0.1",
|
|
32
|
-
"@lokalise/errors": "^2.
|
|
32
|
+
"@lokalise/errors": "^2.2.0",
|
|
33
33
|
"@lokalise/tsconfig": "^5.0.0",
|
|
34
34
|
"@lokalise/zod-extras": "^3.0.2",
|
|
35
35
|
"@types/node": "^26.6.5",
|