@llun/activities.schema 0.0.5 → 0.0.6
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 +5 -0
- package/dist/index.js +5 -0
- package/dist/like.d.ts +387 -14
- package/dist/note/attachment.d.ts +42 -0
- package/dist/note/attachment.js +4 -0
- package/dist/note/document.d.ts +30 -0
- package/dist/note/document.js +11 -0
- package/dist/note/emoji.d.ts +38 -0
- package/dist/note/emoji.js +8 -0
- package/dist/note/image.d.ts +15 -0
- package/dist/note/image.js +6 -0
- package/dist/note/mention.d.ts +15 -0
- package/dist/note/mention.js +6 -0
- package/dist/note/propertyValue.d.ts +15 -0
- package/dist/note/propertyValue.js +6 -0
- package/dist/note.d.ts +215 -6
- package/dist/note.js +6 -1
- package/dist/undo.d.ts +560 -22
- package/package.json +4 -6
- package/src/index.ts +5 -0
- package/src/note/attachment.ts +8 -0
- package/src/note/document.ts +14 -0
- package/src/note/emoji.ts +12 -0
- package/src/note/image.ts +9 -0
- package/src/note/mention.ts +9 -0
- package/src/note/propertyValue.ts +9 -0
- package/src/note.ts +7 -1
- package/src/undo.ts +2 -0
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llun/activities.schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Validate ActivityPub with Zod",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"default": "./dist/index.js"
|
|
8
|
-
},
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
9
7
|
"type": "module",
|
|
10
8
|
"scripts": {
|
|
11
9
|
"build": "tsc",
|
|
@@ -17,7 +15,7 @@
|
|
|
17
15
|
"zod": "^3.22.4"
|
|
18
16
|
},
|
|
19
17
|
"devDependencies": {
|
|
20
|
-
"typescript": "^5.
|
|
18
|
+
"typescript": "^5.3.2"
|
|
21
19
|
},
|
|
22
20
|
"packageManager": "yarn@4.0.1"
|
|
23
21
|
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
export const Document = z.object({
|
|
4
|
+
type: z.literal("Document"),
|
|
5
|
+
mediaType: z.string(),
|
|
6
|
+
url: z.string(),
|
|
7
|
+
blurhash: z.string().optional(),
|
|
8
|
+
width: z.number().optional(),
|
|
9
|
+
height: z.number().optional(),
|
|
10
|
+
name: z.string().optional().nullable(),
|
|
11
|
+
focalPoint: z.tuple([z.number(), z.number()]).optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type Document = z.infer<typeof Document>;
|
package/src/note.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
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";
|
|
2
5
|
|
|
3
6
|
const BaseContent = z.object({
|
|
4
7
|
id: z.string(),
|
|
@@ -8,7 +11,7 @@ const BaseContent = z.object({
|
|
|
8
11
|
to: z.union([z.string(), z.string().array()]),
|
|
9
12
|
cc: z.union([z.string(), z.string().array()]),
|
|
10
13
|
|
|
11
|
-
inReplyTo: z.string().
|
|
14
|
+
inReplyTo: z.string().nullable(),
|
|
12
15
|
|
|
13
16
|
summary: z.string({ description: "Note short summary" }).optional(),
|
|
14
17
|
summaryMap: z
|
|
@@ -20,6 +23,9 @@ const BaseContent = z.object({
|
|
|
20
23
|
.record(z.string(), { description: "Note content in each locale" })
|
|
21
24
|
.optional(),
|
|
22
25
|
|
|
26
|
+
attachment: z.union([Attachment, Attachment.array()]).optional(),
|
|
27
|
+
tag: z.union([Mention, Emoji]).array(),
|
|
28
|
+
|
|
23
29
|
published: z.string({ description: "Object published datetime" }),
|
|
24
30
|
updated: z.string({ description: "Object updated datetime" }).optional(),
|
|
25
31
|
});
|