@lokalise/chatter-api-contracts 0.1.7 → 0.1.9

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 (38) hide show
  1. package/dist/api/contracts/comments/delete-comment-reply.d.ts +6 -6
  2. package/dist/api/contracts/comments/delete-comment-reply.js +3 -3
  3. package/dist/api/contracts/comments/delete-comment.d.ts +4 -4
  4. package/dist/api/contracts/comments/delete-comment.js +2 -2
  5. package/dist/api/contracts/comments/get-comment-replies.d.ts +65 -15
  6. package/dist/api/contracts/comments/get-comment-replies.js +6 -5
  7. package/dist/api/contracts/comments/get-comment-replies.js.map +1 -1
  8. package/dist/api/contracts/comments/get-comment.d.ts +18 -18
  9. package/dist/api/contracts/comments/get-comment.js +4 -4
  10. package/dist/api/contracts/comments/get-comment.js.map +1 -1
  11. package/dist/api/contracts/comments/get-comments.d.ts +81 -5
  12. package/dist/api/contracts/comments/get-comments.js +6 -5
  13. package/dist/api/contracts/comments/get-comments.js.map +1 -1
  14. package/dist/api/contracts/comments/patch-comment-reply.d.ts +9 -9
  15. package/dist/api/contracts/comments/patch-comment-reply.js +3 -3
  16. package/dist/api/contracts/comments/patch-comment.d.ts +7 -7
  17. package/dist/api/contracts/comments/patch-comment.js +2 -2
  18. package/dist/api/contracts/comments/post-comment-reply.d.ts +9 -9
  19. package/dist/api/contracts/comments/post-comment-reply.js +3 -3
  20. package/dist/api/contracts/comments/post-comment.d.ts +9 -9
  21. package/dist/api/contracts/comments/post-comment.js +3 -3
  22. package/dist/api/contracts/comments/post-comments-actions-search.d.ts +20 -20
  23. package/dist/api/contracts/comments/post-comments-actions-search.js +5 -5
  24. package/dist/api/contracts/comments/post-comments-actions-search.js.map +1 -1
  25. package/dist/api/contracts/comments/put-comment-read-state.d.ts +4 -4
  26. package/dist/api/contracts/comments/put-comment-read-state.js +2 -2
  27. package/dist/api/contracts/comments/put-comment-subscription.d.ts +4 -4
  28. package/dist/api/contracts/comments/put-comment-subscription.js +2 -2
  29. package/dist/api/errors/mentioned-user-access-denied.d.ts +2 -2
  30. package/dist/api/errors/mentioned-user-access-denied.js +1 -1
  31. package/dist/api/objects/comment-reply.d.ts +4 -4
  32. package/dist/api/objects/comment-reply.js +3 -3
  33. package/dist/api/objects/comment.d.ts +46 -8
  34. package/dist/api/objects/comment.js +12 -14
  35. package/dist/api/objects/comment.js.map +1 -1
  36. package/dist/api/objects/message.d.ts +3 -3
  37. package/dist/api/objects/message.js +1 -1
  38. package/package.json +1 -1
@@ -7,12 +7,11 @@ export const CommentStatusEnum = {
7
7
  OPEN: 'OPEN',
8
8
  RESOLVED: 'RESOLVED',
9
9
  };
10
- export const COMMENT_SCHEMA = z.compile(z
11
- .object({
12
- id: z.uuid().describe('Id of the comment. It is also the id of the thread'),
13
- teamId: z.uuid().describe('Id of the team that owns the comment'),
10
+ const BASE_COMMENT_SCHEMA = z.object({
11
+ id: z.guid().describe('Id of the comment. It is also the id of the thread'),
12
+ teamId: z.guid().describe('Id of the team that owns the comment'),
14
13
  projectId: z
15
- .uuid()
14
+ .guid()
16
15
  .nullish()
17
16
  .describe('Id of the project of the commented entity. `null` for entities without a project'),
18
17
  entityType: z.enum(CommentEntityTypeEnum).describe('Type of the commented entity'),
@@ -24,24 +23,23 @@ export const COMMENT_SCHEMA = z.compile(z
24
23
  .nullish()
25
24
  .describe('Last edit of the message. `null` if the message was never edited'),
26
25
  resolvedBy: z
27
- .uuid()
26
+ .guid()
28
27
  .nullish()
29
28
  .describe('Id of the user who resolved the thread. `null` when open'),
30
- resolvedAt: z.iso
31
- .datetime()
32
- .nullish()
33
- .describe('Time the thread was resolved. `null` when open'),
29
+ resolvedAt: z.iso.datetime().nullish().describe('Time the thread was resolved. `null` when open'),
34
30
  replyCount: z.int().nonnegative().describe('Number of replies in the thread'),
35
31
  lastActivityAt: z.iso
36
32
  .datetime()
37
33
  .describe('Creation time of the newest message in the thread: the newest reply, or the comment when it has no replies'),
34
+ createdBy: z.guid().describe('Id of the author'),
35
+ createdAt: z.iso.datetime().describe('Creation time'),
36
+ });
37
+ export const COMMENT_SCHEMA = z.compile(BASE_COMMENT_SCHEMA.describe('Root comment of a thread'));
38
+ export const COMMENT_WITH_USER_STATE_SCHEMA = z.compile(BASE_COMMENT_SCHEMA.extend({
38
39
  lastReadAt: z.iso
39
40
  .datetime()
40
41
  .nullish()
41
42
  .describe('Read watermark of the requesting user: thread activity after this time is unread. `null` if never read'),
42
43
  subscribed: z.boolean().describe('Whether the requesting user is subscribed to the thread'),
43
- createdBy: z.uuid().describe('Id of the author'),
44
- createdAt: z.iso.datetime().describe('Creation time'),
45
- })
46
- .describe('Root comment of a thread'));
44
+ }).describe('Root comment of a thread, with the read state and subscription of the requesting user'));
47
45
  //# 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,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CACrC,CAAC;KACE,MAAM,CAAC;IACN,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,CACP,kFAAkF,CACnF;IACH,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,8BAA8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P,4GAA4G,CAC7G;IACH,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,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,wGAAwG,CACzG;IACH,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;CAC5F,CAAC,CAAC,QAAQ,CACT,uFAAuF,CACxF,CACF,CAAA"}
@@ -4,7 +4,7 @@ declare const MESSAGE_CONTENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
4
4
  text: z.ZodString;
5
5
  }, z.core.$strip>, z.ZodObject<{
6
6
  type: z.ZodLiteral<"userMention">;
7
- userId: z.ZodUUID;
7
+ userId: z.ZodGUID;
8
8
  }, z.core.$strip>, z.ZodObject<{
9
9
  type: z.ZodLiteral<"link">;
10
10
  href: z.ZodURL;
@@ -18,7 +18,7 @@ declare const MESSAGE_BLOCK_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
18
18
  text: z.ZodString;
19
19
  }, z.core.$strip>, z.ZodObject<{
20
20
  type: z.ZodLiteral<"userMention">;
21
- userId: z.ZodUUID;
21
+ userId: z.ZodGUID;
22
22
  }, z.core.$strip>, z.ZodObject<{
23
23
  type: z.ZodLiteral<"link">;
24
24
  href: z.ZodURL;
@@ -35,7 +35,7 @@ export declare const MESSAGE_SCHEMA: z.ZodObject<{
35
35
  text: z.ZodString;
36
36
  }, z.core.$strip>, z.ZodObject<{
37
37
  type: z.ZodLiteral<"userMention">;
38
- userId: z.ZodUUID;
38
+ userId: z.ZodGUID;
39
39
  }, z.core.$strip>, z.ZodObject<{
40
40
  type: z.ZodLiteral<"link">;
41
41
  href: z.ZodURL;
@@ -10,7 +10,7 @@ const MESSAGE_CONTENT_SCHEMA = z
10
10
  text: z.string().min(1).describe('Plain text, without formatting'),
11
11
  }),
12
12
  createBaseTypedSchema('userMention').extend({
13
- userId: z.uuid().describe('Id of the mentioned user. Names are never stored in the message'),
13
+ userId: z.guid().describe('Id of the mentioned user. Names are never stored in the message'),
14
14
  }),
15
15
  createBaseTypedSchema('link').extend({
16
16
  href: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/chatter-api-contracts",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "API contracts for chatter",
5
5
  "license": "MIT",
6
6
  "repository": {