@llun/activities.schema 0.2.18 → 0.2.19

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/dist/cjs/index.js CHANGED
@@ -28,4 +28,5 @@ __exportStar(require("./tombstone.js"), exports);
28
28
  __exportStar(require("./note/emoji.js"), exports);
29
29
  __exportStar(require("./note/mention.js"), exports);
30
30
  __exportStar(require("./note/hashtag.js"), exports);
31
+ __exportStar(require("./person.js"), exports);
31
32
  exports.Mastodon = require("./mastodon/index.js");
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Emoji = void 0;
4
4
  const zod_1 = require("zod");
5
- const image_js_1 = require("./image.js");
5
+ const image_js_1 = require("../image.js");
6
6
  exports.Emoji = zod_1.z.object({
7
7
  type: zod_1.z.literal("Emoji"),
8
8
  name: zod_1.z.string(),
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Person = void 0;
4
+ const zod_1 = require("zod");
5
+ const image_js_1 = require("./image.js");
6
+ exports.Person = zod_1.z.object({
7
+ id: zod_1.z.string(),
8
+ type: zod_1.z.literal("Person"),
9
+ following: zod_1.z.string().url(),
10
+ followers: zod_1.z.string().url(),
11
+ inbox: zod_1.z.string().url(),
12
+ outbox: zod_1.z.string().url(),
13
+ preferredUsername: zod_1.z.string(),
14
+ name: zod_1.z.string(),
15
+ summary: zod_1.z.string(),
16
+ url: zod_1.z.string().url(),
17
+ published: zod_1.z.string(),
18
+ publicKey: zod_1.z.object({
19
+ id: zod_1.z.string(),
20
+ owner: zod_1.z.string(),
21
+ publicKeyPem: zod_1.z.string(),
22
+ }),
23
+ endpoints: zod_1.z
24
+ .object({
25
+ sharedInbox: zod_1.z.string().optional(),
26
+ })
27
+ .optional(),
28
+ icon: image_js_1.Image.optional(),
29
+ image: image_js_1.Image.optional(),
30
+ });
package/dist/esm/index.js CHANGED
@@ -11,4 +11,5 @@ export * from "./tombstone.js";
11
11
  export * from "./note/emoji.js";
12
12
  export * from "./note/mention.js";
13
13
  export * from "./note/hashtag.js";
14
+ export * from "./person.js";
14
15
  export * as Mastodon from "./mastodon/index.js";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { Image } from "./image.js";
2
+ import { Image } from "../image.js";
3
3
  export const Emoji = z.object({
4
4
  type: z.literal("Emoji"),
5
5
  name: z.string(),
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { Image } from "./image.js";
3
+ export const Person = z.object({
4
+ id: z.string(),
5
+ type: z.literal("Person"),
6
+ following: z.string().url(),
7
+ followers: z.string().url(),
8
+ inbox: z.string().url(),
9
+ outbox: z.string().url(),
10
+ preferredUsername: z.string(),
11
+ name: z.string(),
12
+ summary: z.string(),
13
+ url: z.string().url(),
14
+ published: z.string(),
15
+ publicKey: z.object({
16
+ id: z.string(),
17
+ owner: z.string(),
18
+ publicKeyPem: z.string(),
19
+ }),
20
+ endpoints: z
21
+ .object({
22
+ sharedInbox: z.string().optional(),
23
+ })
24
+ .optional(),
25
+ icon: Image.optional(),
26
+ image: Image.optional(),
27
+ });
@@ -11,4 +11,5 @@ export * from "./tombstone.js";
11
11
  export * from "./note/emoji.js";
12
12
  export * from "./note/mention.js";
13
13
  export * from "./note/hashtag.js";
14
+ export * from "./person.js";
14
15
  export * as Mastodon from "./mastodon/index.js";
@@ -21,13 +21,13 @@ export declare const PreviewCard: z.ZodObject<{
21
21
  blurhash: string | null;
22
22
  width: number;
23
23
  height: number;
24
+ image: string | null;
24
25
  title: string;
25
26
  author_name: string;
26
27
  author_url: string;
27
28
  provider_name: string;
28
29
  provider_url: string;
29
30
  html: string;
30
- image: string | null;
31
31
  embed_url: string;
32
32
  }, {
33
33
  type: "link" | "photo" | "video" | "rich";
@@ -36,13 +36,13 @@ export declare const PreviewCard: z.ZodObject<{
36
36
  blurhash: string | null;
37
37
  width: number;
38
38
  height: number;
39
+ image: string | null;
39
40
  title: string;
40
41
  author_name: string;
41
42
  author_url: string;
42
43
  provider_name: string;
43
44
  provider_url: string;
44
45
  html: string;
45
- image: string | null;
46
46
  embed_url: string;
47
47
  }>;
48
48
  export type PreviewCard = z.infer<typeof PreviewCard>;
@@ -1041,13 +1041,13 @@ export declare const BaseStatus: z.ZodObject<{
1041
1041
  blurhash: string | null;
1042
1042
  width: number;
1043
1043
  height: number;
1044
+ image: string | null;
1044
1045
  title: string;
1045
1046
  author_name: string;
1046
1047
  author_url: string;
1047
1048
  provider_name: string;
1048
1049
  provider_url: string;
1049
1050
  html: string;
1050
- image: string | null;
1051
1051
  embed_url: string;
1052
1052
  }, {
1053
1053
  type: "link" | "photo" | "video" | "rich";
@@ -1056,13 +1056,13 @@ export declare const BaseStatus: z.ZodObject<{
1056
1056
  blurhash: string | null;
1057
1057
  width: number;
1058
1058
  height: number;
1059
+ image: string | null;
1059
1060
  title: string;
1060
1061
  author_name: string;
1061
1062
  author_url: string;
1062
1063
  provider_name: string;
1063
1064
  provider_url: string;
1064
1065
  html: string;
1065
- image: string | null;
1066
1066
  embed_url: string;
1067
1067
  }>>;
1068
1068
  language: z.ZodNullable<z.ZodString>;
@@ -1414,13 +1414,13 @@ export declare const BaseStatus: z.ZodObject<{
1414
1414
  blurhash: string | null;
1415
1415
  width: number;
1416
1416
  height: number;
1417
+ image: string | null;
1417
1418
  title: string;
1418
1419
  author_name: string;
1419
1420
  author_url: string;
1420
1421
  provider_name: string;
1421
1422
  provider_url: string;
1422
1423
  html: string;
1423
- image: string | null;
1424
1424
  embed_url: string;
1425
1425
  } | null;
1426
1426
  language: string | null;
@@ -1693,13 +1693,13 @@ export declare const BaseStatus: z.ZodObject<{
1693
1693
  blurhash: string | null;
1694
1694
  width: number;
1695
1695
  height: number;
1696
+ image: string | null;
1696
1697
  title: string;
1697
1698
  author_name: string;
1698
1699
  author_url: string;
1699
1700
  provider_name: string;
1700
1701
  provider_url: string;
1701
1702
  html: string;
1702
- image: string | null;
1703
1703
  embed_url: string;
1704
1704
  } | null;
1705
1705
  language: string | null;
@@ -1041,13 +1041,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
1041
1041
  blurhash: string | null;
1042
1042
  width: number;
1043
1043
  height: number;
1044
+ image: string | null;
1044
1045
  title: string;
1045
1046
  author_name: string;
1046
1047
  author_url: string;
1047
1048
  provider_name: string;
1048
1049
  provider_url: string;
1049
1050
  html: string;
1050
- image: string | null;
1051
1051
  embed_url: string;
1052
1052
  }, {
1053
1053
  type: "link" | "photo" | "video" | "rich";
@@ -1056,13 +1056,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
1056
1056
  blurhash: string | null;
1057
1057
  width: number;
1058
1058
  height: number;
1059
+ image: string | null;
1059
1060
  title: string;
1060
1061
  author_name: string;
1061
1062
  author_url: string;
1062
1063
  provider_name: string;
1063
1064
  provider_url: string;
1064
1065
  html: string;
1065
- image: string | null;
1066
1066
  embed_url: string;
1067
1067
  }>>;
1068
1068
  language: z.ZodNullable<z.ZodString>;
@@ -2219,13 +2219,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2219
2219
  blurhash: string | null;
2220
2220
  width: number;
2221
2221
  height: number;
2222
+ image: string | null;
2222
2223
  title: string;
2223
2224
  author_name: string;
2224
2225
  author_url: string;
2225
2226
  provider_name: string;
2226
2227
  provider_url: string;
2227
2228
  html: string;
2228
- image: string | null;
2229
2229
  embed_url: string;
2230
2230
  }, {
2231
2231
  type: "link" | "photo" | "video" | "rich";
@@ -2234,13 +2234,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2234
2234
  blurhash: string | null;
2235
2235
  width: number;
2236
2236
  height: number;
2237
+ image: string | null;
2237
2238
  title: string;
2238
2239
  author_name: string;
2239
2240
  author_url: string;
2240
2241
  provider_name: string;
2241
2242
  provider_url: string;
2242
2243
  html: string;
2243
- image: string | null;
2244
2244
  embed_url: string;
2245
2245
  }>>;
2246
2246
  language: z.ZodNullable<z.ZodString>;
@@ -2592,13 +2592,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2592
2592
  blurhash: string | null;
2593
2593
  width: number;
2594
2594
  height: number;
2595
+ image: string | null;
2595
2596
  title: string;
2596
2597
  author_name: string;
2597
2598
  author_url: string;
2598
2599
  provider_name: string;
2599
2600
  provider_url: string;
2600
2601
  html: string;
2601
- image: string | null;
2602
2602
  embed_url: string;
2603
2603
  } | null;
2604
2604
  language: string | null;
@@ -2871,13 +2871,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2871
2871
  blurhash: string | null;
2872
2872
  width: number;
2873
2873
  height: number;
2874
+ image: string | null;
2874
2875
  title: string;
2875
2876
  author_name: string;
2876
2877
  author_url: string;
2877
2878
  provider_name: string;
2878
2879
  provider_url: string;
2879
2880
  html: string;
2880
- image: string | null;
2881
2881
  embed_url: string;
2882
2882
  } | null;
2883
2883
  language: string | null;
@@ -3151,13 +3151,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3151
3151
  blurhash: string | null;
3152
3152
  width: number;
3153
3153
  height: number;
3154
+ image: string | null;
3154
3155
  title: string;
3155
3156
  author_name: string;
3156
3157
  author_url: string;
3157
3158
  provider_name: string;
3158
3159
  provider_url: string;
3159
3160
  html: string;
3160
- image: string | null;
3161
3161
  embed_url: string;
3162
3162
  } | null;
3163
3163
  language: string | null;
@@ -3401,13 +3401,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3401
3401
  blurhash: string | null;
3402
3402
  width: number;
3403
3403
  height: number;
3404
+ image: string | null;
3404
3405
  title: string;
3405
3406
  author_name: string;
3406
3407
  author_url: string;
3407
3408
  provider_name: string;
3408
3409
  provider_url: string;
3409
3410
  html: string;
3410
- image: string | null;
3411
3411
  embed_url: string;
3412
3412
  } | null;
3413
3413
  language: string | null;
@@ -3710,13 +3710,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3710
3710
  blurhash: string | null;
3711
3711
  width: number;
3712
3712
  height: number;
3713
+ image: string | null;
3713
3714
  title: string;
3714
3715
  author_name: string;
3715
3716
  author_url: string;
3716
3717
  provider_name: string;
3717
3718
  provider_url: string;
3718
3719
  html: string;
3719
- image: string | null;
3720
3720
  embed_url: string;
3721
3721
  } | null;
3722
3722
  language: string | null;
@@ -3960,13 +3960,13 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3960
3960
  blurhash: string | null;
3961
3961
  width: number;
3962
3962
  height: number;
3963
+ image: string | null;
3963
3964
  title: string;
3964
3965
  author_name: string;
3965
3966
  author_url: string;
3966
3967
  provider_name: string;
3967
3968
  provider_url: string;
3968
3969
  html: string;
3969
- image: string | null;
3970
3970
  embed_url: string;
3971
3971
  } | null;
3972
3972
  language: string | null;
@@ -0,0 +1,121 @@
1
+ import { z } from "zod";
2
+ export declare const Person: z.ZodObject<{
3
+ id: z.ZodString;
4
+ type: z.ZodLiteral<"Person">;
5
+ following: z.ZodString;
6
+ followers: z.ZodString;
7
+ inbox: z.ZodString;
8
+ outbox: z.ZodString;
9
+ preferredUsername: z.ZodString;
10
+ name: z.ZodString;
11
+ summary: z.ZodString;
12
+ url: z.ZodString;
13
+ published: z.ZodString;
14
+ publicKey: z.ZodObject<{
15
+ id: z.ZodString;
16
+ owner: z.ZodString;
17
+ publicKeyPem: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ id: string;
20
+ owner: string;
21
+ publicKeyPem: string;
22
+ }, {
23
+ id: string;
24
+ owner: string;
25
+ publicKeyPem: string;
26
+ }>;
27
+ endpoints: z.ZodOptional<z.ZodObject<{
28
+ sharedInbox: z.ZodOptional<z.ZodString>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ sharedInbox?: string | undefined;
31
+ }, {
32
+ sharedInbox?: string | undefined;
33
+ }>>;
34
+ icon: z.ZodOptional<z.ZodObject<{
35
+ type: z.ZodLiteral<"Image">;
36
+ mediaType: z.ZodString;
37
+ url: z.ZodString;
38
+ }, "strip", z.ZodTypeAny, {
39
+ type: "Image";
40
+ mediaType: string;
41
+ url: string;
42
+ }, {
43
+ type: "Image";
44
+ mediaType: string;
45
+ url: string;
46
+ }>>;
47
+ image: z.ZodOptional<z.ZodObject<{
48
+ type: z.ZodLiteral<"Image">;
49
+ mediaType: z.ZodString;
50
+ url: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ type: "Image";
53
+ mediaType: string;
54
+ url: string;
55
+ }, {
56
+ type: "Image";
57
+ mediaType: string;
58
+ url: string;
59
+ }>>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ id: string;
62
+ type: "Person";
63
+ published: string;
64
+ url: string;
65
+ name: string;
66
+ summary: string;
67
+ following: string;
68
+ followers: string;
69
+ inbox: string;
70
+ outbox: string;
71
+ preferredUsername: string;
72
+ publicKey: {
73
+ id: string;
74
+ owner: string;
75
+ publicKeyPem: string;
76
+ };
77
+ icon?: {
78
+ type: "Image";
79
+ mediaType: string;
80
+ url: string;
81
+ } | undefined;
82
+ endpoints?: {
83
+ sharedInbox?: string | undefined;
84
+ } | undefined;
85
+ image?: {
86
+ type: "Image";
87
+ mediaType: string;
88
+ url: string;
89
+ } | undefined;
90
+ }, {
91
+ id: string;
92
+ type: "Person";
93
+ published: string;
94
+ url: string;
95
+ name: string;
96
+ summary: string;
97
+ following: string;
98
+ followers: string;
99
+ inbox: string;
100
+ outbox: string;
101
+ preferredUsername: string;
102
+ publicKey: {
103
+ id: string;
104
+ owner: string;
105
+ publicKeyPem: string;
106
+ };
107
+ icon?: {
108
+ type: "Image";
109
+ mediaType: string;
110
+ url: string;
111
+ } | undefined;
112
+ endpoints?: {
113
+ sharedInbox?: string | undefined;
114
+ } | undefined;
115
+ image?: {
116
+ type: "Image";
117
+ mediaType: string;
118
+ url: string;
119
+ } | undefined;
120
+ }>;
121
+ export type Person = z.infer<typeof Person>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/index.ts CHANGED
@@ -13,4 +13,6 @@ export * from "./note/emoji.js";
13
13
  export * from "./note/mention.js";
14
14
  export * from "./note/hashtag.js";
15
15
 
16
+ export * from "./person.js";
17
+
16
18
  export * as Mastodon from "./mastodon/index.js";
package/src/note/emoji.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
 
3
- import { Image } from "./image.js";
3
+ import { Image } from "../image.js";
4
4
 
5
5
  export const Emoji = z.object({
6
6
  type: z.literal("Emoji"),
package/src/person.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import { Image } from "./image.js";
3
+
4
+ export const Person = z.object({
5
+ id: z.string(),
6
+ type: z.literal("Person"),
7
+ following: z.string().url(),
8
+ followers: z.string().url(),
9
+ inbox: z.string().url(),
10
+ outbox: z.string().url(),
11
+ preferredUsername: z.string(),
12
+ name: z.string(),
13
+ summary: z.string(),
14
+ url: z.string().url(),
15
+ published: z.string(),
16
+ publicKey: z.object({
17
+ id: z.string(),
18
+ owner: z.string(),
19
+ publicKeyPem: z.string(),
20
+ }),
21
+ endpoints: z
22
+ .object({
23
+ sharedInbox: z.string().optional(),
24
+ })
25
+ .optional(),
26
+ icon: Image.optional(),
27
+ image: Image.optional(),
28
+ });
29
+ export type Person = z.infer<typeof Person>;
File without changes
File without changes
File without changes
File without changes