@llun/activities.schema 0.2.34 → 0.3.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.
Files changed (109) hide show
  1. package/.claude/settings.local.json +22 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/dist/cjs/announce.js +1 -1
  4. package/dist/cjs/mastodon/account/field.js +4 -9
  5. package/dist/cjs/mastodon/account/source.js +4 -12
  6. package/dist/cjs/mastodon/account.js +27 -66
  7. package/dist/cjs/mastodon/customEmoji.js +6 -15
  8. package/dist/cjs/mastodon/filter/index.js +4 -7
  9. package/dist/cjs/mastodon/filter/keyword.js +3 -5
  10. package/dist/cjs/mastodon/filter/status.js +2 -4
  11. package/dist/cjs/mastodon/mediaAttachment/base.js +10 -18
  12. package/dist/cjs/mastodon/mediaAttachment/gifv.js +2 -6
  13. package/dist/cjs/mastodon/mediaAttachment/video.js +2 -6
  14. package/dist/cjs/mastodon/poll/index.js +9 -11
  15. package/dist/cjs/mastodon/poll/option.js +3 -4
  16. package/dist/cjs/mastodon/previewCard.js +15 -28
  17. package/dist/cjs/mastodon/status/application.js +3 -6
  18. package/dist/cjs/mastodon/status/base.js +31 -54
  19. package/dist/cjs/mastodon/status/mention.js +4 -8
  20. package/dist/cjs/mastodon/status/tag.js +2 -6
  21. package/dist/cjs/note/baseContent.js +11 -12
  22. package/dist/cjs/question.js +1 -1
  23. package/dist/esm/announce.js +1 -1
  24. package/dist/esm/mastodon/account/field.js +4 -9
  25. package/dist/esm/mastodon/account/source.js +4 -12
  26. package/dist/esm/mastodon/account.js +27 -66
  27. package/dist/esm/mastodon/customEmoji.js +6 -15
  28. package/dist/esm/mastodon/filter/index.js +4 -7
  29. package/dist/esm/mastodon/filter/keyword.js +3 -5
  30. package/dist/esm/mastodon/filter/status.js +2 -4
  31. package/dist/esm/mastodon/mediaAttachment/base.js +10 -18
  32. package/dist/esm/mastodon/mediaAttachment/gifv.js +2 -6
  33. package/dist/esm/mastodon/mediaAttachment/video.js +2 -6
  34. package/dist/esm/mastodon/poll/index.js +9 -11
  35. package/dist/esm/mastodon/poll/option.js +3 -4
  36. package/dist/esm/mastodon/previewCard.js +15 -28
  37. package/dist/esm/mastodon/status/application.js +3 -6
  38. package/dist/esm/mastodon/status/base.js +31 -54
  39. package/dist/esm/mastodon/status/mention.js +4 -8
  40. package/dist/esm/mastodon/status/tag.js +2 -6
  41. package/dist/esm/note/baseContent.js +11 -12
  42. package/dist/esm/question.js +1 -1
  43. package/dist/types/accept.d.ts +2 -32
  44. package/dist/types/actor.d.ts +18 -288
  45. package/dist/types/announce.d.ts +3 -19
  46. package/dist/types/collection.d.ts +11 -87
  47. package/dist/types/follow.d.ts +1 -11
  48. package/dist/types/image.d.ts +1 -9
  49. package/dist/types/like.d.ts +27 -576
  50. package/dist/types/mastodon/account/field.d.ts +1 -9
  51. package/dist/types/mastodon/account/relationship.d.ts +2 -34
  52. package/dist/types/mastodon/account/source.d.ts +8 -33
  53. package/dist/types/mastodon/account.d.ts +22 -397
  54. package/dist/types/mastodon/customEmoji.d.ts +1 -13
  55. package/dist/types/mastodon/filter/index.d.ts +14 -49
  56. package/dist/types/mastodon/filter/keyword.d.ts +1 -9
  57. package/dist/types/mastodon/filter/status.d.ts +1 -7
  58. package/dist/types/mastodon/filterResult.d.ts +17 -90
  59. package/dist/types/mastodon/mediaAttachment/audio.d.ts +3 -68
  60. package/dist/types/mastodon/mediaAttachment/base.d.ts +1 -15
  61. package/dist/types/mastodon/mediaAttachment/gifv.d.ts +4 -129
  62. package/dist/types/mastodon/mediaAttachment/image.d.ts +5 -118
  63. package/dist/types/mastodon/mediaAttachment/index.d.ts +35 -949
  64. package/dist/types/mastodon/mediaAttachment/unknown.d.ts +1 -18
  65. package/dist/types/mastodon/mediaAttachment/video.d.ts +4 -141
  66. package/dist/types/mastodon/poll/index.d.ts +4 -62
  67. package/dist/types/mastodon/poll/option.d.ts +1 -7
  68. package/dist/types/mastodon/previewCard.d.ts +7 -32
  69. package/dist/types/mastodon/status/application.d.ts +1 -7
  70. package/dist/types/mastodon/status/base.d.ts +79 -1722
  71. package/dist/types/mastodon/status/index.d.ts +158 -4073
  72. package/dist/types/mastodon/status/mention.d.ts +1 -11
  73. package/dist/types/mastodon/status/tag.d.ts +1 -7
  74. package/dist/types/mastodon/visibility.d.ts +6 -1
  75. package/dist/types/note/attachment.d.ts +3 -29
  76. package/dist/types/note/baseContent.d.ts +25 -379
  77. package/dist/types/note/document.d.ts +1 -19
  78. package/dist/types/note/emoji.d.ts +2 -28
  79. package/dist/types/note/hashtag.d.ts +1 -9
  80. package/dist/types/note/mention.d.ts +1 -9
  81. package/dist/types/note/propertyValue.d.ts +1 -9
  82. package/dist/types/note/tag.d.ts +5 -47
  83. package/dist/types/note.d.ts +25 -382
  84. package/dist/types/question/note.d.ts +2 -22
  85. package/dist/types/question.d.ts +27 -422
  86. package/dist/types/reject.d.ts +2 -32
  87. package/dist/types/tombstone.d.ts +1 -7
  88. package/dist/types/undo.d.ts +30 -801
  89. package/package.json +2 -2
  90. package/src/announce.ts +1 -1
  91. package/src/mastodon/account/field.ts +6 -10
  92. package/src/mastodon/account/source.ts +4 -12
  93. package/src/mastodon/account.ts +71 -78
  94. package/src/mastodon/customEmoji.ts +8 -16
  95. package/src/mastodon/filter/index.ts +6 -8
  96. package/src/mastodon/filter/keyword.ts +5 -6
  97. package/src/mastodon/filter/status.ts +2 -4
  98. package/src/mastodon/mediaAttachment/base.ts +16 -21
  99. package/src/mastodon/mediaAttachment/gifv.ts +2 -6
  100. package/src/mastodon/mediaAttachment/video.ts +2 -6
  101. package/src/mastodon/poll/index.ts +13 -13
  102. package/src/mastodon/poll/option.ts +5 -5
  103. package/src/mastodon/previewCard.ts +17 -29
  104. package/src/mastodon/status/application.ts +5 -7
  105. package/src/mastodon/status/base.ts +53 -65
  106. package/src/mastodon/status/mention.ts +6 -9
  107. package/src/mastodon/status/tag.ts +2 -6
  108. package/src/note/baseContent.ts +13 -13
  109. package/src/question.ts +1 -1
@@ -12,25 +12,19 @@ import { Mention } from "./mention.js";
12
12
  import { Tag } from "./tag.js";
13
13
 
14
14
  export const BaseStatus = z.object({
15
- id: z.string({
16
- description:
17
- "ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI",
18
- }),
19
- uri: z.string({
20
- description: "URI of the status used for federation",
21
- }),
15
+ id: z.string().describe(
16
+ "ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI"
17
+ ),
18
+ uri: z.string().describe("URI of the status used for federation"),
22
19
 
23
20
  account: Account.describe("The actor that authored the status"),
24
21
 
25
- content: z.string({ description: "HTML-encoded status content" }),
22
+ content: z.string().describe("HTML-encoded status content"),
26
23
  visibility: Visibility.describe("Visibility of this status"),
27
- sensitive: z.boolean({
28
- description: "Is this status marked as sensitive content?",
29
- }),
30
- spoiler_text: z.string({
31
- description:
32
- "Subject or summary line, below which status content is collapsed until expanded",
33
- }),
24
+ sensitive: z.boolean().describe("Is this status marked as sensitive content?"),
25
+ spoiler_text: z.string().describe(
26
+ "Subject or summary line, below which status content is collapsed until expanded"
27
+ ),
34
28
 
35
29
  media_attachments: MediaAttachment.array(),
36
30
  application: Application.optional(),
@@ -43,26 +37,21 @@ export const BaseStatus = z.object({
43
37
  ),
44
38
  tags: Tag.array().describe("Hashtags used within the status content"),
45
39
 
46
- reblogs_count: z.number({
47
- description: "How many boosts this status has received",
48
- }),
49
- favourites_count: z.number({
50
- description: "How many favourites this status has received",
51
- }),
52
- replies_count: z.number({
53
- description: "How many replies this status has received",
54
- }),
40
+ reblogs_count: z.number().describe("How many boosts this status has received"),
41
+ favourites_count: z.number().describe("How many favourites this status has received"),
42
+ replies_count: z.number().describe("How many replies this status has received"),
55
43
 
56
44
  url: z
57
- .string({ description: "A link to the status’s HTML representation" })
45
+ .string()
46
+ .describe("A link to the status's HTML representation")
58
47
  .nullable(),
59
48
  in_reply_to_id: z
60
- .string({ description: "ID of the status being replied to" })
49
+ .string()
50
+ .describe("ID of the status being replied to")
61
51
  .nullable(),
62
52
  in_reply_to_account_id: z
63
- .string({
64
- description: "ID of the actor that authored the status being replied to",
65
- })
53
+ .string()
54
+ .describe("ID of the actor that authored the status being replied to")
66
55
  .nullable(),
67
56
 
68
57
  poll: Poll.nullable().describe("The poll attached to the status"),
@@ -71,59 +60,58 @@ export const BaseStatus = z.object({
71
60
  ),
72
61
 
73
62
  language: z
74
- .string({
75
- description:
76
- "Primary language of this status in ISO 639 Part 1 two-letter language code",
77
- })
63
+ .string()
64
+ .describe(
65
+ "Primary language of this status in ISO 639 Part 1 two-letter language code"
66
+ )
78
67
  .nullable(),
79
68
 
80
69
  text: z
81
- .string({
82
- description:
83
- "Plain-text source of a status. Returned instead of `content` when status is deleted, so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content",
84
- })
70
+ .string()
71
+ .describe(
72
+ "Plain-text source of a status. Returned instead of `content` when status is deleted, so the user may redraft from the source text without the client having to reverse-engineer the original text from the HTML content"
73
+ )
85
74
  .nullable(),
86
75
 
87
- created_at: z.string({
88
- description:
89
- "The date when this status was created in ISO 8601 Datetime format",
90
- }),
76
+ created_at: z.string().describe(
77
+ "The date when this status was created in ISO 8601 Datetime format"
78
+ ),
91
79
  edited_at: z
92
- .string({
93
- description:
94
- "Timestamp of when the status was last edited in ISO 8601 Datetime format",
95
- })
80
+ .string()
81
+ .describe(
82
+ "Timestamp of when the status was last edited in ISO 8601 Datetime format"
83
+ )
96
84
  .nullable(),
97
85
 
98
86
  favourited: z
99
- .boolean({
100
- description:
101
- "If the current token has an authorized user: Have you favourited this status?",
102
- })
87
+ .boolean()
88
+ .describe(
89
+ "If the current token has an authorized user: Have you favourited this status?"
90
+ )
103
91
  .optional(),
104
92
  reblogged: z
105
- .boolean({
106
- description:
107
- "If the current token has an authorized user: Have you boosted this status?",
108
- })
93
+ .boolean()
94
+ .describe(
95
+ "If the current token has an authorized user: Have you boosted this status?"
96
+ )
109
97
  .optional(),
110
98
  muted: z
111
- .boolean({
112
- description:
113
- "If the current token has an authorized user: Have you muted notifications for this statuss conversation?",
114
- })
99
+ .boolean()
100
+ .describe(
101
+ "If the current token has an authorized user: Have you muted notifications for this status's conversation?"
102
+ )
115
103
  .optional(),
116
104
  bookmarked: z
117
- .boolean({
118
- description:
119
- "If the current token has an authorized user: Have you bookmarked this status?",
120
- })
105
+ .boolean()
106
+ .describe(
107
+ "If the current token has an authorized user: Have you bookmarked this status?"
108
+ )
121
109
  .optional(),
122
110
  pinned: z
123
- .boolean({
124
- description:
125
- "If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable",
126
- })
111
+ .boolean()
112
+ .describe(
113
+ "If the current token has an authorized user: Have you pinned this status? Only appears if the status is pinnable"
114
+ )
127
115
  .optional(),
128
116
  filtered: FilterResult.optional().describe(
129
117
  "If the current token has an authorized user: The filter and keywords that matched this status"
@@ -2,14 +2,11 @@
2
2
  import { z } from "zod";
3
3
 
4
4
  export const Mention = z.object({
5
- id: z.string({ description: "The actor ID of the mentioned user" }),
6
- username: z.string({ description: "The username of the mentioned user" }),
7
- url: z.string({
8
- description: "The location of the mentioned user’s profile",
9
- }),
10
- acct: z.string({
11
- description:
12
- "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users",
13
- }),
5
+ id: z.string().describe("The actor ID of the mentioned user"),
6
+ username: z.string().describe("The username of the mentioned user"),
7
+ url: z.string().describe("The location of the mentioned user's profile"),
8
+ acct: z.string().describe(
9
+ "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users"
10
+ ),
14
11
  });
15
12
  export type Mention = z.infer<typeof Mention>;
@@ -2,11 +2,7 @@
2
2
  import { z } from "zod";
3
3
 
4
4
  export const Tag = z.object({
5
- name: z.string({
6
- description: "The value of the hashtag after the `#` sign",
7
- }),
8
- url: z.string({
9
- description: "A link to the hashtag on the instance",
10
- }),
5
+ name: z.string().describe("The value of the hashtag after the `#` sign"),
6
+ url: z.string().describe("A link to the hashtag on the instance"),
11
7
  });
12
8
  export type Tag = z.infer<typeof Tag>;
@@ -6,34 +6,34 @@ import { Collection } from "../collection.js";
6
6
  export const BaseContent = z.object({
7
7
  id: z.string(),
8
8
  url: z
9
- .string({ description: "Note URL. This is optional for Pleloma" })
9
+ .string().describe("Note URL. This is optional for Pleloma")
10
10
  .nullish(),
11
- attributedTo: z.string({ description: "Note publisher" }),
11
+ attributedTo: z.string().describe("Note publisher"),
12
12
 
13
13
  to: z.union([z.string(), z.string().array()]),
14
14
  cc: z.union([z.string(), z.string().array()]),
15
15
 
16
16
  inReplyTo: z.string().nullish(),
17
17
 
18
- summary: z.string({ description: "Note short summary" }).nullish(),
18
+ summary: z.string().describe("Note short summary").nullish(),
19
19
  summaryMap: z
20
- .record(z.string(), { description: "Note short summary in each locale" })
20
+ .record(z.string(), z.string()).describe("Note short summary in each locale")
21
21
  .nullish(),
22
22
 
23
23
  content: z
24
24
  .union([
25
- z.string({ description: "Note content" }),
26
- z.string({ description: "Note content in array from Wordpress" }).array(),
25
+ z.string().describe("Note content"),
26
+ z.string().describe("Note content in array from Wordpress").array(),
27
27
  ])
28
28
  .nullish(),
29
29
  contentMap: z
30
30
  .union([
31
- z.record(z.string(), { description: "Note content in each locale" }),
31
+ z.record(z.string(), z.string()).describe("Note content in each locale"),
32
32
  z
33
- .string({
34
- description:
35
- "Some activity pub server use content map as array with content in the first element",
36
- })
33
+ .string()
34
+ .describe(
35
+ "Some activity pub server use content map as array with content in the first element"
36
+ )
37
37
  .array(),
38
38
  ])
39
39
  .nullish(),
@@ -42,8 +42,8 @@ export const BaseContent = z.object({
42
42
  attachment: z.union([Attachment, Attachment.array()]).nullish(),
43
43
  tag: z.union([Tag, Tag.array()]),
44
44
 
45
- published: z.string({ description: "Object published datetime" }),
46
- updated: z.string({ description: "Object updated datetime" }).nullish(),
45
+ published: z.string().describe("Object published datetime"),
46
+ updated: z.string().describe("Object updated datetime").nullish(),
47
47
  });
48
48
 
49
49
  export type BaseContent = z.infer<typeof BaseContent>;
package/src/question.ts CHANGED
@@ -6,7 +6,7 @@ export const ENTITY_TYPE_QUESTION = "Question";
6
6
  export const Question = BaseContent.extend({
7
7
  type: z.literal(ENTITY_TYPE_QUESTION),
8
8
 
9
- endTime: z.string({ description: "Question end time" }),
9
+ endTime: z.string().describe("Question end time"),
10
10
  oneOf: Note.array(),
11
11
  });
12
12
  export type Question = z.infer<typeof Question>;