@lokalise/chatter-api-contracts 0.1.12 → 0.1.13
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-mentioned-users.d.ts +84 -0
- package/dist/api/contracts/comments/get-comment-mentioned-users.js +52 -0
- package/dist/api/contracts/comments/get-comment-mentioned-users.js.map +1 -0
- 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/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const GET_COMMENT_MENTIONED_USERS_PATH_PARAMS_SCHEMA: z.ZodObject<{
|
|
3
|
+
teamId: z.ZodGUID;
|
|
4
|
+
commentId: z.ZodGUID;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export type GetCommentMentionedUsersPathParams = z.infer<typeof GET_COMMENT_MENTIONED_USERS_PATH_PARAMS_SCHEMA>;
|
|
7
|
+
declare const GET_COMMENT_MENTIONED_USERS_QUERY_SCHEMA: z.ZodObject<{
|
|
8
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
9
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export type GetCommentMentionedUsersQuery = z.infer<typeof GET_COMMENT_MENTIONED_USERS_QUERY_SCHEMA>;
|
|
12
|
+
declare const GET_COMMENT_MENTIONED_USERS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
13
|
+
data: z.ZodArray<z.ZodGUID>;
|
|
14
|
+
meta: z.ZodObject<{
|
|
15
|
+
count: z.ZodNumber;
|
|
16
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
17
|
+
hasMore: z.ZodBoolean;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export type GetCommentMentionedUsersResponseBody = z.infer<typeof GET_COMMENT_MENTIONED_USERS_RESPONSE_BODY_SCHEMA>;
|
|
21
|
+
export declare const getCommentMentionedUsersContract: Omit<{
|
|
22
|
+
readonly method: "get";
|
|
23
|
+
readonly visibility: "internal";
|
|
24
|
+
readonly metadata: import("../../callers.ts").CallerMetadata;
|
|
25
|
+
readonly summary: "List users mentioned in a thread";
|
|
26
|
+
readonly description: string;
|
|
27
|
+
readonly tags: readonly ["Comments"];
|
|
28
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
29
|
+
authorization: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
32
|
+
teamId: z.ZodGUID;
|
|
33
|
+
commentId: z.ZodGUID;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
readonly requestQuerySchema: z.ZodObject<{
|
|
36
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
37
|
+
after: z.ZodOptional<z.ZodGUID>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
readonly pathResolver: ({ teamId, commentId }: {
|
|
40
|
+
teamId: string;
|
|
41
|
+
commentId: string;
|
|
42
|
+
}) => `/v1/teams/${string}/comments/${string}/mentions`;
|
|
43
|
+
readonly responsesByStatusCode: {
|
|
44
|
+
200: z.ZodObject<{
|
|
45
|
+
data: z.ZodArray<z.ZodGUID>;
|
|
46
|
+
meta: z.ZodObject<{
|
|
47
|
+
count: z.ZodNumber;
|
|
48
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
49
|
+
hasMore: z.ZodBoolean;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
400: z.ZodObject<{
|
|
53
|
+
message: z.ZodString;
|
|
54
|
+
code: z.ZodString;
|
|
55
|
+
errorCode: z.ZodString;
|
|
56
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
401: z.ZodObject<{
|
|
59
|
+
message: z.ZodString;
|
|
60
|
+
code: z.ZodString;
|
|
61
|
+
errorCode: z.ZodString;
|
|
62
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
403: z.ZodObject<{
|
|
65
|
+
message: z.ZodString;
|
|
66
|
+
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
67
|
+
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
404: z.ZodObject<{
|
|
70
|
+
message: z.ZodString;
|
|
71
|
+
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
72
|
+
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
500: z.ZodObject<{
|
|
75
|
+
message: z.ZodString;
|
|
76
|
+
code: z.ZodString;
|
|
77
|
+
errorCode: z.ZodString;
|
|
78
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
};
|
|
81
|
+
}, "visibility"> & {
|
|
82
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
83
|
+
};
|
|
84
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { paginatedResponseSchema } from '@lokalise/api-common';
|
|
2
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
3
|
+
import z from 'zod/v4';
|
|
4
|
+
import { acceptCallers, CallerEnum } from '../../callers.js';
|
|
5
|
+
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
|
|
6
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
7
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
8
|
+
// ------------------------------------------------------------
|
|
9
|
+
// GET /v1/teams/:teamId/comments/:commentId/mentions
|
|
10
|
+
// ------------------------------------------------------------
|
|
11
|
+
const GET_COMMENT_MENTIONED_USERS_PATH_PARAMS_SCHEMA = z.compile(z.object({
|
|
12
|
+
teamId: z.guid().describe('Id of the team'),
|
|
13
|
+
commentId: z.guid().describe('Id of the comment'),
|
|
14
|
+
}));
|
|
15
|
+
const COMMENT_MENTIONED_USERS_DEFAULT_LIMIT = 100;
|
|
16
|
+
const GET_COMMENT_MENTIONED_USERS_QUERY_SCHEMA = z.compile(z.object({
|
|
17
|
+
limit: z.coerce
|
|
18
|
+
.number()
|
|
19
|
+
.int()
|
|
20
|
+
.min(1)
|
|
21
|
+
.max(COMMENT_MENTIONED_USERS_DEFAULT_LIMIT)
|
|
22
|
+
.default(COMMENT_MENTIONED_USERS_DEFAULT_LIMIT)
|
|
23
|
+
.describe('Number of user ids to return per page'),
|
|
24
|
+
after: z
|
|
25
|
+
.guid()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Cursor from the previous response `meta.cursor`. Omit to read the first page'),
|
|
28
|
+
}));
|
|
29
|
+
const GET_COMMENT_MENTIONED_USERS_RESPONSE_BODY_SCHEMA = paginatedResponseSchema(z.guid().describe('Id of a user mentioned in the thread'));
|
|
30
|
+
export const getCommentMentionedUsersContract = defineApiContract({
|
|
31
|
+
method: 'get',
|
|
32
|
+
visibility: 'internal',
|
|
33
|
+
metadata: acceptCallers(CallerEnum.USER, CallerEnum.SERVICE),
|
|
34
|
+
summary: 'List users mentioned in a thread',
|
|
35
|
+
description: 'Lists the distinct ids of the users mentioned in a thread, in its root comment and its ' +
|
|
36
|
+
'replies that are not deleted, ordered by id, one page at a time. Pass `meta.cursor` from a ' +
|
|
37
|
+
'response as `after` to read the next page. Deleted and orphaned comments are not found.',
|
|
38
|
+
tags: [OpenApiTags.Comments.name],
|
|
39
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
40
|
+
requestPathParamsSchema: GET_COMMENT_MENTIONED_USERS_PATH_PARAMS_SCHEMA,
|
|
41
|
+
requestQuerySchema: GET_COMMENT_MENTIONED_USERS_QUERY_SCHEMA,
|
|
42
|
+
pathResolver: ({ teamId, commentId }) => `/v1/teams/${teamId}/comments/${commentId}/mentions`,
|
|
43
|
+
responsesByStatusCode: {
|
|
44
|
+
200: GET_COMMENT_MENTIONED_USERS_RESPONSE_BODY_SCHEMA,
|
|
45
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
46
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
47
|
+
403: teamAccessDeniedErrorDefinition.schema,
|
|
48
|
+
404: resourceNotFoundErrorDefinition.schema,
|
|
49
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=get-comment-mentioned-users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-comment-mentioned-users.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/get-comment-mentioned-users.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,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,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,8CAA8C,GAAG,CAAC,CAAC,OAAO,CAC9D,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC3C,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAA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AAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -2,6 +2,7 @@ export * from './comments/comment-search-common.ts';
|
|
|
2
2
|
export * from './comments/delete-comment.ts';
|
|
3
3
|
export * from './comments/delete-comment-reply.ts';
|
|
4
4
|
export * from './comments/get-comment.ts';
|
|
5
|
+
export * from './comments/get-comment-mentioned-users.ts';
|
|
5
6
|
export * from './comments/get-comment-replies.ts';
|
|
6
7
|
export * from './comments/get-comments.ts';
|
|
7
8
|
export * from './comments/get-comments-search-grouped-cursor.ts';
|
|
@@ -2,6 +2,7 @@ export * from './comments/comment-search-common.js';
|
|
|
2
2
|
export * from './comments/delete-comment.js';
|
|
3
3
|
export * from './comments/delete-comment-reply.js';
|
|
4
4
|
export * from './comments/get-comment.js';
|
|
5
|
+
export * from './comments/get-comment-mentioned-users.js';
|
|
5
6
|
export * from './comments/get-comment-replies.js';
|
|
6
7
|
export * from './comments/get-comments.js';
|
|
7
8
|
export * from './comments/get-comments-search-grouped-cursor.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kDAAkD,CAAA;AAChE,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kCAAkC,CAAA;AAChD,cAAc,2CAA2C,CAAA;AACzD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,oDAAoD,CAAA;AAClE,cAAc,sCAAsC,CAAA;AACpD,cAAc,wCAAwC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAA;AACnD,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,2BAA2B,CAAA;AACzC,cAAc,2CAA2C,CAAA;AACzD,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kDAAkD,CAAA;AAChE,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kCAAkC,CAAA;AAChD,cAAc,2CAA2C,CAAA;AACzD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,oDAAoD,CAAA;AAClE,cAAc,sCAAsC,CAAA;AACpD,cAAc,wCAAwC,CAAA"}
|