@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,178 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const POST_COMMENT_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type PostCommentPathParams = z.infer<typeof POST_COMMENT_PATH_PARAMS_SCHEMA>;
|
|
6
|
+
declare const POST_COMMENT_REQUEST_BODY_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
+
entityType: z.ZodLiteral<"SEGMENT">;
|
|
8
|
+
entityId: z.ZodUUID;
|
|
9
|
+
projectId: z.ZodUUID;
|
|
10
|
+
message: z.ZodObject<{
|
|
11
|
+
version: z.ZodLiteral<1>;
|
|
12
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"paragraph">;
|
|
14
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
type: z.ZodLiteral<"text">;
|
|
16
|
+
text: z.ZodString;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"userMention">;
|
|
19
|
+
userId: z.ZodUUID;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"link">;
|
|
22
|
+
href: z.ZodURL;
|
|
23
|
+
text: z.ZodString;
|
|
24
|
+
}, z.core.$strip>], "type">>;
|
|
25
|
+
}, z.core.$strip>], "type">>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
}, z.core.$strip>], "entityType">;
|
|
28
|
+
export type PostCommentRequestBody = z.infer<typeof POST_COMMENT_REQUEST_BODY_SCHEMA>;
|
|
29
|
+
declare const POST_COMMENT_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
30
|
+
data: z.ZodObject<{
|
|
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
|
+
}, z.core.$strip>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export type PostCommentResponseBody = z.infer<typeof POST_COMMENT_RESPONSE_BODY_SCHEMA>;
|
|
71
|
+
export declare const postCommentContract: Omit<{
|
|
72
|
+
readonly method: "post";
|
|
73
|
+
readonly visibility: "internal";
|
|
74
|
+
readonly summary: "Create a comment";
|
|
75
|
+
readonly description: "Creates a comment on an entity, starting a new thread. The requesting user is its author.";
|
|
76
|
+
readonly tags: readonly ["Comments"];
|
|
77
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
78
|
+
authorization: z.ZodString;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
81
|
+
teamId: z.ZodUUID;
|
|
82
|
+
}, z.core.$strip>;
|
|
83
|
+
readonly requestBodySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
84
|
+
entityType: z.ZodLiteral<"SEGMENT">;
|
|
85
|
+
entityId: z.ZodUUID;
|
|
86
|
+
projectId: z.ZodUUID;
|
|
87
|
+
message: 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
|
+
}, z.core.$strip>], "entityType">;
|
|
105
|
+
readonly pathResolver: ({ teamId }: {
|
|
106
|
+
teamId: string;
|
|
107
|
+
}) => `/v1/teams/${string}/comments`;
|
|
108
|
+
readonly responsesByStatusCode: {
|
|
109
|
+
201: z.ZodObject<{
|
|
110
|
+
data: z.ZodObject<{
|
|
111
|
+
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
|
+
}, z.core.$strip>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
400: z.ZodObject<{
|
|
151
|
+
message: z.ZodString;
|
|
152
|
+
code: z.ZodString;
|
|
153
|
+
errorCode: z.ZodString;
|
|
154
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
155
|
+
}, z.core.$strip>;
|
|
156
|
+
401: z.ZodObject<{
|
|
157
|
+
message: z.ZodString;
|
|
158
|
+
code: z.ZodString;
|
|
159
|
+
errorCode: z.ZodString;
|
|
160
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
403: z.ZodObject<{
|
|
163
|
+
message: z.ZodString;
|
|
164
|
+
code: z.ZodString;
|
|
165
|
+
errorCode: z.ZodString;
|
|
166
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
500: z.ZodObject<{
|
|
169
|
+
message: z.ZodString;
|
|
170
|
+
code: z.ZodString;
|
|
171
|
+
errorCode: z.ZodString;
|
|
172
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
};
|
|
175
|
+
}, "visibility"> & {
|
|
176
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
177
|
+
};
|
|
178
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { COMMENT_SCHEMA, CommentEntityTypeEnum } 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
|
+
// POST /v1/teams/:teamId/comments
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const POST_COMMENT_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
+
teamId: z.uuid().describe('Id of the team'),
|
|
12
|
+
}));
|
|
13
|
+
// One option per entity type, as each type decides which fields it requires
|
|
14
|
+
const POST_COMMENT_REQUEST_BODY_SCHEMA = z.compile(z.discriminatedUnion('entityType', [
|
|
15
|
+
z
|
|
16
|
+
.object({
|
|
17
|
+
entityType: z
|
|
18
|
+
.literal(CommentEntityTypeEnum.SEGMENT)
|
|
19
|
+
.describe('Type of the commented entity'),
|
|
20
|
+
entityId: z.uuid().describe('Id of the commented entity'),
|
|
21
|
+
projectId: z.uuid().describe('Id of the project of the commented entity'),
|
|
22
|
+
message: MESSAGE_SCHEMA,
|
|
23
|
+
})
|
|
24
|
+
.describe('Comment on an entity'),
|
|
25
|
+
]));
|
|
26
|
+
const POST_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
27
|
+
data: COMMENT_SCHEMA,
|
|
28
|
+
}));
|
|
29
|
+
export const postCommentContract = defineApiContract({
|
|
30
|
+
method: 'post',
|
|
31
|
+
visibility: 'internal',
|
|
32
|
+
summary: 'Create a comment',
|
|
33
|
+
description: 'Creates a comment on an entity, starting a new thread. The requesting user is its author.',
|
|
34
|
+
tags: [OpenApiTags.Comments.name],
|
|
35
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
36
|
+
requestPathParamsSchema: POST_COMMENT_PATH_PARAMS_SCHEMA,
|
|
37
|
+
requestBodySchema: POST_COMMENT_REQUEST_BODY_SCHEMA,
|
|
38
|
+
pathResolver: ({ teamId }) => `/v1/teams/${teamId}/comments`,
|
|
39
|
+
responsesByStatusCode: {
|
|
40
|
+
201: POST_COMMENT_RESPONSE_BODY_SCHEMA,
|
|
41
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
42
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
43
|
+
403: ERROR_RESPONSE_SCHEMA,
|
|
44
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=post-comment.js.map
|
|
@@ -0,0 +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,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChF,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,iCAAiC,GAAG,CAAC,CAAC,OAAO,CACjD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,cAAc;CACrB,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IACnD,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,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,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodUUID;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type PostSearchCommentsPathParams = z.infer<typeof POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA>;
|
|
6
|
+
export declare const POST_SEARCH_COMMENTS_QUERY_SCHEMA: z.ZodObject<{
|
|
7
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
8
|
+
after: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type PostSearchCommentsQuery = z.infer<typeof POST_SEARCH_COMMENTS_QUERY_SCHEMA>;
|
|
11
|
+
declare const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
12
|
+
entityTypes: z.ZodArray<z.ZodEnum<{
|
|
13
|
+
readonly SEGMENT: 'SEGMENT';
|
|
14
|
+
}>>;
|
|
15
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
16
|
+
projectIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type PostSearchCommentsRequestBody = z.infer<typeof POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA>;
|
|
19
|
+
declare const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
20
|
+
data: z.ZodArray<z.ZodObject<{
|
|
21
|
+
id: z.ZodUUID;
|
|
22
|
+
teamId: z.ZodUUID;
|
|
23
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
24
|
+
entityType: z.ZodEnum<{
|
|
25
|
+
readonly SEGMENT: 'SEGMENT';
|
|
26
|
+
}>;
|
|
27
|
+
entityId: z.ZodUUID;
|
|
28
|
+
status: z.ZodEnum<{
|
|
29
|
+
readonly OPEN: 'OPEN';
|
|
30
|
+
readonly RESOLVED: 'RESOLVED';
|
|
31
|
+
}>;
|
|
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
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
51
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
52
|
+
replyCount: z.ZodInt;
|
|
53
|
+
lastActivityAt: z.ZodISODateTime;
|
|
54
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
55
|
+
subscribed: z.ZodBoolean;
|
|
56
|
+
createdBy: z.ZodUUID;
|
|
57
|
+
createdAt: z.ZodISODateTime;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
meta: z.ZodObject<{
|
|
60
|
+
count: z.ZodNumber;
|
|
61
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
62
|
+
hasMore: z.ZodBoolean;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export type PostSearchCommentsResponseBody = z.infer<typeof POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA>;
|
|
66
|
+
export declare const postSearchCommentsContract: Omit<{
|
|
67
|
+
readonly method: "post";
|
|
68
|
+
readonly visibility: "internal";
|
|
69
|
+
readonly summary: "Search comments";
|
|
70
|
+
readonly description: string;
|
|
71
|
+
readonly tags: readonly ["Comments"];
|
|
72
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
73
|
+
authorization: z.ZodString;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
76
|
+
teamId: z.ZodUUID;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
readonly requestQuerySchema: z.ZodObject<{
|
|
79
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
80
|
+
after: z.ZodOptional<z.ZodString>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
83
|
+
entityTypes: z.ZodArray<z.ZodEnum<{
|
|
84
|
+
readonly SEGMENT: 'SEGMENT';
|
|
85
|
+
}>>;
|
|
86
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
87
|
+
projectIds: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
readonly pathResolver: ({ teamId }: {
|
|
90
|
+
teamId: string;
|
|
91
|
+
}) => `/v1/teams/${string}/comments/actions/search`;
|
|
92
|
+
readonly responsesByStatusCode: {
|
|
93
|
+
200: z.ZodObject<{
|
|
94
|
+
data: z.ZodArray<z.ZodObject<{
|
|
95
|
+
id: z.ZodUUID;
|
|
96
|
+
teamId: z.ZodUUID;
|
|
97
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
98
|
+
entityType: z.ZodEnum<{
|
|
99
|
+
readonly SEGMENT: 'SEGMENT';
|
|
100
|
+
}>;
|
|
101
|
+
entityId: z.ZodUUID;
|
|
102
|
+
status: z.ZodEnum<{
|
|
103
|
+
readonly OPEN: 'OPEN';
|
|
104
|
+
readonly RESOLVED: 'RESOLVED';
|
|
105
|
+
}>;
|
|
106
|
+
message: z.ZodObject<{
|
|
107
|
+
version: z.ZodLiteral<1>;
|
|
108
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"paragraph">;
|
|
110
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
111
|
+
type: z.ZodLiteral<"text">;
|
|
112
|
+
text: z.ZodString;
|
|
113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
+
type: z.ZodLiteral<"userMention">;
|
|
115
|
+
userId: z.ZodUUID;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
type: z.ZodLiteral<"link">;
|
|
118
|
+
href: z.ZodURL;
|
|
119
|
+
text: z.ZodString;
|
|
120
|
+
}, z.core.$strip>], "type">>;
|
|
121
|
+
}, z.core.$strip>], "type">>;
|
|
122
|
+
}, z.core.$strip>;
|
|
123
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
124
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodUUID>>;
|
|
125
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
126
|
+
replyCount: z.ZodInt;
|
|
127
|
+
lastActivityAt: z.ZodISODateTime;
|
|
128
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
129
|
+
subscribed: z.ZodBoolean;
|
|
130
|
+
createdBy: z.ZodUUID;
|
|
131
|
+
createdAt: z.ZodISODateTime;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
meta: z.ZodObject<{
|
|
134
|
+
count: z.ZodNumber;
|
|
135
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
136
|
+
hasMore: z.ZodBoolean;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
}, z.core.$strip>;
|
|
139
|
+
400: z.ZodObject<{
|
|
140
|
+
message: z.ZodString;
|
|
141
|
+
code: z.ZodString;
|
|
142
|
+
errorCode: z.ZodString;
|
|
143
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
144
|
+
}, z.core.$strip>;
|
|
145
|
+
401: z.ZodObject<{
|
|
146
|
+
message: z.ZodString;
|
|
147
|
+
code: z.ZodString;
|
|
148
|
+
errorCode: z.ZodString;
|
|
149
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
403: z.ZodObject<{
|
|
152
|
+
message: z.ZodString;
|
|
153
|
+
code: z.ZodString;
|
|
154
|
+
errorCode: z.ZodString;
|
|
155
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
156
|
+
}, z.core.$strip>;
|
|
157
|
+
500: z.ZodObject<{
|
|
158
|
+
message: z.ZodString;
|
|
159
|
+
code: z.ZodString;
|
|
160
|
+
errorCode: z.ZodString;
|
|
161
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
};
|
|
164
|
+
}, "visibility"> & {
|
|
165
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
166
|
+
};
|
|
167
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { paginatedResponseSchema } from '@lokalise/api-common';
|
|
2
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
3
|
+
import z from 'zod/v4';
|
|
4
|
+
import { COMMENT_SCHEMA, CommentEntityTypeEnum } from '../../objects/comment.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/actions/search
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
11
|
+
teamId: z.uuid().describe('Id of the team'),
|
|
12
|
+
}));
|
|
13
|
+
const COMMENTS_DEFAULT_LIMIT = 100;
|
|
14
|
+
const COMMENTS_MAX_LIMIT = 100;
|
|
15
|
+
export const POST_SEARCH_COMMENTS_QUERY_SCHEMA = z.compile(z.object({
|
|
16
|
+
limit: z.coerce
|
|
17
|
+
.number()
|
|
18
|
+
.int()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(COMMENTS_MAX_LIMIT)
|
|
21
|
+
.default(COMMENTS_DEFAULT_LIMIT)
|
|
22
|
+
.describe('Number of comments to return per page'),
|
|
23
|
+
after: z
|
|
24
|
+
.string()
|
|
25
|
+
.min(1)
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Opaque cursor from the previous response `meta.cursor`. Omit to read the first page'),
|
|
28
|
+
}));
|
|
29
|
+
const COMMENTS_MAX_FILTER_IDS = 100;
|
|
30
|
+
const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(z.object({
|
|
31
|
+
entityTypes: z
|
|
32
|
+
.array(z.enum(CommentEntityTypeEnum))
|
|
33
|
+
.min(1)
|
|
34
|
+
.describe('Types of the commented entities'),
|
|
35
|
+
entityIds: z
|
|
36
|
+
.array(z.uuid())
|
|
37
|
+
.min(1)
|
|
38
|
+
.max(COMMENTS_MAX_FILTER_IDS)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Ids of the commented entities'),
|
|
41
|
+
projectIds: z
|
|
42
|
+
.array(z.uuid())
|
|
43
|
+
.min(1)
|
|
44
|
+
.max(COMMENTS_MAX_FILTER_IDS)
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Only comments of these projects'),
|
|
47
|
+
}));
|
|
48
|
+
const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA = paginatedResponseSchema(COMMENT_SCHEMA);
|
|
49
|
+
export const postSearchCommentsContract = defineApiContract({
|
|
50
|
+
method: 'post',
|
|
51
|
+
visibility: 'internal',
|
|
52
|
+
summary: 'Search comments',
|
|
53
|
+
description: 'Lists the root comments of the threads on the given entities, oldest first, one page at a time. ' +
|
|
54
|
+
'Pass `meta.cursor` from a response as `after` to read the next page.',
|
|
55
|
+
tags: [OpenApiTags.Comments.name],
|
|
56
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
57
|
+
requestPathParamsSchema: POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA,
|
|
58
|
+
requestQuerySchema: POST_SEARCH_COMMENTS_QUERY_SCHEMA,
|
|
59
|
+
requestBodySchema: POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA,
|
|
60
|
+
pathResolver: ({ teamId }) => `/v1/teams/${teamId}/comments/actions/search`,
|
|
61
|
+
responsesByStatusCode: {
|
|
62
|
+
200: POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA,
|
|
63
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
64
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
65
|
+
403: ERROR_RESPONSE_SCHEMA,
|
|
66
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=post-comments-actions-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-comments-actions-search.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
export declare const AUTH_HEADERS: z.ZodObject<{
|
|
3
|
+
authorization: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export declare const ERROR_RESPONSE_SCHEMA: z.ZodObject<{
|
|
6
|
+
message: z.ZodString;
|
|
7
|
+
code: z.ZodString;
|
|
8
|
+
errorCode: z.ZodString;
|
|
9
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
export const AUTH_HEADERS = z.compile(z.object({
|
|
3
|
+
authorization: z.string().describe('Bearer token authorizing the request'),
|
|
4
|
+
}));
|
|
5
|
+
export const ERROR_RESPONSE_SCHEMA = z.compile(z.object({
|
|
6
|
+
message: z.string().describe('Human-readable error message'),
|
|
7
|
+
code: z.string().describe('Machine-readable error code'),
|
|
8
|
+
errorCode: z.string().describe('Machine-readable error code (legacy alias of `code`)'),
|
|
9
|
+
details: z.unknown().optional().describe('Optional structured error details'),
|
|
10
|
+
}));
|
|
11
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/api/contracts/common.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,OAAO,CACnC,CAAC,CAAC,MAAM,CAAC;IACP,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CAC3E,CAAC,CACH,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,OAAO,CAC5C,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAC5D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;IACxD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;IACtF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CAC9E,CAAC,CACH,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const GET_HELLO_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
3
|
+
message: z.ZodString;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type GetHelloResponseBody = z.infer<typeof GET_HELLO_RESPONSE_BODY_SCHEMA>;
|
|
6
|
+
export declare const getHelloContract: Omit<{
|
|
7
|
+
readonly method: "get";
|
|
8
|
+
readonly summary: "Say hello";
|
|
9
|
+
readonly description: "Returns a greeting. Placeholder endpoint until the first real chatter module lands.";
|
|
10
|
+
readonly tags: readonly ["Hello"];
|
|
11
|
+
readonly visibility: "public";
|
|
12
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
13
|
+
authorization: z.ZodString;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
readonly pathResolver: () => "/hello";
|
|
16
|
+
readonly responsesByStatusCode: {
|
|
17
|
+
200: z.ZodObject<{
|
|
18
|
+
message: z.ZodString;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
500: z.ZodObject<{
|
|
21
|
+
message: z.ZodString;
|
|
22
|
+
code: z.ZodString;
|
|
23
|
+
errorCode: z.ZodString;
|
|
24
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
};
|
|
27
|
+
}, "visibility"> & {
|
|
28
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
4
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
5
|
+
// GET /hello
|
|
6
|
+
const GET_HELLO_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
7
|
+
message: z.string().describe('Greeting message'),
|
|
8
|
+
}));
|
|
9
|
+
export const getHelloContract = defineApiContract({
|
|
10
|
+
method: 'get',
|
|
11
|
+
summary: 'Say hello',
|
|
12
|
+
description: 'Returns a greeting. Placeholder endpoint until the first real chatter module lands.',
|
|
13
|
+
tags: [OpenApiTags.Hello.name],
|
|
14
|
+
visibility: 'public',
|
|
15
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
16
|
+
pathResolver: () => '/hello',
|
|
17
|
+
responsesByStatusCode: {
|
|
18
|
+
200: GET_HELLO_RESPONSE_BODY_SCHEMA,
|
|
19
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=get-hello.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-hello.js","sourceRoot":"","sources":["../../../../src/api/contracts/hello/get-hello.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,aAAa;AACb,MAAM,8BAA8B,GAAG,CAAC,CAAC,OAAO,CAC9C,CAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;CACjD,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;IAChD,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,WAAW;IACpB,WAAW,EACT,qFAAqF;IACvF,IAAI,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;IAC9B,UAAU,EAAE,QAAQ;IACpB,mBAAmB,EAAE,YAAY;IACjC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ;IAC5B,qBAAqB,EAAE;QACrB,GAAG,EAAE,8BAA8B;QACnC,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from './comments/delete-comment.ts';
|
|
2
|
+
export * from './comments/delete-comment-reply.ts';
|
|
3
|
+
export * from './comments/get-comment-replies.ts';
|
|
4
|
+
export * from './comments/get-comments.ts';
|
|
5
|
+
export * from './comments/patch-comment.ts';
|
|
6
|
+
export * from './comments/patch-comment-reply.ts';
|
|
7
|
+
export * from './comments/post-comment.ts';
|
|
8
|
+
export * from './comments/post-comment-reply.ts';
|
|
9
|
+
export * from './comments/post-comments-actions-search.ts';
|
|
10
|
+
export * from './hello/get-hello.ts';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './comments/delete-comment.js';
|
|
2
|
+
export * from './comments/delete-comment-reply.js';
|
|
3
|
+
export * from './comments/get-comment-replies.js';
|
|
4
|
+
export * from './comments/get-comments.js';
|
|
5
|
+
export * from './comments/patch-comment.js';
|
|
6
|
+
export * from './comments/patch-comment-reply.js';
|
|
7
|
+
export * from './comments/post-comment.js';
|
|
8
|
+
export * from './comments/post-comment-reply.js';
|
|
9
|
+
export * from './comments/post-comments-actions-search.js';
|
|
10
|
+
export * from './hello/get-hello.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
export declare const COMMENT_REPLY_SCHEMA: z.ZodObject<{
|
|
3
|
+
id: z.ZodUUID;
|
|
4
|
+
commentId: z.ZodUUID;
|
|
5
|
+
message: z.ZodObject<{
|
|
6
|
+
version: z.ZodLiteral<1>;
|
|
7
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"paragraph">;
|
|
9
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
10
|
+
type: z.ZodLiteral<"text">;
|
|
11
|
+
text: z.ZodString;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"userMention">;
|
|
14
|
+
userId: z.ZodUUID;
|
|
15
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
16
|
+
type: z.ZodLiteral<"link">;
|
|
17
|
+
href: z.ZodURL;
|
|
18
|
+
text: z.ZodString;
|
|
19
|
+
}, z.core.$strip>], "type">>;
|
|
20
|
+
}, z.core.$strip>], "type">>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
23
|
+
createdBy: z.ZodUUID;
|
|
24
|
+
createdAt: z.ZodISODateTime;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type CommentReply = z.infer<typeof COMMENT_REPLY_SCHEMA>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
import { MESSAGE_SCHEMA } from './message.js';
|
|
3
|
+
export const COMMENT_REPLY_SCHEMA = z.compile(z
|
|
4
|
+
.object({
|
|
5
|
+
id: z.uuid().describe('Id of the reply'),
|
|
6
|
+
commentId: z.uuid().describe('Id of the thread the reply belongs to'),
|
|
7
|
+
message: MESSAGE_SCHEMA,
|
|
8
|
+
messageUpdatedAt: z.iso
|
|
9
|
+
.datetime()
|
|
10
|
+
.nullish()
|
|
11
|
+
.describe('Last edit of the message. `null` if the message was never edited'),
|
|
12
|
+
createdBy: z.uuid().describe('Id of the author'),
|
|
13
|
+
createdAt: z.iso.datetime().describe('Creation time'),
|
|
14
|
+
})
|
|
15
|
+
.describe('Reply in a thread'));
|
|
16
|
+
//# sourceMappingURL=comment-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-reply.js","sourceRoot":"","sources":["../../../src/api/objects/comment-reply.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,OAAO,CAC3C,CAAC;KACE,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IACxC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;IACrE,OAAO,EAAE,cAAc;IACvB,gBAAgB,EAAE,CAAC,CAAC,GAAG;SACpB,QAAQ,EAAE;SACV,OAAO,EAAE;SACT,QAAQ,CAAC,kEAAkE,CAAC;IAC/E,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;CACtD,CAAC;KACD,QAAQ,CAAC,mBAAmB,CAAC,CACjC,CAAA"}
|