@llun/activities.schema 0.2.33 → 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 (110) hide show
  1. package/.claude/settings.local.json +22 -0
  2. package/.yarn/install-state.gz +0 -0
  3. package/CLAUDE.md +46 -0
  4. package/dist/cjs/announce.js +1 -1
  5. package/dist/cjs/mastodon/account/field.js +4 -9
  6. package/dist/cjs/mastodon/account/source.js +4 -12
  7. package/dist/cjs/mastodon/account.js +27 -66
  8. package/dist/cjs/mastodon/customEmoji.js +6 -15
  9. package/dist/cjs/mastodon/filter/index.js +4 -7
  10. package/dist/cjs/mastodon/filter/keyword.js +3 -5
  11. package/dist/cjs/mastodon/filter/status.js +2 -4
  12. package/dist/cjs/mastodon/mediaAttachment/base.js +10 -18
  13. package/dist/cjs/mastodon/mediaAttachment/gifv.js +2 -6
  14. package/dist/cjs/mastodon/mediaAttachment/video.js +2 -6
  15. package/dist/cjs/mastodon/poll/index.js +9 -11
  16. package/dist/cjs/mastodon/poll/option.js +3 -4
  17. package/dist/cjs/mastodon/previewCard.js +15 -28
  18. package/dist/cjs/mastodon/status/application.js +3 -6
  19. package/dist/cjs/mastodon/status/base.js +31 -54
  20. package/dist/cjs/mastodon/status/mention.js +4 -8
  21. package/dist/cjs/mastodon/status/tag.js +2 -6
  22. package/dist/cjs/note/baseContent.js +11 -12
  23. package/dist/cjs/question.js +1 -1
  24. package/dist/esm/announce.js +1 -1
  25. package/dist/esm/mastodon/account/field.js +4 -9
  26. package/dist/esm/mastodon/account/source.js +4 -12
  27. package/dist/esm/mastodon/account.js +27 -66
  28. package/dist/esm/mastodon/customEmoji.js +6 -15
  29. package/dist/esm/mastodon/filter/index.js +4 -7
  30. package/dist/esm/mastodon/filter/keyword.js +3 -5
  31. package/dist/esm/mastodon/filter/status.js +2 -4
  32. package/dist/esm/mastodon/mediaAttachment/base.js +10 -18
  33. package/dist/esm/mastodon/mediaAttachment/gifv.js +2 -6
  34. package/dist/esm/mastodon/mediaAttachment/video.js +2 -6
  35. package/dist/esm/mastodon/poll/index.js +9 -11
  36. package/dist/esm/mastodon/poll/option.js +3 -4
  37. package/dist/esm/mastodon/previewCard.js +15 -28
  38. package/dist/esm/mastodon/status/application.js +3 -6
  39. package/dist/esm/mastodon/status/base.js +31 -54
  40. package/dist/esm/mastodon/status/mention.js +4 -8
  41. package/dist/esm/mastodon/status/tag.js +2 -6
  42. package/dist/esm/note/baseContent.js +11 -12
  43. package/dist/esm/question.js +1 -1
  44. package/dist/types/accept.d.ts +2 -32
  45. package/dist/types/actor.d.ts +18 -288
  46. package/dist/types/announce.d.ts +3 -19
  47. package/dist/types/collection.d.ts +11 -87
  48. package/dist/types/follow.d.ts +1 -11
  49. package/dist/types/image.d.ts +1 -9
  50. package/dist/types/like.d.ts +27 -576
  51. package/dist/types/mastodon/account/field.d.ts +1 -9
  52. package/dist/types/mastodon/account/relationship.d.ts +2 -34
  53. package/dist/types/mastodon/account/source.d.ts +8 -33
  54. package/dist/types/mastodon/account.d.ts +22 -397
  55. package/dist/types/mastodon/customEmoji.d.ts +1 -13
  56. package/dist/types/mastodon/filter/index.d.ts +14 -49
  57. package/dist/types/mastodon/filter/keyword.d.ts +1 -9
  58. package/dist/types/mastodon/filter/status.d.ts +1 -7
  59. package/dist/types/mastodon/filterResult.d.ts +17 -90
  60. package/dist/types/mastodon/mediaAttachment/audio.d.ts +3 -68
  61. package/dist/types/mastodon/mediaAttachment/base.d.ts +1 -15
  62. package/dist/types/mastodon/mediaAttachment/gifv.d.ts +4 -129
  63. package/dist/types/mastodon/mediaAttachment/image.d.ts +5 -118
  64. package/dist/types/mastodon/mediaAttachment/index.d.ts +35 -949
  65. package/dist/types/mastodon/mediaAttachment/unknown.d.ts +1 -18
  66. package/dist/types/mastodon/mediaAttachment/video.d.ts +4 -141
  67. package/dist/types/mastodon/poll/index.d.ts +4 -62
  68. package/dist/types/mastodon/poll/option.d.ts +1 -7
  69. package/dist/types/mastodon/previewCard.d.ts +7 -32
  70. package/dist/types/mastodon/status/application.d.ts +1 -7
  71. package/dist/types/mastodon/status/base.d.ts +79 -1722
  72. package/dist/types/mastodon/status/index.d.ts +158 -4073
  73. package/dist/types/mastodon/status/mention.d.ts +1 -11
  74. package/dist/types/mastodon/status/tag.d.ts +1 -7
  75. package/dist/types/mastodon/visibility.d.ts +6 -1
  76. package/dist/types/note/attachment.d.ts +3 -29
  77. package/dist/types/note/baseContent.d.ts +25 -379
  78. package/dist/types/note/document.d.ts +1 -19
  79. package/dist/types/note/emoji.d.ts +2 -28
  80. package/dist/types/note/hashtag.d.ts +1 -9
  81. package/dist/types/note/mention.d.ts +1 -9
  82. package/dist/types/note/propertyValue.d.ts +1 -9
  83. package/dist/types/note/tag.d.ts +5 -47
  84. package/dist/types/note.d.ts +25 -382
  85. package/dist/types/question/note.d.ts +2 -22
  86. package/dist/types/question.d.ts +27 -422
  87. package/dist/types/reject.d.ts +2 -32
  88. package/dist/types/tombstone.d.ts +1 -7
  89. package/dist/types/undo.d.ts +30 -801
  90. package/package.json +3 -3
  91. package/src/announce.ts +1 -1
  92. package/src/mastodon/account/field.ts +6 -10
  93. package/src/mastodon/account/source.ts +4 -12
  94. package/src/mastodon/account.ts +71 -78
  95. package/src/mastodon/customEmoji.ts +8 -16
  96. package/src/mastodon/filter/index.ts +6 -8
  97. package/src/mastodon/filter/keyword.ts +5 -6
  98. package/src/mastodon/filter/status.ts +2 -4
  99. package/src/mastodon/mediaAttachment/base.ts +16 -21
  100. package/src/mastodon/mediaAttachment/gifv.ts +2 -6
  101. package/src/mastodon/mediaAttachment/video.ts +2 -6
  102. package/src/mastodon/poll/index.ts +13 -13
  103. package/src/mastodon/poll/option.ts +5 -5
  104. package/src/mastodon/previewCard.ts +17 -29
  105. package/src/mastodon/status/application.ts +5 -7
  106. package/src/mastodon/status/base.ts +53 -65
  107. package/src/mastodon/status/mention.ts +6 -9
  108. package/src/mastodon/status/tag.ts +2 -6
  109. package/src/note/baseContent.ts +13 -13
  110. package/src/question.ts +1 -1
@@ -0,0 +1,22 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git checkout:*)",
5
+ "WebFetch(domain:zod.dev)",
6
+ "Bash(yarn upgrade:*)",
7
+ "Bash(yarn add:*)",
8
+ "Bash(npm run build:*)",
9
+ "Bash(npm test)",
10
+ "Bash(npm run:*)",
11
+ "Bash(ls:*)",
12
+ "Bash(find:*)",
13
+ "Bash(git add:*)",
14
+ "Bash(git commit:*)",
15
+ "Bash(git push:*)",
16
+ "Bash(gh pr create:*)",
17
+ "Bash(gh pr view:*)",
18
+ "Bash(gh pr edit:*)"
19
+ ],
20
+ "deny": []
21
+ }
22
+ }
Binary file
package/CLAUDE.md ADDED
@@ -0,0 +1,46 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ This is a TypeScript library that provides Zod schemas for validating ActivityPub and Mastodon data. It exports validation schemas for social media activities and objects like notes, actors, follows, likes, and various Mastodon-specific entities.
8
+
9
+ ## Commands
10
+
11
+ ### Build
12
+ ```bash
13
+ npm run build
14
+ ```
15
+ Builds the project in three module formats:
16
+ - CommonJS to `dist/cjs/`
17
+ - ES Modules to `dist/esm/`
18
+ - TypeScript declarations to `dist/types/`
19
+
20
+ ### Release
21
+ ```bash
22
+ npm run release
23
+ ```
24
+ Cleans dist directory, builds, and publishes to npm with public access.
25
+
26
+ ## Architecture
27
+
28
+ ### Core Structure
29
+ - **Root exports** (`src/index.ts`): ActivityPub entities (Actor, Note, Follow, Like, etc.)
30
+ - **Mastodon namespace** (`src/mastodon/`): Mastodon-specific schemas exported as `Mastodon.*`
31
+ - **Nested schemas**: Complex types like Note use composition with shared base schemas
32
+
33
+ ### Key Patterns
34
+ - All schemas use Zod for validation and TypeScript type generation
35
+ - Exports follow the pattern: `export const Schema = z.object(...)` and `export type Schema = z.infer<typeof Schema>`
36
+ - ActivityPub entities extend base content schemas for common properties
37
+ - Mastodon schemas are organized by entity type (account, status, media, etc.)
38
+
39
+ ### Module System
40
+ - Uses ES modules (`"type": "module"` in package.json)
41
+ - Import paths use `.js` extensions for compatibility
42
+ - Triple build output supports both CommonJS and ES module consumers
43
+
44
+ ## Key Dependencies
45
+ - **zod**: Core validation library - all schemas are built with Zod
46
+ - **typescript**: Development dependency for type checking and compilation
@@ -6,7 +6,7 @@ exports.Announce = zod_1.z.object({
6
6
  type: zod_1.z.literal("Announce"),
7
7
  id: zod_1.z.string(),
8
8
  actor: zod_1.z.string(),
9
- published: zod_1.z.string({ description: "Object published datetime" }),
9
+ published: zod_1.z.string().describe("Object published datetime"),
10
10
  to: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
11
11
  cc: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
12
12
  object: zod_1.z.string(),
@@ -4,15 +4,10 @@ exports.Field = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
5
5
  const zod_1 = require("zod");
6
6
  exports.Field = zod_1.z.object({
7
- name: zod_1.z.string({
8
- description: "The key of a given field’s key-value pair",
9
- }),
10
- value: zod_1.z.string({
11
- description: "The value associated with the `name` key.",
12
- }),
7
+ name: zod_1.z.string().describe("The key of a given field's key-value pair"),
8
+ value: zod_1.z.string().describe("The value associated with the `name` key."),
13
9
  verified_at: zod_1.z
14
- .string({
15
- description: 'Timestamp of when the server verified a URL value for a rel="me" link in ISO 8601 Date time format',
16
- })
10
+ .string()
11
+ .describe('Timestamp of when the server verified a URL value for a rel="me" link in ISO 8601 Date time format')
17
12
  .nullable(),
18
13
  });
@@ -6,18 +6,10 @@ const zod_1 = require("zod");
6
6
  const field_js_1 = require("./field.js");
7
7
  const visibility_js_1 = require("../visibility.js");
8
8
  exports.Source = zod_1.z.object({
9
- note: zod_1.z.string({
10
- description: "Profile bio, in plain-text instead of in HTML",
11
- }),
9
+ note: zod_1.z.string().describe("Profile bio, in plain-text instead of in HTML"),
12
10
  fields: field_js_1.Field.array().describe("Metadata about the account"),
13
11
  privacy: visibility_js_1.Visibility.describe("The default post privacy to be used for new statuses."),
14
- sensitive: zod_1.z.boolean({
15
- description: "Whether new statuses should be marked sensitive by default",
16
- }),
17
- language: zod_1.z.string({
18
- description: "The default posting language for new statuses",
19
- }),
20
- follow_requests_count: zod_1.z.number({
21
- description: "The number of pending follow requests",
22
- }),
12
+ sensitive: zod_1.z.boolean().describe("Whether new statuses should be marked sensitive by default"),
13
+ language: zod_1.z.string().describe("The default posting language for new statuses"),
14
+ follow_requests_count: zod_1.z.number().describe("The number of pending follow requests"),
23
15
  });
@@ -7,85 +7,46 @@ const field_js_1 = require("./account/field.js");
7
7
  const customEmoji_js_1 = require("./customEmoji.js");
8
8
  const source_js_1 = require("./account/source.js");
9
9
  const BaseAccount = zod_1.z.object({
10
- id: zod_1.z.string({
11
- description: "This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
12
- }),
13
- username: zod_1.z.string({
14
- description: "The username of the actor, not including domain",
15
- }),
16
- acct: zod_1.z.string({
17
- description: "The Webfinger actor URI. Equal to username for local users, or username@domain for remote users",
18
- }),
19
- url: zod_1.z.string({
20
- description: "The location of the user's profile page",
21
- }),
22
- display_name: zod_1.z.string({
23
- description: "The profile's display name",
24
- }),
25
- note: zod_1.z.string({
26
- description: "The profile's bio or description",
27
- }),
28
- avatar: zod_1.z.string({
29
- description: "An image URL icon that is shown next to statuses and in the profile",
30
- }),
31
- avatar_static: zod_1.z.string({
32
- description: "A static version of the `avatar`. Equal to `avatar` if its value is a static image; different if `avatar` is an animated GIF",
33
- }),
34
- header: zod_1.z.string({
35
- description: "An image banner URL that is shown above the profile and in profile cards.",
36
- }),
37
- header_static: zod_1.z.string({
38
- description: "A static version of the `header`. Equal to `header` if its value is a static image; different if `header` is an animated GIF",
39
- }),
40
- locked: zod_1.z.boolean({
41
- description: "Whether the actor manually approves follow requests",
42
- }),
10
+ id: zod_1.z.string().describe("This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI"),
11
+ username: zod_1.z.string().describe("The username of the actor, not including domain"),
12
+ acct: zod_1.z.string().describe("The Webfinger actor URI. Equal to username for local users, or username@domain for remote users"),
13
+ url: zod_1.z.string().describe("The location of the user's profile page"),
14
+ display_name: zod_1.z.string().describe("The profile's display name"),
15
+ note: zod_1.z.string().describe("The profile's bio or description"),
16
+ avatar: zod_1.z.string().describe("An image URL icon that is shown next to statuses and in the profile"),
17
+ avatar_static: zod_1.z.string().describe("A static version of the `avatar`. Equal to `avatar` if its value is a static image; different if `avatar` is an animated GIF"),
18
+ header: zod_1.z.string().describe("An image banner URL that is shown above the profile and in profile cards."),
19
+ header_static: zod_1.z.string().describe("A static version of the `header`. Equal to `header` if its value is a static image; different if `header` is an animated GIF"),
20
+ locked: zod_1.z.boolean().describe("Whether the actor manually approves follow requests"),
43
21
  source: source_js_1.Source.describe("An extra attribute that contains source values to be used with API methods that verify credentials and update credentials"),
44
22
  fields: field_js_1.Field.array().describe("Additional metadata attached to a profile as name-value pairs"),
45
23
  emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji entities to be used when rendering the profile"),
46
- bot: zod_1.z.boolean({
47
- description: "Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
48
- }),
49
- group: zod_1.z.boolean({
50
- description: "Indicates that the actor represents a Group actor",
51
- }),
24
+ bot: zod_1.z.boolean().describe("Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot"),
25
+ group: zod_1.z.boolean().describe("Indicates that the actor represents a Group actor"),
52
26
  discoverable: zod_1.z
53
- .boolean({
54
- description: "Whether the actor has opted into discovery features such as the profile directory",
55
- })
27
+ .boolean()
28
+ .describe("Whether the actor has opted into discovery features such as the profile directory")
56
29
  .nullable(),
57
30
  noindex: zod_1.z
58
- .boolean({
59
- description: "Whether the local user has opted out of being indexed by search engines",
60
- })
31
+ .boolean()
32
+ .describe("Whether the local user has opted out of being indexed by search engines")
61
33
  .nullish(),
62
34
  suspended: zod_1.z
63
- .boolean({
64
- description: "An extra attribute returned only when an actor is suspended",
65
- })
35
+ .boolean()
36
+ .describe("An extra attribute returned only when an actor is suspended")
66
37
  .optional(),
67
38
  limited: zod_1.z
68
- .boolean({
69
- description: "An extra attribute returned only when an actor is silenced. If true, indicates that the actor should be hidden behind a warning screen.",
70
- })
39
+ .boolean()
40
+ .describe("An extra attribute returned only when an actor is silenced. If true, indicates that the actor should be hidden behind a warning screen.")
71
41
  .optional(),
72
- created_at: zod_1.z.string({
73
- description: "The time the actor was created in ISO 8601 Datetime format",
74
- }),
42
+ created_at: zod_1.z.string().describe("The time the actor was created in ISO 8601 Datetime format"),
75
43
  last_status_at: zod_1.z
76
- .string({
77
- description: "The time when the most recent status was posted in ISO 8601 Datetime format",
78
- })
44
+ .string()
45
+ .describe("The time when the most recent status was posted in ISO 8601 Datetime format")
79
46
  .nullable(),
80
- statuses_count: zod_1.z.number({
81
- description: "How many statuses are attached to this actor",
82
- }),
83
- followers_count: zod_1.z.number({
84
- description: "The reported followers of this profile",
85
- }),
86
- following_count: zod_1.z.number({
87
- description: "The reported follows of this profile",
88
- }),
47
+ statuses_count: zod_1.z.number().describe("How many statuses are attached to this actor"),
48
+ followers_count: zod_1.z.number().describe("The reported followers of this profile"),
49
+ following_count: zod_1.z.number().describe("The reported follows of this profile"),
89
50
  });
90
51
  exports.Account = BaseAccount.extend({
91
52
  moved: BaseAccount.nullish().describe("Indicates that the profile is currently inactive and that its user has moved to a new account"),
@@ -4,21 +4,12 @@ exports.CustomEmoji = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/CustomEmoji/
5
5
  const zod_1 = require("zod");
6
6
  exports.CustomEmoji = zod_1.z.object({
7
- shortcode: zod_1.z.string({
8
- description: "The name of the custom emoji",
9
- }),
10
- static_url: zod_1.z.string({
11
- description: "A link to a static copy of the custom emoji",
12
- }),
13
- url: zod_1.z.string({
14
- description: "A link to the custom emoji",
15
- }),
16
- visible_in_picker: zod_1.z.boolean({
17
- description: "Whether this Emoji should be visible in the picker or unlisted",
18
- }),
7
+ shortcode: zod_1.z.string().describe("The name of the custom emoji"),
8
+ static_url: zod_1.z.string().describe("A link to a static copy of the custom emoji"),
9
+ url: zod_1.z.string().describe("A link to the custom emoji"),
10
+ visible_in_picker: zod_1.z.boolean().describe("Whether this Emoji should be visible in the picker or unlisted"),
19
11
  category: zod_1.z
20
- .string({
21
- description: "Used for sorting custom emoji in the picker",
22
- })
12
+ .string()
13
+ .describe("Used for sorting custom emoji in the picker")
23
14
  .nullable(),
24
15
  });
@@ -6,18 +6,15 @@ const zod_1 = require("zod");
6
6
  const keyword_js_1 = require("./keyword.js");
7
7
  const status_js_1 = require("./status.js");
8
8
  exports.Filter = zod_1.z.object({
9
- id: zod_1.z.string({ description: "The ID of the Filter in the database" }),
10
- title: zod_1.z.string({
11
- description: "A title given by the user to name the filter",
12
- }),
9
+ id: zod_1.z.string().describe("The ID of the Filter in the database"),
10
+ title: zod_1.z.string().describe("A title given by the user to name the filter"),
13
11
  context: zod_1.z
14
12
  .enum(["home", "notifications", "public", "thread", "account"])
15
13
  .array()
16
14
  .describe("The contexts in which the filter should be applied"),
17
15
  expires_at: zod_1.z
18
- .string({
19
- description: "When the filter should no longer be applied in ISO 8601 Datetime format or null if the filter does not expire",
20
- })
16
+ .string()
17
+ .describe("When the filter should no longer be applied in ISO 8601 Datetime format or null if the filter does not expire")
21
18
  .nullable(),
22
19
  filter_action: zod_1.z
23
20
  .enum(["warn", "hide"])
@@ -4,9 +4,7 @@ exports.FilterKeyword = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/FilterKeyword/
5
5
  const zod_1 = require("zod");
6
6
  exports.FilterKeyword = zod_1.z.object({
7
- id: zod_1.z.string({ description: "The ID of the FilterKeyword in the database" }),
8
- keyword: zod_1.z.string({ description: "The phrase to be matched against" }),
9
- whole_word: zod_1.z.boolean({
10
- description: "Should the filter consider word boundaries? See [implementation guidelines for filters](https://docs.joinmastodon.org/api/guidelines/#filters)",
11
- }),
7
+ id: zod_1.z.string().describe("The ID of the FilterKeyword in the database"),
8
+ keyword: zod_1.z.string().describe("The phrase to be matched against"),
9
+ whole_word: zod_1.z.boolean().describe("Should the filter consider word boundaries? See [implementation guidelines for filters](https://docs.joinmastodon.org/api/guidelines/#filters)"),
12
10
  });
@@ -4,8 +4,6 @@ exports.FilterStatus = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/FilterStatus/
5
5
  const zod_1 = require("zod");
6
6
  exports.FilterStatus = zod_1.z.object({
7
- id: zod_1.z.string({ description: "The ID of the FilterStatus in the database" }),
8
- status_id: zod_1.z.string({
9
- description: "The ID of the Status that will be filtered",
10
- }),
7
+ id: zod_1.z.string().describe("The ID of the FilterStatus in the database"),
8
+ status_id: zod_1.z.string().describe("The ID of the Status that will be filtered"),
11
9
  });
@@ -4,30 +4,22 @@ exports.BaseMediaAttachment = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/MediaAttachment/
5
5
  const zod_1 = require("zod");
6
6
  exports.BaseMediaAttachment = zod_1.z.object({
7
- id: zod_1.z.string({
8
- description: "The ID of the attachment in the database",
9
- }),
10
- url: zod_1.z.string({
11
- description: "The location of the original full-size attachment",
12
- }),
7
+ id: zod_1.z.string().describe("The ID of the attachment in the database"),
8
+ url: zod_1.z.string().describe("The location of the original full-size attachment"),
13
9
  preview_url: zod_1.z
14
- .string({
15
- description: "The location of a scaled-down preview of the attachment",
16
- })
10
+ .string()
11
+ .describe("The location of a scaled-down preview of the attachment")
17
12
  .nullable(),
18
13
  remote_url: zod_1.z
19
- .string({
20
- description: "The location of the full-size original attachment on the remote website",
21
- })
14
+ .string()
15
+ .describe("The location of the full-size original attachment on the remote website")
22
16
  .nullable(),
23
17
  description: zod_1.z
24
- .string({
25
- description: "Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load",
26
- })
18
+ .string()
19
+ .describe("Alternate text that describes what is in the media attachment, to be used for the visually impaired or when media attachments do not load")
27
20
  .nullable(),
28
21
  blurhash: zod_1.z
29
- .string({
30
- description: "hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.",
31
- })
22
+ .string()
23
+ .describe("hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.")
32
24
  .nullable(),
33
25
  });
@@ -13,14 +13,10 @@ exports.Gifv = base_js_1.BaseMediaAttachment.extend({
13
13
  length: zod_1.z.string().nullish(),
14
14
  duration: zod_1.z.number().nullish(),
15
15
  fps: zod_1.z.number().nullish(),
16
- size: zod_1.z.string({
17
- description: "Video width and height in string wxh format",
18
- }),
16
+ size: zod_1.z.string().describe("Video width and height in string wxh format"),
19
17
  width: zod_1.z.number(),
20
18
  height: zod_1.z.number(),
21
- aspect: zod_1.z.number({
22
- description: "Aspect ratio of the video (width/height)",
23
- }),
19
+ aspect: zod_1.z.number().describe("Aspect ratio of the video (width/height)"),
24
20
  original: zod_1.z.object({
25
21
  width: zod_1.z.number(),
26
22
  height: zod_1.z.number(),
@@ -11,14 +11,10 @@ exports.Video = base_js_1.BaseMediaAttachment.extend({
11
11
  length: zod_1.z.string().nullish(),
12
12
  duration: zod_1.z.number().nullish(),
13
13
  fps: zod_1.z.number().nullish(),
14
- size: zod_1.z.string({
15
- description: "Video width and height in string wxh format",
16
- }),
14
+ size: zod_1.z.string().describe("Video width and height in string wxh format"),
17
15
  width: zod_1.z.number(),
18
16
  height: zod_1.z.number(),
19
- aspect: zod_1.z.number({
20
- description: "Aspect ratio of the video (width/height)",
21
- }),
17
+ aspect: zod_1.z.number().describe("Aspect ratio of the video (width/height)"),
22
18
  audio_encode: zod_1.z.string().nullish(),
23
19
  audio_bitrate: zod_1.z.string().nullish(),
24
20
  audio_channels: zod_1.z.string().nullish(),
@@ -6,22 +6,20 @@ const zod_1 = require("zod");
6
6
  const customEmoji_js_1 = require("../customEmoji.js");
7
7
  const option_js_1 = require("./option.js");
8
8
  exports.Poll = zod_1.z.object({
9
- id: zod_1.z.string({ description: "The ID of the poll in the database" }),
9
+ id: zod_1.z.string().describe("The ID of the poll in the database"),
10
10
  expires_at: zod_1.z
11
- .string({
12
- description: "The time the poll ends in ISO 8601 datetime or null if the poll does not end",
13
- })
11
+ .string()
12
+ .describe("The time the poll ends in ISO 8601 datetime or null if the poll does not end")
14
13
  .nullable(),
15
- expired: zod_1.z.boolean({ description: "Whether the poll has expired" }),
16
- multiple: zod_1.z.boolean({ description: "Whether multiple choices are allowed" }),
17
- votes_count: zod_1.z.number({ description: "The number of votes the poll has" }),
18
- voters_count: zod_1.z.number({ description: "The number of actors that voted" }),
14
+ expired: zod_1.z.boolean().describe("Whether the poll has expired"),
15
+ multiple: zod_1.z.boolean().describe("Whether multiple choices are allowed"),
16
+ votes_count: zod_1.z.number().describe("The number of votes the poll has"),
17
+ voters_count: zod_1.z.number().describe("The number of actors that voted"),
19
18
  options: option_js_1.Option.array().describe("Possible answers for the poll"),
20
19
  emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji to be used for rendering poll options"),
21
20
  voted: zod_1.z
22
- .boolean({
23
- description: "When called with a user token, has the authorized user voted?",
24
- })
21
+ .boolean()
22
+ .describe("When called with a user token, has the authorized user voted?")
25
23
  .optional(),
26
24
  own_votes: zod_1.z
27
25
  .number()
@@ -4,10 +4,9 @@ exports.Option = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/Poll/#Option
5
5
  const zod_1 = require("zod");
6
6
  exports.Option = zod_1.z.object({
7
- title: zod_1.z.string({ description: "The text value of the poll option" }),
7
+ title: zod_1.z.string().describe("The text value of the poll option"),
8
8
  votes_count: zod_1.z
9
- .number({
10
- description: "The number of votes the poll option has or null if the results are not published yet",
11
- })
9
+ .number()
10
+ .describe("The number of votes the poll option has or null if the results are not published yet")
12
11
  .nullable(),
13
12
  });
@@ -4,34 +4,21 @@ exports.PreviewCard = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/PreviewCard/
5
5
  const zod_1 = require("zod");
6
6
  exports.PreviewCard = zod_1.z.object({
7
- url: zod_1.z.string({ description: "Location of linked resource" }),
8
- title: zod_1.z.string({ description: "Title of linked resource" }),
9
- description: zod_1.z.string({ description: "Description of preview" }),
10
- type: zod_1.z.enum(["link", "photo", "video", "rich"], {
11
- description: "The type of the preview card",
12
- }),
13
- author_name: zod_1.z.string({ description: "The author of the original resource" }),
14
- author_url: zod_1.z.string({
15
- description: "A link to the author of the original resource",
16
- }),
17
- provider_name: zod_1.z.string({
18
- description: "The provider of the original resource",
19
- }),
20
- provider_url: zod_1.z.string({
21
- description: "A link to the provider of the original resource",
22
- }),
23
- html: zod_1.z.string({
24
- description: "HTML to be used for generating the preview card",
25
- }),
26
- width: zod_1.z.number({ description: "Width of preview, in pixels" }),
27
- height: zod_1.z.number({ description: "Height of preview, in pixels" }),
28
- image: zod_1.z.string({ description: "Preview thumbnail url" }).nullable(),
29
- embed_url: zod_1.z.string({
30
- description: "Used for photo embeds, instead of custom html",
31
- }),
7
+ url: zod_1.z.string().describe("Location of linked resource"),
8
+ title: zod_1.z.string().describe("Title of linked resource"),
9
+ description: zod_1.z.string().describe("Description of preview"),
10
+ type: zod_1.z.enum(["link", "photo", "video", "rich"]).describe("The type of the preview card"),
11
+ author_name: zod_1.z.string().describe("The author of the original resource"),
12
+ author_url: zod_1.z.string().describe("A link to the author of the original resource"),
13
+ provider_name: zod_1.z.string().describe("The provider of the original resource"),
14
+ provider_url: zod_1.z.string().describe("A link to the provider of the original resource"),
15
+ html: zod_1.z.string().describe("HTML to be used for generating the preview card"),
16
+ width: zod_1.z.number().describe("Width of preview, in pixels"),
17
+ height: zod_1.z.number().describe("Height of preview, in pixels"),
18
+ image: zod_1.z.string().describe("Preview thumbnail url").nullable(),
19
+ embed_url: zod_1.z.string().describe("Used for photo embeds, instead of custom html"),
32
20
  blurhash: zod_1.z
33
- .string({
34
- description: "A hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet",
35
- })
21
+ .string()
22
+ .describe("A hash computed by the [BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet")
36
23
  .nullable(),
37
24
  });
@@ -4,12 +4,9 @@ exports.Application = void 0;
4
4
  // This schema is base on https://docs.joinmastodon.org/entities/Status/#application
5
5
  const zod_1 = require("zod");
6
6
  exports.Application = zod_1.z.object({
7
- name: zod_1.z.string({
8
- description: "The name of the application that posted this status",
9
- }),
7
+ name: zod_1.z.string().describe("The name of the application that posted this status"),
10
8
  website: zod_1.z
11
- .string({
12
- description: "The website associated with the application that posted this status",
13
- })
9
+ .string()
10
+ .describe("The website associated with the application that posted this status")
14
11
  .nullable(),
15
12
  });