@llun/activities.schema 0.0.4 → 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.
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ export declare const Emoji: z.ZodObject<{
3
+ type: z.ZodLiteral<"Emoji">;
4
+ name: z.ZodString;
5
+ updated: z.ZodString;
6
+ icon: z.ZodObject<{
7
+ type: z.ZodLiteral<"Image">;
8
+ mediaType: z.ZodString;
9
+ url: z.ZodString;
10
+ }, "strip", z.ZodTypeAny, {
11
+ type: "Image";
12
+ mediaType: string;
13
+ url: string;
14
+ }, {
15
+ type: "Image";
16
+ mediaType: string;
17
+ url: string;
18
+ }>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ type: "Emoji";
21
+ name: string;
22
+ updated: string;
23
+ icon: {
24
+ type: "Image";
25
+ mediaType: string;
26
+ url: string;
27
+ };
28
+ }, {
29
+ type: "Emoji";
30
+ name: string;
31
+ updated: string;
32
+ icon: {
33
+ type: "Image";
34
+ mediaType: string;
35
+ url: string;
36
+ };
37
+ }>;
38
+ export type Emoji = z.infer<typeof Emoji>;
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ import { Image } from "./image.js";
3
+ export const Emoji = z.object({
4
+ type: z.literal("Emoji"),
5
+ name: z.string(),
6
+ updated: z.string(),
7
+ icon: Image,
8
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const Image: z.ZodObject<{
3
+ type: z.ZodLiteral<"Image">;
4
+ mediaType: z.ZodString;
5
+ url: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "Image";
8
+ mediaType: string;
9
+ url: string;
10
+ }, {
11
+ type: "Image";
12
+ mediaType: string;
13
+ url: string;
14
+ }>;
15
+ export type Image = z.infer<typeof Image>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const Image = z.object({
3
+ type: z.literal("Image"),
4
+ mediaType: z.string(),
5
+ url: z.string(),
6
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const Mention: z.ZodObject<{
3
+ type: z.ZodLiteral<"Mention">;
4
+ href: z.ZodString;
5
+ name: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "Mention";
8
+ name: string;
9
+ href: string;
10
+ }, {
11
+ type: "Mention";
12
+ name: string;
13
+ href: string;
14
+ }>;
15
+ export type Mention = z.infer<typeof Mention>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const Mention = z.object({
3
+ type: z.literal("Mention"),
4
+ href: z.string(),
5
+ name: z.string(),
6
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const PropertyValue: z.ZodObject<{
3
+ type: z.ZodLiteral<"PropertyValue">;
4
+ name: z.ZodString;
5
+ value: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "PropertyValue";
8
+ value: string;
9
+ name: string;
10
+ }, {
11
+ type: "PropertyValue";
12
+ value: string;
13
+ name: string;
14
+ }>;
15
+ export type PropertyValue = z.infer<typeof PropertyValue>;
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const PropertyValue = z.object({
3
+ type: z.literal("PropertyValue"),
4
+ name: z.string(),
5
+ value: z.string(),
6
+ });
package/dist/note.d.ts CHANGED
@@ -2,44 +2,253 @@ import { z } from "zod";
2
2
  export declare const Note: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  url: z.ZodString;
5
+ updated: z.ZodOptional<z.ZodString>;
5
6
  attributedTo: z.ZodString;
6
7
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
8
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
8
- inReplyTo: z.ZodOptional<z.ZodString>;
9
+ inReplyTo: z.ZodNullable<z.ZodString>;
9
10
  summary: z.ZodOptional<z.ZodString>;
10
11
  summaryMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
11
12
  content: z.ZodOptional<z.ZodString>;
12
13
  contentMap: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
14
+ attachment: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
15
+ type: z.ZodLiteral<"PropertyValue">;
16
+ name: z.ZodString;
17
+ value: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "PropertyValue";
20
+ value: string;
21
+ name: string;
22
+ }, {
23
+ type: "PropertyValue";
24
+ value: string;
25
+ name: string;
26
+ }>, z.ZodObject<{
27
+ type: z.ZodLiteral<"Document">;
28
+ mediaType: z.ZodString;
29
+ url: z.ZodString;
30
+ blurhash: z.ZodOptional<z.ZodString>;
31
+ width: z.ZodOptional<z.ZodNumber>;
32
+ height: z.ZodOptional<z.ZodNumber>;
33
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
34
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ type: "Document";
37
+ mediaType: string;
38
+ url: string;
39
+ blurhash?: string | undefined;
40
+ width?: number | undefined;
41
+ height?: number | undefined;
42
+ name?: string | null | undefined;
43
+ focalPoint?: [number, number] | undefined;
44
+ }, {
45
+ type: "Document";
46
+ mediaType: string;
47
+ url: string;
48
+ blurhash?: string | undefined;
49
+ width?: number | undefined;
50
+ height?: number | undefined;
51
+ name?: string | null | undefined;
52
+ focalPoint?: [number, number] | undefined;
53
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
54
+ type: z.ZodLiteral<"PropertyValue">;
55
+ name: z.ZodString;
56
+ value: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: "PropertyValue";
59
+ value: string;
60
+ name: string;
61
+ }, {
62
+ type: "PropertyValue";
63
+ value: string;
64
+ name: string;
65
+ }>, z.ZodObject<{
66
+ type: z.ZodLiteral<"Document">;
67
+ mediaType: z.ZodString;
68
+ url: z.ZodString;
69
+ blurhash: z.ZodOptional<z.ZodString>;
70
+ width: z.ZodOptional<z.ZodNumber>;
71
+ height: z.ZodOptional<z.ZodNumber>;
72
+ name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
73
+ focalPoint: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ type: "Document";
76
+ mediaType: string;
77
+ url: string;
78
+ blurhash?: string | undefined;
79
+ width?: number | undefined;
80
+ height?: number | undefined;
81
+ name?: string | null | undefined;
82
+ focalPoint?: [number, number] | undefined;
83
+ }, {
84
+ type: "Document";
85
+ mediaType: string;
86
+ url: string;
87
+ blurhash?: string | undefined;
88
+ width?: number | undefined;
89
+ height?: number | undefined;
90
+ name?: string | null | undefined;
91
+ focalPoint?: [number, number] | undefined;
92
+ }>]>, "many">]>>;
93
+ tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
94
+ type: z.ZodLiteral<"Mention">;
95
+ href: z.ZodString;
96
+ name: z.ZodString;
97
+ }, "strip", z.ZodTypeAny, {
98
+ type: "Mention";
99
+ name: string;
100
+ href: string;
101
+ }, {
102
+ type: "Mention";
103
+ name: string;
104
+ href: string;
105
+ }>, z.ZodObject<{
106
+ type: z.ZodLiteral<"Emoji">;
107
+ name: z.ZodString;
108
+ updated: z.ZodString;
109
+ icon: z.ZodObject<{
110
+ type: z.ZodLiteral<"Image">;
111
+ mediaType: z.ZodString;
112
+ url: z.ZodString;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "Image";
115
+ mediaType: string;
116
+ url: string;
117
+ }, {
118
+ type: "Image";
119
+ mediaType: string;
120
+ url: string;
121
+ }>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ type: "Emoji";
124
+ name: string;
125
+ updated: string;
126
+ icon: {
127
+ type: "Image";
128
+ mediaType: string;
129
+ url: string;
130
+ };
131
+ }, {
132
+ type: "Emoji";
133
+ name: string;
134
+ updated: string;
135
+ icon: {
136
+ type: "Image";
137
+ mediaType: string;
138
+ url: string;
139
+ };
140
+ }>]>, "many">;
13
141
  published: z.ZodString;
14
- updated: z.ZodOptional<z.ZodString>;
15
142
  type: z.ZodLiteral<"Note">;
16
143
  }, "strip", z.ZodTypeAny, {
17
144
  id: string;
145
+ type: "Note";
18
146
  url: string;
19
147
  attributedTo: string;
20
148
  to: (string | string[]) & (string | string[] | undefined);
21
- type: "Note";
22
149
  cc: (string | string[]) & (string | string[] | undefined);
150
+ inReplyTo: string | null;
151
+ tag: ({
152
+ type: "Emoji";
153
+ name: string;
154
+ updated: string;
155
+ icon: {
156
+ type: "Image";
157
+ mediaType: string;
158
+ url: string;
159
+ };
160
+ } | {
161
+ type: "Mention";
162
+ name: string;
163
+ href: string;
164
+ })[];
23
165
  published: string;
24
- inReplyTo?: string | undefined;
166
+ updated?: string | undefined;
25
167
  summary?: string | undefined;
26
168
  summaryMap?: Record<string, string> | undefined;
27
169
  content?: string | undefined;
28
170
  contentMap?: Record<string, string> | undefined;
29
- updated?: string | undefined;
171
+ attachment?: {
172
+ type: "Document";
173
+ mediaType: string;
174
+ url: string;
175
+ blurhash?: string | undefined;
176
+ width?: number | undefined;
177
+ height?: number | undefined;
178
+ name?: string | null | undefined;
179
+ focalPoint?: [number, number] | undefined;
180
+ } | {
181
+ type: "PropertyValue";
182
+ value: string;
183
+ name: string;
184
+ } | ({
185
+ type: "Document";
186
+ mediaType: string;
187
+ url: string;
188
+ blurhash?: string | undefined;
189
+ width?: number | undefined;
190
+ height?: number | undefined;
191
+ name?: string | null | undefined;
192
+ focalPoint?: [number, number] | undefined;
193
+ } | {
194
+ type: "PropertyValue";
195
+ value: string;
196
+ name: string;
197
+ })[] | undefined;
30
198
  }, {
31
199
  id: string;
200
+ type: "Note";
32
201
  url: string;
33
202
  attributedTo: string;
34
203
  to: (string | string[]) & (string | string[] | undefined);
35
- type: "Note";
36
204
  cc: (string | string[]) & (string | string[] | undefined);
205
+ inReplyTo: string | null;
206
+ tag: ({
207
+ type: "Emoji";
208
+ name: string;
209
+ updated: string;
210
+ icon: {
211
+ type: "Image";
212
+ mediaType: string;
213
+ url: string;
214
+ };
215
+ } | {
216
+ type: "Mention";
217
+ name: string;
218
+ href: string;
219
+ })[];
37
220
  published: string;
38
- inReplyTo?: string | undefined;
221
+ updated?: string | undefined;
39
222
  summary?: string | undefined;
40
223
  summaryMap?: Record<string, string> | undefined;
41
224
  content?: string | undefined;
42
225
  contentMap?: Record<string, string> | undefined;
43
- updated?: string | undefined;
226
+ attachment?: {
227
+ type: "Document";
228
+ mediaType: string;
229
+ url: string;
230
+ blurhash?: string | undefined;
231
+ width?: number | undefined;
232
+ height?: number | undefined;
233
+ name?: string | null | undefined;
234
+ focalPoint?: [number, number] | undefined;
235
+ } | {
236
+ type: "PropertyValue";
237
+ value: string;
238
+ name: string;
239
+ } | ({
240
+ type: "Document";
241
+ mediaType: string;
242
+ url: string;
243
+ blurhash?: string | undefined;
244
+ width?: number | undefined;
245
+ height?: number | undefined;
246
+ name?: string | null | undefined;
247
+ focalPoint?: [number, number] | undefined;
248
+ } | {
249
+ type: "PropertyValue";
250
+ value: string;
251
+ name: string;
252
+ })[] | undefined;
44
253
  }>;
45
254
  export type Note = z.infer<typeof Note>;
package/dist/note.js CHANGED
@@ -1,11 +1,14 @@
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
  const BaseContent = z.object({
3
6
  id: z.string(),
4
7
  url: z.string({ description: "Note URL" }),
5
8
  attributedTo: z.string({ description: "Note publisher" }),
6
9
  to: z.union([z.string(), z.string().array()]),
7
10
  cc: z.union([z.string(), z.string().array()]),
8
- inReplyTo: z.string().optional(),
11
+ inReplyTo: z.string().nullable(),
9
12
  summary: z.string({ description: "Note short summary" }).optional(),
10
13
  summaryMap: z
11
14
  .record(z.string(), { description: "Note short summary in each locale" })
@@ -14,6 +17,8 @@ const BaseContent = z.object({
14
17
  contentMap: z
15
18
  .record(z.string(), { description: "Note content in each locale" })
16
19
  .optional(),
20
+ attachment: z.union([Attachment, Attachment.array()]).optional(),
21
+ tag: z.union([Mention, Emoji]).array(),
17
22
  published: z.string({ description: "Object published datetime" }),
18
23
  updated: z.string({ description: "Object updated datetime" }).optional(),
19
24
  });
@@ -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
+ });