@llun/activities.schema 0.0.7 → 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
- package/src/index.ts +2 -0
- package/src/mastodon/account.ts +111 -0
- package/src/mastodon/accountField.ts +18 -0
- package/src/mastodon/customEmoji.ts +24 -0
- package/src/mastodon/index.ts +3 -0
package/dist/undo.d.ts
CHANGED
|
@@ -7,10 +7,9 @@ export declare const Undo: z.ZodObject<{
|
|
|
7
7
|
type: z.ZodLiteral<"Like">;
|
|
8
8
|
id: z.ZodString;
|
|
9
9
|
actor: z.ZodString;
|
|
10
|
-
object: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
10
|
+
object: z.ZodUnion<[z.ZodString, z.ZodObject<z.objectUtil.extendShape<{
|
|
11
11
|
id: z.ZodString;
|
|
12
12
|
url: z.ZodString;
|
|
13
|
-
updated: z.ZodOptional<z.ZodString>;
|
|
14
13
|
attributedTo: z.ZodString;
|
|
15
14
|
to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
16
15
|
cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
|
|
@@ -147,14 +146,16 @@ export declare const Undo: z.ZodObject<{
|
|
|
147
146
|
};
|
|
148
147
|
}>]>, "many">;
|
|
149
148
|
published: z.ZodString;
|
|
149
|
+
updated: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, {
|
|
150
151
|
type: z.ZodLiteral<"Note">;
|
|
151
|
-
}
|
|
152
|
+
}>, "strip", z.ZodTypeAny, {
|
|
152
153
|
id: string;
|
|
153
154
|
type: "Note";
|
|
154
155
|
url: string;
|
|
155
156
|
attributedTo: string;
|
|
156
|
-
to:
|
|
157
|
-
cc:
|
|
157
|
+
to: string | string[];
|
|
158
|
+
cc: string | string[];
|
|
158
159
|
inReplyTo: string | null;
|
|
159
160
|
tag: ({
|
|
160
161
|
type: "Emoji";
|
|
@@ -208,8 +209,8 @@ export declare const Undo: z.ZodObject<{
|
|
|
208
209
|
type: "Note";
|
|
209
210
|
url: string;
|
|
210
211
|
attributedTo: string;
|
|
211
|
-
to:
|
|
212
|
-
cc:
|
|
212
|
+
to: string | string[];
|
|
213
|
+
cc: string | string[];
|
|
213
214
|
inReplyTo: string | null;
|
|
214
215
|
tag: ({
|
|
215
216
|
type: "Emoji";
|
|
@@ -260,68 +261,13 @@ export declare const Undo: z.ZodObject<{
|
|
|
260
261
|
})[] | undefined;
|
|
261
262
|
}>]>;
|
|
262
263
|
}, "strip", z.ZodTypeAny, {
|
|
263
|
-
object:
|
|
264
|
-
id: string;
|
|
265
|
-
type: "Note";
|
|
266
|
-
url: string;
|
|
267
|
-
attributedTo: string;
|
|
268
|
-
to: (string | string[]) & (string | string[] | undefined);
|
|
269
|
-
cc: (string | string[]) & (string | string[] | undefined);
|
|
270
|
-
inReplyTo: string | null;
|
|
271
|
-
tag: ({
|
|
272
|
-
type: "Emoji";
|
|
273
|
-
name: string;
|
|
274
|
-
updated: string;
|
|
275
|
-
icon: {
|
|
276
|
-
type: "Image";
|
|
277
|
-
mediaType: string;
|
|
278
|
-
url: string;
|
|
279
|
-
};
|
|
280
|
-
} | {
|
|
281
|
-
type: "Mention";
|
|
282
|
-
name: string;
|
|
283
|
-
href: string;
|
|
284
|
-
})[];
|
|
285
|
-
published: string;
|
|
286
|
-
updated?: string | undefined;
|
|
287
|
-
summary?: string | undefined;
|
|
288
|
-
summaryMap?: Record<string, string> | undefined;
|
|
289
|
-
content?: string | undefined;
|
|
290
|
-
contentMap?: Record<string, string> | undefined;
|
|
291
|
-
attachment?: {
|
|
292
|
-
type: "Document";
|
|
293
|
-
mediaType: string;
|
|
294
|
-
url: string;
|
|
295
|
-
blurhash?: string | undefined;
|
|
296
|
-
width?: number | undefined;
|
|
297
|
-
height?: number | undefined;
|
|
298
|
-
name?: string | null | undefined;
|
|
299
|
-
focalPoint?: [number, number] | undefined;
|
|
300
|
-
} | {
|
|
301
|
-
type: "PropertyValue";
|
|
302
|
-
value: string;
|
|
303
|
-
name: string;
|
|
304
|
-
} | ({
|
|
305
|
-
type: "Document";
|
|
306
|
-
mediaType: string;
|
|
307
|
-
url: string;
|
|
308
|
-
blurhash?: string | undefined;
|
|
309
|
-
width?: number | undefined;
|
|
310
|
-
height?: number | undefined;
|
|
311
|
-
name?: string | null | undefined;
|
|
312
|
-
focalPoint?: [number, number] | undefined;
|
|
313
|
-
} | {
|
|
314
|
-
type: "PropertyValue";
|
|
315
|
-
value: string;
|
|
316
|
-
name: string;
|
|
317
|
-
})[] | undefined;
|
|
318
|
-
}) & (string | {
|
|
264
|
+
object: string | {
|
|
319
265
|
id: string;
|
|
320
266
|
type: "Note";
|
|
321
267
|
url: string;
|
|
322
268
|
attributedTo: string;
|
|
323
|
-
to:
|
|
324
|
-
cc:
|
|
269
|
+
to: string | string[];
|
|
270
|
+
cc: string | string[];
|
|
325
271
|
inReplyTo: string | null;
|
|
326
272
|
tag: ({
|
|
327
273
|
type: "Emoji";
|
|
@@ -370,18 +316,18 @@ export declare const Undo: z.ZodObject<{
|
|
|
370
316
|
value: string;
|
|
371
317
|
name: string;
|
|
372
318
|
})[] | undefined;
|
|
373
|
-
}
|
|
319
|
+
};
|
|
374
320
|
id: string;
|
|
375
321
|
type: "Like";
|
|
376
322
|
actor: string;
|
|
377
323
|
}, {
|
|
378
|
-
object:
|
|
324
|
+
object: string | {
|
|
379
325
|
id: string;
|
|
380
326
|
type: "Note";
|
|
381
327
|
url: string;
|
|
382
328
|
attributedTo: string;
|
|
383
|
-
to:
|
|
384
|
-
cc:
|
|
329
|
+
to: string | string[];
|
|
330
|
+
cc: string | string[];
|
|
385
331
|
inReplyTo: string | null;
|
|
386
332
|
tag: ({
|
|
387
333
|
type: "Emoji";
|
|
@@ -430,62 +376,7 @@ export declare const Undo: z.ZodObject<{
|
|
|
430
376
|
value: string;
|
|
431
377
|
name: string;
|
|
432
378
|
})[] | undefined;
|
|
433
|
-
}
|
|
434
|
-
id: string;
|
|
435
|
-
type: "Note";
|
|
436
|
-
url: string;
|
|
437
|
-
attributedTo: string;
|
|
438
|
-
to: (string | string[]) & (string | string[] | undefined);
|
|
439
|
-
cc: (string | string[]) & (string | string[] | undefined);
|
|
440
|
-
inReplyTo: string | null;
|
|
441
|
-
tag: ({
|
|
442
|
-
type: "Emoji";
|
|
443
|
-
name: string;
|
|
444
|
-
updated: string;
|
|
445
|
-
icon: {
|
|
446
|
-
type: "Image";
|
|
447
|
-
mediaType: string;
|
|
448
|
-
url: string;
|
|
449
|
-
};
|
|
450
|
-
} | {
|
|
451
|
-
type: "Mention";
|
|
452
|
-
name: string;
|
|
453
|
-
href: string;
|
|
454
|
-
})[];
|
|
455
|
-
published: string;
|
|
456
|
-
updated?: string | undefined;
|
|
457
|
-
summary?: string | undefined;
|
|
458
|
-
summaryMap?: Record<string, string> | undefined;
|
|
459
|
-
content?: string | undefined;
|
|
460
|
-
contentMap?: Record<string, string> | undefined;
|
|
461
|
-
attachment?: {
|
|
462
|
-
type: "Document";
|
|
463
|
-
mediaType: string;
|
|
464
|
-
url: string;
|
|
465
|
-
blurhash?: string | undefined;
|
|
466
|
-
width?: number | undefined;
|
|
467
|
-
height?: number | undefined;
|
|
468
|
-
name?: string | null | undefined;
|
|
469
|
-
focalPoint?: [number, number] | undefined;
|
|
470
|
-
} | {
|
|
471
|
-
type: "PropertyValue";
|
|
472
|
-
value: string;
|
|
473
|
-
name: string;
|
|
474
|
-
} | ({
|
|
475
|
-
type: "Document";
|
|
476
|
-
mediaType: string;
|
|
477
|
-
url: string;
|
|
478
|
-
blurhash?: string | undefined;
|
|
479
|
-
width?: number | undefined;
|
|
480
|
-
height?: number | undefined;
|
|
481
|
-
name?: string | null | undefined;
|
|
482
|
-
focalPoint?: [number, number] | undefined;
|
|
483
|
-
} | {
|
|
484
|
-
type: "PropertyValue";
|
|
485
|
-
value: string;
|
|
486
|
-
name: string;
|
|
487
|
-
})[] | undefined;
|
|
488
|
-
} | undefined);
|
|
379
|
+
};
|
|
489
380
|
id: string;
|
|
490
381
|
type: "Like";
|
|
491
382
|
actor: string;
|
|
@@ -512,68 +403,13 @@ export declare const Undo: z.ZodObject<{
|
|
|
512
403
|
type: "Follow";
|
|
513
404
|
actor: string;
|
|
514
405
|
} | {
|
|
515
|
-
object:
|
|
516
|
-
id: string;
|
|
517
|
-
type: "Note";
|
|
518
|
-
url: string;
|
|
519
|
-
attributedTo: string;
|
|
520
|
-
to: (string | string[]) & (string | string[] | undefined);
|
|
521
|
-
cc: (string | string[]) & (string | string[] | undefined);
|
|
522
|
-
inReplyTo: string | null;
|
|
523
|
-
tag: ({
|
|
524
|
-
type: "Emoji";
|
|
525
|
-
name: string;
|
|
526
|
-
updated: string;
|
|
527
|
-
icon: {
|
|
528
|
-
type: "Image";
|
|
529
|
-
mediaType: string;
|
|
530
|
-
url: string;
|
|
531
|
-
};
|
|
532
|
-
} | {
|
|
533
|
-
type: "Mention";
|
|
534
|
-
name: string;
|
|
535
|
-
href: string;
|
|
536
|
-
})[];
|
|
537
|
-
published: string;
|
|
538
|
-
updated?: string | undefined;
|
|
539
|
-
summary?: string | undefined;
|
|
540
|
-
summaryMap?: Record<string, string> | undefined;
|
|
541
|
-
content?: string | undefined;
|
|
542
|
-
contentMap?: Record<string, string> | undefined;
|
|
543
|
-
attachment?: {
|
|
544
|
-
type: "Document";
|
|
545
|
-
mediaType: string;
|
|
546
|
-
url: string;
|
|
547
|
-
blurhash?: string | undefined;
|
|
548
|
-
width?: number | undefined;
|
|
549
|
-
height?: number | undefined;
|
|
550
|
-
name?: string | null | undefined;
|
|
551
|
-
focalPoint?: [number, number] | undefined;
|
|
552
|
-
} | {
|
|
553
|
-
type: "PropertyValue";
|
|
554
|
-
value: string;
|
|
555
|
-
name: string;
|
|
556
|
-
} | ({
|
|
557
|
-
type: "Document";
|
|
558
|
-
mediaType: string;
|
|
559
|
-
url: string;
|
|
560
|
-
blurhash?: string | undefined;
|
|
561
|
-
width?: number | undefined;
|
|
562
|
-
height?: number | undefined;
|
|
563
|
-
name?: string | null | undefined;
|
|
564
|
-
focalPoint?: [number, number] | undefined;
|
|
565
|
-
} | {
|
|
566
|
-
type: "PropertyValue";
|
|
567
|
-
value: string;
|
|
568
|
-
name: string;
|
|
569
|
-
})[] | undefined;
|
|
570
|
-
}) & (string | {
|
|
406
|
+
object: string | {
|
|
571
407
|
id: string;
|
|
572
408
|
type: "Note";
|
|
573
409
|
url: string;
|
|
574
410
|
attributedTo: string;
|
|
575
|
-
to:
|
|
576
|
-
cc:
|
|
411
|
+
to: string | string[];
|
|
412
|
+
cc: string | string[];
|
|
577
413
|
inReplyTo: string | null;
|
|
578
414
|
tag: ({
|
|
579
415
|
type: "Emoji";
|
|
@@ -622,7 +458,7 @@ export declare const Undo: z.ZodObject<{
|
|
|
622
458
|
value: string;
|
|
623
459
|
name: string;
|
|
624
460
|
})[] | undefined;
|
|
625
|
-
}
|
|
461
|
+
};
|
|
626
462
|
id: string;
|
|
627
463
|
type: "Like";
|
|
628
464
|
actor: string;
|
|
@@ -637,68 +473,13 @@ export declare const Undo: z.ZodObject<{
|
|
|
637
473
|
type: "Follow";
|
|
638
474
|
actor: string;
|
|
639
475
|
} | {
|
|
640
|
-
object:
|
|
641
|
-
id: string;
|
|
642
|
-
type: "Note";
|
|
643
|
-
url: string;
|
|
644
|
-
attributedTo: string;
|
|
645
|
-
to: (string | string[]) & (string | string[] | undefined);
|
|
646
|
-
cc: (string | string[]) & (string | string[] | undefined);
|
|
647
|
-
inReplyTo: string | null;
|
|
648
|
-
tag: ({
|
|
649
|
-
type: "Emoji";
|
|
650
|
-
name: string;
|
|
651
|
-
updated: string;
|
|
652
|
-
icon: {
|
|
653
|
-
type: "Image";
|
|
654
|
-
mediaType: string;
|
|
655
|
-
url: string;
|
|
656
|
-
};
|
|
657
|
-
} | {
|
|
658
|
-
type: "Mention";
|
|
659
|
-
name: string;
|
|
660
|
-
href: string;
|
|
661
|
-
})[];
|
|
662
|
-
published: string;
|
|
663
|
-
updated?: string | undefined;
|
|
664
|
-
summary?: string | undefined;
|
|
665
|
-
summaryMap?: Record<string, string> | undefined;
|
|
666
|
-
content?: string | undefined;
|
|
667
|
-
contentMap?: Record<string, string> | undefined;
|
|
668
|
-
attachment?: {
|
|
669
|
-
type: "Document";
|
|
670
|
-
mediaType: string;
|
|
671
|
-
url: string;
|
|
672
|
-
blurhash?: string | undefined;
|
|
673
|
-
width?: number | undefined;
|
|
674
|
-
height?: number | undefined;
|
|
675
|
-
name?: string | null | undefined;
|
|
676
|
-
focalPoint?: [number, number] | undefined;
|
|
677
|
-
} | {
|
|
678
|
-
type: "PropertyValue";
|
|
679
|
-
value: string;
|
|
680
|
-
name: string;
|
|
681
|
-
} | ({
|
|
682
|
-
type: "Document";
|
|
683
|
-
mediaType: string;
|
|
684
|
-
url: string;
|
|
685
|
-
blurhash?: string | undefined;
|
|
686
|
-
width?: number | undefined;
|
|
687
|
-
height?: number | undefined;
|
|
688
|
-
name?: string | null | undefined;
|
|
689
|
-
focalPoint?: [number, number] | undefined;
|
|
690
|
-
} | {
|
|
691
|
-
type: "PropertyValue";
|
|
692
|
-
value: string;
|
|
693
|
-
name: string;
|
|
694
|
-
})[] | undefined;
|
|
695
|
-
}) & (string | {
|
|
476
|
+
object: string | {
|
|
696
477
|
id: string;
|
|
697
478
|
type: "Note";
|
|
698
479
|
url: string;
|
|
699
480
|
attributedTo: string;
|
|
700
|
-
to:
|
|
701
|
-
cc:
|
|
481
|
+
to: string | string[];
|
|
482
|
+
cc: string | string[];
|
|
702
483
|
inReplyTo: string | null;
|
|
703
484
|
tag: ({
|
|
704
485
|
type: "Emoji";
|
|
@@ -747,7 +528,7 @@ export declare const Undo: z.ZodObject<{
|
|
|
747
528
|
value: string;
|
|
748
529
|
name: string;
|
|
749
530
|
})[] | undefined;
|
|
750
|
-
}
|
|
531
|
+
};
|
|
751
532
|
id: string;
|
|
752
533
|
type: "Like";
|
|
753
534
|
actor: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llun/activities.schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "Validate ActivityPub with Zod",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"author": "Maythee Anegboonlap <null@llun.dev>",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"zod": "^3.23.
|
|
15
|
+
"zod": "^3.23.8"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"typescript": "^5.4.5"
|
|
19
19
|
},
|
|
20
|
-
"packageManager": "yarn@4.
|
|
20
|
+
"packageManager": "yarn@4.2.2"
|
|
21
21
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { AccountField } from "./accountField.js";
|
|
4
|
+
import { CustomEmoji } from "./customEmoji.js";
|
|
5
|
+
|
|
6
|
+
const BaseAccount = z.object({
|
|
7
|
+
id: z.string({
|
|
8
|
+
description:
|
|
9
|
+
"This is actor id, for Mastodon, it is a string that case from number but in Activities.next, this is URI",
|
|
10
|
+
}),
|
|
11
|
+
username: z.string({
|
|
12
|
+
description: "The username of the actor, not including domain",
|
|
13
|
+
}),
|
|
14
|
+
acct: z.string({
|
|
15
|
+
description:
|
|
16
|
+
"The Webfinger actor URI. Equal to username for local users, or username@domain for remote users",
|
|
17
|
+
}),
|
|
18
|
+
url: z.string({
|
|
19
|
+
description: "The location of the user's profile page",
|
|
20
|
+
}),
|
|
21
|
+
display_name: z.string({
|
|
22
|
+
description: "The profile's display name",
|
|
23
|
+
}),
|
|
24
|
+
note: z.string({
|
|
25
|
+
description: "The profile's bio or description",
|
|
26
|
+
}),
|
|
27
|
+
avatar: z.string({
|
|
28
|
+
description:
|
|
29
|
+
"An image URL icon that is shown next to statuses and in the profile",
|
|
30
|
+
}),
|
|
31
|
+
avatar_static: z.string({
|
|
32
|
+
description:
|
|
33
|
+
"A static version of the `avatar`. Equal to `avatar` if its value is a static image; different if `avatar` is an animated GIF",
|
|
34
|
+
}),
|
|
35
|
+
header: z.string({
|
|
36
|
+
description:
|
|
37
|
+
"An image banner URL that is shown above the profile and in profile cards.",
|
|
38
|
+
}),
|
|
39
|
+
header_static: z.string({
|
|
40
|
+
description:
|
|
41
|
+
"A static version of the `header`. Equal to `header` if its value is a static image; different if `header` is an animated GIF",
|
|
42
|
+
}),
|
|
43
|
+
loacked: z.string({
|
|
44
|
+
description: "Whether the actor manually approves follow requests",
|
|
45
|
+
}),
|
|
46
|
+
fields: AccountField.array().describe(
|
|
47
|
+
"Additional metadata attached to a profile as name-value pairs"
|
|
48
|
+
),
|
|
49
|
+
emojis: CustomEmoji.array().describe(
|
|
50
|
+
"Custom emoji entities to be used when rendering the profile"
|
|
51
|
+
),
|
|
52
|
+
bot: z.boolean({
|
|
53
|
+
description:
|
|
54
|
+
"Indicates that the actor may perform automated actions, may not be monitored, or identifies as a robot",
|
|
55
|
+
}),
|
|
56
|
+
group: z.boolean({
|
|
57
|
+
description: "Indicates that the actor represents a Group actor",
|
|
58
|
+
}),
|
|
59
|
+
discoverable: z
|
|
60
|
+
.boolean({
|
|
61
|
+
description:
|
|
62
|
+
"Whether the actor has opted into discovery features such as the profile directory",
|
|
63
|
+
})
|
|
64
|
+
.nullable(),
|
|
65
|
+
noindex: z
|
|
66
|
+
.boolean({
|
|
67
|
+
description:
|
|
68
|
+
"Whether the local user has opted out of being indexed by search engines",
|
|
69
|
+
})
|
|
70
|
+
.nullish(),
|
|
71
|
+
suspended: z
|
|
72
|
+
.boolean({
|
|
73
|
+
description:
|
|
74
|
+
"An extra attribute returned only when an actor is suspended",
|
|
75
|
+
})
|
|
76
|
+
.optional(),
|
|
77
|
+
limited: z
|
|
78
|
+
.boolean({
|
|
79
|
+
description:
|
|
80
|
+
"An extra attribute returned only when an actor is silenced. If true, indicates that the actor should be hidden behind a warning screen.",
|
|
81
|
+
})
|
|
82
|
+
.optional(),
|
|
83
|
+
|
|
84
|
+
created_at: z.string({
|
|
85
|
+
description: "The time the actor was created in ISO 8601 Datetime format",
|
|
86
|
+
}),
|
|
87
|
+
last_status_at: z
|
|
88
|
+
.string({
|
|
89
|
+
description:
|
|
90
|
+
"The time when the most recent status was posted in ISO 8601 Datetime format",
|
|
91
|
+
})
|
|
92
|
+
.nullable(),
|
|
93
|
+
|
|
94
|
+
statuses_count: z.number({
|
|
95
|
+
description: "How many statuses are attached to this actor",
|
|
96
|
+
}),
|
|
97
|
+
followers_count: z.number({
|
|
98
|
+
description: "The reported followers of this profile",
|
|
99
|
+
}),
|
|
100
|
+
following_count: z.number({
|
|
101
|
+
description: "The reported follows of this profile",
|
|
102
|
+
}),
|
|
103
|
+
});
|
|
104
|
+
type BaseAccount = z.infer<typeof BaseAccount>;
|
|
105
|
+
|
|
106
|
+
export const Account = BaseAccount.extend({
|
|
107
|
+
moved: BaseAccount.nullable().describe(
|
|
108
|
+
"Indicates that the profile is currently inactive and that its user has moved to a new account"
|
|
109
|
+
),
|
|
110
|
+
});
|
|
111
|
+
export type Account = z.infer<typeof Account>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/Account/#Field
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const AccountField = z.object({
|
|
5
|
+
name: z.string({
|
|
6
|
+
description: "The key of a given field’s key-value pair",
|
|
7
|
+
}),
|
|
8
|
+
value: z.string({
|
|
9
|
+
description: "The value associated with the `name` key.",
|
|
10
|
+
}),
|
|
11
|
+
verified_at: z
|
|
12
|
+
.string({
|
|
13
|
+
description:
|
|
14
|
+
'Timestamp of when the server verified a URL value for a rel="me" link in ISO 8601 Date time format',
|
|
15
|
+
})
|
|
16
|
+
.nullable(),
|
|
17
|
+
});
|
|
18
|
+
export type AccountField = z.infer<typeof AccountField>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// This schema is base on https://docs.joinmastodon.org/entities/CustomEmoji/
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const CustomEmoji = z.object({
|
|
5
|
+
shortcode: z.string({
|
|
6
|
+
description: "The name of the custom emoji",
|
|
7
|
+
}),
|
|
8
|
+
static_url: z.string({
|
|
9
|
+
description: "A link to a static copy of the custom emoji",
|
|
10
|
+
}),
|
|
11
|
+
url: z.string({
|
|
12
|
+
description: "A link to the custom emoji",
|
|
13
|
+
}),
|
|
14
|
+
visible_in_picker: z.boolean({
|
|
15
|
+
description:
|
|
16
|
+
"Whether this Emoji should be visible in the picker or unlisted",
|
|
17
|
+
}),
|
|
18
|
+
category: z
|
|
19
|
+
.string({
|
|
20
|
+
description: "Used for sorting custom emoji in the picker",
|
|
21
|
+
})
|
|
22
|
+
.nullable(),
|
|
23
|
+
});
|
|
24
|
+
export type CustomEmoji = z.infer<typeof CustomEmoji>;
|