@lokalise/chatter-api-contracts 0.1.9 → 0.1.11
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/callers.d.ts +48 -0
- package/dist/api/callers.js +28 -0
- package/dist/api/callers.js.map +1 -0
- package/dist/api/contracts/comments/comment-search-common.d.ts +27 -0
- package/dist/api/contracts/comments/comment-search-common.js +55 -0
- package/dist/api/contracts/comments/comment-search-common.js.map +1 -0
- package/dist/api/contracts/comments/delete-comment-reply.d.ts +5 -0
- package/dist/api/contracts/comments/delete-comment-reply.js +4 -1
- package/dist/api/contracts/comments/delete-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/delete-comment.d.ts +5 -0
- package/dist/api/contracts/comments/delete-comment.js +4 -1
- package/dist/api/contracts/comments/delete-comment.js.map +1 -1
- package/dist/api/contracts/comments/get-comment-replies.d.ts +1 -0
- package/dist/api/contracts/comments/get-comment-replies.js +2 -0
- package/dist/api/contracts/comments/get-comment-replies.js.map +1 -1
- package/dist/api/contracts/comments/get-comment.d.ts +1 -0
- package/dist/api/contracts/comments/get-comment.js +2 -0
- package/dist/api/contracts/comments/get-comment.js.map +1 -1
- package/dist/api/contracts/comments/get-comments.d.ts +1 -0
- package/dist/api/contracts/comments/get-comments.js +2 -0
- package/dist/api/contracts/comments/get-comments.js.map +1 -1
- package/dist/api/contracts/comments/patch-comment-reply.d.ts +5 -0
- package/dist/api/contracts/comments/patch-comment-reply.js +4 -1
- package/dist/api/contracts/comments/patch-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/patch-comment.d.ts +5 -0
- package/dist/api/contracts/comments/patch-comment.js +4 -1
- package/dist/api/contracts/comments/patch-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comment-reply.d.ts +7 -2
- package/dist/api/contracts/comments/post-comment-reply.js +4 -2
- package/dist/api/contracts/comments/post-comment-reply.js.map +1 -1
- package/dist/api/contracts/comments/post-comment.d.ts +7 -2
- package/dist/api/contracts/comments/post-comment.js +4 -2
- package/dist/api/contracts/comments/post-comment.js.map +1 -1
- package/dist/api/contracts/comments/post-comments-actions-count.d.ts +97 -0
- package/dist/api/contracts/comments/post-comments-actions-count.js +37 -0
- package/dist/api/contracts/comments/post-comments-actions-count.js.map +1 -0
- package/dist/api/contracts/comments/post-comments-actions-search-grouped.d.ts +295 -0
- package/dist/api/contracts/comments/post-comments-actions-search-grouped.js +78 -0
- package/dist/api/contracts/comments/post-comments-actions-search-grouped.js.map +1 -0
- package/dist/api/contracts/comments/post-comments-actions-search.d.ts +51 -12
- package/dist/api/contracts/comments/post-comments-actions-search.js +16 -41
- package/dist/api/contracts/comments/post-comments-actions-search.js.map +1 -1
- package/dist/api/contracts/comments/put-comment-read-state.d.ts +7 -2
- package/dist/api/contracts/comments/put-comment-read-state.js +4 -2
- package/dist/api/contracts/comments/put-comment-read-state.js.map +1 -1
- package/dist/api/contracts/comments/put-comment-subscription.d.ts +7 -2
- package/dist/api/contracts/comments/put-comment-subscription.js +4 -2
- package/dist/api/contracts/comments/put-comment-subscription.js.map +1 -1
- package/dist/api/contracts/common.js +3 -1
- package/dist/api/contracts/common.js.map +1 -1
- package/dist/api/contracts/index.d.ts +3 -0
- package/dist/api/contracts/index.js +3 -0
- package/dist/api/contracts/index.js.map +1 -1
- package/dist/api/errors/index.d.ts +1 -0
- package/dist/api/errors/index.js +1 -0
- package/dist/api/errors/index.js.map +1 -1
- package/dist/api/errors/user-token-required.d.ts +10 -0
- package/dist/api/errors/user-token-required.js +7 -0
- package/dist/api/errors/user-token-required.js.map +1 -0
- package/dist/api/objects/comment.js +6 -2
- package/dist/api/objects/comment.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
2
|
import z from 'zod/v4';
|
|
3
|
-
import {
|
|
3
|
+
import { acceptCallers, CallerEnum } from '../../callers.js';
|
|
4
|
+
import { mentionedUserAccessDeniedErrorDefinition, resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
|
|
4
5
|
import { CommentEntityTypeEnum } from '../../objects/comment.js';
|
|
5
6
|
import { MESSAGE_SCHEMA } from '../../objects/message.js';
|
|
6
7
|
import { OpenApiTags } from '../../open-api-tags.js';
|
|
@@ -30,6 +31,7 @@ const POST_COMMENT_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
|
30
31
|
export const postCommentContract = defineApiContract({
|
|
31
32
|
method: 'post',
|
|
32
33
|
visibility: 'internal',
|
|
34
|
+
metadata: acceptCallers(CallerEnum.USER),
|
|
33
35
|
summary: 'Create a comment',
|
|
34
36
|
description: 'Creates a comment on an entity, starting a new thread. The requesting user is its author.',
|
|
35
37
|
tags: [OpenApiTags.Comments.name],
|
|
@@ -41,7 +43,7 @@ export const postCommentContract = defineApiContract({
|
|
|
41
43
|
201: POST_COMMENT_RESPONSE_BODY_SCHEMA,
|
|
42
44
|
400: ERROR_RESPONSE_SCHEMA,
|
|
43
45
|
401: ERROR_RESPONSE_SCHEMA,
|
|
44
|
-
403: teamAccessDeniedErrorDefinition.schema,
|
|
46
|
+
403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
|
|
45
47
|
404: resourceNotFoundErrorDefinition.schema,
|
|
46
48
|
422: mentionedUserAccessDeniedErrorDefinition.schema,
|
|
47
49
|
500: ERROR_RESPONSE_SCHEMA,
|
|
@@ -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,wCAAwC,EACxC,+BAA+B,EAC/B,+BAA+B,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CAAC;CACpC,CAAC,CACH,CAAA;AAGD,MAAM,iCAAiC,GAAG,CAAC,CAAC,OAAO,CACjD,CAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,CAAC;CACnE,CAAC,CACH,CAAA;AAGD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IACnD,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC;IACxC,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,CAAC,CAAC,KAAK,CAAC,CAAC,+BAA+B,CAAC,MAAM,EAAE,gCAAgC,CAAC,MAAM,CAAC,CAAC;QAC/F,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,wCAAwC,CAAC,MAAM;QACpD,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
import { type CommentSearchPathParams } from './comment-search-common.ts';
|
|
3
|
+
export type PostCountCommentsPathParams = CommentSearchPathParams;
|
|
4
|
+
declare const POST_COUNT_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
5
|
+
projectId: z.ZodGUID;
|
|
6
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
7
|
+
readonly SEGMENT: 'SEGMENT';
|
|
8
|
+
}>>>;
|
|
9
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
10
|
+
unreadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
mentionsMe: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
13
|
+
locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
14
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
readonly OPEN: 'OPEN';
|
|
16
|
+
readonly RESOLVED: 'RESOLVED';
|
|
17
|
+
}>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type PostCountCommentsRequestBody = z.input<typeof POST_COUNT_COMMENTS_REQUEST_BODY_SCHEMA>;
|
|
20
|
+
declare const POST_COUNT_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
21
|
+
total: z.ZodInt;
|
|
22
|
+
unread: z.ZodInt;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export type PostCountCommentsResponseBody = z.infer<typeof POST_COUNT_COMMENTS_RESPONSE_BODY_SCHEMA>;
|
|
25
|
+
export declare const postCountCommentsContract: Omit<{
|
|
26
|
+
readonly method: "post";
|
|
27
|
+
readonly visibility: "internal";
|
|
28
|
+
readonly metadata: import("../../callers.ts").CallerMetadata;
|
|
29
|
+
readonly summary: "Count comments";
|
|
30
|
+
readonly description: string;
|
|
31
|
+
readonly tags: readonly ["Comments"];
|
|
32
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
33
|
+
authorization: z.ZodString;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
36
|
+
teamId: z.ZodGUID;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
39
|
+
projectId: z.ZodGUID;
|
|
40
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
41
|
+
readonly SEGMENT: 'SEGMENT';
|
|
42
|
+
}>>>;
|
|
43
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
44
|
+
unreadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
mentionsMe: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
47
|
+
locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
49
|
+
readonly OPEN: 'OPEN';
|
|
50
|
+
readonly RESOLVED: 'RESOLVED';
|
|
51
|
+
}>>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
readonly pathResolver: ({ teamId }: {
|
|
54
|
+
teamId: string;
|
|
55
|
+
}) => `/v1/teams/${string}/comments/actions/count`;
|
|
56
|
+
readonly responsesByStatusCode: {
|
|
57
|
+
200: z.ZodObject<{
|
|
58
|
+
total: z.ZodInt;
|
|
59
|
+
unread: z.ZodInt;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
400: z.ZodObject<{
|
|
62
|
+
message: z.ZodString;
|
|
63
|
+
code: z.ZodString;
|
|
64
|
+
errorCode: z.ZodString;
|
|
65
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
401: z.ZodObject<{
|
|
68
|
+
message: z.ZodString;
|
|
69
|
+
code: z.ZodString;
|
|
70
|
+
errorCode: z.ZodString;
|
|
71
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
74
|
+
message: z.ZodString;
|
|
75
|
+
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
76
|
+
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
+
message: z.ZodString;
|
|
79
|
+
code: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
|
|
80
|
+
errorCode: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
|
|
81
|
+
}, z.core.$strip>]>;
|
|
82
|
+
404: z.ZodObject<{
|
|
83
|
+
message: z.ZodString;
|
|
84
|
+
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
85
|
+
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
500: z.ZodObject<{
|
|
88
|
+
message: z.ZodString;
|
|
89
|
+
code: z.ZodString;
|
|
90
|
+
errorCode: z.ZodString;
|
|
91
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
};
|
|
94
|
+
}, "visibility"> & {
|
|
95
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
96
|
+
};
|
|
97
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { acceptCallers, CallerEnum } from '../../callers.js';
|
|
4
|
+
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
|
|
5
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
6
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
7
|
+
import { COMMENT_SEARCH_FILTERS_SCHEMA, COMMENT_SEARCH_PATH_PARAMS_SCHEMA, } from './comment-search-common.js';
|
|
8
|
+
const POST_COUNT_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(COMMENT_SEARCH_FILTERS_SCHEMA);
|
|
9
|
+
const POST_COUNT_COMMENTS_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
10
|
+
total: z.int().nonnegative().describe('Threads matching the filters'),
|
|
11
|
+
unread: z
|
|
12
|
+
.int()
|
|
13
|
+
.nonnegative()
|
|
14
|
+
.describe('Open threads matching the filters and unread for the user'),
|
|
15
|
+
}));
|
|
16
|
+
export const postCountCommentsContract = defineApiContract({
|
|
17
|
+
method: 'post',
|
|
18
|
+
visibility: 'internal',
|
|
19
|
+
metadata: acceptCallers(CallerEnum.USER),
|
|
20
|
+
summary: 'Count comments',
|
|
21
|
+
description: "Counts the project's threads matching the filters, and how many of them are " +
|
|
22
|
+
'open and unread for the user.',
|
|
23
|
+
tags: [OpenApiTags.Comments.name],
|
|
24
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
25
|
+
requestPathParamsSchema: COMMENT_SEARCH_PATH_PARAMS_SCHEMA,
|
|
26
|
+
requestBodySchema: POST_COUNT_COMMENTS_REQUEST_BODY_SCHEMA,
|
|
27
|
+
pathResolver: ({ teamId }) => `/v1/teams/${teamId}/comments/actions/count`,
|
|
28
|
+
responsesByStatusCode: {
|
|
29
|
+
200: POST_COUNT_COMMENTS_RESPONSE_BODY_SCHEMA,
|
|
30
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
31
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
32
|
+
403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
|
|
33
|
+
404: resourceNotFoundErrorDefinition.schema,
|
|
34
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=post-comments-actions-count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-comments-actions-count.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-count.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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ACrB,GAAG,EAAE,wCAAwC;QAC7C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,+BAA+B,CAAC,MAAM,EAAE,gCAAgC,CAAC,MAAM,CAAC,CAAC;QAC/F,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
import { type CommentSearchPathParams } from './comment-search-common.ts';
|
|
3
|
+
export type PostSearchGroupedCommentsPathParams = CommentSearchPathParams;
|
|
4
|
+
export declare const COMMENT_GROUPED_SEARCH_CURSOR_SCHEMA: z.ZodObject<{
|
|
5
|
+
lastActivityAt: z.ZodISODateTime;
|
|
6
|
+
id: z.ZodGUID;
|
|
7
|
+
groupActivityAt: z.ZodISODateTime;
|
|
8
|
+
groupKey: z.ZodGUID;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export type CommentGroupedSearchCursor = z.infer<typeof COMMENT_GROUPED_SEARCH_CURSOR_SCHEMA>;
|
|
11
|
+
export declare const POST_SEARCH_GROUPED_COMMENTS_QUERY_SCHEMA: z.ZodObject<{
|
|
12
|
+
before: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
|
|
13
|
+
lastActivityAt: z.ZodISODateTime;
|
|
14
|
+
id: z.ZodGUID;
|
|
15
|
+
groupActivityAt: z.ZodISODateTime;
|
|
16
|
+
groupKey: z.ZodGUID;
|
|
17
|
+
}, z.core.$strip>>>>;
|
|
18
|
+
after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
|
|
19
|
+
lastActivityAt: z.ZodISODateTime;
|
|
20
|
+
id: z.ZodGUID;
|
|
21
|
+
groupActivityAt: z.ZodISODateTime;
|
|
22
|
+
groupKey: z.ZodGUID;
|
|
23
|
+
}, z.core.$strip>>>>;
|
|
24
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type PostSearchGroupedCommentsQuery = z.infer<typeof POST_SEARCH_GROUPED_COMMENTS_QUERY_SCHEMA>;
|
|
27
|
+
export type PostSearchGroupedCommentsQueryInput = z.input<typeof POST_SEARCH_GROUPED_COMMENTS_QUERY_SCHEMA>;
|
|
28
|
+
export declare const CommentGroupByEnum: {
|
|
29
|
+
readonly ENTITY: 'ENTITY';
|
|
30
|
+
};
|
|
31
|
+
export type CommentGroupBy = (typeof CommentGroupByEnum)[keyof typeof CommentGroupByEnum];
|
|
32
|
+
declare const POST_SEARCH_GROUPED_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
|
|
33
|
+
projectId: z.ZodGUID;
|
|
34
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
35
|
+
readonly SEGMENT: 'SEGMENT';
|
|
36
|
+
}>>>;
|
|
37
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
38
|
+
unreadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
mentionsMe: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
41
|
+
locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
42
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
43
|
+
readonly OPEN: 'OPEN';
|
|
44
|
+
readonly RESOLVED: 'RESOLVED';
|
|
45
|
+
}>>;
|
|
46
|
+
groupBy: z.ZodEnum<{
|
|
47
|
+
readonly ENTITY: 'ENTITY';
|
|
48
|
+
}>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type PostSearchGroupedCommentsRequestBody = z.input<typeof POST_SEARCH_GROUPED_COMMENTS_REQUEST_BODY_SCHEMA>;
|
|
51
|
+
export declare const COMMENT_GROUP_KEY_SCHEMA: z.ZodObject<{
|
|
52
|
+
entityId: z.ZodGUID;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export type CommentGroupKey = z.infer<typeof COMMENT_GROUP_KEY_SCHEMA>;
|
|
55
|
+
export declare const COMMENTS_GROUP_SCHEMA: z.ZodObject<{
|
|
56
|
+
key: z.ZodObject<{
|
|
57
|
+
entityId: z.ZodGUID;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
total: z.ZodInt;
|
|
60
|
+
unread: z.ZodInt;
|
|
61
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
62
|
+
id: z.ZodGUID;
|
|
63
|
+
teamId: z.ZodGUID;
|
|
64
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
65
|
+
entityType: z.ZodEnum<{
|
|
66
|
+
readonly SEGMENT: 'SEGMENT';
|
|
67
|
+
}>;
|
|
68
|
+
entityId: z.ZodGUID;
|
|
69
|
+
status: z.ZodEnum<{
|
|
70
|
+
readonly OPEN: 'OPEN';
|
|
71
|
+
readonly RESOLVED: 'RESOLVED';
|
|
72
|
+
}>;
|
|
73
|
+
message: z.ZodObject<{
|
|
74
|
+
version: z.ZodLiteral<1>;
|
|
75
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"paragraph">;
|
|
77
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
type: z.ZodLiteral<"text">;
|
|
79
|
+
text: z.ZodString;
|
|
80
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
81
|
+
type: z.ZodLiteral<"userMention">;
|
|
82
|
+
userId: z.ZodGUID;
|
|
83
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
84
|
+
type: z.ZodLiteral<"link">;
|
|
85
|
+
href: z.ZodURL;
|
|
86
|
+
text: z.ZodString;
|
|
87
|
+
}, z.core.$strip>], "type">>;
|
|
88
|
+
}, z.core.$strip>], "type">>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
91
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
92
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
93
|
+
replyCount: z.ZodInt;
|
|
94
|
+
lastActivityAt: z.ZodISODateTime;
|
|
95
|
+
createdBy: z.ZodGUID;
|
|
96
|
+
createdAt: z.ZodISODateTime;
|
|
97
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
98
|
+
subscribed: z.ZodBoolean;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
}, z.core.$strip>;
|
|
101
|
+
export type CommentsGroup = z.infer<typeof COMMENTS_GROUP_SCHEMA>;
|
|
102
|
+
declare const POST_SEARCH_GROUPED_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
|
|
103
|
+
data: z.ZodArray<z.ZodObject<{
|
|
104
|
+
key: z.ZodObject<{
|
|
105
|
+
entityId: z.ZodGUID;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
total: z.ZodInt;
|
|
108
|
+
unread: z.ZodInt;
|
|
109
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
110
|
+
id: z.ZodGUID;
|
|
111
|
+
teamId: z.ZodGUID;
|
|
112
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
113
|
+
entityType: z.ZodEnum<{
|
|
114
|
+
readonly SEGMENT: 'SEGMENT';
|
|
115
|
+
}>;
|
|
116
|
+
entityId: z.ZodGUID;
|
|
117
|
+
status: z.ZodEnum<{
|
|
118
|
+
readonly OPEN: 'OPEN';
|
|
119
|
+
readonly RESOLVED: 'RESOLVED';
|
|
120
|
+
}>;
|
|
121
|
+
message: z.ZodObject<{
|
|
122
|
+
version: z.ZodLiteral<1>;
|
|
123
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"paragraph">;
|
|
125
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
126
|
+
type: z.ZodLiteral<"text">;
|
|
127
|
+
text: z.ZodString;
|
|
128
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
129
|
+
type: z.ZodLiteral<"userMention">;
|
|
130
|
+
userId: z.ZodGUID;
|
|
131
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
132
|
+
type: z.ZodLiteral<"link">;
|
|
133
|
+
href: z.ZodURL;
|
|
134
|
+
text: z.ZodString;
|
|
135
|
+
}, z.core.$strip>], "type">>;
|
|
136
|
+
}, z.core.$strip>], "type">>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
139
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
140
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
141
|
+
replyCount: z.ZodInt;
|
|
142
|
+
lastActivityAt: z.ZodISODateTime;
|
|
143
|
+
createdBy: z.ZodGUID;
|
|
144
|
+
createdAt: z.ZodISODateTime;
|
|
145
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
146
|
+
subscribed: z.ZodBoolean;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
meta: z.ZodObject<{
|
|
150
|
+
count: z.ZodInt;
|
|
151
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
152
|
+
hasMore: z.ZodBoolean;
|
|
153
|
+
}, z.core.$strip>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type PostSearchGroupedCommentsResponseBody = z.infer<typeof POST_SEARCH_GROUPED_COMMENTS_RESPONSE_BODY_SCHEMA>;
|
|
156
|
+
export declare const postSearchGroupedCommentsContract: Omit<{
|
|
157
|
+
readonly method: "post";
|
|
158
|
+
readonly visibility: "internal";
|
|
159
|
+
readonly metadata: import("../../callers.ts").CallerMetadata;
|
|
160
|
+
readonly summary: "Search comments grouped";
|
|
161
|
+
readonly description: string;
|
|
162
|
+
readonly tags: readonly ["Comments"];
|
|
163
|
+
readonly requestHeaderSchema: z.ZodObject<{
|
|
164
|
+
authorization: z.ZodString;
|
|
165
|
+
}, z.core.$strip>;
|
|
166
|
+
readonly requestPathParamsSchema: z.ZodObject<{
|
|
167
|
+
teamId: z.ZodGUID;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
readonly requestQuerySchema: z.ZodObject<{
|
|
170
|
+
before: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
|
|
171
|
+
lastActivityAt: z.ZodISODateTime;
|
|
172
|
+
id: z.ZodGUID;
|
|
173
|
+
groupActivityAt: z.ZodISODateTime;
|
|
174
|
+
groupKey: z.ZodGUID;
|
|
175
|
+
}, z.core.$strip>>>>;
|
|
176
|
+
after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
|
|
177
|
+
lastActivityAt: z.ZodISODateTime;
|
|
178
|
+
id: z.ZodGUID;
|
|
179
|
+
groupActivityAt: z.ZodISODateTime;
|
|
180
|
+
groupKey: z.ZodGUID;
|
|
181
|
+
}, z.core.$strip>>>>;
|
|
182
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
readonly requestBodySchema: z.ZodObject<{
|
|
185
|
+
projectId: z.ZodGUID;
|
|
186
|
+
entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
187
|
+
readonly SEGMENT: 'SEGMENT';
|
|
188
|
+
}>>>;
|
|
189
|
+
entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
190
|
+
unreadOnly: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
mentionsMe: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
|
|
193
|
+
locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
194
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
195
|
+
readonly OPEN: 'OPEN';
|
|
196
|
+
readonly RESOLVED: 'RESOLVED';
|
|
197
|
+
}>>;
|
|
198
|
+
groupBy: z.ZodEnum<{
|
|
199
|
+
readonly ENTITY: 'ENTITY';
|
|
200
|
+
}>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
readonly pathResolver: ({ teamId }: {
|
|
203
|
+
teamId: string;
|
|
204
|
+
}) => `/v1/teams/${string}/comments/actions/search-grouped`;
|
|
205
|
+
readonly responsesByStatusCode: {
|
|
206
|
+
200: z.ZodObject<{
|
|
207
|
+
data: z.ZodArray<z.ZodObject<{
|
|
208
|
+
key: z.ZodObject<{
|
|
209
|
+
entityId: z.ZodGUID;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
total: z.ZodInt;
|
|
212
|
+
unread: z.ZodInt;
|
|
213
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
214
|
+
id: z.ZodGUID;
|
|
215
|
+
teamId: z.ZodGUID;
|
|
216
|
+
projectId: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
217
|
+
entityType: z.ZodEnum<{
|
|
218
|
+
readonly SEGMENT: 'SEGMENT';
|
|
219
|
+
}>;
|
|
220
|
+
entityId: z.ZodGUID;
|
|
221
|
+
status: z.ZodEnum<{
|
|
222
|
+
readonly OPEN: 'OPEN';
|
|
223
|
+
readonly RESOLVED: 'RESOLVED';
|
|
224
|
+
}>;
|
|
225
|
+
message: z.ZodObject<{
|
|
226
|
+
version: z.ZodLiteral<1>;
|
|
227
|
+
blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
228
|
+
type: z.ZodLiteral<"paragraph">;
|
|
229
|
+
content: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
230
|
+
type: z.ZodLiteral<"text">;
|
|
231
|
+
text: z.ZodString;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"userMention">;
|
|
234
|
+
userId: z.ZodGUID;
|
|
235
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
236
|
+
type: z.ZodLiteral<"link">;
|
|
237
|
+
href: z.ZodURL;
|
|
238
|
+
text: z.ZodString;
|
|
239
|
+
}, z.core.$strip>], "type">>;
|
|
240
|
+
}, z.core.$strip>], "type">>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
messageUpdatedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
243
|
+
resolvedBy: z.ZodOptional<z.ZodNullable<z.ZodGUID>>;
|
|
244
|
+
resolvedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
245
|
+
replyCount: z.ZodInt;
|
|
246
|
+
lastActivityAt: z.ZodISODateTime;
|
|
247
|
+
createdBy: z.ZodGUID;
|
|
248
|
+
createdAt: z.ZodISODateTime;
|
|
249
|
+
lastReadAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
250
|
+
subscribed: z.ZodBoolean;
|
|
251
|
+
}, z.core.$strip>>;
|
|
252
|
+
}, z.core.$strip>>;
|
|
253
|
+
meta: z.ZodObject<{
|
|
254
|
+
count: z.ZodInt;
|
|
255
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
256
|
+
hasMore: z.ZodBoolean;
|
|
257
|
+
}, z.core.$strip>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
400: z.ZodObject<{
|
|
260
|
+
message: z.ZodString;
|
|
261
|
+
code: z.ZodString;
|
|
262
|
+
errorCode: z.ZodString;
|
|
263
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
264
|
+
}, z.core.$strip>;
|
|
265
|
+
401: z.ZodObject<{
|
|
266
|
+
message: z.ZodString;
|
|
267
|
+
code: z.ZodString;
|
|
268
|
+
errorCode: z.ZodString;
|
|
269
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
403: z.ZodUnion<readonly [z.ZodObject<{
|
|
272
|
+
message: z.ZodString;
|
|
273
|
+
code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
274
|
+
errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
message: z.ZodString;
|
|
277
|
+
code: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
|
|
278
|
+
errorCode: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
|
|
279
|
+
}, z.core.$strip>]>;
|
|
280
|
+
404: z.ZodObject<{
|
|
281
|
+
message: z.ZodString;
|
|
282
|
+
code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
283
|
+
errorCode: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
|
|
284
|
+
}, z.core.$strip>;
|
|
285
|
+
500: z.ZodObject<{
|
|
286
|
+
message: z.ZodString;
|
|
287
|
+
code: z.ZodString;
|
|
288
|
+
errorCode: z.ZodString;
|
|
289
|
+
details: z.ZodOptional<z.ZodUnknown>;
|
|
290
|
+
}, z.core.$strip>;
|
|
291
|
+
};
|
|
292
|
+
}, "visibility"> & {
|
|
293
|
+
visibility: import("@lokalise/api-contracts").RouteVisibility;
|
|
294
|
+
};
|
|
295
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineApiContract } from '@lokalise/api-contracts';
|
|
2
|
+
import z from 'zod/v4';
|
|
3
|
+
import { acceptCallers, CallerEnum } from '../../callers.js';
|
|
4
|
+
import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
|
|
5
|
+
import { COMMENT_WITH_USER_STATE_SCHEMA } from '../../objects/comment.js';
|
|
6
|
+
import { OpenApiTags } from '../../open-api-tags.js';
|
|
7
|
+
import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
|
|
8
|
+
import { buildCommentSearchPaginationSchema, COMMENT_SEARCH_FILTERS_SCHEMA, COMMENT_SEARCH_PATH_PARAMS_SCHEMA, } from './comment-search-common.js';
|
|
9
|
+
import { COMMENT_SEARCH_CURSOR_SCHEMA } from './post-comments-actions-search.js';
|
|
10
|
+
export const COMMENT_GROUPED_SEARCH_CURSOR_SCHEMA = COMMENT_SEARCH_CURSOR_SCHEMA.extend({
|
|
11
|
+
groupActivityAt: z.iso.datetime(),
|
|
12
|
+
groupKey: z.guid(),
|
|
13
|
+
});
|
|
14
|
+
export const POST_SEARCH_GROUPED_COMMENTS_QUERY_SCHEMA = z.compile(buildCommentSearchPaginationSchema(COMMENT_GROUPED_SEARCH_CURSOR_SCHEMA));
|
|
15
|
+
export const CommentGroupByEnum = {
|
|
16
|
+
ENTITY: 'ENTITY',
|
|
17
|
+
};
|
|
18
|
+
const POST_SEARCH_GROUPED_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(COMMENT_SEARCH_FILTERS_SCHEMA.extend({
|
|
19
|
+
groupBy: z
|
|
20
|
+
.enum(CommentGroupByEnum)
|
|
21
|
+
.describe('What the threads are grouped by. `ENTITY`: the commented entity'),
|
|
22
|
+
}));
|
|
23
|
+
export const COMMENT_GROUP_KEY_SCHEMA = z
|
|
24
|
+
.object({
|
|
25
|
+
entityId: z.guid().describe('Id of the commented entity'),
|
|
26
|
+
})
|
|
27
|
+
.describe('Fields that identify the group');
|
|
28
|
+
export const COMMENTS_GROUP_SCHEMA = z
|
|
29
|
+
.object({
|
|
30
|
+
key: COMMENT_GROUP_KEY_SCHEMA,
|
|
31
|
+
total: z.int().nonnegative().describe('Threads of the group matching the filters'),
|
|
32
|
+
unread: z
|
|
33
|
+
.int()
|
|
34
|
+
.nonnegative()
|
|
35
|
+
.describe('Open threads of the group matching the filters and unread for the user'),
|
|
36
|
+
comments: z
|
|
37
|
+
.array(COMMENT_WITH_USER_STATE_SCHEMA)
|
|
38
|
+
.describe('Threads of the group on this page, newest first. A group can continue on the next page'),
|
|
39
|
+
})
|
|
40
|
+
.describe('A group of threads');
|
|
41
|
+
const POST_SEARCH_GROUPED_COMMENTS_RESPONSE_BODY_SCHEMA = z.compile(z.object({
|
|
42
|
+
data: z.array(COMMENTS_GROUP_SCHEMA).describe('Groups in group order'),
|
|
43
|
+
meta: z.object({
|
|
44
|
+
count: z.int().nonnegative().describe('Threads on the page, across all groups'),
|
|
45
|
+
cursor: z
|
|
46
|
+
.string()
|
|
47
|
+
.optional()
|
|
48
|
+
.describe('Opaque cursor for the next page in the direction of the request'),
|
|
49
|
+
hasMore: z
|
|
50
|
+
.boolean()
|
|
51
|
+
.describe('Whether there are more threads in the direction of the request'),
|
|
52
|
+
}),
|
|
53
|
+
}));
|
|
54
|
+
export const postSearchGroupedCommentsContract = defineApiContract({
|
|
55
|
+
method: 'post',
|
|
56
|
+
visibility: 'internal',
|
|
57
|
+
metadata: acceptCallers(CallerEnum.USER),
|
|
58
|
+
summary: 'Search comments grouped',
|
|
59
|
+
description: "Lists the project's threads matching the filters, grouped, one page at a time. " +
|
|
60
|
+
'Groups are ordered by their newest matching activity, threads in a group newest first. ' +
|
|
61
|
+
'`limit` counts threads, so a group can be cut at a page end and continue on the next page. ' +
|
|
62
|
+
"Each group's `total` and `unread` cover the whole group.",
|
|
63
|
+
tags: [OpenApiTags.Comments.name],
|
|
64
|
+
requestHeaderSchema: AUTH_HEADERS,
|
|
65
|
+
requestPathParamsSchema: COMMENT_SEARCH_PATH_PARAMS_SCHEMA,
|
|
66
|
+
requestQuerySchema: POST_SEARCH_GROUPED_COMMENTS_QUERY_SCHEMA,
|
|
67
|
+
requestBodySchema: POST_SEARCH_GROUPED_COMMENTS_REQUEST_BODY_SCHEMA,
|
|
68
|
+
pathResolver: ({ teamId }) => `/v1/teams/${teamId}/comments/actions/search-grouped`,
|
|
69
|
+
responsesByStatusCode: {
|
|
70
|
+
200: POST_SEARCH_GROUPED_COMMENTS_RESPONSE_BODY_SCHEMA,
|
|
71
|
+
400: ERROR_RESPONSE_SCHEMA,
|
|
72
|
+
401: ERROR_RESPONSE_SCHEMA,
|
|
73
|
+
403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
|
|
74
|
+
404: resourceNotFoundErrorDefinition.schema,
|
|
75
|
+
500: ERROR_RESPONSE_SCHEMA,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
//# sourceMappingURL=post-comments-actions-search-grouped.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post-comments-actions-search-grouped.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search-grouped.ts"],"names":[],"mappings":"AAAA,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,EAC/B,gCAAgC,GACjC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EACL,kCAAkC,EAClC,6BAA6B,EAC7B,iCAAiC,GAElC,MAAM,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