@llun/activities.schema 0.2.7 → 0.2.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.
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseContent = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const attachment_js_1 = require("./attachment.js");
6
- const emoji_js_1 = require("./emoji.js");
7
- const mention_js_1 = require("./mention.js");
6
+ const tag_js_1 = require("./tag.js");
8
7
  exports.BaseContent = zod_1.z.object({
9
8
  id: zod_1.z.string(),
10
9
  url: zod_1.z.string({ description: "Note URL" }),
@@ -33,7 +32,7 @@ exports.BaseContent = zod_1.z.object({
33
32
  ])
34
33
  .nullish(),
35
34
  attachment: zod_1.z.union([attachment_js_1.Attachment, attachment_js_1.Attachment.array()]).nullish(),
36
- tag: zod_1.z.union([mention_js_1.Mention, emoji_js_1.Emoji]).array(),
35
+ tag: zod_1.z.union([tag_js_1.Tag, tag_js_1.Tag.array()]),
37
36
  published: zod_1.z.string({ description: "Object published datetime" }),
38
37
  updated: zod_1.z.string({ description: "Object updated datetime" }).nullish(),
39
38
  });
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HashTag = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.HashTag = zod_1.z.object({
6
+ type: zod_1.z.literal("Hashtag"),
7
+ href: zod_1.z.string().url(),
8
+ name: zod_1.z.string().startsWith("#"),
9
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Tag = void 0;
4
+ const zod_1 = require("zod");
5
+ const emoji_js_1 = require("./emoji.js");
6
+ const mention_js_1 = require("./mention.js");
7
+ const hashtag_js_1 = require("./hashtag.js");
8
+ exports.Tag = zod_1.z.union([mention_js_1.Mention, emoji_js_1.Emoji, hashtag_js_1.HashTag]);
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { Attachment } from "./attachment.js";
3
- import { Emoji } from "./emoji.js";
4
- import { Mention } from "./mention.js";
3
+ import { Tag } from "./tag.js";
5
4
  export const BaseContent = z.object({
6
5
  id: z.string(),
7
6
  url: z.string({ description: "Note URL" }),
@@ -30,7 +29,7 @@ export const BaseContent = z.object({
30
29
  ])
31
30
  .nullish(),
32
31
  attachment: z.union([Attachment, Attachment.array()]).nullish(),
33
- tag: z.union([Mention, Emoji]).array(),
32
+ tag: z.union([Tag, Tag.array()]),
34
33
  published: z.string({ description: "Object published datetime" }),
35
34
  updated: z.string({ description: "Object updated datetime" }).nullish(),
36
35
  });
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const HashTag = z.object({
3
+ type: z.literal("Hashtag"),
4
+ href: z.string().url(),
5
+ name: z.string().startsWith("#"),
6
+ });
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ import { Emoji } from "./emoji.js";
3
+ import { Mention } from "./mention.js";
4
+ import { HashTag } from "./hashtag.js";
5
+ export const Tag = z.union([Mention, Emoji, HashTag]);
@@ -93,7 +93,7 @@ export declare const Like: z.ZodObject<{
93
93
  name?: string | null | undefined;
94
94
  focalPoint?: [number, number] | undefined;
95
95
  }>]>, "many">]>>>;
96
- tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
96
+ tag: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
97
97
  type: z.ZodLiteral<"Mention">;
98
98
  href: z.ZodString;
99
99
  name: z.ZodString;
@@ -140,7 +140,78 @@ export declare const Like: z.ZodObject<{
140
140
  mediaType: string;
141
141
  url: string;
142
142
  };
143
- }>]>, "many">;
143
+ }>, z.ZodObject<{
144
+ type: z.ZodLiteral<"Hashtag">;
145
+ href: z.ZodString;
146
+ name: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
151
+ }, {
152
+ type: "Hashtag";
153
+ name: string;
154
+ href: string;
155
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
156
+ type: z.ZodLiteral<"Mention">;
157
+ href: z.ZodString;
158
+ name: z.ZodString;
159
+ }, "strip", z.ZodTypeAny, {
160
+ type: "Mention";
161
+ name: string;
162
+ href: string;
163
+ }, {
164
+ type: "Mention";
165
+ name: string;
166
+ href: string;
167
+ }>, z.ZodObject<{
168
+ type: z.ZodLiteral<"Emoji">;
169
+ name: z.ZodString;
170
+ updated: z.ZodString;
171
+ icon: z.ZodObject<{
172
+ type: z.ZodLiteral<"Image">;
173
+ mediaType: z.ZodString;
174
+ url: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "Image";
177
+ mediaType: string;
178
+ url: string;
179
+ }, {
180
+ type: "Image";
181
+ mediaType: string;
182
+ url: string;
183
+ }>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ type: "Emoji";
186
+ name: string;
187
+ updated: string;
188
+ icon: {
189
+ type: "Image";
190
+ mediaType: string;
191
+ url: string;
192
+ };
193
+ }, {
194
+ type: "Emoji";
195
+ name: string;
196
+ updated: string;
197
+ icon: {
198
+ type: "Image";
199
+ mediaType: string;
200
+ url: string;
201
+ };
202
+ }>, z.ZodObject<{
203
+ type: z.ZodLiteral<"Hashtag">;
204
+ href: z.ZodString;
205
+ name: z.ZodString;
206
+ }, "strip", z.ZodTypeAny, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
210
+ }, {
211
+ type: "Hashtag";
212
+ name: string;
213
+ href: string;
214
+ }>]>, "many">]>;
144
215
  published: z.ZodString;
145
216
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
217
  }, {
@@ -153,7 +224,7 @@ export declare const Like: z.ZodObject<{
153
224
  cc: string | string[];
154
225
  url: string;
155
226
  attributedTo: string;
156
- tag: ({
227
+ tag: {
157
228
  type: "Emoji";
158
229
  name: string;
159
230
  updated: string;
@@ -166,6 +237,27 @@ export declare const Like: z.ZodObject<{
166
237
  type: "Mention";
167
238
  name: string;
168
239
  href: string;
240
+ } | {
241
+ type: "Hashtag";
242
+ name: string;
243
+ href: string;
244
+ } | ({
245
+ type: "Emoji";
246
+ name: string;
247
+ updated: string;
248
+ icon: {
249
+ type: "Image";
250
+ mediaType: string;
251
+ url: string;
252
+ };
253
+ } | {
254
+ type: "Mention";
255
+ name: string;
256
+ href: string;
257
+ } | {
258
+ type: "Hashtag";
259
+ name: string;
260
+ href: string;
169
261
  })[];
170
262
  updated?: string | null | undefined;
171
263
  inReplyTo?: string | null | undefined;
@@ -208,7 +300,7 @@ export declare const Like: z.ZodObject<{
208
300
  cc: string | string[];
209
301
  url: string;
210
302
  attributedTo: string;
211
- tag: ({
303
+ tag: {
212
304
  type: "Emoji";
213
305
  name: string;
214
306
  updated: string;
@@ -221,6 +313,27 @@ export declare const Like: z.ZodObject<{
221
313
  type: "Mention";
222
314
  name: string;
223
315
  href: string;
316
+ } | {
317
+ type: "Hashtag";
318
+ name: string;
319
+ href: string;
320
+ } | ({
321
+ type: "Emoji";
322
+ name: string;
323
+ updated: string;
324
+ icon: {
325
+ type: "Image";
326
+ mediaType: string;
327
+ url: string;
328
+ };
329
+ } | {
330
+ type: "Mention";
331
+ name: string;
332
+ href: string;
333
+ } | {
334
+ type: "Hashtag";
335
+ name: string;
336
+ href: string;
224
337
  })[];
225
338
  updated?: string | null | undefined;
226
339
  inReplyTo?: string | null | undefined;
@@ -265,7 +378,24 @@ export declare const Like: z.ZodObject<{
265
378
  cc: string | string[];
266
379
  url: string;
267
380
  attributedTo: string;
268
- tag: ({
381
+ tag: {
382
+ type: "Emoji";
383
+ name: string;
384
+ updated: string;
385
+ icon: {
386
+ type: "Image";
387
+ mediaType: string;
388
+ url: string;
389
+ };
390
+ } | {
391
+ type: "Mention";
392
+ name: string;
393
+ href: string;
394
+ } | {
395
+ type: "Hashtag";
396
+ name: string;
397
+ href: string;
398
+ } | ({
269
399
  type: "Emoji";
270
400
  name: string;
271
401
  updated: string;
@@ -278,6 +408,10 @@ export declare const Like: z.ZodObject<{
278
408
  type: "Mention";
279
409
  name: string;
280
410
  href: string;
411
+ } | {
412
+ type: "Hashtag";
413
+ name: string;
414
+ href: string;
281
415
  })[];
282
416
  updated?: string | null | undefined;
283
417
  inReplyTo?: string | null | undefined;
@@ -325,7 +459,7 @@ export declare const Like: z.ZodObject<{
325
459
  cc: string | string[];
326
460
  url: string;
327
461
  attributedTo: string;
328
- tag: ({
462
+ tag: {
329
463
  type: "Emoji";
330
464
  name: string;
331
465
  updated: string;
@@ -338,6 +472,27 @@ export declare const Like: z.ZodObject<{
338
472
  type: "Mention";
339
473
  name: string;
340
474
  href: string;
475
+ } | {
476
+ type: "Hashtag";
477
+ name: string;
478
+ href: string;
479
+ } | ({
480
+ type: "Emoji";
481
+ name: string;
482
+ updated: string;
483
+ icon: {
484
+ type: "Image";
485
+ mediaType: string;
486
+ url: string;
487
+ };
488
+ } | {
489
+ type: "Mention";
490
+ name: string;
491
+ href: string;
492
+ } | {
493
+ type: "Hashtag";
494
+ name: string;
495
+ href: string;
341
496
  })[];
342
497
  updated?: string | null | undefined;
343
498
  inReplyTo?: string | null | undefined;
@@ -89,7 +89,7 @@ export declare const BaseContent: z.ZodObject<{
89
89
  name?: string | null | undefined;
90
90
  focalPoint?: [number, number] | undefined;
91
91
  }>]>, "many">]>>>;
92
- tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
92
+ tag: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
93
93
  type: z.ZodLiteral<"Mention">;
94
94
  href: z.ZodString;
95
95
  name: z.ZodString;
@@ -136,7 +136,78 @@ export declare const BaseContent: z.ZodObject<{
136
136
  mediaType: string;
137
137
  url: string;
138
138
  };
139
- }>]>, "many">;
139
+ }>, z.ZodObject<{
140
+ type: z.ZodLiteral<"Hashtag">;
141
+ href: z.ZodString;
142
+ name: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ type: "Hashtag";
145
+ name: string;
146
+ href: string;
147
+ }, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
151
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
152
+ type: z.ZodLiteral<"Mention">;
153
+ href: z.ZodString;
154
+ name: z.ZodString;
155
+ }, "strip", z.ZodTypeAny, {
156
+ type: "Mention";
157
+ name: string;
158
+ href: string;
159
+ }, {
160
+ type: "Mention";
161
+ name: string;
162
+ href: string;
163
+ }>, z.ZodObject<{
164
+ type: z.ZodLiteral<"Emoji">;
165
+ name: z.ZodString;
166
+ updated: z.ZodString;
167
+ icon: z.ZodObject<{
168
+ type: z.ZodLiteral<"Image">;
169
+ mediaType: z.ZodString;
170
+ url: z.ZodString;
171
+ }, "strip", z.ZodTypeAny, {
172
+ type: "Image";
173
+ mediaType: string;
174
+ url: string;
175
+ }, {
176
+ type: "Image";
177
+ mediaType: string;
178
+ url: string;
179
+ }>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ type: "Emoji";
182
+ name: string;
183
+ updated: string;
184
+ icon: {
185
+ type: "Image";
186
+ mediaType: string;
187
+ url: string;
188
+ };
189
+ }, {
190
+ type: "Emoji";
191
+ name: string;
192
+ updated: string;
193
+ icon: {
194
+ type: "Image";
195
+ mediaType: string;
196
+ url: string;
197
+ };
198
+ }>, z.ZodObject<{
199
+ type: z.ZodLiteral<"Hashtag">;
200
+ href: z.ZodString;
201
+ name: z.ZodString;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: "Hashtag";
204
+ name: string;
205
+ href: string;
206
+ }, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
210
+ }>]>, "many">]>;
140
211
  published: z.ZodString;
141
212
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
213
  }, "strip", z.ZodTypeAny, {
@@ -146,7 +217,7 @@ export declare const BaseContent: z.ZodObject<{
146
217
  cc: string | string[];
147
218
  url: string;
148
219
  attributedTo: string;
149
- tag: ({
220
+ tag: {
150
221
  type: "Emoji";
151
222
  name: string;
152
223
  updated: string;
@@ -159,6 +230,27 @@ export declare const BaseContent: z.ZodObject<{
159
230
  type: "Mention";
160
231
  name: string;
161
232
  href: string;
233
+ } | {
234
+ type: "Hashtag";
235
+ name: string;
236
+ href: string;
237
+ } | ({
238
+ type: "Emoji";
239
+ name: string;
240
+ updated: string;
241
+ icon: {
242
+ type: "Image";
243
+ mediaType: string;
244
+ url: string;
245
+ };
246
+ } | {
247
+ type: "Mention";
248
+ name: string;
249
+ href: string;
250
+ } | {
251
+ type: "Hashtag";
252
+ name: string;
253
+ href: string;
162
254
  })[];
163
255
  updated?: string | null | undefined;
164
256
  inReplyTo?: string | null | undefined;
@@ -200,7 +292,7 @@ export declare const BaseContent: z.ZodObject<{
200
292
  cc: string | string[];
201
293
  url: string;
202
294
  attributedTo: string;
203
- tag: ({
295
+ tag: {
204
296
  type: "Emoji";
205
297
  name: string;
206
298
  updated: string;
@@ -213,6 +305,27 @@ export declare const BaseContent: z.ZodObject<{
213
305
  type: "Mention";
214
306
  name: string;
215
307
  href: string;
308
+ } | {
309
+ type: "Hashtag";
310
+ name: string;
311
+ href: string;
312
+ } | ({
313
+ type: "Emoji";
314
+ name: string;
315
+ updated: string;
316
+ icon: {
317
+ type: "Image";
318
+ mediaType: string;
319
+ url: string;
320
+ };
321
+ } | {
322
+ type: "Mention";
323
+ name: string;
324
+ href: string;
325
+ } | {
326
+ type: "Hashtag";
327
+ name: string;
328
+ href: string;
216
329
  })[];
217
330
  updated?: string | null | undefined;
218
331
  inReplyTo?: string | null | undefined;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const HashTag: z.ZodObject<{
3
+ type: z.ZodLiteral<"Hashtag">;
4
+ href: z.ZodString;
5
+ name: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "Hashtag";
8
+ name: string;
9
+ href: string;
10
+ }, {
11
+ type: "Hashtag";
12
+ name: string;
13
+ href: string;
14
+ }>;
15
+ export type HashTag = z.infer<typeof HashTag>;
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ export declare const Tag: z.ZodUnion<[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
+ }>, z.ZodObject<{
15
+ type: z.ZodLiteral<"Emoji">;
16
+ name: z.ZodString;
17
+ updated: z.ZodString;
18
+ icon: z.ZodObject<{
19
+ type: z.ZodLiteral<"Image">;
20
+ mediaType: z.ZodString;
21
+ url: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ type: "Image";
24
+ mediaType: string;
25
+ url: string;
26
+ }, {
27
+ type: "Image";
28
+ mediaType: string;
29
+ url: string;
30
+ }>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ type: "Emoji";
33
+ name: string;
34
+ updated: string;
35
+ icon: {
36
+ type: "Image";
37
+ mediaType: string;
38
+ url: string;
39
+ };
40
+ }, {
41
+ type: "Emoji";
42
+ name: string;
43
+ updated: string;
44
+ icon: {
45
+ type: "Image";
46
+ mediaType: string;
47
+ url: string;
48
+ };
49
+ }>, z.ZodObject<{
50
+ type: z.ZodLiteral<"Hashtag">;
51
+ href: z.ZodString;
52
+ name: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ type: "Hashtag";
55
+ name: string;
56
+ href: string;
57
+ }, {
58
+ type: "Hashtag";
59
+ name: string;
60
+ href: string;
61
+ }>]>;
62
+ export type Tag = z.infer<typeof Tag>;
@@ -89,7 +89,7 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
89
89
  name?: string | null | undefined;
90
90
  focalPoint?: [number, number] | undefined;
91
91
  }>]>, "many">]>>>;
92
- tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
92
+ tag: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
93
93
  type: z.ZodLiteral<"Mention">;
94
94
  href: z.ZodString;
95
95
  name: z.ZodString;
@@ -136,7 +136,78 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
136
136
  mediaType: string;
137
137
  url: string;
138
138
  };
139
- }>]>, "many">;
139
+ }>, z.ZodObject<{
140
+ type: z.ZodLiteral<"Hashtag">;
141
+ href: z.ZodString;
142
+ name: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ type: "Hashtag";
145
+ name: string;
146
+ href: string;
147
+ }, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
151
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
152
+ type: z.ZodLiteral<"Mention">;
153
+ href: z.ZodString;
154
+ name: z.ZodString;
155
+ }, "strip", z.ZodTypeAny, {
156
+ type: "Mention";
157
+ name: string;
158
+ href: string;
159
+ }, {
160
+ type: "Mention";
161
+ name: string;
162
+ href: string;
163
+ }>, z.ZodObject<{
164
+ type: z.ZodLiteral<"Emoji">;
165
+ name: z.ZodString;
166
+ updated: z.ZodString;
167
+ icon: z.ZodObject<{
168
+ type: z.ZodLiteral<"Image">;
169
+ mediaType: z.ZodString;
170
+ url: z.ZodString;
171
+ }, "strip", z.ZodTypeAny, {
172
+ type: "Image";
173
+ mediaType: string;
174
+ url: string;
175
+ }, {
176
+ type: "Image";
177
+ mediaType: string;
178
+ url: string;
179
+ }>;
180
+ }, "strip", z.ZodTypeAny, {
181
+ type: "Emoji";
182
+ name: string;
183
+ updated: string;
184
+ icon: {
185
+ type: "Image";
186
+ mediaType: string;
187
+ url: string;
188
+ };
189
+ }, {
190
+ type: "Emoji";
191
+ name: string;
192
+ updated: string;
193
+ icon: {
194
+ type: "Image";
195
+ mediaType: string;
196
+ url: string;
197
+ };
198
+ }>, z.ZodObject<{
199
+ type: z.ZodLiteral<"Hashtag">;
200
+ href: z.ZodString;
201
+ name: z.ZodString;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: "Hashtag";
204
+ name: string;
205
+ href: string;
206
+ }, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
210
+ }>]>, "many">]>;
140
211
  published: z.ZodString;
141
212
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
213
  }, {
@@ -149,7 +220,7 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
149
220
  cc: string | string[];
150
221
  url: string;
151
222
  attributedTo: string;
152
- tag: ({
223
+ tag: {
153
224
  type: "Emoji";
154
225
  name: string;
155
226
  updated: string;
@@ -162,6 +233,27 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
162
233
  type: "Mention";
163
234
  name: string;
164
235
  href: string;
236
+ } | {
237
+ type: "Hashtag";
238
+ name: string;
239
+ href: string;
240
+ } | ({
241
+ type: "Emoji";
242
+ name: string;
243
+ updated: string;
244
+ icon: {
245
+ type: "Image";
246
+ mediaType: string;
247
+ url: string;
248
+ };
249
+ } | {
250
+ type: "Mention";
251
+ name: string;
252
+ href: string;
253
+ } | {
254
+ type: "Hashtag";
255
+ name: string;
256
+ href: string;
165
257
  })[];
166
258
  updated?: string | null | undefined;
167
259
  inReplyTo?: string | null | undefined;
@@ -204,7 +296,7 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
204
296
  cc: string | string[];
205
297
  url: string;
206
298
  attributedTo: string;
207
- tag: ({
299
+ tag: {
208
300
  type: "Emoji";
209
301
  name: string;
210
302
  updated: string;
@@ -217,6 +309,27 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
217
309
  type: "Mention";
218
310
  name: string;
219
311
  href: string;
312
+ } | {
313
+ type: "Hashtag";
314
+ name: string;
315
+ href: string;
316
+ } | ({
317
+ type: "Emoji";
318
+ name: string;
319
+ updated: string;
320
+ icon: {
321
+ type: "Image";
322
+ mediaType: string;
323
+ url: string;
324
+ };
325
+ } | {
326
+ type: "Mention";
327
+ name: string;
328
+ href: string;
329
+ } | {
330
+ type: "Hashtag";
331
+ name: string;
332
+ href: string;
220
333
  })[];
221
334
  updated?: string | null | undefined;
222
335
  inReplyTo?: string | null | undefined;
@@ -97,7 +97,7 @@ export declare const Undo: z.ZodObject<{
97
97
  name?: string | null | undefined;
98
98
  focalPoint?: [number, number] | undefined;
99
99
  }>]>, "many">]>>>;
100
- tag: z.ZodArray<z.ZodUnion<[z.ZodObject<{
100
+ tag: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
101
101
  type: z.ZodLiteral<"Mention">;
102
102
  href: z.ZodString;
103
103
  name: z.ZodString;
@@ -144,7 +144,78 @@ export declare const Undo: z.ZodObject<{
144
144
  mediaType: string;
145
145
  url: string;
146
146
  };
147
- }>]>, "many">;
147
+ }>, z.ZodObject<{
148
+ type: z.ZodLiteral<"Hashtag">;
149
+ href: z.ZodString;
150
+ name: z.ZodString;
151
+ }, "strip", z.ZodTypeAny, {
152
+ type: "Hashtag";
153
+ name: string;
154
+ href: string;
155
+ }, {
156
+ type: "Hashtag";
157
+ name: string;
158
+ href: string;
159
+ }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
160
+ type: z.ZodLiteral<"Mention">;
161
+ href: z.ZodString;
162
+ name: z.ZodString;
163
+ }, "strip", z.ZodTypeAny, {
164
+ type: "Mention";
165
+ name: string;
166
+ href: string;
167
+ }, {
168
+ type: "Mention";
169
+ name: string;
170
+ href: string;
171
+ }>, z.ZodObject<{
172
+ type: z.ZodLiteral<"Emoji">;
173
+ name: z.ZodString;
174
+ updated: z.ZodString;
175
+ icon: z.ZodObject<{
176
+ type: z.ZodLiteral<"Image">;
177
+ mediaType: z.ZodString;
178
+ url: z.ZodString;
179
+ }, "strip", z.ZodTypeAny, {
180
+ type: "Image";
181
+ mediaType: string;
182
+ url: string;
183
+ }, {
184
+ type: "Image";
185
+ mediaType: string;
186
+ url: string;
187
+ }>;
188
+ }, "strip", z.ZodTypeAny, {
189
+ type: "Emoji";
190
+ name: string;
191
+ updated: string;
192
+ icon: {
193
+ type: "Image";
194
+ mediaType: string;
195
+ url: string;
196
+ };
197
+ }, {
198
+ type: "Emoji";
199
+ name: string;
200
+ updated: string;
201
+ icon: {
202
+ type: "Image";
203
+ mediaType: string;
204
+ url: string;
205
+ };
206
+ }>, z.ZodObject<{
207
+ type: z.ZodLiteral<"Hashtag">;
208
+ href: z.ZodString;
209
+ name: z.ZodString;
210
+ }, "strip", z.ZodTypeAny, {
211
+ type: "Hashtag";
212
+ name: string;
213
+ href: string;
214
+ }, {
215
+ type: "Hashtag";
216
+ name: string;
217
+ href: string;
218
+ }>]>, "many">]>;
148
219
  published: z.ZodString;
149
220
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
150
221
  }, {
@@ -157,7 +228,7 @@ export declare const Undo: z.ZodObject<{
157
228
  cc: string | string[];
158
229
  url: string;
159
230
  attributedTo: string;
160
- tag: ({
231
+ tag: {
161
232
  type: "Emoji";
162
233
  name: string;
163
234
  updated: string;
@@ -170,6 +241,27 @@ export declare const Undo: z.ZodObject<{
170
241
  type: "Mention";
171
242
  name: string;
172
243
  href: string;
244
+ } | {
245
+ type: "Hashtag";
246
+ name: string;
247
+ href: string;
248
+ } | ({
249
+ type: "Emoji";
250
+ name: string;
251
+ updated: string;
252
+ icon: {
253
+ type: "Image";
254
+ mediaType: string;
255
+ url: string;
256
+ };
257
+ } | {
258
+ type: "Mention";
259
+ name: string;
260
+ href: string;
261
+ } | {
262
+ type: "Hashtag";
263
+ name: string;
264
+ href: string;
173
265
  })[];
174
266
  updated?: string | null | undefined;
175
267
  inReplyTo?: string | null | undefined;
@@ -212,7 +304,7 @@ export declare const Undo: z.ZodObject<{
212
304
  cc: string | string[];
213
305
  url: string;
214
306
  attributedTo: string;
215
- tag: ({
307
+ tag: {
216
308
  type: "Emoji";
217
309
  name: string;
218
310
  updated: string;
@@ -225,6 +317,27 @@ export declare const Undo: z.ZodObject<{
225
317
  type: "Mention";
226
318
  name: string;
227
319
  href: string;
320
+ } | {
321
+ type: "Hashtag";
322
+ name: string;
323
+ href: string;
324
+ } | ({
325
+ type: "Emoji";
326
+ name: string;
327
+ updated: string;
328
+ icon: {
329
+ type: "Image";
330
+ mediaType: string;
331
+ url: string;
332
+ };
333
+ } | {
334
+ type: "Mention";
335
+ name: string;
336
+ href: string;
337
+ } | {
338
+ type: "Hashtag";
339
+ name: string;
340
+ href: string;
228
341
  })[];
229
342
  updated?: string | null | undefined;
230
343
  inReplyTo?: string | null | undefined;
@@ -269,7 +382,7 @@ export declare const Undo: z.ZodObject<{
269
382
  cc: string | string[];
270
383
  url: string;
271
384
  attributedTo: string;
272
- tag: ({
385
+ tag: {
273
386
  type: "Emoji";
274
387
  name: string;
275
388
  updated: string;
@@ -282,6 +395,27 @@ export declare const Undo: z.ZodObject<{
282
395
  type: "Mention";
283
396
  name: string;
284
397
  href: string;
398
+ } | {
399
+ type: "Hashtag";
400
+ name: string;
401
+ href: string;
402
+ } | ({
403
+ type: "Emoji";
404
+ name: string;
405
+ updated: string;
406
+ icon: {
407
+ type: "Image";
408
+ mediaType: string;
409
+ url: string;
410
+ };
411
+ } | {
412
+ type: "Mention";
413
+ name: string;
414
+ href: string;
415
+ } | {
416
+ type: "Hashtag";
417
+ name: string;
418
+ href: string;
285
419
  })[];
286
420
  updated?: string | null | undefined;
287
421
  inReplyTo?: string | null | undefined;
@@ -329,7 +463,7 @@ export declare const Undo: z.ZodObject<{
329
463
  cc: string | string[];
330
464
  url: string;
331
465
  attributedTo: string;
332
- tag: ({
466
+ tag: {
333
467
  type: "Emoji";
334
468
  name: string;
335
469
  updated: string;
@@ -342,6 +476,27 @@ export declare const Undo: z.ZodObject<{
342
476
  type: "Mention";
343
477
  name: string;
344
478
  href: string;
479
+ } | {
480
+ type: "Hashtag";
481
+ name: string;
482
+ href: string;
483
+ } | ({
484
+ type: "Emoji";
485
+ name: string;
486
+ updated: string;
487
+ icon: {
488
+ type: "Image";
489
+ mediaType: string;
490
+ url: string;
491
+ };
492
+ } | {
493
+ type: "Mention";
494
+ name: string;
495
+ href: string;
496
+ } | {
497
+ type: "Hashtag";
498
+ name: string;
499
+ href: string;
345
500
  })[];
346
501
  updated?: string | null | undefined;
347
502
  inReplyTo?: string | null | undefined;
@@ -411,7 +566,24 @@ export declare const Undo: z.ZodObject<{
411
566
  cc: string | string[];
412
567
  url: string;
413
568
  attributedTo: string;
414
- tag: ({
569
+ tag: {
570
+ type: "Emoji";
571
+ name: string;
572
+ updated: string;
573
+ icon: {
574
+ type: "Image";
575
+ mediaType: string;
576
+ url: string;
577
+ };
578
+ } | {
579
+ type: "Mention";
580
+ name: string;
581
+ href: string;
582
+ } | {
583
+ type: "Hashtag";
584
+ name: string;
585
+ href: string;
586
+ } | ({
415
587
  type: "Emoji";
416
588
  name: string;
417
589
  updated: string;
@@ -424,6 +596,10 @@ export declare const Undo: z.ZodObject<{
424
596
  type: "Mention";
425
597
  name: string;
426
598
  href: string;
599
+ } | {
600
+ type: "Hashtag";
601
+ name: string;
602
+ href: string;
427
603
  })[];
428
604
  updated?: string | null | undefined;
429
605
  inReplyTo?: string | null | undefined;
@@ -481,7 +657,24 @@ export declare const Undo: z.ZodObject<{
481
657
  cc: string | string[];
482
658
  url: string;
483
659
  attributedTo: string;
484
- tag: ({
660
+ tag: {
661
+ type: "Emoji";
662
+ name: string;
663
+ updated: string;
664
+ icon: {
665
+ type: "Image";
666
+ mediaType: string;
667
+ url: string;
668
+ };
669
+ } | {
670
+ type: "Mention";
671
+ name: string;
672
+ href: string;
673
+ } | {
674
+ type: "Hashtag";
675
+ name: string;
676
+ href: string;
677
+ } | ({
485
678
  type: "Emoji";
486
679
  name: string;
487
680
  updated: string;
@@ -494,6 +687,10 @@ export declare const Undo: z.ZodObject<{
494
687
  type: "Mention";
495
688
  name: string;
496
689
  href: string;
690
+ } | {
691
+ type: "Hashtag";
692
+ name: string;
693
+ href: string;
497
694
  })[];
498
695
  updated?: string | null | undefined;
499
696
  inReplyTo?: string | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,7 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { Attachment } from "./attachment.js";
3
- import { Emoji } from "./emoji.js";
4
- import { Mention } from "./mention.js";
3
+ import { Tag } from "./tag.js";
5
4
 
6
5
  export const BaseContent = z.object({
7
6
  id: z.string(),
@@ -37,7 +36,7 @@ export const BaseContent = z.object({
37
36
  .nullish(),
38
37
 
39
38
  attachment: z.union([Attachment, Attachment.array()]).nullish(),
40
- tag: z.union([Mention, Emoji]).array(),
39
+ tag: z.union([Tag, Tag.array()]),
41
40
 
42
41
  published: z.string({ description: "Object published datetime" }),
43
42
  updated: z.string({ description: "Object updated datetime" }).nullish(),
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const HashTag = z.object({
4
+ type: z.literal("Hashtag"),
5
+ href: z.string().url(),
6
+ name: z.string().startsWith("#"),
7
+ });
8
+
9
+ export type HashTag = z.infer<typeof HashTag>;
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ import { Emoji } from "./emoji.js";
3
+ import { Mention } from "./mention.js";
4
+ import { HashTag } from "./hashtag.js";
5
+
6
+ export const Tag = z.union([Mention, Emoji, HashTag]);
7
+ export type Tag = z.infer<typeof Tag>;