@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.
Files changed (65) hide show
  1. package/dist/api/callers.d.ts +48 -0
  2. package/dist/api/callers.js +28 -0
  3. package/dist/api/callers.js.map +1 -0
  4. package/dist/api/contracts/comments/comment-search-common.d.ts +27 -0
  5. package/dist/api/contracts/comments/comment-search-common.js +55 -0
  6. package/dist/api/contracts/comments/comment-search-common.js.map +1 -0
  7. package/dist/api/contracts/comments/delete-comment-reply.d.ts +5 -0
  8. package/dist/api/contracts/comments/delete-comment-reply.js +4 -1
  9. package/dist/api/contracts/comments/delete-comment-reply.js.map +1 -1
  10. package/dist/api/contracts/comments/delete-comment.d.ts +5 -0
  11. package/dist/api/contracts/comments/delete-comment.js +4 -1
  12. package/dist/api/contracts/comments/delete-comment.js.map +1 -1
  13. package/dist/api/contracts/comments/get-comment-replies.d.ts +1 -0
  14. package/dist/api/contracts/comments/get-comment-replies.js +2 -0
  15. package/dist/api/contracts/comments/get-comment-replies.js.map +1 -1
  16. package/dist/api/contracts/comments/get-comment.d.ts +1 -0
  17. package/dist/api/contracts/comments/get-comment.js +2 -0
  18. package/dist/api/contracts/comments/get-comment.js.map +1 -1
  19. package/dist/api/contracts/comments/get-comments.d.ts +1 -0
  20. package/dist/api/contracts/comments/get-comments.js +2 -0
  21. package/dist/api/contracts/comments/get-comments.js.map +1 -1
  22. package/dist/api/contracts/comments/patch-comment-reply.d.ts +5 -0
  23. package/dist/api/contracts/comments/patch-comment-reply.js +4 -1
  24. package/dist/api/contracts/comments/patch-comment-reply.js.map +1 -1
  25. package/dist/api/contracts/comments/patch-comment.d.ts +5 -0
  26. package/dist/api/contracts/comments/patch-comment.js +4 -1
  27. package/dist/api/contracts/comments/patch-comment.js.map +1 -1
  28. package/dist/api/contracts/comments/post-comment-reply.d.ts +7 -2
  29. package/dist/api/contracts/comments/post-comment-reply.js +4 -2
  30. package/dist/api/contracts/comments/post-comment-reply.js.map +1 -1
  31. package/dist/api/contracts/comments/post-comment.d.ts +7 -2
  32. package/dist/api/contracts/comments/post-comment.js +4 -2
  33. package/dist/api/contracts/comments/post-comment.js.map +1 -1
  34. package/dist/api/contracts/comments/post-comments-actions-count.d.ts +97 -0
  35. package/dist/api/contracts/comments/post-comments-actions-count.js +37 -0
  36. package/dist/api/contracts/comments/post-comments-actions-count.js.map +1 -0
  37. package/dist/api/contracts/comments/post-comments-actions-search-grouped.d.ts +295 -0
  38. package/dist/api/contracts/comments/post-comments-actions-search-grouped.js +78 -0
  39. package/dist/api/contracts/comments/post-comments-actions-search-grouped.js.map +1 -0
  40. package/dist/api/contracts/comments/post-comments-actions-search.d.ts +51 -12
  41. package/dist/api/contracts/comments/post-comments-actions-search.js +16 -41
  42. package/dist/api/contracts/comments/post-comments-actions-search.js.map +1 -1
  43. package/dist/api/contracts/comments/put-comment-read-state.d.ts +7 -2
  44. package/dist/api/contracts/comments/put-comment-read-state.js +4 -2
  45. package/dist/api/contracts/comments/put-comment-read-state.js.map +1 -1
  46. package/dist/api/contracts/comments/put-comment-subscription.d.ts +7 -2
  47. package/dist/api/contracts/comments/put-comment-subscription.js +4 -2
  48. package/dist/api/contracts/comments/put-comment-subscription.js.map +1 -1
  49. package/dist/api/contracts/common.js +3 -1
  50. package/dist/api/contracts/common.js.map +1 -1
  51. package/dist/api/contracts/index.d.ts +3 -0
  52. package/dist/api/contracts/index.js +3 -0
  53. package/dist/api/contracts/index.js.map +1 -1
  54. package/dist/api/errors/index.d.ts +1 -0
  55. package/dist/api/errors/index.js +1 -0
  56. package/dist/api/errors/index.js.map +1 -1
  57. package/dist/api/errors/user-token-required.d.ts +10 -0
  58. package/dist/api/errors/user-token-required.js +7 -0
  59. package/dist/api/errors/user-token-required.js.map +1 -0
  60. package/dist/api/objects/comment.js +6 -2
  61. package/dist/api/objects/comment.js.map +1 -1
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.js +1 -0
  64. package/dist/index.js.map +1 -1
  65. package/package.json +4 -3
@@ -1,21 +1,40 @@
1
1
  import z from 'zod/v4';
2
- declare const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA: z.ZodObject<{
3
- teamId: z.ZodGUID;
2
+ import { type CommentSearchPathParams } from './comment-search-common.ts';
3
+ export type PostSearchCommentsPathParams = CommentSearchPathParams;
4
+ export declare const COMMENT_SEARCH_CURSOR_SCHEMA: z.ZodObject<{
5
+ lastActivityAt: z.ZodISODateTime;
6
+ id: z.ZodGUID;
4
7
  }, z.core.$strip>;
5
- export type PostSearchCommentsPathParams = z.infer<typeof POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA>;
8
+ export type CommentSearchCursor = z.infer<typeof COMMENT_SEARCH_CURSOR_SCHEMA>;
6
9
  export declare const POST_SEARCH_COMMENTS_QUERY_SCHEMA: z.ZodObject<{
10
+ before: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
11
+ lastActivityAt: z.ZodISODateTime;
12
+ id: z.ZodGUID;
13
+ }, z.core.$strip>>>>;
14
+ after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
15
+ lastActivityAt: z.ZodISODateTime;
16
+ id: z.ZodGUID;
17
+ }, z.core.$strip>>>>;
7
18
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
8
- after: z.ZodOptional<z.ZodGUID>;
9
19
  }, z.core.$strip>;
10
20
  export type PostSearchCommentsQuery = z.infer<typeof POST_SEARCH_COMMENTS_QUERY_SCHEMA>;
21
+ export type PostSearchCommentsQueryInput = z.input<typeof POST_SEARCH_COMMENTS_QUERY_SCHEMA>;
11
22
  declare const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA: z.ZodObject<{
12
23
  projectId: z.ZodGUID;
13
- entityTypes: z.ZodArray<z.ZodEnum<{
24
+ entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
14
25
  readonly SEGMENT: 'SEGMENT';
15
- }>>;
26
+ }>>>;
16
27
  entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
28
+ unreadOnly: z.ZodOptional<z.ZodBoolean>;
29
+ mentionsMe: z.ZodOptional<z.ZodBoolean>;
30
+ createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
31
+ locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
+ status: z.ZodOptional<z.ZodEnum<{
33
+ readonly OPEN: 'OPEN';
34
+ readonly RESOLVED: 'RESOLVED';
35
+ }>>;
17
36
  }, z.core.$strip>;
18
- export type PostSearchCommentsRequestBody = z.infer<typeof POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA>;
37
+ export type PostSearchCommentsRequestBody = z.input<typeof POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA>;
19
38
  declare const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA: z.ZodObject<{
20
39
  data: z.ZodArray<z.ZodObject<{
21
40
  id: z.ZodGUID;
@@ -66,6 +85,7 @@ export type PostSearchCommentsResponseBody = z.infer<typeof POST_SEARCH_COMMENTS
66
85
  export declare const postSearchCommentsContract: Omit<{
67
86
  readonly method: "post";
68
87
  readonly visibility: "internal";
88
+ readonly metadata: import("../../callers.ts").CallerMetadata;
69
89
  readonly summary: "Search comments";
70
90
  readonly description: string;
71
91
  readonly tags: readonly ["Comments"];
@@ -76,15 +96,30 @@ export declare const postSearchCommentsContract: Omit<{
76
96
  teamId: z.ZodGUID;
77
97
  }, z.core.$strip>;
78
98
  readonly requestQuerySchema: z.ZodObject<{
99
+ before: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
100
+ lastActivityAt: z.ZodISODateTime;
101
+ id: z.ZodGUID;
102
+ }, z.core.$strip>>>>;
103
+ after: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<Record<string, unknown> | undefined, string>>, z.ZodOptional<z.ZodObject<{
104
+ lastActivityAt: z.ZodISODateTime;
105
+ id: z.ZodGUID;
106
+ }, z.core.$strip>>>>;
79
107
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
80
- after: z.ZodOptional<z.ZodGUID>;
81
108
  }, z.core.$strip>;
82
109
  readonly requestBodySchema: z.ZodObject<{
83
110
  projectId: z.ZodGUID;
84
- entityTypes: z.ZodArray<z.ZodEnum<{
111
+ entityTypes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
85
112
  readonly SEGMENT: 'SEGMENT';
86
- }>>;
113
+ }>>>;
87
114
  entityIds: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
115
+ unreadOnly: z.ZodOptional<z.ZodBoolean>;
116
+ mentionsMe: z.ZodOptional<z.ZodBoolean>;
117
+ createdBy: z.ZodOptional<z.ZodArray<z.ZodGUID>>;
118
+ locales: z.ZodOptional<z.ZodArray<z.ZodString>>;
119
+ status: z.ZodOptional<z.ZodEnum<{
120
+ readonly OPEN: 'OPEN';
121
+ readonly RESOLVED: 'RESOLVED';
122
+ }>>;
88
123
  }, z.core.$strip>;
89
124
  readonly pathResolver: ({ teamId }: {
90
125
  teamId: string;
@@ -148,11 +183,15 @@ export declare const postSearchCommentsContract: Omit<{
148
183
  errorCode: z.ZodString;
149
184
  details: z.ZodOptional<z.ZodUnknown>;
150
185
  }, z.core.$strip>;
151
- 403: z.ZodObject<{
186
+ 403: z.ZodUnion<readonly [z.ZodObject<{
152
187
  message: z.ZodString;
153
188
  code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
154
189
  errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
155
- }, z.core.$strip>;
190
+ }, z.core.$strip>, z.ZodObject<{
191
+ message: z.ZodString;
192
+ code: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
193
+ errorCode: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
194
+ }, z.core.$strip>]>;
156
195
  404: z.ZodObject<{
157
196
  message: z.ZodString;
158
197
  code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
@@ -1,55 +1,30 @@
1
1
  import { paginatedResponseSchema } from '@lokalise/api-common';
2
2
  import { defineApiContract } from '@lokalise/api-contracts';
3
3
  import z from 'zod/v4';
4
- import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
5
- import { COMMENT_WITH_USER_STATE_SCHEMA, CommentEntityTypeEnum } from '../../objects/comment.js';
4
+ import { acceptCallers, CallerEnum } from '../../callers.js';
5
+ import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
6
+ import { COMMENT_WITH_USER_STATE_SCHEMA } from '../../objects/comment.js';
6
7
  import { OpenApiTags } from '../../open-api-tags.js';
7
8
  import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
8
- // ------------------------------------------------------------
9
- // POST /v1/teams/:teamId/comments/actions/search
10
- // ------------------------------------------------------------
11
- const POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA = z.compile(z.object({
12
- teamId: z.guid().describe('Id of the team'),
13
- }));
14
- const COMMENTS_DEFAULT_LIMIT = 100;
15
- const COMMENTS_MAX_LIMIT = 100;
16
- export const POST_SEARCH_COMMENTS_QUERY_SCHEMA = z.compile(z.object({
17
- limit: z.coerce
18
- .number()
19
- .int()
20
- .min(1)
21
- .max(COMMENTS_MAX_LIMIT)
22
- .default(COMMENTS_DEFAULT_LIMIT)
23
- .describe('Number of comments 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 COMMENTS_MAX_FILTER_IDS = 100;
30
- const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(z.object({
31
- projectId: z.guid().describe('Only comments for this project'),
32
- entityTypes: z
33
- .array(z.enum(CommentEntityTypeEnum))
34
- .min(1)
35
- .describe('Types of the commented entities'),
36
- entityIds: z
37
- .array(z.guid())
38
- .min(1)
39
- .max(COMMENTS_MAX_FILTER_IDS)
40
- .optional()
41
- .describe('Ids of the commented entities'),
42
- }));
9
+ import { buildCommentSearchPaginationSchema, COMMENT_SEARCH_FILTERS_SCHEMA, COMMENT_SEARCH_PATH_PARAMS_SCHEMA, } from './comment-search-common.js';
10
+ export const COMMENT_SEARCH_CURSOR_SCHEMA = z.object({
11
+ lastActivityAt: z.iso.datetime(),
12
+ id: z.guid(),
13
+ });
14
+ export const POST_SEARCH_COMMENTS_QUERY_SCHEMA = z.compile(buildCommentSearchPaginationSchema(COMMENT_SEARCH_CURSOR_SCHEMA));
15
+ const POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA = z.compile(COMMENT_SEARCH_FILTERS_SCHEMA);
43
16
  const POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA = paginatedResponseSchema(COMMENT_WITH_USER_STATE_SCHEMA);
44
17
  export const postSearchCommentsContract = defineApiContract({
45
18
  method: 'post',
46
19
  visibility: 'internal',
20
+ metadata: acceptCallers(CallerEnum.USER),
47
21
  summary: 'Search comments',
48
- description: 'Lists the root comments of the threads on the given entities, oldest first, one page at a time. ' +
49
- 'Pass `meta.cursor` from a response as `after` to read the next page.',
22
+ description: "Lists the project's threads (root comments) matching the filters one page at a time, newest " +
23
+ 'activity first. Pass `meta.cursor` back as `after` after an `after` request (or a first ' +
24
+ 'page), and as `before` after a `before` request.',
50
25
  tags: [OpenApiTags.Comments.name],
51
26
  requestHeaderSchema: AUTH_HEADERS,
52
- requestPathParamsSchema: POST_SEARCH_COMMENTS_PATH_PARAMS_SCHEMA,
27
+ requestPathParamsSchema: COMMENT_SEARCH_PATH_PARAMS_SCHEMA,
53
28
  requestQuerySchema: POST_SEARCH_COMMENTS_QUERY_SCHEMA,
54
29
  requestBodySchema: POST_SEARCH_COMMENTS_REQUEST_BODY_SCHEMA,
55
30
  pathResolver: ({ teamId }) => `/v1/teams/${teamId}/comments/actions/search`,
@@ -57,7 +32,7 @@ export const postSearchCommentsContract = defineApiContract({
57
32
  200: POST_SEARCH_COMMENTS_RESPONSE_BODY_SCHEMA,
58
33
  400: ERROR_RESPONSE_SCHEMA,
59
34
  401: ERROR_RESPONSE_SCHEMA,
60
- 403: teamAccessDeniedErrorDefinition.schema,
35
+ 403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
61
36
  404: resourceNotFoundErrorDefinition.schema,
62
37
  500: ERROR_RESPONSE_SCHEMA,
63
38
  },
@@ -1 +1 @@
1
- {"version":3,"file":"post-comments-actions-search.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,iDAAiD;AACjD,+DAA+D;AAC/D,MAAM,uCAAuC,GAAG,CAAC,CAAC,OAAO,CACvD,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;CAC5C,CAAC,CACH,CAAA;AAGD,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAClC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,CAAC,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B,EAAE,YAAY;IACjC,uBAAuB,EAAE,uCAAuC;IAChE,kBAAkB,EAAE,iCAAiC;IACrD,iBAAiB,EAAE,wCAAwC;IAC3D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,0BAA0B;IAC3E,qBAAqB,EAAE;QACrB,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"post-comments-actions-search.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/post-comments-actions-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,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,4BAA4B,CAAA;AAOnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,cAAc,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAChC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;CACb,CAAC,CAAA;AAGF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,OAAO,CACxD,kCAAkC,CAAC,4BAA4B,CAAC,CACjE,CAAA;AAID,MAAM,wCAAwC,GAAG,CAAC,CAAC,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAGzF,MAAM,yCAAyC,GAAG,uBAAuB,CACvE,8BAA8B,CAC/B,CAAA;AAKD,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC;IACxC,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,8FAA8F;QAC9F,0FAA0F;QAC1F,kDAAkD;IACpD,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,iCAAiC;IAC1D,kBAAkB,EAAE,iCAAiC;IACrD,iBAAiB,EAAE,wCAAwC;IAC3D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,0BAA0B;IAC3E,qBAAqB,EAAE;QACrB,GAAG,EAAE,yCAAyC;QAC9C,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,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"}
@@ -11,6 +11,7 @@ export type PutCommentReadStateRequestBody = z.infer<typeof PUT_COMMENT_READ_STA
11
11
  export declare const putCommentReadStateContract: Omit<{
12
12
  readonly method: "put";
13
13
  readonly visibility: "internal";
14
+ readonly metadata: import("../../callers.ts").CallerMetadata;
14
15
  readonly summary: "Mark a comment thread as read or unread";
15
16
  readonly description: string;
16
17
  readonly tags: readonly ["Comments"];
@@ -42,11 +43,15 @@ export declare const putCommentReadStateContract: Omit<{
42
43
  errorCode: z.ZodString;
43
44
  details: z.ZodOptional<z.ZodUnknown>;
44
45
  }, z.core.$strip>;
45
- 403: z.ZodObject<{
46
+ 403: z.ZodUnion<readonly [z.ZodObject<{
46
47
  message: z.ZodString;
47
48
  code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
48
49
  errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
49
- }, z.core.$strip>;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ message: z.ZodString;
52
+ code: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
53
+ errorCode: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
54
+ }, z.core.$strip>]>;
50
55
  404: z.ZodObject<{
51
56
  message: z.ZodString;
52
57
  code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
@@ -1,6 +1,7 @@
1
1
  import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
2
2
  import z from 'zod/v4';
3
- import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
3
+ import { acceptCallers, CallerEnum } from '../../callers.js';
4
+ import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
4
5
  import { OpenApiTags } from '../../open-api-tags.js';
5
6
  import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
6
7
  // ------------------------------------------------------------
@@ -25,6 +26,7 @@ const PUT_COMMENT_READ_STATE_REQUEST_BODY_SCHEMA = z.compile(z
25
26
  export const putCommentReadStateContract = defineApiContract({
26
27
  method: 'put',
27
28
  visibility: 'internal',
29
+ metadata: acceptCallers(CallerEnum.USER),
28
30
  summary: 'Mark a comment thread as read or unread',
29
31
  description: 'Sets until when the requesting user has read the thread of a comment. ' +
30
32
  'Moving `lastReadAt` forward marks newer activity as read; moving it back marks it as unread.',
@@ -37,7 +39,7 @@ export const putCommentReadStateContract = defineApiContract({
37
39
  204: noBodyResponse({ description: 'Read state updated' }),
38
40
  400: ERROR_RESPONSE_SCHEMA,
39
41
  401: ERROR_RESPONSE_SCHEMA,
40
- 403: teamAccessDeniedErrorDefinition.schema,
42
+ 403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
41
43
  404: resourceNotFoundErrorDefinition.schema,
42
44
  500: ERROR_RESPONSE_SCHEMA,
43
45
  },
@@ -1 +1 @@
1
- {"version":3,"file":"put-comment-read-state.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/put-comment-read-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,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,uDAAuD;AACvD,+DAA+D;AAC/D,MAAM,yCAAyC,GAAG,CAAC,CAAC,OAAO,CACzD,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;AAKD,MAAM,0CAA0C,GAAG,CAAC,CAAC,OAAO,CAC1D,CAAC;KACE,MAAM,CAAC;IACN,UAAU,EAAE,CAAC,CAAC,GAAG;SACd,QAAQ,EAAE;SACV,QAAQ,EAAE;SACV,QAAQ,CACP,yEAAyE;QACvE,0DAA0D,CAC7D;CACJ,CAAC;KACD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,EAAE,EAAE;IAC7E,OAAO,EAAE,sCAAsC;IAC/C,IAAI,EAAE,CAAC,YAAY,CAAC;CACrB,CAAC,CACL,CAAA;AAKD,MAAM,CAAC,MAAM,2BAA2B,GAAG,iBAAiB,CAAC;IAC3D,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,UAAU;IACtB,OAAO,EAAE,yCAAyC;IAClD,WAAW,EACT,wEAAwE;QACxE,8FAA8F;IAChG,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,yCAAyC;IAClE,iBAAiB,EAAE,0CAA0C;IAC7D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,aAAa;IAC/F,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;QAC1D,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"put-comment-read-state.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/put-comment-read-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EA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ClE,iBAAiB,EAAE,0CAA0C;IAC7D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,aAAa;IAC/F,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC;QAC1D,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"}
@@ -19,6 +19,7 @@ export type PutCommentSubscriptionRequestBody = z.infer<typeof PUT_COMMENT_SUBSC
19
19
  export declare const putCommentSubscriptionContract: Omit<{
20
20
  readonly method: "put";
21
21
  readonly visibility: "internal";
22
+ readonly metadata: import("../../callers.ts").CallerMetadata;
22
23
  readonly summary: "Subscribe to or unsubscribe from a comment thread";
23
24
  readonly description: string;
24
25
  readonly tags: readonly ["Comments"];
@@ -53,11 +54,15 @@ export declare const putCommentSubscriptionContract: Omit<{
53
54
  errorCode: z.ZodString;
54
55
  details: z.ZodOptional<z.ZodUnknown>;
55
56
  }, z.core.$strip>;
56
- 403: z.ZodObject<{
57
+ 403: z.ZodUnion<readonly [z.ZodObject<{
57
58
  message: z.ZodString;
58
59
  code: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
59
60
  errorCode: z.ZodLiteral<"TEAM_ACCESS_DENIED">;
60
- }, z.core.$strip>;
61
+ }, z.core.$strip>, z.ZodObject<{
62
+ message: z.ZodString;
63
+ code: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
64
+ errorCode: z.ZodLiteral<"USER_TOKEN_REQUIRED">;
65
+ }, z.core.$strip>]>;
61
66
  404: z.ZodObject<{
62
67
  message: z.ZodString;
63
68
  code: z.ZodLiteral<"RESOURCE_NOT_FOUND">;
@@ -1,6 +1,7 @@
1
1
  import { defineApiContract, noBodyResponse } from '@lokalise/api-contracts';
2
2
  import z from 'zod/v4';
3
- import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, } from '../../errors/index.js';
3
+ import { acceptCallers, CallerEnum } from '../../callers.js';
4
+ import { resourceNotFoundErrorDefinition, teamAccessDeniedErrorDefinition, userTokenRequiredErrorDefinition, } from '../../errors/index.js';
4
5
  import { OpenApiTags } from '../../open-api-tags.js';
5
6
  import { AUTH_HEADERS, ERROR_RESPONSE_SCHEMA } from '../common.js';
6
7
  // ------------------------------------------------------------
@@ -22,6 +23,7 @@ const PUT_COMMENT_SUBSCRIPTION_REQUEST_BODY_SCHEMA = z.compile(z.object({
22
23
  export const putCommentSubscriptionContract = defineApiContract({
23
24
  method: 'put',
24
25
  visibility: 'internal',
26
+ metadata: acceptCallers(CallerEnum.USER),
25
27
  summary: 'Subscribe to or unsubscribe from a comment thread',
26
28
  description: 'Subscribes the requesting user to the thread of a comment, so they are notified of its changes, ' +
27
29
  'or unsubscribes them so they are no longer notified. ' +
@@ -35,7 +37,7 @@ export const putCommentSubscriptionContract = defineApiContract({
35
37
  204: noBodyResponse({ description: 'Subscription updated' }),
36
38
  400: ERROR_RESPONSE_SCHEMA,
37
39
  401: ERROR_RESPONSE_SCHEMA,
38
- 403: teamAccessDeniedErrorDefinition.schema,
40
+ 403: z.union([teamAccessDeniedErrorDefinition.schema, userTokenRequiredErrorDefinition.schema]),
39
41
  404: resourceNotFoundErrorDefinition.schema,
40
42
  500: ERROR_RESPONSE_SCHEMA,
41
43
  },
@@ -1 +1 @@
1
- {"version":3,"file":"put-comment-subscription.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/put-comment-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,CAAC,MAAM,Q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rB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;QAC5D,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,qBAAqB;QAC1B,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,+BAA+B,CAAC,MAAM;QAC3C,GAAG,EAAE,qBAAqB;KAC3B;CACF,CAAC,CAAA"}
1
+ {"version":3,"file":"put-comment-subscription.js","sourceRoot":"","sources":["../../../../src/api/contracts/comments/put-comment-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC3E,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,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,+DAA+D;AAC/D,yDAAyD;AACzD,+DAA+D;AAE/D,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;CAClB,CAAA;AAIV,MAAM,2CAA2C,GAAG,CAAC,CAAC,OAAO,CAC3D,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;AAKD,MAAM,4CAA4C,GAAG,CAAC,CAAC,OAAO,CAC5D,CAAC,CAAC,MAAM,CAAC;IACP,MAAM,EAAE,CAAC;SACN,IAAI,CAAC,6BAA6B,CAAC;SACnC,QAAQ,CAAC,wDAAwD,CAAC;CACtE,CAAC,CACH,CAAA;AAKD,MAAM,CAAC,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC9D,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC;IACxC,OAAO,EAAE,mDAAmD;IAC5D,WAAW,EACT,kGAAkG;QAClG,uDAAuD;QACvD,2FAA2F;IAC7F,IAAI,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;IACjC,mBAAmB,EAAE,YAAY;IACjC,uBAAuB,EAAE,2CAA2C;IACpE,iBAAiB,EAAE,4CAA4C;IAC/D,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,aAAa,MAAM,aAAa,SAAS,eAAe;IACjG,qBAAqB,EAAE;QACrB,GAAG,EAAE,cAAc,CAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;QAC5D,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"}
@@ -1,6 +1,8 @@
1
1
  import z from 'zod/v4';
2
2
  export const AUTH_HEADERS = z.compile(z.object({
3
- authorization: z.string().describe('Bearer token authorizing the request'),
3
+ authorization: z
4
+ .string()
5
+ .describe('Bearer token authorizing the request: an Expert user or service-to-service token'),
4
6
  }));
5
7
  export const ERROR_RESPONSE_SCHEMA = z.compile(z.object({
6
8
  message: z.string().describe('Human-readable error message'),
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/api/contracts/common.ts"],"names":[],"mappings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C,QAAQ,CAAC,sDAAsD,CAAC;IACtF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;CAC9E,CAAC,CACH,CAAA"}
@@ -1,3 +1,4 @@
1
+ export * from './comments/comment-search-common.ts';
1
2
  export * from './comments/delete-comment.ts';
2
3
  export * from './comments/delete-comment-reply.ts';
3
4
  export * from './comments/get-comment.ts';
@@ -7,6 +8,8 @@ export * from './comments/patch-comment.ts';
7
8
  export * from './comments/patch-comment-reply.ts';
8
9
  export * from './comments/post-comment.ts';
9
10
  export * from './comments/post-comment-reply.ts';
11
+ export * from './comments/post-comments-actions-count.ts';
10
12
  export * from './comments/post-comments-actions-search.ts';
13
+ export * from './comments/post-comments-actions-search-grouped.ts';
11
14
  export * from './comments/put-comment-read-state.ts';
12
15
  export * from './comments/put-comment-subscription.ts';
@@ -1,3 +1,4 @@
1
+ export * from './comments/comment-search-common.js';
1
2
  export * from './comments/delete-comment.js';
2
3
  export * from './comments/delete-comment-reply.js';
3
4
  export * from './comments/get-comment.js';
@@ -7,7 +8,9 @@ export * from './comments/patch-comment.js';
7
8
  export * from './comments/patch-comment-reply.js';
8
9
  export * from './comments/post-comment.js';
9
10
  export * from './comments/post-comment-reply.js';
11
+ export * from './comments/post-comments-actions-count.js';
10
12
  export * from './comments/post-comments-actions-search.js';
13
+ export * from './comments/post-comments-actions-search-grouped.js';
11
14
  export * from './comments/put-comment-read-state.js';
12
15
  export * from './comments/put-comment-subscription.js';
13
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAClD,cAAc,2BAA2B,CAAA;AACzC,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mCAAmC,CAAA;AACjD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,kCAAkC,CAAA;AAChD,cAAc,4CAA4C,CAAA;AAC1D,cAAc,sCAAsC,CAAA;AACpD,cAAc,wCAAwC,CAAA"}
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,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"}
@@ -3,3 +3,4 @@ export * from './comment-delete-permission-required.ts';
3
3
  export * from './mentioned-user-access-denied.ts';
4
4
  export * from './resource-not-found.ts';
5
5
  export * from './team-access-denied.ts';
6
+ export * from './user-token-required.ts';
@@ -3,4 +3,5 @@ export * from './comment-delete-permission-required.js';
3
3
  export * from './mentioned-user-access-denied.js';
4
4
  export * from './resource-not-found.js';
5
5
  export * from './team-access-denied.js';
6
+ export * from './user-token-required.js';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,mCAAmC,CAAA;AACjD,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,yCAAyC,CAAA;AACvD,cAAc,mCAAmC,CAAA;AACjD,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,0BAA0B,CAAA"}
@@ -0,0 +1,10 @@
1
+ export declare const userTokenRequiredErrorDefinition: {
2
+ readonly code: "USER_TOKEN_REQUIRED";
3
+ readonly type: "permission-denied";
4
+ } & {
5
+ schema: import("zod").ZodObject<{
6
+ message: import("zod").ZodString;
7
+ code: import("zod").ZodLiteral<"USER_TOKEN_REQUIRED">;
8
+ errorCode: import("zod").ZodLiteral<"USER_TOKEN_REQUIRED">;
9
+ }, import("zod/v4/core").$strip>;
10
+ };
@@ -0,0 +1,7 @@
1
+ import { definePublicError, ErrorType } from '@lokalise/errors';
2
+ // The token is valid, but the endpoint acts on behalf of a person and a service token names none
3
+ export const userTokenRequiredErrorDefinition = definePublicError({
4
+ code: 'USER_TOKEN_REQUIRED',
5
+ type: ErrorType.PERMISSION_DENIED,
6
+ });
7
+ //# sourceMappingURL=user-token-required.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-token-required.js","sourceRoot":"","sources":["../../../src/api/errors/user-token-required.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE/D,iGAAiG;AACjG,MAAM,CAAC,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAChE,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,SAAS,CAAC,iBAAiB;CAClC,CAAC,CAAA"}
@@ -39,7 +39,11 @@ export const COMMENT_WITH_USER_STATE_SCHEMA = z.compile(BASE_COMMENT_SCHEMA.exte
39
39
  lastReadAt: z.iso
40
40
  .datetime()
41
41
  .nullish()
42
- .describe('Read watermark of the requesting user: thread activity after this time is unread. `null` if never read'),
43
- subscribed: z.boolean().describe('Whether the requesting user is subscribed to the thread'),
42
+ .describe('Read watermark of the requesting user: thread activity after this time is unread. ' +
43
+ '`null` if never read, and always `null` for a service token, which names no user'),
44
+ subscribed: z
45
+ .boolean()
46
+ .describe('Whether the requesting user is subscribed to the thread. ' +
47
+ 'Always `false` for a service token, which names no user'),
44
48
  }).describe('Root comment of a thread, with the read state and subscription of the requesting user'));
45
49
  //# sourceMappingURL=comment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../src/api/objects/comment.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,OAAO,EAAE,SAAS;CACV,CAAA;AAGV,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACZ,CAAA;AAGV,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,oDAAoD,CAAC;IAC3E,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACjE,SAAS,EAAE,CAAC;SACT,IAAI,EAAE;SACN,OAAO,EAAE;SACT,QAAQ,CAAC,kFAAkF,CAAC;IAC/F,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,8BAA8B,CAAC;IAClF,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;IACrF,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAClE,OAAO,EAAE,cAAc;IACvB,gBAAgB,EAAE,CAAC,CAAC,GAAG;SACpB,QAAQ,EAAE;SACV,OAAO,EAAE;SACT,QAAQ,CAAC,kEAAk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AC,kBAAkB,CAAC;IAChD,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,eAAe,CAAC;CACtD,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,CAAA;AAGjG,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,OAAO,CACrD,mBAAmB,CAAC,MAAM,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC,GAAG;SACd,QAAQ,EAAE;SACV,OAAO,EAAE;SACT,QAAQ,CACP,oFAAoF;QAClF,kFAAkF,CACrF;IACH,UAAU,EAAE,CAAC;SACV,OAAO,EAAE;SACT,QAAQ,CACP,2DAA2D;QACzD,yDAAyD,CAC5D;CACJ,CAAC,CAAC,QAAQ,CACT,uFAAuF,CACxF,CACF,CAAA"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './api/callers.ts';
1
2
  export * from './api/contracts/index.ts';
2
3
  export * from './api/errors/index.ts';
3
4
  export * from './api/objects/index.ts';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './api/callers.js';
1
2
  export * from './api/contracts/index.js';
2
3
  export * from './api/errors/index.js';
3
4
  export * from './api/objects/index.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/chatter-api-contracts",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "API contracts for chatter",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -29,12 +29,13 @@
29
29
  "devDependencies": {
30
30
  "@lokalise/api-common": "^7.1.1",
31
31
  "@lokalise/api-contracts": "^9.0.1",
32
+ "@lokalise/biome-config": "^5.0.0",
32
33
  "@lokalise/errors": "^2.2.0",
33
34
  "@lokalise/tsconfig": "^5.0.0",
34
35
  "@lokalise/zod-extras": "^3.0.2",
35
- "@types/node": "^26.6.5",
36
+ "@types/node": "^26.6.10",
36
37
  "typescript": "7.0.2",
37
- "vitest": "^5.0.4",
38
+ "vitest": "^5.1.2",
38
39
  "zod": "^4.6.7"
39
40
  },
40
41
  "scripts": {