@llun/activities.schema 0.2.25 → 0.2.27

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.
@@ -25,17 +25,17 @@ export declare const Undo: z.ZodObject<{
25
25
  type: z.ZodLiteral<"CollectionPage">;
26
26
  next: z.ZodString;
27
27
  partOf: z.ZodString;
28
- items: z.ZodArray<z.ZodAny, "many">;
28
+ items: z.ZodUnion<[z.ZodAny, z.ZodArray<z.ZodAny, "many">]>;
29
29
  }, "strip", z.ZodTypeAny, {
30
30
  type: "CollectionPage";
31
31
  next: string;
32
32
  partOf: string;
33
- items: any[];
33
+ items?: any;
34
34
  }, {
35
35
  type: "CollectionPage";
36
36
  next: string;
37
37
  partOf: string;
38
- items: any[];
38
+ items?: any;
39
39
  }>;
40
40
  }, "strip", z.ZodTypeAny, {
41
41
  id: string;
@@ -44,7 +44,7 @@ export declare const Undo: z.ZodObject<{
44
44
  type: "CollectionPage";
45
45
  next: string;
46
46
  partOf: string;
47
- items: any[];
47
+ items?: any;
48
48
  };
49
49
  }, {
50
50
  id: string;
@@ -53,23 +53,23 @@ export declare const Undo: z.ZodObject<{
53
53
  type: "CollectionPage";
54
54
  next: string;
55
55
  partOf: string;
56
- items: any[];
56
+ items?: any;
57
57
  };
58
58
  }>, z.ZodObject<{
59
59
  id: z.ZodString;
60
60
  type: z.ZodLiteral<"Collection">;
61
61
  totalItems: z.ZodNumber;
62
- items: z.ZodArray<z.ZodAny, "many">;
62
+ items: z.ZodUnion<[z.ZodAny, z.ZodArray<z.ZodAny, "many">]>;
63
63
  }, "strip", z.ZodTypeAny, {
64
64
  id: string;
65
65
  type: "Collection";
66
- items: any[];
67
66
  totalItems: number;
67
+ items?: any;
68
68
  }, {
69
69
  id: string;
70
70
  type: "Collection";
71
- items: any[];
72
71
  totalItems: number;
72
+ items?: any;
73
73
  }>]>>>;
74
74
  attachment: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
75
75
  type: z.ZodLiteral<"PropertyValue">;
@@ -168,16 +168,16 @@ export declare const Undo: z.ZodObject<{
168
168
  updated: z.ZodString;
169
169
  icon: z.ZodObject<{
170
170
  type: z.ZodLiteral<"Image">;
171
- mediaType: z.ZodString;
171
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
172
172
  url: z.ZodString;
173
173
  }, "strip", z.ZodTypeAny, {
174
174
  type: "Image";
175
- mediaType: string;
176
175
  url: string;
176
+ mediaType?: string | null | undefined;
177
177
  }, {
178
178
  type: "Image";
179
- mediaType: string;
180
179
  url: string;
180
+ mediaType?: string | null | undefined;
181
181
  }>;
182
182
  }, "strip", z.ZodTypeAny, {
183
183
  type: "Emoji";
@@ -185,8 +185,8 @@ export declare const Undo: z.ZodObject<{
185
185
  updated: string;
186
186
  icon: {
187
187
  type: "Image";
188
- mediaType: string;
189
188
  url: string;
189
+ mediaType?: string | null | undefined;
190
190
  };
191
191
  }, {
192
192
  type: "Emoji";
@@ -194,8 +194,8 @@ export declare const Undo: z.ZodObject<{
194
194
  updated: string;
195
195
  icon: {
196
196
  type: "Image";
197
- mediaType: string;
198
197
  url: string;
198
+ mediaType?: string | null | undefined;
199
199
  };
200
200
  }>, z.ZodObject<{
201
201
  type: z.ZodLiteral<"Hashtag">;
@@ -227,16 +227,16 @@ export declare const Undo: z.ZodObject<{
227
227
  updated: z.ZodString;
228
228
  icon: z.ZodObject<{
229
229
  type: z.ZodLiteral<"Image">;
230
- mediaType: z.ZodString;
230
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
231
  url: z.ZodString;
232
232
  }, "strip", z.ZodTypeAny, {
233
233
  type: "Image";
234
- mediaType: string;
235
234
  url: string;
235
+ mediaType?: string | null | undefined;
236
236
  }, {
237
237
  type: "Image";
238
- mediaType: string;
239
238
  url: string;
239
+ mediaType?: string | null | undefined;
240
240
  }>;
241
241
  }, "strip", z.ZodTypeAny, {
242
242
  type: "Emoji";
@@ -244,8 +244,8 @@ export declare const Undo: z.ZodObject<{
244
244
  updated: string;
245
245
  icon: {
246
246
  type: "Image";
247
- mediaType: string;
248
247
  url: string;
248
+ mediaType?: string | null | undefined;
249
249
  };
250
250
  }, {
251
251
  type: "Emoji";
@@ -253,8 +253,8 @@ export declare const Undo: z.ZodObject<{
253
253
  updated: string;
254
254
  icon: {
255
255
  type: "Image";
256
- mediaType: string;
257
256
  url: string;
257
+ mediaType?: string | null | undefined;
258
258
  };
259
259
  }>, z.ZodObject<{
260
260
  type: z.ZodLiteral<"Hashtag">;
@@ -286,8 +286,8 @@ export declare const Undo: z.ZodObject<{
286
286
  updated: string;
287
287
  icon: {
288
288
  type: "Image";
289
- mediaType: string;
290
289
  url: string;
290
+ mediaType?: string | null | undefined;
291
291
  };
292
292
  } | {
293
293
  type: "Mention";
@@ -303,8 +303,8 @@ export declare const Undo: z.ZodObject<{
303
303
  updated: string;
304
304
  icon: {
305
305
  type: "Image";
306
- mediaType: string;
307
306
  url: string;
307
+ mediaType?: string | null | undefined;
308
308
  };
309
309
  } | {
310
310
  type: "Mention";
@@ -329,13 +329,13 @@ export declare const Undo: z.ZodObject<{
329
329
  type: "CollectionPage";
330
330
  next: string;
331
331
  partOf: string;
332
- items: any[];
332
+ items?: any;
333
333
  };
334
334
  } | {
335
335
  id: string;
336
336
  type: "Collection";
337
- items: any[];
338
337
  totalItems: number;
338
+ items?: any;
339
339
  } | null | undefined;
340
340
  attachment?: {
341
341
  type: "Document";
@@ -377,8 +377,8 @@ export declare const Undo: z.ZodObject<{
377
377
  updated: string;
378
378
  icon: {
379
379
  type: "Image";
380
- mediaType: string;
381
380
  url: string;
381
+ mediaType?: string | null | undefined;
382
382
  };
383
383
  } | {
384
384
  type: "Mention";
@@ -394,8 +394,8 @@ export declare const Undo: z.ZodObject<{
394
394
  updated: string;
395
395
  icon: {
396
396
  type: "Image";
397
- mediaType: string;
398
397
  url: string;
398
+ mediaType?: string | null | undefined;
399
399
  };
400
400
  } | {
401
401
  type: "Mention";
@@ -420,13 +420,13 @@ export declare const Undo: z.ZodObject<{
420
420
  type: "CollectionPage";
421
421
  next: string;
422
422
  partOf: string;
423
- items: any[];
423
+ items?: any;
424
424
  };
425
425
  } | {
426
426
  id: string;
427
427
  type: "Collection";
428
- items: any[];
429
428
  totalItems: number;
429
+ items?: any;
430
430
  } | null | undefined;
431
431
  attachment?: {
432
432
  type: "Document";
@@ -470,8 +470,8 @@ export declare const Undo: z.ZodObject<{
470
470
  updated: string;
471
471
  icon: {
472
472
  type: "Image";
473
- mediaType: string;
474
473
  url: string;
474
+ mediaType?: string | null | undefined;
475
475
  };
476
476
  } | {
477
477
  type: "Mention";
@@ -487,8 +487,8 @@ export declare const Undo: z.ZodObject<{
487
487
  updated: string;
488
488
  icon: {
489
489
  type: "Image";
490
- mediaType: string;
491
490
  url: string;
491
+ mediaType?: string | null | undefined;
492
492
  };
493
493
  } | {
494
494
  type: "Mention";
@@ -513,13 +513,13 @@ export declare const Undo: z.ZodObject<{
513
513
  type: "CollectionPage";
514
514
  next: string;
515
515
  partOf: string;
516
- items: any[];
516
+ items?: any;
517
517
  };
518
518
  } | {
519
519
  id: string;
520
520
  type: "Collection";
521
- items: any[];
522
521
  totalItems: number;
522
+ items?: any;
523
523
  } | null | undefined;
524
524
  attachment?: {
525
525
  type: "Document";
@@ -566,8 +566,8 @@ export declare const Undo: z.ZodObject<{
566
566
  updated: string;
567
567
  icon: {
568
568
  type: "Image";
569
- mediaType: string;
570
569
  url: string;
570
+ mediaType?: string | null | undefined;
571
571
  };
572
572
  } | {
573
573
  type: "Mention";
@@ -583,8 +583,8 @@ export declare const Undo: z.ZodObject<{
583
583
  updated: string;
584
584
  icon: {
585
585
  type: "Image";
586
- mediaType: string;
587
586
  url: string;
587
+ mediaType?: string | null | undefined;
588
588
  };
589
589
  } | {
590
590
  type: "Mention";
@@ -609,13 +609,13 @@ export declare const Undo: z.ZodObject<{
609
609
  type: "CollectionPage";
610
610
  next: string;
611
611
  partOf: string;
612
- items: any[];
612
+ items?: any;
613
613
  };
614
614
  } | {
615
615
  id: string;
616
616
  type: "Collection";
617
- items: any[];
618
617
  totalItems: number;
618
+ items?: any;
619
619
  } | null | undefined;
620
620
  attachment?: {
621
621
  type: "Document";
@@ -684,8 +684,8 @@ export declare const Undo: z.ZodObject<{
684
684
  updated: string;
685
685
  icon: {
686
686
  type: "Image";
687
- mediaType: string;
688
687
  url: string;
688
+ mediaType?: string | null | undefined;
689
689
  };
690
690
  } | {
691
691
  type: "Mention";
@@ -701,8 +701,8 @@ export declare const Undo: z.ZodObject<{
701
701
  updated: string;
702
702
  icon: {
703
703
  type: "Image";
704
- mediaType: string;
705
704
  url: string;
705
+ mediaType?: string | null | undefined;
706
706
  };
707
707
  } | {
708
708
  type: "Mention";
@@ -727,13 +727,13 @@ export declare const Undo: z.ZodObject<{
727
727
  type: "CollectionPage";
728
728
  next: string;
729
729
  partOf: string;
730
- items: any[];
730
+ items?: any;
731
731
  };
732
732
  } | {
733
733
  id: string;
734
734
  type: "Collection";
735
- items: any[];
736
735
  totalItems: number;
736
+ items?: any;
737
737
  } | null | undefined;
738
738
  attachment?: {
739
739
  type: "Document";
@@ -790,8 +790,8 @@ export declare const Undo: z.ZodObject<{
790
790
  updated: string;
791
791
  icon: {
792
792
  type: "Image";
793
- mediaType: string;
794
793
  url: string;
794
+ mediaType?: string | null | undefined;
795
795
  };
796
796
  } | {
797
797
  type: "Mention";
@@ -807,8 +807,8 @@ export declare const Undo: z.ZodObject<{
807
807
  updated: string;
808
808
  icon: {
809
809
  type: "Image";
810
- mediaType: string;
811
810
  url: string;
811
+ mediaType?: string | null | undefined;
812
812
  };
813
813
  } | {
814
814
  type: "Mention";
@@ -833,13 +833,13 @@ export declare const Undo: z.ZodObject<{
833
833
  type: "CollectionPage";
834
834
  next: string;
835
835
  partOf: string;
836
- items: any[];
836
+ items?: any;
837
837
  };
838
838
  } | {
839
839
  id: string;
840
840
  type: "Collection";
841
- items: any[];
842
841
  totalItems: number;
842
+ items?: any;
843
843
  } | null | undefined;
844
844
  attachment?: {
845
845
  type: "Document";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.25",
3
+ "version": "0.2.27",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -13,7 +13,7 @@
13
13
  "author": "Maythee Anegboonlap <null@llun.dev>",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "zod": "^3.24.1"
16
+ "zod": "^3.24.2"
17
17
  },
18
18
  "devDependencies": {
19
19
  "typescript": "^5.7.3"
package/src/collection.ts CHANGED
@@ -7,7 +7,7 @@ export const CollectionWithFirstPage = z.object({
7
7
  type: z.literal("CollectionPage"),
8
8
  next: z.string(),
9
9
  partOf: z.string(),
10
- items: z.array(z.any()),
10
+ items: z.union([z.any(), z.array(z.any())]),
11
11
  }),
12
12
  });
13
13
  export type CollectionWithFirstPage = z.infer<typeof CollectionWithFirstPage>;
@@ -16,7 +16,7 @@ export const CollectionWithItems = z.object({
16
16
  id: z.string(),
17
17
  type: z.literal("Collection"),
18
18
  totalItems: z.number(),
19
- items: z.array(z.any()),
19
+ items: z.union([z.any(), z.array(z.any())]),
20
20
  });
21
21
  export type CollectionWithItems = z.infer<typeof CollectionWithItems>;
22
22
 
package/src/image.ts CHANGED
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
 
3
3
  export const Image = z.object({
4
4
  type: z.literal("Image"),
5
- mediaType: z.string(),
5
+ mediaType: z.string().nullish(),
6
6
  url: z.string(),
7
7
  });
8
8