@lokalise/chatter-api-contracts 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -2
- package/dist/api/contracts/comments/delete-comment-reply.d.ts +63 -0
- package/dist/api/contracts/comments/delete-comment-reply.js +31 -0
- package/dist/api/contracts/comments/delete-comment-reply.js.map +1 -0
- package/dist/api/contracts/comments/delete-comment.d.ts +60 -0
- package/dist/api/contracts/comments/delete-comment.js +30 -0
- package/dist/api/contracts/comments/delete-comment.js.map +1 -0
- package/dist/api/contracts/comments/get-comment-replies.d.ts +138 -0
- package/dist/api/contracts/comments/get-comment-replies.js +60 -0
- package/dist/api/contracts/comments/get-comment-replies.js.map +1 -0
- package/dist/api/contracts/comments/get-comments.d.ts +71 -0
- package/dist/api/contracts/comments/get-comments.js +39 -0
- package/dist/api/contracts/comments/get-comments.js.map +1 -0
- package/dist/api/contracts/comments/patch-comment-reply.d.ts +154 -0
- package/dist/api/contracts/comments/patch-comment-reply.js +40 -0
- package/dist/api/contracts/comments/patch-comment-reply.js.map +1 -0
- package/dist/api/contracts/comments/patch-comment.d.ts +189 -0
- package/dist/api/contracts/comments/patch-comment.js +48 -0
- package/dist/api/contracts/comments/patch-comment.js.map +1 -0
- package/dist/api/contracts/comments/post-comment-reply.d.ts +151 -0
- package/dist/api/contracts/comments/post-comment-reply.js +39 -0
- package/dist/api/contracts/comments/post-comment-reply.js.map +1 -0
- package/dist/api/contracts/comments/post-comment.d.ts +178 -0
- package/dist/api/contracts/comments/post-comment.js +47 -0
- package/dist/api/contracts/comments/post-comment.js.map +1 -0
- package/dist/api/contracts/comments/post-comments-actions-search.d.ts +167 -0
- package/dist/api/contracts/comments/post-comments-actions-search.js +69 -0
- package/dist/api/contracts/comments/post-comments-actions-search.js.map +1 -0
- package/dist/api/contracts/common.d.ts +10 -0
- package/dist/api/contracts/common.js +11 -0
- package/dist/api/contracts/common.js.map +1 -0
- package/dist/api/contracts/hello/get-hello.d.ts +30 -0
- package/dist/api/contracts/hello/get-hello.js +22 -0
- package/dist/api/contracts/hello/get-hello.js.map +1 -0
- package/dist/api/contracts/index.d.ts +10 -0
- package/dist/api/contracts/index.js +11 -0
- package/dist/api/contracts/index.js.map +1 -0
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +2 -0
- package/dist/api/errors/index.js.map +1 -0
- package/dist/api/objects/comment-reply.d.ts +26 -0
- package/dist/api/objects/comment-reply.js +16 -0
- package/dist/api/objects/comment-reply.js.map +1 -0
- package/dist/api/objects/comment.d.ts +50 -0
- package/dist/api/objects/comment.js +47 -0
- package/dist/api/objects/comment.js.map +1 -0
- package/dist/api/objects/index.d.ts +3 -0
- package/dist/api/objects/index.js +4 -0
- package/dist/api/objects/index.js.map +1 -0
- package/dist/api/objects/message.d.ts +47 -0
- package/dist/api/objects/message.js +57 -0
- package/dist/api/objects/message.js.map +1 -0
- package/dist/api/open-api-tags.d.ts +21 -0
- package/dist/api/open-api-tags.js +22 -0
- package/dist/api/open-api-tags.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/package.json +47 -4
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
commentId: z.ZodUUID;
|
|
5
|
+
replyId: z.ZodUUID;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export type PatchCommentReplyPathParams = z.infer<typeof PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA>;
|
|
8
|
+
declare const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
9
|
+
message: z.ZodObject<{
|
|
10
|
+
version: z.ZodLiteral<1>;
|
|
11
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
12
|
+
type: z.ZodLiteral<"paragraph">;
|
|
13
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"text">;
|
|
15
|
+
text: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"userMention">;
|
|
18
|
+
userId: z.ZodUUID;
|
|
19
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
20
|
+
type: z.ZodLiteral<"link">;
|
|
21
|
+
href: z.ZodURL;
|
|
22
|
+
text: z.ZodString;
|
|
23
|
+
}, z.core.$strip>], "type">>;
|
|
24
|
+
}, z.core.$strip>], "type">>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
}, z.core.$strip>;
|
|
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
|
+
export declare const patchCommentReplyContract: Omit<{
|
|
56
|
+
readonly method: "patch";
|
|
57
|
+
readonly visibility: "internal";
|
|
58
|
+
readonly summary: "Update a reply";
|
|
59
|
+
readonly description: "Edits the message of a reply. Only the author can edit it.";
|
|
60
|
+
readonly tags: readonly ["Comments"];
|
|
61
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
62
|
+
authorization: z.ZodString;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
65
|
+
teamId: z.ZodUUID;
|
|
66
|
+
commentId: z.ZodUUID;
|
|
67
|
+
replyId: z.ZodUUID;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
70
|
+
message: z.ZodObject<{
|
|
71
|
+
version: z.ZodLiteral<1>;
|
|
72
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"paragraph">;
|
|
74
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"text">;
|
|
76
|
+
text: z.ZodString;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"userMention">;
|
|
79
|
+
userId: z.ZodUUID;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"link">;
|
|
82
|
+
href: z.ZodURL;
|
|
83
|
+
text: z.ZodString;
|
|
84
|
+
}, z.core.$strip>], "type">>;
|
|
85
|
+
}, z.core.$strip>], "type">>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
readonly pathResolver: ({ teamId, commentId, replyId }: {
|
|
89
|
+
teamId: string;
|
|
90
|
+
commentId: string;
|
|
91
|
+
replyId: string;
|
|
92
|
+
}) => `/v1/teams/${string}/comments/${string}/replies/${string}`;
|
|
93
|
+
readonly responsesByStatusCode: {
|
|
94
|
+
200: z.ZodObject<{
|
|
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>;
|
|
120
|
+
400: z.ZodObject<{
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
code: z.ZodString;
|
|
123
|
+
errorCode: z.ZodString;
|
|
124
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
401: z.ZodObject<{
|
|
127
|
+
message: z.ZodString;
|
|
128
|
+
code: z.ZodString;
|
|
129
|
+
errorCode: z.ZodString;
|
|
130
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
131
|
+
}, z.core.$strip>;
|
|
132
|
+
403: z.ZodObject<{
|
|
133
|
+
message: z.ZodString;
|
|
134
|
+
code: z.ZodString;
|
|
135
|
+
errorCode: z.ZodString;
|
|
136
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
404: z.ZodObject<{
|
|
139
|
+
message: z.ZodString;
|
|
140
|
+
code: z.ZodString;
|
|
141
|
+
errorCode: z.ZodString;
|
|
142
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
500: z.ZodObject<{
|
|
145
|
+
message: z.ZodString;
|
|
146
|
+
code: z.ZodString;
|
|
147
|
+
errorCode: z.ZodString;
|
|
148
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
};
|
|
151
|
+
}, "visibility"> & {
|
|
152
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
153
|
+
};
|
|
154
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { COMMENT_REPLY_SCHEMA } from '../../objects/comment-reply.js';
|
|
4
|
+
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
5
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
7
|
+
// ------------------------------------------------------------
|
|
8
|
+
// PATCH /v1/teams/:teamId/comments/:commentId/replies/:replyId
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const PATCH_COMMENT_REPLY_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
|
+
replyId: z.uuid().describe('Id of the reply'),
|
|
14
|
+
}));
|
|
15
|
+
const PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
16
|
+
message: MESSAGE_SCHEMA,
|
|
17
|
+
}));
|
|
18
|
+
const PATCH_COMMENT_REPLY_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
19
|
+
data: COMMENT_REPLY_SCHEMA,
|
|
20
|
+
}));
|
|
21
|
+
export const patchCommentReplyContract = defineApiContract({
|
|
22
|
+
method: 'patch',
|
|
23
|
+
visibility: 'internal',
|
|
24
|
+
summary: 'Update a reply',
|
|
25
|
+
description: 'Edits the message of a reply. Only the author can edit it.',
|
|
26
|
+
tags: [OpenApiTags.Comments.name],
|
|
27
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
28
|
+
requestPathParamsSchema: PATCH_COMMENT_REPLY_PATH_PARAMS_SCHEMA,
|
|
29
|
+
requestBodySchema: PATCH_COMMENT_REPLY_REQUEST_BODY_SCHEMA,
|
|
30
|
+
pathResolver: ({ teamId, commentId, replyId }) => `/v1/teams/${teamId}/comments/${commentId}/replies/${replyId}`,
|
|
31
|
+
responsesByStatusCode: {
|
|
32
|
+
200: PATCH_COMMENT_REPLY_RESPONSE_BODY_SCHEMA,
|
|
33
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
34
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
35
|
+
403: ERROR_RESPONSE_SCHEMA,
|
|
36
|
+
404: ERROR_RESPONSE_SCHEMA,
|
|
37
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=patch-comment-reply.js.map
|
|
@@ -0,0 +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;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,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,+DAA+D;AAC/D,+DAA+D;AAC/D,MAAM,sCAAsC,GAAG,CAAC,CAAC,OAAO,CACtD,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;IACjD,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;CAC9C,CAAC,CACH,CAAA;AAGD,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,cAAc;CACxB,CAAC,CACH,CAAA;AAGD,MAAM,wCAAwC,GAAG,CAAC,CAAC,OAAO,CACxD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,oBAAoB;CAC3B,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,wCAAwC;QAC7C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const PATCH_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
commentId: z.ZodUUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type PatchCommentPathParams = z.infer<typeof PATCH_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
7
|
+
declare const PATCH_COMMENT_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
8
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
version: z.ZodLiteral<1>;
|
|
10
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"paragraph">;
|
|
12
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"text">;
|
|
14
|
+
text: z.ZodString;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"userMention">;
|
|
17
|
+
userId: z.ZodUUID;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"link">;
|
|
20
|
+
href: z.ZodURL;
|
|
21
|
+
text: z.ZodString;
|
|
22
|
+
}, z.core.$strip>], "type">>;
|
|
23
|
+
}, z.core.$strip>], "type">>;
|
|
24
|
+
}, z.core.$strip>>;
|
|
25
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
readonly OPEN: 'OPEN';
|
|
27
|
+
readonly RESOLVED: 'RESOLVED';
|
|
28
|
+
}>>;
|
|
29
|
+
}, z.core.$strip>;
|
|
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
|
+
export declare const patchCommentContract: Omit<{
|
|
74
|
+
readonly method: "patch";
|
|
75
|
+
readonly visibility: "internal";
|
|
76
|
+
readonly summary: "Update a comment";
|
|
77
|
+
readonly description: string;
|
|
78
|
+
readonly tags: readonly ["Comments"];
|
|
79
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
80
|
+
authorization: z.ZodString;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
83
|
+
teamId: z.ZodUUID;
|
|
84
|
+
commentId: z.ZodUUID;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
87
|
+
message: z.ZodOptional<z.ZodObject<{
|
|
88
|
+
version: z.ZodLiteral<1>;
|
|
89
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
type: z.ZodLiteral<"paragraph">;
|
|
91
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
+
type: z.ZodLiteral<"text">;
|
|
93
|
+
text: z.ZodString;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
type: z.ZodLiteral<"userMention">;
|
|
96
|
+
userId: z.ZodUUID;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
type: z.ZodLiteral<"link">;
|
|
99
|
+
href: z.ZodURL;
|
|
100
|
+
text: z.ZodString;
|
|
101
|
+
}, z.core.$strip>], "type">>;
|
|
102
|
+
}, z.core.$strip>], "type">>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
readonly OPEN: 'OPEN';
|
|
106
|
+
readonly RESOLVED: 'RESOLVED';
|
|
107
|
+
}>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
readonly pathResolver: ({ teamId, commentId }: {
|
|
110
|
+
teamId: string;
|
|
111
|
+
commentId: string;
|
|
112
|
+
}) => `/v1/teams/${string}/comments/${string}`;
|
|
113
|
+
readonly responsesByStatusCode: {
|
|
114
|
+
200: z.ZodObject<{
|
|
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>;
|
|
155
|
+
400: z.ZodObject<{
|
|
156
|
+
message: z.ZodString;
|
|
157
|
+
code: z.ZodString;
|
|
158
|
+
errorCode: z.ZodString;
|
|
159
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
401: z.ZodObject<{
|
|
162
|
+
message: z.ZodString;
|
|
163
|
+
code: z.ZodString;
|
|
164
|
+
errorCode: z.ZodString;
|
|
165
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
403: z.ZodObject<{
|
|
168
|
+
message: z.ZodString;
|
|
169
|
+
code: z.ZodString;
|
|
170
|
+
errorCode: z.ZodString;
|
|
171
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
404: z.ZodObject<{
|
|
174
|
+
message: z.ZodString;
|
|
175
|
+
code: z.ZodString;
|
|
176
|
+
errorCode: z.ZodString;
|
|
177
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
500: z.ZodObject<{
|
|
180
|
+
message: z.ZodString;
|
|
181
|
+
code: z.ZodString;
|
|
182
|
+
errorCode: z.ZodString;
|
|
183
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
};
|
|
186
|
+
}, "visibility"> & {
|
|
187
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
188
|
+
};
|
|
189
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { COMMENT_SCHEMA, CommentStatusEnum } from '../../objects/comment.js';
|
|
4
|
+
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
5
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
7
|
+
// ------------------------------------------------------------
|
|
8
|
+
// PATCH /v1/teams/:teamId/comments/:commentId
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const PATCH_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 PATCH_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z
|
|
15
|
+
.object({
|
|
16
|
+
message: MESSAGE_SCHEMA.optional(),
|
|
17
|
+
status: z
|
|
18
|
+
.enum(CommentStatusEnum)
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('New status of the thread: `RESOLVED` resolves it, `OPEN` reopens it'),
|
|
21
|
+
})
|
|
22
|
+
.refine((body) => body.message !== undefined || body.status !== undefined, {
|
|
23
|
+
message: 'At least one of `message` or `status` is required',
|
|
24
|
+
}));
|
|
25
|
+
const PATCH_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
26
|
+
data: COMMENT_SCHEMA,
|
|
27
|
+
}));
|
|
28
|
+
export const patchCommentContract = defineApiContract({
|
|
29
|
+
method: 'patch',
|
|
30
|
+
visibility: 'internal',
|
|
31
|
+
summary: 'Update a comment',
|
|
32
|
+
description: 'Edits the message of a comment, or resolves or reopens its thread. Send at least one of `message` or `status`. ' +
|
|
33
|
+
'Only the author can change the message; anyone with access to the comment can change the status. ',
|
|
34
|
+
tags: [OpenApiTags.Comments.name],
|
|
35
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
36
|
+
requestPathParamsSchema: PATCH_COMMENT_PATH_PARAMS_SCHEMA,
|
|
37
|
+
requestBodySchema: PATCH_COMMENT_REQUEST_BODY_SCHEMA,
|
|
38
|
+
pathResolver: ({ teamId, commentId }) => `/v1/teams/${teamId}/comments/${commentId}`,
|
|
39
|
+
responsesByStatusCode: {
|
|
40
|
+
200: PATCH_COMMENT_RESPONSE_BODY_SCHEMA,
|
|
41
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
42
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
43
|
+
403: ERROR_RESPONSE_SCHEMA,
|
|
44
|
+
404: ERROR_RESPONSE_SCHEMA,
|
|
45
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=patch-comment.js.map
|
|
@@ -0,0 +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;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,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,kCAAkC,GAAG,CAAC,CAAC,OAAO,CAClD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,cAAc;CACrB,CAAC,CACH,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,mGAAmG;IACrG,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,kCAAkC;QACvC,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
commentId: z.ZodUUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type PostCommentReplyPathParams = z.infer<typeof POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA>;
|
|
7
|
+
declare const POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
8
|
+
message: z.ZodObject<{
|
|
9
|
+
version: z.ZodLiteral<1>;
|
|
10
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
type: z.ZodLiteral<"paragraph">;
|
|
12
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"text">;
|
|
14
|
+
text: z.ZodString;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"userMention">;
|
|
17
|
+
userId: z.ZodUUID;
|
|
18
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
19
|
+
type: z.ZodLiteral<"link">;
|
|
20
|
+
href: z.ZodURL;
|
|
21
|
+
text: z.ZodString;
|
|
22
|
+
}, z.core.$strip>], "type">>;
|
|
23
|
+
}, z.core.$strip>], "type">>;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type PostCommentReplyRequestBody = z.infer<typeof POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA>;
|
|
27
|
+
declare const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
28
|
+
data: z.ZodObject<{
|
|
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
|
+
}, z.core.$strip>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type PostCommentReplyResponseBody = z.infer<typeof POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA>;
|
|
54
|
+
export declare const postCommentReplyContract: Omit<{
|
|
55
|
+
readonly method: "post";
|
|
56
|
+
readonly visibility: "internal";
|
|
57
|
+
readonly summary: "Reply to a comment";
|
|
58
|
+
readonly description: "Adds a reply to the thread of a comment. The requesting user is its author.";
|
|
59
|
+
readonly tags: readonly ["Comments"];
|
|
60
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
61
|
+
authorization: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
64
|
+
teamId: z.ZodUUID;
|
|
65
|
+
commentId: z.ZodUUID;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
68
|
+
message: z.ZodObject<{
|
|
69
|
+
version: z.ZodLiteral<1>;
|
|
70
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"paragraph">;
|
|
72
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
73
|
+
type: z.ZodLiteral<"text">;
|
|
74
|
+
text: z.ZodString;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"userMention">;
|
|
77
|
+
userId: z.ZodUUID;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"link">;
|
|
80
|
+
href: z.ZodURL;
|
|
81
|
+
text: z.ZodString;
|
|
82
|
+
}, z.core.$strip>], "type">>;
|
|
83
|
+
}, z.core.$strip>], "type">>;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
readonly pathResolver: ({ teamId, commentId }: {
|
|
87
|
+
teamId: string;
|
|
88
|
+
commentId: string;
|
|
89
|
+
}) => `/v1/teams/${string}/comments/${string}/replies`;
|
|
90
|
+
readonly responsesByStatusCode: {
|
|
91
|
+
201: z.ZodObject<{
|
|
92
|
+
data: z.ZodObject<{
|
|
93
|
+
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
|
+
}, z.core.$strip>;
|
|
116
|
+
}, z.core.$strip>;
|
|
117
|
+
400: z.ZodObject<{
|
|
118
|
+
message: z.ZodString;
|
|
119
|
+
code: z.ZodString;
|
|
120
|
+
errorCode: z.ZodString;
|
|
121
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
401: z.ZodObject<{
|
|
124
|
+
message: z.ZodString;
|
|
125
|
+
code: z.ZodString;
|
|
126
|
+
errorCode: z.ZodString;
|
|
127
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
403: z.ZodObject<{
|
|
130
|
+
message: z.ZodString;
|
|
131
|
+
code: z.ZodString;
|
|
132
|
+
errorCode: z.ZodString;
|
|
133
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
404: z.ZodObject<{
|
|
136
|
+
message: z.ZodString;
|
|
137
|
+
code: z.ZodString;
|
|
138
|
+
errorCode: z.ZodString;
|
|
139
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
140
|
+
}, z.core.$strip>;
|
|
141
|
+
500: z.ZodObject<{
|
|
142
|
+
message: z.ZodString;
|
|
143
|
+
code: z.ZodString;
|
|
144
|
+
errorCode: z.ZodString;
|
|
145
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
146
|
+
}, z.core.$strip>;
|
|
147
|
+
};
|
|
148
|
+
}, "visibility"> & {
|
|
149
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
150
|
+
};
|
|
151
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { COMMENT_REPLY_SCHEMA } from '../../objects/comment-reply.js';
|
|
4
|
+
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
5
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
7
|
+
// ------------------------------------------------------------
|
|
8
|
+
// POST /v1/teams/:teamId/comments/:commentId/replies
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const POST_COMMENT_REPLY_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 POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
15
|
+
message: MESSAGE_SCHEMA,
|
|
16
|
+
}));
|
|
17
|
+
const POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
18
|
+
data: COMMENT_REPLY_SCHEMA,
|
|
19
|
+
}));
|
|
20
|
+
export const postCommentReplyContract = defineApiContract({
|
|
21
|
+
method: 'post',
|
|
22
|
+
visibility: 'internal',
|
|
23
|
+
summary: 'Reply to a comment',
|
|
24
|
+
description: 'Adds a reply to the thread of a comment. The requesting user is its author.',
|
|
25
|
+
tags: [OpenApiTags.Comments.name],
|
|
26
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
27
|
+
requestPathParamsSchema: POST_COMMENT_REPLY_PATH_PARAMS_SCHEMA,
|
|
28
|
+
requestBodySchema: POST_COMMENT_REPLY_REQUEST_BODY_SCHEMA,
|
|
29
|
+
pathResolver: ({ teamId, commentId }) => `/v1/teams/${teamId}/comments/${commentId}/replies`,
|
|
30
|
+
responsesByStatusCode: {
|
|
31
|
+
201: POST_COMMENT_REPLY_RESPONSE_BODY_SCHEMA,
|
|
32
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
33
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
34
|
+
403: ERROR_RESPONSE_SCHEMA,
|
|
35
|
+
404: ERROR_RESPONSE_SCHEMA,
|
|
36
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=post-comment-reply.js.map
|
|
@@ -0,0 +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,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,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,oBAAoB;CAC3B,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,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|