@llun/activities.schema 0.0.3 → 0.0.5

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.
Binary file
package/.yarnrc.yml ADDED
@@ -0,0 +1 @@
1
+ nodeLinker: node-modules
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const Accept: z.ZodObject<{
3
+ id: z.ZodString;
4
+ actor: z.ZodString;
5
+ type: z.ZodLiteral<"Accept">;
6
+ object: z.ZodObject<{
7
+ id: z.ZodString;
8
+ type: z.ZodLiteral<"Follow">;
9
+ actor: z.ZodString;
10
+ object: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ object: string;
13
+ id: string;
14
+ type: "Follow";
15
+ actor: string;
16
+ }, {
17
+ object: string;
18
+ id: string;
19
+ type: "Follow";
20
+ actor: string;
21
+ }>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ object: {
24
+ object: string;
25
+ id: string;
26
+ type: "Follow";
27
+ actor: string;
28
+ };
29
+ id: string;
30
+ type: "Accept";
31
+ actor: string;
32
+ }, {
33
+ object: {
34
+ object: string;
35
+ id: string;
36
+ type: "Follow";
37
+ actor: string;
38
+ };
39
+ id: string;
40
+ type: "Accept";
41
+ actor: string;
42
+ }>;
43
+ export type Accept = z.infer<typeof Accept>;
package/dist/accept.js ADDED
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import { Follow } from "./follow.js";
3
+ export const Accept = z.object({
4
+ id: z.string(),
5
+ actor: z.string(),
6
+ type: z.literal("Accept"),
7
+ object: Follow,
8
+ });
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ export declare const Follow: z.ZodObject<{
3
+ id: z.ZodString;
4
+ type: z.ZodLiteral<"Follow">;
5
+ actor: z.ZodString;
6
+ object: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ object: string;
9
+ id: string;
10
+ type: "Follow";
11
+ actor: string;
12
+ }, {
13
+ object: string;
14
+ id: string;
15
+ type: "Follow";
16
+ actor: string;
17
+ }>;
18
+ export type Follow = z.infer<typeof Follow>;
package/dist/follow.js ADDED
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ export const Follow = z.object({
3
+ id: z.string(),
4
+ type: z.literal("Follow"),
5
+ actor: z.string(),
6
+ object: z.string(),
7
+ });
package/dist/like.d.ts ADDED
@@ -0,0 +1,116 @@
1
+ import { z } from "zod";
2
+ export declare const Like: z.ZodObject<{
3
+ type: z.ZodLiteral<"Like">;
4
+ id: z.ZodString;
5
+ actor: z.ZodString;
6
+ object: z.ZodUnion<[z.ZodString, z.ZodObject<{
7
+ id: z.ZodString;
8
+ url: z.ZodString;
9
+ attributedTo: z.ZodString;
10
+ to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
11
+ cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
12
+ inReplyTo: z.ZodOptional<z.ZodString>;
13
+ summary: z.ZodOptional<z.ZodString>;
14
+ summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ content: z.ZodOptional<z.ZodString>;
16
+ contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
17
+ published: z.ZodString;
18
+ updated: z.ZodOptional<z.ZodString>;
19
+ type: z.ZodLiteral<"Note">;
20
+ }, "strip", z.ZodTypeAny, {
21
+ id: string;
22
+ type: "Note";
23
+ url: string;
24
+ attributedTo: string;
25
+ to: (string | string[]) & (string | string[] | undefined);
26
+ cc: (string | string[]) & (string | string[] | undefined);
27
+ published: string;
28
+ inReplyTo?: string | undefined;
29
+ summary?: string | undefined;
30
+ summaryMap?: Record<string, string> | undefined;
31
+ content?: string | undefined;
32
+ contentMap?: Record<string, string> | undefined;
33
+ updated?: string | undefined;
34
+ }, {
35
+ id: string;
36
+ type: "Note";
37
+ url: string;
38
+ attributedTo: string;
39
+ to: (string | string[]) & (string | string[] | undefined);
40
+ cc: (string | string[]) & (string | string[] | undefined);
41
+ published: string;
42
+ inReplyTo?: string | undefined;
43
+ summary?: string | undefined;
44
+ summaryMap?: Record<string, string> | undefined;
45
+ content?: string | undefined;
46
+ contentMap?: Record<string, string> | undefined;
47
+ updated?: string | undefined;
48
+ }>]>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ object: (string | {
51
+ id: string;
52
+ type: "Note";
53
+ url: string;
54
+ attributedTo: string;
55
+ to: (string | string[]) & (string | string[] | undefined);
56
+ cc: (string | string[]) & (string | string[] | undefined);
57
+ published: string;
58
+ inReplyTo?: string | undefined;
59
+ summary?: string | undefined;
60
+ summaryMap?: Record<string, string> | undefined;
61
+ content?: string | undefined;
62
+ contentMap?: Record<string, string> | undefined;
63
+ updated?: string | undefined;
64
+ }) & (string | {
65
+ id: string;
66
+ type: "Note";
67
+ url: string;
68
+ attributedTo: string;
69
+ to: (string | string[]) & (string | string[] | undefined);
70
+ cc: (string | string[]) & (string | string[] | undefined);
71
+ published: string;
72
+ inReplyTo?: string | undefined;
73
+ summary?: string | undefined;
74
+ summaryMap?: Record<string, string> | undefined;
75
+ content?: string | undefined;
76
+ contentMap?: Record<string, string> | undefined;
77
+ updated?: string | undefined;
78
+ } | undefined);
79
+ id: string;
80
+ type: "Like";
81
+ actor: string;
82
+ }, {
83
+ object: (string | {
84
+ id: string;
85
+ type: "Note";
86
+ url: string;
87
+ attributedTo: string;
88
+ to: (string | string[]) & (string | string[] | undefined);
89
+ cc: (string | string[]) & (string | string[] | undefined);
90
+ published: string;
91
+ inReplyTo?: string | undefined;
92
+ summary?: string | undefined;
93
+ summaryMap?: Record<string, string> | undefined;
94
+ content?: string | undefined;
95
+ contentMap?: Record<string, string> | undefined;
96
+ updated?: string | undefined;
97
+ }) & (string | {
98
+ id: string;
99
+ type: "Note";
100
+ url: string;
101
+ attributedTo: string;
102
+ to: (string | string[]) & (string | string[] | undefined);
103
+ cc: (string | string[]) & (string | string[] | undefined);
104
+ published: string;
105
+ inReplyTo?: string | undefined;
106
+ summary?: string | undefined;
107
+ summaryMap?: Record<string, string> | undefined;
108
+ content?: string | undefined;
109
+ contentMap?: Record<string, string> | undefined;
110
+ updated?: string | undefined;
111
+ } | undefined);
112
+ id: string;
113
+ type: "Like";
114
+ actor: string;
115
+ }>;
116
+ export type Like = z.infer<typeof Like>;
package/dist/like.js ADDED
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import { Note } from "./note.js";
3
+ export const Like = z.object({
4
+ type: z.literal("Like"),
5
+ id: z.string(),
6
+ actor: z.string(),
7
+ object: z.union([z.string(), Note]),
8
+ });
package/dist/note.d.ts CHANGED
@@ -15,10 +15,10 @@ export declare const Note: z.ZodObject<{
15
15
  type: z.ZodLiteral<"Note">;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  id: string;
18
+ type: "Note";
18
19
  url: string;
19
20
  attributedTo: string;
20
21
  to: (string | string[]) & (string | string[] | undefined);
21
- type: "Note";
22
22
  cc: (string | string[]) & (string | string[] | undefined);
23
23
  published: string;
24
24
  inReplyTo?: string | undefined;
@@ -29,10 +29,10 @@ export declare const Note: z.ZodObject<{
29
29
  updated?: string | undefined;
30
30
  }, {
31
31
  id: string;
32
+ type: "Note";
32
33
  url: string;
33
34
  attributedTo: string;
34
35
  to: (string | string[]) & (string | string[] | undefined);
35
- type: "Note";
36
36
  cc: (string | string[]) & (string | string[] | undefined);
37
37
  published: string;
38
38
  inReplyTo?: string | undefined;
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const Reject: z.ZodObject<{
3
+ id: z.ZodString;
4
+ actor: z.ZodString;
5
+ type: z.ZodLiteral<"Reject">;
6
+ object: z.ZodObject<{
7
+ id: z.ZodString;
8
+ type: z.ZodLiteral<"Follow">;
9
+ actor: z.ZodString;
10
+ object: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ object: string;
13
+ id: string;
14
+ type: "Follow";
15
+ actor: string;
16
+ }, {
17
+ object: string;
18
+ id: string;
19
+ type: "Follow";
20
+ actor: string;
21
+ }>;
22
+ }, "strip", z.ZodTypeAny, {
23
+ object: {
24
+ object: string;
25
+ id: string;
26
+ type: "Follow";
27
+ actor: string;
28
+ };
29
+ id: string;
30
+ type: "Reject";
31
+ actor: string;
32
+ }, {
33
+ object: {
34
+ object: string;
35
+ id: string;
36
+ type: "Follow";
37
+ actor: string;
38
+ };
39
+ id: string;
40
+ type: "Reject";
41
+ actor: string;
42
+ }>;
43
+ export type Reject = z.infer<typeof Reject>;
package/dist/reject.js ADDED
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import { Follow } from "./follow.js";
3
+ export const Reject = z.object({
4
+ id: z.string(),
5
+ actor: z.string(),
6
+ type: z.literal("Reject"),
7
+ object: Follow,
8
+ });
package/dist/undo.d.ts ADDED
@@ -0,0 +1,221 @@
1
+ import { z } from "zod";
2
+ export declare const Undo: z.ZodObject<{
3
+ id: z.ZodString;
4
+ actor: z.ZodString;
5
+ type: z.ZodLiteral<"Undo">;
6
+ object: z.ZodUnion<[z.ZodObject<{
7
+ type: z.ZodLiteral<"Like">;
8
+ id: z.ZodString;
9
+ actor: z.ZodString;
10
+ object: z.ZodUnion<[z.ZodString, z.ZodObject<{
11
+ id: z.ZodString;
12
+ url: z.ZodString;
13
+ attributedTo: z.ZodString;
14
+ to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
15
+ cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
16
+ inReplyTo: z.ZodOptional<z.ZodString>;
17
+ summary: z.ZodOptional<z.ZodString>;
18
+ summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
19
+ content: z.ZodOptional<z.ZodString>;
20
+ contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
21
+ published: z.ZodString;
22
+ updated: z.ZodOptional<z.ZodString>;
23
+ type: z.ZodLiteral<"Note">;
24
+ }, "strip", z.ZodTypeAny, {
25
+ id: string;
26
+ type: "Note";
27
+ url: string;
28
+ attributedTo: string;
29
+ to: (string | string[]) & (string | string[] | undefined);
30
+ cc: (string | string[]) & (string | string[] | undefined);
31
+ published: string;
32
+ inReplyTo?: string | undefined;
33
+ summary?: string | undefined;
34
+ summaryMap?: Record<string, string> | undefined;
35
+ content?: string | undefined;
36
+ contentMap?: Record<string, string> | undefined;
37
+ updated?: string | undefined;
38
+ }, {
39
+ id: string;
40
+ type: "Note";
41
+ url: string;
42
+ attributedTo: string;
43
+ to: (string | string[]) & (string | string[] | undefined);
44
+ cc: (string | string[]) & (string | string[] | undefined);
45
+ published: string;
46
+ inReplyTo?: string | undefined;
47
+ summary?: string | undefined;
48
+ summaryMap?: Record<string, string> | undefined;
49
+ content?: string | undefined;
50
+ contentMap?: Record<string, string> | undefined;
51
+ updated?: string | undefined;
52
+ }>]>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ object: (string | {
55
+ id: string;
56
+ type: "Note";
57
+ url: string;
58
+ attributedTo: string;
59
+ to: (string | string[]) & (string | string[] | undefined);
60
+ cc: (string | string[]) & (string | string[] | undefined);
61
+ published: string;
62
+ inReplyTo?: string | undefined;
63
+ summary?: string | undefined;
64
+ summaryMap?: Record<string, string> | undefined;
65
+ content?: string | undefined;
66
+ contentMap?: Record<string, string> | undefined;
67
+ updated?: string | undefined;
68
+ }) & (string | {
69
+ id: string;
70
+ type: "Note";
71
+ url: string;
72
+ attributedTo: string;
73
+ to: (string | string[]) & (string | string[] | undefined);
74
+ cc: (string | string[]) & (string | string[] | undefined);
75
+ published: string;
76
+ inReplyTo?: string | undefined;
77
+ summary?: string | undefined;
78
+ summaryMap?: Record<string, string> | undefined;
79
+ content?: string | undefined;
80
+ contentMap?: Record<string, string> | undefined;
81
+ updated?: string | undefined;
82
+ } | undefined);
83
+ id: string;
84
+ type: "Like";
85
+ actor: string;
86
+ }, {
87
+ object: (string | {
88
+ id: string;
89
+ type: "Note";
90
+ url: string;
91
+ attributedTo: string;
92
+ to: (string | string[]) & (string | string[] | undefined);
93
+ cc: (string | string[]) & (string | string[] | undefined);
94
+ published: string;
95
+ inReplyTo?: string | undefined;
96
+ summary?: string | undefined;
97
+ summaryMap?: Record<string, string> | undefined;
98
+ content?: string | undefined;
99
+ contentMap?: Record<string, string> | undefined;
100
+ updated?: string | undefined;
101
+ }) & (string | {
102
+ id: string;
103
+ type: "Note";
104
+ url: string;
105
+ attributedTo: string;
106
+ to: (string | string[]) & (string | string[] | undefined);
107
+ cc: (string | string[]) & (string | string[] | undefined);
108
+ published: string;
109
+ inReplyTo?: string | undefined;
110
+ summary?: string | undefined;
111
+ summaryMap?: Record<string, string> | undefined;
112
+ content?: string | undefined;
113
+ contentMap?: Record<string, string> | undefined;
114
+ updated?: string | undefined;
115
+ } | undefined);
116
+ id: string;
117
+ type: "Like";
118
+ actor: string;
119
+ }>, z.ZodObject<{
120
+ id: z.ZodString;
121
+ type: z.ZodLiteral<"Follow">;
122
+ actor: z.ZodString;
123
+ object: z.ZodString;
124
+ }, "strip", z.ZodTypeAny, {
125
+ object: string;
126
+ id: string;
127
+ type: "Follow";
128
+ actor: string;
129
+ }, {
130
+ object: string;
131
+ id: string;
132
+ type: "Follow";
133
+ actor: string;
134
+ }>]>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ object: {
137
+ object: string;
138
+ id: string;
139
+ type: "Follow";
140
+ actor: string;
141
+ } | {
142
+ object: (string | {
143
+ id: string;
144
+ type: "Note";
145
+ url: string;
146
+ attributedTo: string;
147
+ to: (string | string[]) & (string | string[] | undefined);
148
+ cc: (string | string[]) & (string | string[] | undefined);
149
+ published: string;
150
+ inReplyTo?: string | undefined;
151
+ summary?: string | undefined;
152
+ summaryMap?: Record<string, string> | undefined;
153
+ content?: string | undefined;
154
+ contentMap?: Record<string, string> | undefined;
155
+ updated?: string | undefined;
156
+ }) & (string | {
157
+ id: string;
158
+ type: "Note";
159
+ url: string;
160
+ attributedTo: string;
161
+ to: (string | string[]) & (string | string[] | undefined);
162
+ cc: (string | string[]) & (string | string[] | undefined);
163
+ published: string;
164
+ inReplyTo?: string | undefined;
165
+ summary?: string | undefined;
166
+ summaryMap?: Record<string, string> | undefined;
167
+ content?: string | undefined;
168
+ contentMap?: Record<string, string> | undefined;
169
+ updated?: string | undefined;
170
+ } | undefined);
171
+ id: string;
172
+ type: "Like";
173
+ actor: string;
174
+ };
175
+ id: string;
176
+ type: "Undo";
177
+ actor: string;
178
+ }, {
179
+ object: {
180
+ object: string;
181
+ id: string;
182
+ type: "Follow";
183
+ actor: string;
184
+ } | {
185
+ object: (string | {
186
+ id: string;
187
+ type: "Note";
188
+ url: string;
189
+ attributedTo: string;
190
+ to: (string | string[]) & (string | string[] | undefined);
191
+ cc: (string | string[]) & (string | string[] | undefined);
192
+ published: string;
193
+ inReplyTo?: string | undefined;
194
+ summary?: string | undefined;
195
+ summaryMap?: Record<string, string> | undefined;
196
+ content?: string | undefined;
197
+ contentMap?: Record<string, string> | undefined;
198
+ updated?: string | undefined;
199
+ }) & (string | {
200
+ id: string;
201
+ type: "Note";
202
+ url: string;
203
+ attributedTo: string;
204
+ to: (string | string[]) & (string | string[] | undefined);
205
+ cc: (string | string[]) & (string | string[] | undefined);
206
+ published: string;
207
+ inReplyTo?: string | undefined;
208
+ summary?: string | undefined;
209
+ summaryMap?: Record<string, string> | undefined;
210
+ content?: string | undefined;
211
+ contentMap?: Record<string, string> | undefined;
212
+ updated?: string | undefined;
213
+ } | undefined);
214
+ id: string;
215
+ type: "Like";
216
+ actor: string;
217
+ };
218
+ id: string;
219
+ type: "Undo";
220
+ actor: string;
221
+ }>;
package/dist/undo.js ADDED
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+ import { Follow } from "./follow.js";
3
+ import { Like } from "./like.js";
4
+ export const Undo = z.object({
5
+ id: z.string(),
6
+ actor: z.string(),
7
+ type: z.literal("Undo"),
8
+ object: z.union([Like, Follow]),
9
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Validate ActivityPub with Zod",
5
5
  "exports": {
6
6
  "types": "./dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "type": "module",
10
10
  "scripts": {
11
11
  "build": "tsc",
12
- "publish": "rm -rf dist && yarn build && npm publish --access public"
12
+ "release": "rm -rf dist && npm run build && npm publish --access public"
13
13
  },
14
14
  "author": "Maythee Anegboonlap <null@llun.dev>",
15
15
  "license": "MIT",
@@ -18,5 +18,6 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "typescript": "^5.2.2"
21
- }
21
+ },
22
+ "packageManager": "yarn@4.0.1"
22
23
  }
package/src/accept.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+
3
+ import { Follow } from "./follow.js";
4
+
5
+ export const Accept = z.object({
6
+ id: z.string(),
7
+ actor: z.string(),
8
+ type: z.literal("Accept"),
9
+ object: Follow,
10
+ });
11
+
12
+ export type Accept = z.infer<typeof Accept>;
package/src/follow.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { z } from "zod";
2
+
3
+ export const Follow = z.object({
4
+ id: z.string(),
5
+ type: z.literal("Follow"),
6
+ actor: z.string(),
7
+ object: z.string(),
8
+ });
9
+
10
+ export type Follow = z.infer<typeof Follow>;
package/src/like.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+
3
+ import { Note } from "./note.js";
4
+
5
+ export const Like = z.object({
6
+ type: z.literal("Like"),
7
+ id: z.string(),
8
+ actor: z.string(),
9
+ object: z.union([z.string(), Note]),
10
+ });
11
+
12
+ export type Like = z.infer<typeof Like>;
package/src/reject.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { z } from "zod";
2
+
3
+ import { Follow } from "./follow.js";
4
+
5
+ export const Reject = z.object({
6
+ id: z.string(),
7
+ actor: z.string(),
8
+ type: z.literal("Reject"),
9
+ object: Follow,
10
+ });
11
+
12
+ export type Reject = z.infer<typeof Reject>;
package/src/undo.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+
3
+ import { Follow } from "./follow.js";
4
+ import { Like } from "./like.js";
5
+
6
+ export const Undo = z.object({
7
+ id: z.string(),
8
+ actor: z.string(),
9
+ type: z.literal("Undo"),
10
+ object: z.union([Like, Follow]),
11
+ });