@llun/activities.schema 0.0.8 → 0.0.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.
- package/.yarn/install-state.gz +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/like.d.ts +16 -125
- package/dist/mastodon/account.d.ts +327 -0
- package/dist/mastodon/account.js +87 -0
- package/dist/mastodon/accountField.d.ts +15 -0
- package/dist/mastodon/accountField.js +15 -0
- package/dist/mastodon/customEmoji.d.ts +21 -0
- package/dist/mastodon/customEmoji.js +21 -0
- package/dist/mastodon/index.d.ts +3 -0
- package/dist/mastodon/index.js +3 -0
- package/dist/note/baseContent.d.ts +251 -0
- package/dist/note/baseContent.js +24 -0
- package/dist/note.d.ts +8 -7
- package/dist/note.js +1 -23
- package/dist/undo.d.ts +24 -243
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/CustomEmoji/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export const CustomEmoji = z.object({
|
|
4
|
+
shortcode: z.string({
|
|
5
|
+
description: "The name of the custom emoji",
|
|
6
|
+
}),
|
|
7
|
+
static_url: z.string({
|
|
8
|
+
description: "A link to a static copy of the custom emoji",
|
|
9
|
+
}),
|
|
10
|
+
url: z.string({
|
|
11
|
+
description: "A link to the custom emoji",
|
|
12
|
+
}),
|
|
13
|
+
visible_in_picker: z.boolean({
|
|
14
|
+
description: "Whether this Emoji should be visible in the picker or unlisted",
|
|
15
|
+
}),
|
|
16
|
+
category: z
|
|
17
|
+
.string({
|
|
18
|
+
description: "Used for sorting custom emoji in the picker",
|
|
19
|
+
})
|
|
20
|
+
.nullable(),
|
|
21
|
+
});
|
|
@@ -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
|
-
}
|
|
144
|
+
}>, "strip", z.ZodTypeAny, {
|
|
144
145
|
id: string;
|
|
145
146
|
type: "Note";
|
|
146
147
|
url: string;
|
|
147
148
|
attributedTo: string;
|
|
148
|
-
to:
|
|
149
|
-
cc:
|
|
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:
|
|
204
|
-
cc:
|
|
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 {
|
|
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
|
});
|