@lokalise/chatter-api-contracts 0.1.1 → 0.1.3
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/get-comment.d.ts +140 -0
- package/dist/api/contracts/comments/get-comment.js +37 -0
- package/dist/api/contracts/comments/get-comment.js.map +1 -0
- package/dist/api/contracts/comments/patch-comment-reply.d.ts +7 -55
- package/dist/api/contracts/comments/patch-comment-reply.js +7 -8
- package/dist/api/contracts/comments/patch-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/patch-comment.d.ts +7 -85
- package/dist/api/contracts/comments/patch-comment.js +9 -9
- package/dist/api/contracts/comments/patch-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comment-reply.d.ts +0 -42
- package/dist/api/contracts/comments/post-comment-reply.js +1 -2
- package/dist/api/contracts/comments/post-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/post-comment.d.ts +0 -72
- package/dist/api/contracts/comments/post-comment.js +2 -2
- package/dist/api/contracts/comments/post-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comments-actions-search.d.ts +2 -2
- package/dist/api/contracts/comments/post-comments-actions-search.js +2 -3
- package/dist/api/contracts/comments/post-comments-actions-search.js.map +1 -1
- package/dist/api/contracts/index.d.ts +1 -0
- package/dist/api/contracts/index.js +1 -0
- package/dist/api/contracts/index.js.map +1 -1
- package/dist/api/errors/comment-author-required.d.ts +10 -0
- package/dist/api/errors/comment-author-required.js +7 -0
- package/dist/api/errors/comment-author-required.js.map +1 -0
- 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/package.json +1 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const GET_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
commentId: z.ZodUUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type GetCommentPathParams = z.infer<typeof GET_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
7
|
+
declare const GET_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
8
|
+
data: z.ZodObject<{
|
|
9
|
+
id: z.ZodUUID;
|
|
10
|
+
teamId: z.ZodUUID;
|
|
11
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
12
|
+
entityType: z.ZodEnum<{
|
|
13
|
+
readonly SEGMENT: 'SEGMENT';
|
|
14
|
+
}>;
|
|
15
|
+
entityId: z.ZodUUID;
|
|
16
|
+
status: z.ZodEnum<{
|
|
17
|
+
readonly OPEN: 'OPEN';
|
|
18
|
+
readonly RESOLVED: 'RESOLVED';
|
|
19
|
+
}>;
|
|
20
|
+
message: z.ZodObject<{
|
|
21
|
+
version: z.ZodLiteral<1>;
|
|
22
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"paragraph">;
|
|
24
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
|
+
type: z.ZodLiteral<"text">;
|
|
26
|
+
text: z.ZodString;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"userMention">;
|
|
29
|
+
userId: z.ZodUUID;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
type: z.ZodLiteral<"link">;
|
|
32
|
+
href: z.ZodURL;
|
|
33
|
+
text: z.ZodString;
|
|
34
|
+
}, z.core.$strip>], "type">>;
|
|
35
|
+
}, z.core.$strip>], "type">>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
38
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
39
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
40
|
+
replyCount: z.ZodInt;
|
|
41
|
+
lastActivityAt: z.ZodISODateTime;
|
|
42
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
43
|
+
subscribed: z.ZodBoolean;
|
|
44
|
+
createdBy: z.ZodUUID;
|
|
45
|
+
createdAt: z.ZodISODateTime;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
}, z.core.$strip>;
|
|
48
|
+
export type GetCommentResponseBody = z.infer<typeof GET_COMMENT_RESPONSE_BODY_SCHEMA>;
|
|
49
|
+
export declare const getCommentContract: Omit<{
|
|
50
|
+
readonly method: "get";
|
|
51
|
+
readonly visibility: "internal";
|
|
52
|
+
readonly summary: "Get a comment";
|
|
53
|
+
readonly description: string;
|
|
54
|
+
readonly tags: readonly ["Comments"];
|
|
55
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
56
|
+
authorization: z.ZodString;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
59
|
+
teamId: z.ZodUUID;
|
|
60
|
+
commentId: z.ZodUUID;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
readonly pathResolver: ({ teamId, commentId }: {
|
|
63
|
+
teamId: string;
|
|
64
|
+
commentId: string;
|
|
65
|
+
}) => `/v1/teams/${string}/comments/${string}`;
|
|
66
|
+
readonly responsesByStatusCode: {
|
|
67
|
+
200: z.ZodObject<{
|
|
68
|
+
data: z.ZodObject<{
|
|
69
|
+
id: z.ZodUUID;
|
|
70
|
+
teamId: z.ZodUUID;
|
|
71
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
72
|
+
entityType: z.ZodEnum<{
|
|
73
|
+
readonly SEGMENT: 'SEGMENT';
|
|
74
|
+
}>;
|
|
75
|
+
entityId: z.ZodUUID;
|
|
76
|
+
status: z.ZodEnum<{
|
|
77
|
+
readonly OPEN: 'OPEN';
|
|
78
|
+
readonly RESOLVED: 'RESOLVED';
|
|
79
|
+
}>;
|
|
80
|
+
message: z.ZodObject<{
|
|
81
|
+
version: z.ZodLiteral<1>;
|
|
82
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
83
|
+
type: z.ZodLiteral<"paragraph">;
|
|
84
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"text">;
|
|
86
|
+
text: z.ZodString;
|
|
87
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
88
|
+
type: z.ZodLiteral<"userMention">;
|
|
89
|
+
userId: z.ZodUUID;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
type: z.ZodLiteral<"link">;
|
|
92
|
+
href: z.ZodURL;
|
|
93
|
+
text: z.ZodString;
|
|
94
|
+
}, z.core.$strip>], "type">>;
|
|
95
|
+
}, z.core.$strip>], "type">>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
98
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
99
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
100
|
+
replyCount: z.ZodInt;
|
|
101
|
+
lastActivityAt: z.ZodISODateTime;
|
|
102
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
103
|
+
subscribed: z.ZodBoolean;
|
|
104
|
+
createdBy: z.ZodUUID;
|
|
105
|
+
createdAt: z.ZodISODateTime;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
400: z.ZodObject<{
|
|
109
|
+
message: z.ZodString;
|
|
110
|
+
code: z.ZodString;
|
|
111
|
+
errorCode: z.ZodString;
|
|
112
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
401: z.ZodObject<{
|
|
115
|
+
message: z.ZodString;
|
|
116
|
+
code: z.ZodString;
|
|
117
|
+
errorCode: z.ZodString;
|
|
118
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
403: z.ZodObject<{
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
123
|
+
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
404: z.ZodObject<{
|
|
126
|
+
message: z.ZodString;
|
|
127
|
+
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
128
|
+
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
129
|
+
}, z.core.$strip>;
|
|
130
|
+
500: z.ZodObject<{
|
|
131
|
+
message: z.ZodString;
|
|
132
|
+
code: z.ZodString;
|
|
133
|
+
errorCode: z.ZodString;
|
|
134
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
135
|
+
}, z.core.$strip>;
|
|
136
|
+
};
|
|
137
|
+
}, "visibility"> & {
|
|
138
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
139
|
+
};
|
|
140
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
|
+
import { COMMENT_SCHEMA } from '../../objects/comment.js';
|
|
5
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
7
|
+
// ------------------------------------------------------------
|
|
8
|
+
// GET /v1/teams/:teamId/comments/:commentId
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const GET_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
+
teamId: z.uuid().describe('Id of the team'),
|
|
12
|
+
commentId: z.uuid().describe('Id of the comment'),
|
|
13
|
+
}));
|
|
14
|
+
const GET_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
15
|
+
data: COMMENT_SCHEMA,
|
|
16
|
+
}));
|
|
17
|
+
export const getCommentContract = defineApiContract({
|
|
18
|
+
method: 'get',
|
|
19
|
+
visibility: 'internal',
|
|
20
|
+
summary: 'Get a comment',
|
|
21
|
+
description: 'Returns the root comment of a thread, with its reply count and the read state and ' +
|
|
22
|
+
'subscription of the requesting user. Deleted and orphaned comments are not found. ' +
|
|
23
|
+
'Use the replies endpoint to read the thread itself.',
|
|
24
|
+
tags: [OpenApiTags.Comments.name],
|
|
25
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
26
|
+
requestPathParamsSchema: GET_COMMENT_PATH_PARAMS_SCHEMA,
|
|
27
|
+
pathResolver: ({ teamId, commentId }) => `/v1/teams/${teamId}/comments/${commentId}`,
|
|
28
|
+
responsesByStatusCode: {
|
|
29
|
+
200: GET_COMMENT_RESPONSE_BODY_SCHEMA,
|
|
30
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
31
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
32
|
+
403: teamAccessDeniedErrorDefinition.schema,
|
|
33
|
+
404: resourceNotFoundErrorDefinition.schema,
|
|
34
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=get-comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-comment.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/get-comment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AAC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GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -25,33 +25,6 @@ declare const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
25
25
|
}, z.core.$strip>;
|
|
26
26
|
}, z.core.$strip>;
|
|
27
27
|
export type PatchCommentReplyRequestBody = z.infer<typeof PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA>;
|
|
28
|
-
declare const PATCH_COMMENT_REPLY_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
29
|
-
data: z.ZodObject<{
|
|
30
|
-
id: z.ZodUUID;
|
|
31
|
-
commentId: z.ZodUUID;
|
|
32
|
-
message: z.ZodObject<{
|
|
33
|
-
version: z.ZodLiteral<1>;
|
|
34
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
35
|
-
type: z.ZodLiteral<"paragraph">;
|
|
36
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
37
|
-
type: z.ZodLiteral<"text">;
|
|
38
|
-
text: z.ZodString;
|
|
39
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
40
|
-
type: z.ZodLiteral<"userMention">;
|
|
41
|
-
userId: z.ZodUUID;
|
|
42
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
43
|
-
type: z.ZodLiteral<"link">;
|
|
44
|
-
href: z.ZodURL;
|
|
45
|
-
text: z.ZodString;
|
|
46
|
-
}, z.core.$strip>], "type">>;
|
|
47
|
-
}, z.core.$strip>], "type">>;
|
|
48
|
-
}, z.core.$strip>;
|
|
49
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
50
|
-
createdBy: z.ZodUUID;
|
|
51
|
-
createdAt: z.ZodISODateTime;
|
|
52
|
-
}, z.core.$strip>;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
export type PatchCommentReplyResponseBody = z.infer<typeof PATCH_COMMENT_REPLY_RESPONSE_BODY_SCHEMA>;
|
|
55
28
|
export declare const patchCommentReplyContract: Omit<{
|
|
56
29
|
readonly method: "patch";
|
|
57
30
|
readonly visibility: "internal";
|
|
@@ -91,32 +64,7 @@ export declare const patchCommentReplyContract: Omit<{
|
|
|
91
64
|
replyId: string;
|
|
92
65
|
}) => `/v1/teams/${string}/comments/${string}/replies/${string}`;
|
|
93
66
|
readonly responsesByStatusCode: {
|
|
94
|
-
|
|
95
|
-
data: z.ZodObject<{
|
|
96
|
-
id: z.ZodUUID;
|
|
97
|
-
commentId: z.ZodUUID;
|
|
98
|
-
message: z.ZodObject<{
|
|
99
|
-
version: z.ZodLiteral<1>;
|
|
100
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
101
|
-
type: z.ZodLiteral<"paragraph">;
|
|
102
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
103
|
-
type: z.ZodLiteral<"text">;
|
|
104
|
-
text: z.ZodString;
|
|
105
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
-
type: z.ZodLiteral<"userMention">;
|
|
107
|
-
userId: z.ZodUUID;
|
|
108
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
-
type: z.ZodLiteral<"link">;
|
|
110
|
-
href: z.ZodURL;
|
|
111
|
-
text: z.ZodString;
|
|
112
|
-
}, z.core.$strip>], "type">>;
|
|
113
|
-
}, z.core.$strip>], "type">>;
|
|
114
|
-
}, z.core.$strip>;
|
|
115
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
116
|
-
createdBy: z.ZodUUID;
|
|
117
|
-
createdAt: z.ZodISODateTime;
|
|
118
|
-
}, z.core.$strip>;
|
|
119
|
-
}, z.core.$strip>;
|
|
67
|
+
204: import("@lokalise/api-contracts").NoBodyContentResponseEntry;
|
|
120
68
|
400: z.ZodObject<{
|
|
121
69
|
message: z.ZodString;
|
|
122
70
|
code: z.ZodString;
|
|
@@ -129,11 +77,15 @@ export declare const patchCommentReplyContract: Omit<{
|
|
|
129
77
|
errorCode: z.ZodString;
|
|
130
78
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
131
79
|
}, z.core.$strip>;
|
|
132
|
-
403: z.ZodObject<{
|
|
80
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
133
81
|
message: z.ZodString;
|
|
134
82
|
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
135
83
|
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
136
|
-
}, z.core.$strip
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
message: z.ZodString;
|
|
86
|
+
code: z.ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
87
|
+
errorCode: z.ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
88
|
+
}, z.core.$strip>]>;
|
|
137
89
|
404: z.ZodObject<{
|
|
138
90
|
message: z.ZodString;
|
|
139
91
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { defineApiContract } from '@lokalise/api-contracts';
|
|
1
|
+
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
|
-
import { COMMENT_REPLY_SCHEMA } from '../../objects/comment-reply.js';
|
|
3
|
+
import { commentAuthorRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
5
4
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
6
5
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
7
6
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -16,9 +15,6 @@ const PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
|
16
15
|
const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
17
16
|
message: MESSAGE_SCHEMA,
|
|
18
17
|
}));
|
|
19
|
-
const PATCH_COMMENT_REPLY_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
20
|
-
data: COMMENT_REPLY_SCHEMA,
|
|
21
|
-
}));
|
|
22
18
|
export const patchCommentReplyContract = defineApiContract({
|
|
23
19
|
method: 'patch',
|
|
24
20
|
visibility: 'internal',
|
|
@@ -30,10 +26,13 @@ export const patchCommentReplyContract = defineApiContract({
|
|
|
30
26
|
requestBodySchema: PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA,
|
|
31
27
|
pathResolver: ({ teamId, commentId, replyId }) => `/v1/teams/${teamId}/comments/${commentId}/replies/${replyId}`,
|
|
32
28
|
responsesByStatusCode: {
|
|
33
|
-
|
|
29
|
+
204: noBodyResponse({ description: 'Reply updated' }),
|
|
34
30
|
400: ERROR_RESPONSE_SCHEMA,
|
|
35
31
|
401: ERROR_RESPONSE_SCHEMA,
|
|
36
|
-
403:
|
|
32
|
+
403: z.union([
|
|
33
|
+
teamAccessDeniedErrorDefinition.schema,
|
|
34
|
+
commentAuthorRequiredErrorDefinition.schema,
|
|
35
|
+
]),
|
|
37
36
|
404: resourceNotFoundErrorDefinition.schema,
|
|
38
37
|
500: ERROR_RESPONSE_SCHEMA,
|
|
39
38
|
},
|
|
@@ -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,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"patch-comment-reply.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/patch-comment-reply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,M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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,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -28,48 +28,6 @@ declare const PATCH_COMMENT_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
|
28
28
|
}>>;
|
|
29
29
|
}, z.core.$strip>;
|
|
30
30
|
export type PatchCommentRequestBody = z.infer<typeof PATCH_COMMENT_REQUEST_BODY_SCHEMA>;
|
|
31
|
-
declare const PATCH_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
32
|
-
data: z.ZodObject<{
|
|
33
|
-
id: z.ZodUUID;
|
|
34
|
-
teamId: z.ZodUUID;
|
|
35
|
-
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
36
|
-
entityType: z.ZodEnum<{
|
|
37
|
-
readonly SEGMENT: 'SEGMENT';
|
|
38
|
-
}>;
|
|
39
|
-
entityId: z.ZodUUID;
|
|
40
|
-
status: z.ZodEnum<{
|
|
41
|
-
readonly OPEN: 'OPEN';
|
|
42
|
-
readonly RESOLVED: 'RESOLVED';
|
|
43
|
-
}>;
|
|
44
|
-
message: z.ZodObject<{
|
|
45
|
-
version: z.ZodLiteral<1>;
|
|
46
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
-
type: z.ZodLiteral<"paragraph">;
|
|
48
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
49
|
-
type: z.ZodLiteral<"text">;
|
|
50
|
-
text: z.ZodString;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
type: z.ZodLiteral<"userMention">;
|
|
53
|
-
userId: z.ZodUUID;
|
|
54
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
55
|
-
type: z.ZodLiteral<"link">;
|
|
56
|
-
href: z.ZodURL;
|
|
57
|
-
text: z.ZodString;
|
|
58
|
-
}, z.core.$strip>], "type">>;
|
|
59
|
-
}, z.core.$strip>], "type">>;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
62
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
63
|
-
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
64
|
-
replyCount: z.ZodInt;
|
|
65
|
-
lastActivityAt: z.ZodISODateTime;
|
|
66
|
-
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
67
|
-
subscribed: z.ZodBoolean;
|
|
68
|
-
createdBy: z.ZodUUID;
|
|
69
|
-
createdAt: z.ZodISODateTime;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
}, z.core.$strip>;
|
|
72
|
-
export type PatchCommentResponseBody = z.infer<typeof PATCH_COMMENT_RESPONSE_BODY_SCHEMA>;
|
|
73
31
|
export declare const patchCommentContract: Omit<{
|
|
74
32
|
readonly method: "patch";
|
|
75
33
|
readonly visibility: "internal";
|
|
@@ -111,47 +69,7 @@ export declare const patchCommentContract: Omit<{
|
|
|
111
69
|
commentId: string;
|
|
112
70
|
}) => `/v1/teams/${string}/comments/${string}`;
|
|
113
71
|
readonly responsesByStatusCode: {
|
|
114
|
-
|
|
115
|
-
data: z.ZodObject<{
|
|
116
|
-
id: z.ZodUUID;
|
|
117
|
-
teamId: z.ZodUUID;
|
|
118
|
-
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
119
|
-
entityType: z.ZodEnum<{
|
|
120
|
-
readonly SEGMENT: 'SEGMENT';
|
|
121
|
-
}>;
|
|
122
|
-
entityId: z.ZodUUID;
|
|
123
|
-
status: z.ZodEnum<{
|
|
124
|
-
readonly OPEN: 'OPEN';
|
|
125
|
-
readonly RESOLVED: 'RESOLVED';
|
|
126
|
-
}>;
|
|
127
|
-
message: z.ZodObject<{
|
|
128
|
-
version: z.ZodLiteral<1>;
|
|
129
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
130
|
-
type: z.ZodLiteral<"paragraph">;
|
|
131
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
132
|
-
type: z.ZodLiteral<"text">;
|
|
133
|
-
text: z.ZodString;
|
|
134
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
135
|
-
type: z.ZodLiteral<"userMention">;
|
|
136
|
-
userId: z.ZodUUID;
|
|
137
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
138
|
-
type: z.ZodLiteral<"link">;
|
|
139
|
-
href: z.ZodURL;
|
|
140
|
-
text: z.ZodString;
|
|
141
|
-
}, z.core.$strip>], "type">>;
|
|
142
|
-
}, z.core.$strip>], "type">>;
|
|
143
|
-
}, z.core.$strip>;
|
|
144
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
145
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
146
|
-
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
147
|
-
replyCount: z.ZodInt;
|
|
148
|
-
lastActivityAt: z.ZodISODateTime;
|
|
149
|
-
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
150
|
-
subscribed: z.ZodBoolean;
|
|
151
|
-
createdBy: z.ZodUUID;
|
|
152
|
-
createdAt: z.ZodISODateTime;
|
|
153
|
-
}, z.core.$strip>;
|
|
154
|
-
}, z.core.$strip>;
|
|
72
|
+
204: import("@lokalise/api-contracts").NoBodyContentResponseEntry;
|
|
155
73
|
400: z.ZodObject<{
|
|
156
74
|
message: z.ZodString;
|
|
157
75
|
code: z.ZodString;
|
|
@@ -164,11 +82,15 @@ export declare const patchCommentContract: Omit<{
|
|
|
164
82
|
errorCode: z.ZodString;
|
|
165
83
|
details: z.ZodOptional<z.ZodUnknown>;
|
|
166
84
|
}, z.core.$strip>;
|
|
167
|
-
403: z.ZodObject<{
|
|
85
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
168
86
|
message: z.ZodString;
|
|
169
87
|
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
170
88
|
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
171
|
-
}, z.core.$strip
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
message: z.ZodString;
|
|
91
|
+
code: z.ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
92
|
+
errorCode: z.ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
93
|
+
}, z.core.$strip>]>;
|
|
172
94
|
404: z.ZodObject<{
|
|
173
95
|
message: z.ZodString;
|
|
174
96
|
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineApiContract } from '@lokalise/api-contracts';
|
|
1
|
+
import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
|
-
import {
|
|
3
|
+
import { commentAuthorRequiredErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
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';
|
|
7
7
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -23,25 +23,25 @@ const PATCH_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z
|
|
|
23
23
|
.refine((body) => body.message !== undefined || body.status !== undefined, {
|
|
24
24
|
message: 'At least one of `message` or `status` is required',
|
|
25
25
|
}));
|
|
26
|
-
const PATCH_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
27
|
-
data: COMMENT_SCHEMA,
|
|
28
|
-
}));
|
|
29
26
|
export const patchCommentContract = defineApiContract({
|
|
30
27
|
method: 'patch',
|
|
31
28
|
visibility: 'internal',
|
|
32
29
|
summary: 'Update a comment',
|
|
33
30
|
description: 'Edits the message of a comment, or resolves or reopens its thread. Send at least one of `message` or `status`. ' +
|
|
34
|
-
'Only the author can change the message; anyone with access to the comment can change the status.
|
|
31
|
+
'Only the author can change the message; anyone with access to the comment can change the status.',
|
|
35
32
|
tags: [OpenApiTags.Comments.name],
|
|
36
33
|
requestHeaderSchema: AUTH_HEADERS,
|
|
37
34
|
requestPathParamsSchema: PATCH_COMMENT_PATH_PARAMS_SCHEMA,
|
|
38
35
|
requestBodySchema: PATCH_COMMENT_REQUEST_BODY_SCHEMA,
|
|
39
36
|
pathResolver: ({ teamId, commentId }) => `/v1/teams/${teamId}/comments/${commentId}`,
|
|
40
37
|
responsesByStatusCode: {
|
|
41
|
-
|
|
38
|
+
204: noBodyResponse({ description: 'Comment updated' }),
|
|
42
39
|
400: ERROR_RESPONSE_SCHEMA,
|
|
43
40
|
401: ERROR_RESPONSE_SCHEMA,
|
|
44
|
-
403:
|
|
41
|
+
403: z.union([
|
|
42
|
+
teamAccessDeniedErrorDefinition.schema,
|
|
43
|
+
commentAuthorRequiredErrorDefinition.schema,
|
|
44
|
+
]),
|
|
45
45
|
404: resourceNotFoundErrorDefinition.schema,
|
|
46
46
|
500: ERROR_RESPONSE_SCHEMA,
|
|
47
47
|
},
|
|
@@ -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,MAAM,yBAAyB,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,+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"}
|
|
@@ -27,27 +27,6 @@ export type PostCommentReplyRequestBody = z.infer<typeof POST_COMMENT_REPLY_REQU
|
|
|
27
27
|
declare const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
28
28
|
data: z.ZodObject<{
|
|
29
29
|
id: z.ZodUUID;
|
|
30
|
-
commentId: z.ZodUUID;
|
|
31
|
-
message: z.ZodObject<{
|
|
32
|
-
version: z.ZodLiteral<1>;
|
|
33
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
|
-
type: z.ZodLiteral<"paragraph">;
|
|
35
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
|
-
type: z.ZodLiteral<"text">;
|
|
37
|
-
text: z.ZodString;
|
|
38
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
-
type: z.ZodLiteral<"userMention">;
|
|
40
|
-
userId: z.ZodUUID;
|
|
41
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
-
type: z.ZodLiteral<"link">;
|
|
43
|
-
href: z.ZodURL;
|
|
44
|
-
text: z.ZodString;
|
|
45
|
-
}, z.core.$strip>], "type">>;
|
|
46
|
-
}, z.core.$strip>], "type">>;
|
|
47
|
-
}, z.core.$strip>;
|
|
48
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
49
|
-
createdBy: z.ZodUUID;
|
|
50
|
-
createdAt: z.ZodISODateTime;
|
|
51
30
|
}, z.core.$strip>;
|
|
52
31
|
}, z.core.$strip>;
|
|
53
32
|
export type PostCommentReplyResponseBody = z.infer<typeof POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA>;
|
|
@@ -91,27 +70,6 @@ export declare const postCommentReplyContract: Omit<{
|
|
|
91
70
|
201: z.ZodObject<{
|
|
92
71
|
data: z.ZodObject<{
|
|
93
72
|
id: z.ZodUUID;
|
|
94
|
-
commentId: z.ZodUUID;
|
|
95
|
-
message: z.ZodObject<{
|
|
96
|
-
version: z.ZodLiteral<1>;
|
|
97
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
-
type: z.ZodLiteral<"paragraph">;
|
|
99
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
100
|
-
type: z.ZodLiteral<"text">;
|
|
101
|
-
text: z.ZodString;
|
|
102
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
103
|
-
type: z.ZodLiteral<"userMention">;
|
|
104
|
-
userId: z.ZodUUID;
|
|
105
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
-
type: z.ZodLiteral<"link">;
|
|
107
|
-
href: z.ZodURL;
|
|
108
|
-
text: z.ZodString;
|
|
109
|
-
}, z.core.$strip>], "type">>;
|
|
110
|
-
}, z.core.$strip>], "type">>;
|
|
111
|
-
}, z.core.$strip>;
|
|
112
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
113
|
-
createdBy: z.ZodUUID;
|
|
114
|
-
createdAt: z.ZodISODateTime;
|
|
115
73
|
}, z.core.$strip>;
|
|
116
74
|
}, z.core.$strip>;
|
|
117
75
|
400: z.ZodObject<{
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
3
|
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
|
-
import { COMMENT_REPLY_SCHEMA } from '../../objects/comment-reply.js';
|
|
5
4
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
6
5
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
7
6
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -16,7 +15,7 @@ const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
|
16
15
|
message: MESSAGE_SCHEMA,
|
|
17
16
|
}));
|
|
18
17
|
const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
19
|
-
data:
|
|
18
|
+
data: z.object({ id: z.uuid().describe('Id of the new reply') }),
|
|
20
19
|
}));
|
|
21
20
|
export const postCommentReplyContract = defineApiContract({
|
|
22
21
|
method: 'post',
|
|
@@ -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,
|
|
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,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,sCAAsC,GAAG,CAAC,CAAC,OAAO,CACtD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,cAAc;CACxB,CAAC,CACH,CAAA;AAGD,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE,CAAC;CACjE,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACxD,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,oBAAoB;IAC7B,WAAW,EAAE,6EAA6E;IAC1F,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,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,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -29,42 +29,6 @@ export type PostCommentRequestBody = z.infer<typeof POST_COMMENT_REQUEST_BODY_SC
|
|
|
29
29
|
declare const POST_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
30
30
|
data: z.ZodObject<{
|
|
31
31
|
id: z.ZodUUID;
|
|
32
|
-
teamId: z.ZodUUID;
|
|
33
|
-
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
34
|
-
entityType: z.ZodEnum<{
|
|
35
|
-
readonly SEGMENT: 'SEGMENT';
|
|
36
|
-
}>;
|
|
37
|
-
entityId: z.ZodUUID;
|
|
38
|
-
status: z.ZodEnum<{
|
|
39
|
-
readonly OPEN: 'OPEN';
|
|
40
|
-
readonly RESOLVED: 'RESOLVED';
|
|
41
|
-
}>;
|
|
42
|
-
message: z.ZodObject<{
|
|
43
|
-
version: z.ZodLiteral<1>;
|
|
44
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
-
type: z.ZodLiteral<"paragraph">;
|
|
46
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
|
-
type: z.ZodLiteral<"text">;
|
|
48
|
-
text: z.ZodString;
|
|
49
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
-
type: z.ZodLiteral<"userMention">;
|
|
51
|
-
userId: z.ZodUUID;
|
|
52
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
53
|
-
type: z.ZodLiteral<"link">;
|
|
54
|
-
href: z.ZodURL;
|
|
55
|
-
text: z.ZodString;
|
|
56
|
-
}, z.core.$strip>], "type">>;
|
|
57
|
-
}, z.core.$strip>], "type">>;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
60
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
61
|
-
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
62
|
-
replyCount: z.ZodInt;
|
|
63
|
-
lastActivityAt: z.ZodISODateTime;
|
|
64
|
-
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
65
|
-
subscribed: z.ZodBoolean;
|
|
66
|
-
createdBy: z.ZodUUID;
|
|
67
|
-
createdAt: z.ZodISODateTime;
|
|
68
32
|
}, z.core.$strip>;
|
|
69
33
|
}, z.core.$strip>;
|
|
70
34
|
export type PostCommentResponseBody = z.infer<typeof POST_COMMENT_RESPONSE_BODY_SCHEMA>;
|
|
@@ -109,42 +73,6 @@ export declare const postCommentContract: Omit<{
|
|
|
109
73
|
201: z.ZodObject<{
|
|
110
74
|
data: z.ZodObject<{
|
|
111
75
|
id: z.ZodUUID;
|
|
112
|
-
teamId: z.ZodUUID;
|
|
113
|
-
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
114
|
-
entityType: z.ZodEnum<{
|
|
115
|
-
readonly SEGMENT: 'SEGMENT';
|
|
116
|
-
}>;
|
|
117
|
-
entityId: z.ZodUUID;
|
|
118
|
-
status: z.ZodEnum<{
|
|
119
|
-
readonly OPEN: 'OPEN';
|
|
120
|
-
readonly RESOLVED: 'RESOLVED';
|
|
121
|
-
}>;
|
|
122
|
-
message: z.ZodObject<{
|
|
123
|
-
version: z.ZodLiteral<1>;
|
|
124
|
-
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
125
|
-
type: z.ZodLiteral<"paragraph">;
|
|
126
|
-
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
127
|
-
type: z.ZodLiteral<"text">;
|
|
128
|
-
text: z.ZodString;
|
|
129
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
-
type: z.ZodLiteral<"userMention">;
|
|
131
|
-
userId: z.ZodUUID;
|
|
132
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
-
type: z.ZodLiteral<"link">;
|
|
134
|
-
href: z.ZodURL;
|
|
135
|
-
text: z.ZodString;
|
|
136
|
-
}, z.core.$strip>], "type">>;
|
|
137
|
-
}, z.core.$strip>], "type">>;
|
|
138
|
-
}, z.core.$strip>;
|
|
139
|
-
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
140
|
-
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
141
|
-
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
142
|
-
replyCount: z.ZodInt;
|
|
143
|
-
lastActivityAt: z.ZodISODateTime;
|
|
144
|
-
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
145
|
-
subscribed: z.ZodBoolean;
|
|
146
|
-
createdBy: z.ZodUUID;
|
|
147
|
-
createdAt: z.ZodISODateTime;
|
|
148
76
|
}, z.core.$strip>;
|
|
149
77
|
}, z.core.$strip>;
|
|
150
78
|
400: z.ZodObject<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
3
|
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
4
|
-
import {
|
|
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';
|
|
7
7
|
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
@@ -25,7 +25,7 @@ const POST_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z.discriminatedUnion('entityT
|
|
|
25
25
|
.describe('Comment on an entity'),
|
|
26
26
|
]));
|
|
27
27
|
const POST_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
28
|
-
data:
|
|
28
|
+
data: z.object({ id: z.uuid().describe('Id of the new comment') }),
|
|
29
29
|
}));
|
|
30
30
|
export const postCommentContract = defineApiContract({
|
|
31
31
|
method: 'post',
|
|
@@ -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,
|
|
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;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AAE,UAAU;IACtB,OAAO,EAAE,kBAAkB;IAC3B,WAAW,EACT,2FAA2F;IAC7F,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,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,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -5,7 +5,7 @@ declare const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
|
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.ZodUUID>;
|
|
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<{
|
|
@@ -77,7 +77,7 @@ export declare const postSearchCommentsContract: Omit<{
|
|
|
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.ZodUUID>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
82
|
readonly requestBodySchema: z.ZodObject<{
|
|
83
83
|
projectId: z.ZodUUID;
|
|
@@ -22,10 +22,9 @@ 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
|
-
.
|
|
26
|
-
.min(1)
|
|
25
|
+
.uuid()
|
|
27
26
|
.optional()
|
|
28
|
-
.describe('
|
|
27
|
+
.describe('Cursor from the previous response `meta.cursor`. Omit to read the first page'),
|
|
29
28
|
}));
|
|
30
29
|
const COMMENTS_MAX_FILTER_IDS = 100;
|
|
31
30
|
const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-comments-actions-search.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,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,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,iDAAiD;AACjD,+DAA+D;AAC/D,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC5C,CAAC,CACH,CAAA;AAGD,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAClC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,OAAO,CACxD,CAAC,CAAC,MAAM,CAAC;IACP,KAAK,EAAE,CAAC,CAAC,MAAM;SACZ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,GAAG,CAAC,kBAAkB,CAAC;SACvB,OAAO,CAAC,sBAAsB,CAAC;SAC/B,QAAQ,CAAC,uCAAuC,CAAC;IACpD,KAAK,EAAE,CAAC;SACL,
|
|
1
|
+
{"version":3,"file":"post-comments-actions-search.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,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,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,iDAAiD;AACjD,+DAA+D;AAC/D,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC5C,CAAC,CACH,CAAA;AAGD,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAClC,MAAM,kBAAkB,GA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,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,uCAAuC;IAChE,kBAAkB,EAAE,iCAAiC;IACrD,iBAAiB,EAAE,wCAAwC;IAC3D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,0BAA0B;IAC3E,qBAAqB,EAAE;QACrB,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './comments/delete-comment.ts';
|
|
2
2
|
export * from './comments/delete-comment-reply.ts';
|
|
3
|
+
export * from './comments/get-comment.ts';
|
|
3
4
|
export * from './comments/get-comment-replies.ts';
|
|
4
5
|
export * from './comments/get-comments.ts';
|
|
5
6
|
export * from './comments/patch-comment.ts';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './comments/delete-comment.js';
|
|
2
2
|
export * from './comments/delete-comment-reply.js';
|
|
3
|
+
export * from './comments/get-comment.js';
|
|
3
4
|
export * from './comments/get-comment-replies.js';
|
|
4
5
|
export * from './comments/get-comments.js';
|
|
5
6
|
export * from './comments/patch-comment.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kCAAkC,CAAA;AAChD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,wCAAwC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kCAAkC,CAAA;AAChD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,wCAAwC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const commentAuthorRequiredErrorDefinition: {
|
|
2
|
+
readonly code: "COMMENT_AUTHOR_REQUIRED";
|
|
3
|
+
readonly type: "permission-denied";
|
|
4
|
+
} & {
|
|
5
|
+
schema: import("zod").ZodObject<{
|
|
6
|
+
message: import("zod").ZodString;
|
|
7
|
+
code: import("zod").ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
8
|
+
errorCode: import("zod").ZodLiteral<"COMMENT_AUTHOR_REQUIRED">;
|
|
9
|
+
}, import("zod/v4/core").$strip>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { definePublicError, ErrorType } from '@lokalise/errors';
|
|
2
|
+
// Only the author of a comment or reply can perform some operations
|
|
3
|
+
export const commentAuthorRequiredErrorDefinition = definePublicError({
|
|
4
|
+
code: 'COMMENT_AUTHOR_REQUIRED',
|
|
5
|
+
type: ErrorType.PERMISSION_DENIED,
|
|
6
|
+
});
|
|
7
|
+
//# sourceMappingURL=comment-author-required.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-author-required.js","sourceRoot":"","sources":["../../../src/api/errors/comment-author-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE/D,oEAAoE;AACpE,MAAM,CAAC,MAAM,oCAAoC,GAAG,iBAAiB,CAAC;IACpE,IAAI,EAAE,yBAAyB;IAC/B,IAAI,EAAE,SAAS,CAAC,iBAAiB;CAClC,CAAC,CAAA"}
|
package/dist/api/errors/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,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,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
|