@llun/activities.schema 0.0.8 → 0.1.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 (78) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.js +1 -0
  4. package/dist/like.d.ts +16 -125
  5. package/dist/mastodon/account.d.ts +327 -0
  6. package/dist/mastodon/account.js +87 -0
  7. package/dist/mastodon/accountField.d.ts +15 -0
  8. package/dist/mastodon/accountField.js +15 -0
  9. package/dist/mastodon/customEmoji.d.ts +21 -0
  10. package/dist/mastodon/customEmoji.js +21 -0
  11. package/dist/mastodon/filter/index.d.ts +62 -0
  12. package/dist/mastodon/filter/index.js +24 -0
  13. package/dist/mastodon/filter/keyword.d.ts +15 -0
  14. package/dist/mastodon/filter/keyword.js +9 -0
  15. package/dist/mastodon/filter/status.d.ts +12 -0
  16. package/dist/mastodon/filter/status.js +8 -0
  17. package/dist/mastodon/filterResult.d.ts +104 -0
  18. package/dist/mastodon/filterResult.js +16 -0
  19. package/dist/mastodon/index.d.ts +3 -0
  20. package/dist/mastodon/index.js +3 -0
  21. package/dist/mastodon/mediaAttachment/audio.d.ts +87 -0
  22. package/dist/mastodon/mediaAttachment/audio.js +17 -0
  23. package/dist/mastodon/mediaAttachment/base.d.ts +24 -0
  24. package/dist/mastodon/mediaAttachment/base.js +26 -0
  25. package/dist/mastodon/mediaAttachment/gifv.d.ts +158 -0
  26. package/dist/mastodon/mediaAttachment/gifv.js +37 -0
  27. package/dist/mastodon/mediaAttachment/image.d.ts +142 -0
  28. package/dist/mastodon/mediaAttachment/image.js +30 -0
  29. package/dist/mastodon/mediaAttachment/index.d.ts +576 -0
  30. package/dist/mastodon/mediaAttachment/index.js +8 -0
  31. package/dist/mastodon/mediaAttachment/unknown.d.ts +28 -0
  32. package/dist/mastodon/mediaAttachment/unknown.js +8 -0
  33. package/dist/mastodon/mediaAttachment/video.d.ts +173 -0
  34. package/dist/mastodon/mediaAttachment/video.js +38 -0
  35. package/dist/mastodon/poll/index.d.ts +81 -0
  36. package/dist/mastodon/poll/index.js +27 -0
  37. package/dist/mastodon/poll/option.d.ts +12 -0
  38. package/dist/mastodon/poll/option.js +10 -0
  39. package/dist/mastodon/previewCard.d.ts +48 -0
  40. package/dist/mastodon/previewCard.js +34 -0
  41. package/dist/mastodon/status/application.d.ts +12 -0
  42. package/dist/mastodon/status/application.js +12 -0
  43. package/dist/mastodon/status/base.d.ts +1738 -0
  44. package/dist/mastodon/status/base.js +96 -0
  45. package/dist/mastodon/status/index.d.ts +4035 -0
  46. package/dist/mastodon/status/index.js +4 -0
  47. package/dist/mastodon/status/mention.d.ts +18 -0
  48. package/dist/mastodon/status/mention.js +12 -0
  49. package/dist/mastodon/status/tag.d.ts +12 -0
  50. package/dist/mastodon/status/tag.js +10 -0
  51. package/dist/mastodon/status/visibility.d.ts +3 -0
  52. package/dist/mastodon/status/visibility.js +3 -0
  53. package/dist/note/baseContent.d.ts +251 -0
  54. package/dist/note/baseContent.js +24 -0
  55. package/dist/note.d.ts +8 -7
  56. package/dist/note.js +1 -23
  57. package/dist/undo.d.ts +24 -243
  58. package/package.json +4 -4
  59. package/src/mastodon/filter/index.ts +31 -0
  60. package/src/mastodon/filter/keyword.ts +12 -0
  61. package/src/mastodon/filter/status.ts +10 -0
  62. package/src/mastodon/filterResult.ts +18 -0
  63. package/src/mastodon/mediaAttachment/audio.ts +19 -0
  64. package/src/mastodon/mediaAttachment/base.ts +34 -0
  65. package/src/mastodon/mediaAttachment/gifv.ts +41 -0
  66. package/src/mastodon/mediaAttachment/image.ts +32 -0
  67. package/src/mastodon/mediaAttachment/index.ts +10 -0
  68. package/src/mastodon/mediaAttachment/unknown.ts +12 -0
  69. package/src/mastodon/mediaAttachment/video.ts +43 -0
  70. package/src/mastodon/poll/index.ts +35 -0
  71. package/src/mastodon/poll/option.ts +13 -0
  72. package/src/mastodon/previewCard.ts +41 -0
  73. package/src/mastodon/status/application.ts +15 -0
  74. package/src/mastodon/status/base.ts +125 -0
  75. package/src/mastodon/status/index.ts +8 -0
  76. package/src/mastodon/status/mention.ts +15 -0
  77. package/src/mastodon/status/tag.ts +12 -0
  78. package/src/mastodon/status/visibility.ts +5 -0
@@ -0,0 +1,4 @@
1
+ import { BaseStatus } from "./base.js";
2
+ export const Status = BaseStatus.extend({
3
+ reblog: BaseStatus.nullable().describe("The status being reblogged"),
4
+ });
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const Mention: z.ZodObject<{
3
+ id: z.ZodString;
4
+ username: z.ZodString;
5
+ url: z.ZodString;
6
+ acct: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ id: string;
9
+ url: string;
10
+ username: string;
11
+ acct: string;
12
+ }, {
13
+ id: string;
14
+ url: string;
15
+ username: string;
16
+ acct: string;
17
+ }>;
18
+ export type Mention = z.infer<typeof Mention>;
@@ -0,0 +1,12 @@
1
+ // This schema is base on https://docs.joinmastodon.org/entities/Status/#Mention
2
+ import { z } from "zod";
3
+ export const Mention = z.object({
4
+ id: z.string({ description: "The actor ID of the mentioned user" }),
5
+ username: z.string({ description: "The username of the mentioned user" }),
6
+ url: z.string({
7
+ description: "The location of the mentioned user’s profile",
8
+ }),
9
+ acct: z.string({
10
+ description: "The webfinger acct: URI of the mentioned user. Equivalent to `username` for local users, or `username@domain` for remote users",
11
+ }),
12
+ });
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+ export declare const Tag: z.ZodObject<{
3
+ name: z.ZodString;
4
+ url: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ url: string;
7
+ name: string;
8
+ }, {
9
+ url: string;
10
+ name: string;
11
+ }>;
12
+ export type Tag = z.infer<typeof Tag>;
@@ -0,0 +1,10 @@
1
+ // This schema is base on https://docs.joinmastodon.org/entities/Status/#Tag
2
+ import { z } from "zod";
3
+ export const Tag = z.object({
4
+ name: z.string({
5
+ description: "The value of the hashtag after the `#` sign",
6
+ }),
7
+ url: z.string({
8
+ description: "A link to the hashtag on the instance",
9
+ }),
10
+ });
@@ -0,0 +1,3 @@
1
+ import { z } from "zod";
2
+ export declare const Visibility: z.ZodEnum<["public", "unlist", "private", "direct"]>;
3
+ export type Visibility = z.infer<typeof Visibility>;
@@ -0,0 +1,3 @@
1
+ // This schema is base on https://docs.joinmastodon.org/entities/Status/#visibility
2
+ import { z } from "zod";
3
+ export const Visibility = z.enum(["public", "unlist", "private", "direct"]);
@@ -0,0 +1,251 @@
1
+ import { z } from "zod";
2
+ export declare const BaseContent: z.ZodObject<{
3
+ id: z.ZodString;
4
+ url: z.ZodString;
5
+ attributedTo: z.ZodString;
6
+ to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
+ cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
8
+ inReplyTo: z.ZodNullable<z.ZodString>;
9
+ summary: z.ZodOptional<z.ZodString>;
10
+ summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
+ content: z.ZodOptional<z.ZodString>;
12
+ contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
14
+ type: z.ZodLiteral<"PropertyValue">;
15
+ name: z.ZodString;
16
+ value: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ type: "PropertyValue";
19
+ value: string;
20
+ name: string;
21
+ }, {
22
+ type: "PropertyValue";
23
+ value: string;
24
+ name: string;
25
+ }>, z.ZodObject<{
26
+ type: z.ZodLiteral<"Document">;
27
+ mediaType: z.ZodString;
28
+ url: z.ZodString;
29
+ blurhash: z.ZodOptional<z.ZodString>;
30
+ width: z.ZodOptional<z.ZodNumber>;
31
+ height: z.ZodOptional<z.ZodNumber>;
32
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
33
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ type: "Document";
36
+ mediaType: string;
37
+ url: string;
38
+ blurhash?: string | undefined;
39
+ width?: number | undefined;
40
+ height?: number | undefined;
41
+ name?: string | null | undefined;
42
+ focalPoint?: [number, number] | undefined;
43
+ }, {
44
+ type: "Document";
45
+ mediaType: string;
46
+ url: string;
47
+ blurhash?: string | undefined;
48
+ width?: number | undefined;
49
+ height?: number | undefined;
50
+ name?: string | null | undefined;
51
+ focalPoint?: [number, number] | undefined;
52
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
53
+ type: z.ZodLiteral<"PropertyValue">;
54
+ name: z.ZodString;
55
+ value: z.ZodString;
56
+ }, "strip", z.ZodTypeAny, {
57
+ type: "PropertyValue";
58
+ value: string;
59
+ name: string;
60
+ }, {
61
+ type: "PropertyValue";
62
+ value: string;
63
+ name: string;
64
+ }>, z.ZodObject<{
65
+ type: z.ZodLiteral<"Document">;
66
+ mediaType: z.ZodString;
67
+ url: z.ZodString;
68
+ blurhash: z.ZodOptional<z.ZodString>;
69
+ width: z.ZodOptional<z.ZodNumber>;
70
+ height: z.ZodOptional<z.ZodNumber>;
71
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
72
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ type: "Document";
75
+ mediaType: string;
76
+ url: string;
77
+ blurhash?: string | undefined;
78
+ width?: number | undefined;
79
+ height?: number | undefined;
80
+ name?: string | null | undefined;
81
+ focalPoint?: [number, number] | undefined;
82
+ }, {
83
+ type: "Document";
84
+ mediaType: string;
85
+ url: string;
86
+ blurhash?: string | undefined;
87
+ width?: number | undefined;
88
+ height?: number | undefined;
89
+ name?: string | null | undefined;
90
+ focalPoint?: [number, number] | undefined;
91
+ }>]>, "many">]>>;
92
+ tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
93
+ type: z.ZodLiteral<"Mention">;
94
+ href: z.ZodString;
95
+ name: z.ZodString;
96
+ }, "strip", z.ZodTypeAny, {
97
+ type: "Mention";
98
+ name: string;
99
+ href: string;
100
+ }, {
101
+ type: "Mention";
102
+ name: string;
103
+ href: string;
104
+ }>, z.ZodObject<{
105
+ type: z.ZodLiteral<"Emoji">;
106
+ name: z.ZodString;
107
+ updated: z.ZodString;
108
+ icon: z.ZodObject<{
109
+ type: z.ZodLiteral<"Image">;
110
+ mediaType: z.ZodString;
111
+ url: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ type: "Image";
114
+ mediaType: string;
115
+ url: string;
116
+ }, {
117
+ type: "Image";
118
+ mediaType: string;
119
+ url: string;
120
+ }>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ type: "Emoji";
123
+ name: string;
124
+ updated: string;
125
+ icon: {
126
+ type: "Image";
127
+ mediaType: string;
128
+ url: string;
129
+ };
130
+ }, {
131
+ type: "Emoji";
132
+ name: string;
133
+ updated: string;
134
+ icon: {
135
+ type: "Image";
136
+ mediaType: string;
137
+ url: string;
138
+ };
139
+ }>]>, "many">;
140
+ published: z.ZodString;
141
+ updated: z.ZodOptional<z.ZodString>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ id: string;
144
+ url: string;
145
+ attributedTo: string;
146
+ to: string | string[];
147
+ cc: string | string[];
148
+ inReplyTo: string | null;
149
+ tag: ({
150
+ type: "Emoji";
151
+ name: string;
152
+ updated: string;
153
+ icon: {
154
+ type: "Image";
155
+ mediaType: string;
156
+ url: string;
157
+ };
158
+ } | {
159
+ type: "Mention";
160
+ name: string;
161
+ href: string;
162
+ })[];
163
+ published: string;
164
+ updated?: string | undefined;
165
+ summary?: string | undefined;
166
+ summaryMap?: Record<string, string> | undefined;
167
+ content?: string | undefined;
168
+ contentMap?: Record<string, string> | undefined;
169
+ attachment?: {
170
+ type: "Document";
171
+ mediaType: string;
172
+ url: string;
173
+ blurhash?: string | undefined;
174
+ width?: number | undefined;
175
+ height?: number | undefined;
176
+ name?: string | null | undefined;
177
+ focalPoint?: [number, number] | undefined;
178
+ } | {
179
+ type: "PropertyValue";
180
+ value: string;
181
+ name: string;
182
+ } | ({
183
+ type: "Document";
184
+ mediaType: string;
185
+ url: string;
186
+ blurhash?: string | undefined;
187
+ width?: number | undefined;
188
+ height?: number | undefined;
189
+ name?: string | null | undefined;
190
+ focalPoint?: [number, number] | undefined;
191
+ } | {
192
+ type: "PropertyValue";
193
+ value: string;
194
+ name: string;
195
+ })[] | undefined;
196
+ }, {
197
+ id: string;
198
+ url: string;
199
+ attributedTo: string;
200
+ to: string | string[];
201
+ cc: string | string[];
202
+ inReplyTo: string | null;
203
+ tag: ({
204
+ type: "Emoji";
205
+ name: string;
206
+ updated: string;
207
+ icon: {
208
+ type: "Image";
209
+ mediaType: string;
210
+ url: string;
211
+ };
212
+ } | {
213
+ type: "Mention";
214
+ name: string;
215
+ href: string;
216
+ })[];
217
+ published: string;
218
+ updated?: string | undefined;
219
+ summary?: string | undefined;
220
+ summaryMap?: Record<string, string> | undefined;
221
+ content?: string | undefined;
222
+ contentMap?: Record<string, string> | undefined;
223
+ attachment?: {
224
+ type: "Document";
225
+ mediaType: string;
226
+ url: string;
227
+ blurhash?: string | undefined;
228
+ width?: number | undefined;
229
+ height?: number | undefined;
230
+ name?: string | null | undefined;
231
+ focalPoint?: [number, number] | undefined;
232
+ } | {
233
+ type: "PropertyValue";
234
+ value: string;
235
+ name: string;
236
+ } | ({
237
+ type: "Document";
238
+ mediaType: string;
239
+ url: string;
240
+ blurhash?: string | undefined;
241
+ width?: number | undefined;
242
+ height?: number | undefined;
243
+ name?: string | null | undefined;
244
+ focalPoint?: [number, number] | undefined;
245
+ } | {
246
+ type: "PropertyValue";
247
+ value: string;
248
+ name: string;
249
+ })[] | undefined;
250
+ }>;
251
+ export type BaseContent = z.infer<typeof BaseContent>;
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { Attachment } from "./attachment.js";
3
+ import { Emoji } from "./emoji.js";
4
+ import { Mention } from "./mention.js";
5
+ export const BaseContent = z.object({
6
+ id: z.string(),
7
+ url: z.string({ description: "Note URL" }),
8
+ attributedTo: z.string({ description: "Note publisher" }),
9
+ to: z.union([z.string(), z.string().array()]),
10
+ cc: z.union([z.string(), z.string().array()]),
11
+ inReplyTo: z.string().nullable(),
12
+ summary: z.string({ description: "Note short summary" }).optional(),
13
+ summaryMap: z
14
+ .record(z.string(), { description: "Note short summary in each locale" })
15
+ .optional(),
16
+ content: z.string({ description: "Note content" }).optional(),
17
+ contentMap: z
18
+ .record(z.string(), { description: "Note content in each locale" })
19
+ .optional(),
20
+ attachment: z.union([Attachment, Attachment.array()]).optional(),
21
+ tag: z.union([Mention, Emoji]).array(),
22
+ published: z.string({ description: "Object published datetime" }),
23
+ updated: z.string({ description: "Object updated datetime" }).optional(),
24
+ });
package/dist/note.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { z } from "zod";
2
- export declare const Note: z.ZodObject<{
2
+ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
3
3
  id: z.ZodString;
4
4
  url: z.ZodString;
5
- updated: z.ZodOptional<z.ZodString>;
6
5
  attributedTo: z.ZodString;
7
6
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
8
7
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
@@ -139,14 +138,16 @@ export declare const Note: z.ZodObject<{
139
138
  };
140
139
  }>]>, "many">;
141
140
  published: z.ZodString;
141
+ updated: z.ZodOptional<z.ZodString>;
142
+ }, {
142
143
  type: z.ZodLiteral<"Note">;
143
- }, "strip", z.ZodTypeAny, {
144
+ }>, "strip", z.ZodTypeAny, {
144
145
  id: string;
145
146
  type: "Note";
146
147
  url: string;
147
148
  attributedTo: string;
148
- to: (string | string[]) & (string | string[] | undefined);
149
- cc: (string | string[]) & (string | string[] | undefined);
149
+ to: string | string[];
150
+ cc: string | string[];
150
151
  inReplyTo: string | null;
151
152
  tag: ({
152
153
  type: "Emoji";
@@ -200,8 +201,8 @@ export declare const Note: z.ZodObject<{
200
201
  type: "Note";
201
202
  url: string;
202
203
  attributedTo: string;
203
- to: (string | string[]) & (string | string[] | undefined);
204
- cc: (string | string[]) & (string | string[] | undefined);
204
+ to: string | string[];
205
+ cc: string | string[];
205
206
  inReplyTo: string | null;
206
207
  tag: ({
207
208
  type: "Emoji";
package/dist/note.js CHANGED
@@ -1,27 +1,5 @@
1
1
  import { z } from "zod";
2
- import { Attachment } from "./note/attachment.js";
3
- import { Emoji } from "./note/emoji.js";
4
- import { Mention } from "./note/mention.js";
5
- const BaseContent = z.object({
6
- id: z.string(),
7
- url: z.string({ description: "Note URL" }),
8
- attributedTo: z.string({ description: "Note publisher" }),
9
- to: z.union([z.string(), z.string().array()]),
10
- cc: z.union([z.string(), z.string().array()]),
11
- inReplyTo: z.string().nullable(),
12
- summary: z.string({ description: "Note short summary" }).optional(),
13
- summaryMap: z
14
- .record(z.string(), { description: "Note short summary in each locale" })
15
- .optional(),
16
- content: z.string({ description: "Note content" }).optional(),
17
- contentMap: z
18
- .record(z.string(), { description: "Note content in each locale" })
19
- .optional(),
20
- attachment: z.union([Attachment, Attachment.array()]).optional(),
21
- tag: z.union([Mention, Emoji]).array(),
22
- published: z.string({ description: "Object published datetime" }),
23
- updated: z.string({ description: "Object updated datetime" }).optional(),
24
- });
2
+ import { BaseContent } from "./note/baseContent.js";
25
3
  export const Note = BaseContent.extend({
26
4
  type: z.literal("Note"),
27
5
  });