@llun/activities.schema 0.2.28 → 0.2.30

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
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Relationship = void 0;
4
+ const zod_1 = require("zod");
5
+ /**
6
+ * Represents the relationship between accounts in Mastodon, such as following, blocking, muting, etc.
7
+ * @see https://docs.joinmastodon.org/entities/Relationship/
8
+ */
9
+ exports.Relationship = zod_1.z.object({
10
+ // The account ID (cast from integer but not guaranteed to be a number)
11
+ id: zod_1.z.string(),
12
+ // Are you following this user?
13
+ following: zod_1.z.boolean(),
14
+ // Are you receiving this user's boosts in your home timeline?
15
+ showing_reblogs: zod_1.z.boolean(),
16
+ // Have you enabled notifications for this user?
17
+ notifying: zod_1.z.boolean(),
18
+ // Which languages are you following from this user?
19
+ languages: zod_1.z.array(zod_1.z.string()),
20
+ // Are you followed by this user?
21
+ followed_by: zod_1.z.boolean(),
22
+ // Are you blocking this user?
23
+ blocking: zod_1.z.boolean(),
24
+ // Is this user blocking you?
25
+ blocked_by: zod_1.z.boolean(),
26
+ // Are you muting this user?
27
+ muting: zod_1.z.boolean(),
28
+ // Are you muting notifications from this user?
29
+ muting_notifications: zod_1.z.boolean(),
30
+ // Do you have a pending follow request for this user?
31
+ requested: zod_1.z.boolean(),
32
+ // Has this user requested to follow you?
33
+ requested_by: zod_1.z.boolean(),
34
+ // Are you blocking this user's domain?
35
+ domain_blocking: zod_1.z.boolean(),
36
+ // Are you featuring this user on your profile?
37
+ endorsed: zod_1.z.boolean(),
38
+ // This user's profile bio
39
+ note: zod_1.z.string(),
40
+ });
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./account.js"), exports);
18
18
  __exportStar(require("./account/field.js"), exports);
19
19
  __exportStar(require("./account/source.js"), exports);
20
+ __exportStar(require("./account/relationship.js"), exports);
20
21
  __exportStar(require("./customEmoji.js"), exports);
21
22
  __exportStar(require("./filterResult.js"), exports);
22
23
  __exportStar(require("./previewCard.js"), exports);
@@ -14,7 +14,7 @@ exports.Person = zod_1.z.object({
14
14
  name: zod_1.z.string(),
15
15
  summary: zod_1.z.string().nullish(),
16
16
  url: zod_1.z.string().url(),
17
- published: zod_1.z.string(),
17
+ published: zod_1.z.string().nullish(),
18
18
  publicKey: zod_1.z.object({
19
19
  id: zod_1.z.string(),
20
20
  owner: zod_1.z.string(),
@@ -25,6 +25,6 @@ exports.Person = zod_1.z.object({
25
25
  sharedInbox: zod_1.z.string().optional(),
26
26
  })
27
27
  .optional(),
28
- icon: image_js_1.Image.optional(),
29
- image: image_js_1.Image.optional(),
28
+ icon: image_js_1.Image.nullish(),
29
+ image: image_js_1.Image.nullish(),
30
30
  });
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Represents the relationship between accounts in Mastodon, such as following, blocking, muting, etc.
4
+ * @see https://docs.joinmastodon.org/entities/Relationship/
5
+ */
6
+ export const Relationship = z.object({
7
+ // The account ID (cast from integer but not guaranteed to be a number)
8
+ id: z.string(),
9
+ // Are you following this user?
10
+ following: z.boolean(),
11
+ // Are you receiving this user's boosts in your home timeline?
12
+ showing_reblogs: z.boolean(),
13
+ // Have you enabled notifications for this user?
14
+ notifying: z.boolean(),
15
+ // Which languages are you following from this user?
16
+ languages: z.array(z.string()),
17
+ // Are you followed by this user?
18
+ followed_by: z.boolean(),
19
+ // Are you blocking this user?
20
+ blocking: z.boolean(),
21
+ // Is this user blocking you?
22
+ blocked_by: z.boolean(),
23
+ // Are you muting this user?
24
+ muting: z.boolean(),
25
+ // Are you muting notifications from this user?
26
+ muting_notifications: z.boolean(),
27
+ // Do you have a pending follow request for this user?
28
+ requested: z.boolean(),
29
+ // Has this user requested to follow you?
30
+ requested_by: z.boolean(),
31
+ // Are you blocking this user's domain?
32
+ domain_blocking: z.boolean(),
33
+ // Are you featuring this user on your profile?
34
+ endorsed: z.boolean(),
35
+ // This user's profile bio
36
+ note: z.string(),
37
+ });
@@ -1,6 +1,7 @@
1
1
  export * from "./account.js";
2
2
  export * from "./account/field.js";
3
3
  export * from "./account/source.js";
4
+ export * from "./account/relationship.js";
4
5
  export * from "./customEmoji.js";
5
6
  export * from "./filterResult.js";
6
7
  export * from "./previewCard.js";
@@ -11,7 +11,7 @@ export const Person = z.object({
11
11
  name: z.string(),
12
12
  summary: z.string().nullish(),
13
13
  url: z.string().url(),
14
- published: z.string(),
14
+ published: z.string().nullish(),
15
15
  publicKey: z.object({
16
16
  id: z.string(),
17
17
  owner: z.string(),
@@ -22,6 +22,6 @@ export const Person = z.object({
22
22
  sharedInbox: z.string().optional(),
23
23
  })
24
24
  .optional(),
25
- icon: Image.optional(),
26
- image: Image.optional(),
25
+ icon: Image.nullish(),
26
+ image: Image.nullish(),
27
27
  });
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Represents the relationship between accounts in Mastodon, such as following, blocking, muting, etc.
4
+ * @see https://docs.joinmastodon.org/entities/Relationship/
5
+ */
6
+ export declare const Relationship: z.ZodObject<{
7
+ id: z.ZodString;
8
+ following: z.ZodBoolean;
9
+ showing_reblogs: z.ZodBoolean;
10
+ notifying: z.ZodBoolean;
11
+ languages: z.ZodArray<z.ZodString, "many">;
12
+ followed_by: z.ZodBoolean;
13
+ blocking: z.ZodBoolean;
14
+ blocked_by: z.ZodBoolean;
15
+ muting: z.ZodBoolean;
16
+ muting_notifications: z.ZodBoolean;
17
+ requested: z.ZodBoolean;
18
+ requested_by: z.ZodBoolean;
19
+ domain_blocking: z.ZodBoolean;
20
+ endorsed: z.ZodBoolean;
21
+ note: z.ZodString;
22
+ }, "strip", z.ZodTypeAny, {
23
+ id: string;
24
+ following: boolean;
25
+ note: string;
26
+ showing_reblogs: boolean;
27
+ notifying: boolean;
28
+ languages: string[];
29
+ followed_by: boolean;
30
+ blocking: boolean;
31
+ blocked_by: boolean;
32
+ muting: boolean;
33
+ muting_notifications: boolean;
34
+ requested: boolean;
35
+ requested_by: boolean;
36
+ domain_blocking: boolean;
37
+ endorsed: boolean;
38
+ }, {
39
+ id: string;
40
+ following: boolean;
41
+ note: string;
42
+ showing_reblogs: boolean;
43
+ notifying: boolean;
44
+ languages: string[];
45
+ followed_by: boolean;
46
+ blocking: boolean;
47
+ blocked_by: boolean;
48
+ muting: boolean;
49
+ muting_notifications: boolean;
50
+ requested: boolean;
51
+ requested_by: boolean;
52
+ domain_blocking: boolean;
53
+ endorsed: boolean;
54
+ }>;
55
+ export type Relationship = z.infer<typeof Relationship>;
@@ -1,6 +1,7 @@
1
1
  export * from "./account.js";
2
2
  export * from "./account/field.js";
3
3
  export * from "./account/source.js";
4
+ export * from "./account/relationship.js";
4
5
  export * from "./customEmoji.js";
5
6
  export * from "./filterResult.js";
6
7
  export * from "./previewCard.js";
@@ -10,7 +10,7 @@ export declare const Person: z.ZodObject<{
10
10
  name: z.ZodString;
11
11
  summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
12
12
  url: z.ZodString;
13
- published: z.ZodString;
13
+ published: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
14
  publicKey: z.ZodObject<{
15
15
  id: z.ZodString;
16
16
  owner: z.ZodString;
@@ -31,7 +31,7 @@ export declare const Person: z.ZodObject<{
31
31
  }, {
32
32
  sharedInbox?: string | undefined;
33
33
  }>>;
34
- icon: z.ZodOptional<z.ZodObject<{
34
+ icon: z.ZodOptional<z.ZodNullable<z.ZodObject<{
35
35
  type: z.ZodLiteral<"Image">;
36
36
  mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
37
  url: z.ZodString;
@@ -43,8 +43,8 @@ export declare const Person: z.ZodObject<{
43
43
  type: "Image";
44
44
  url: string;
45
45
  mediaType?: string | null | undefined;
46
- }>>;
47
- image: z.ZodOptional<z.ZodObject<{
46
+ }>>>;
47
+ image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
48
48
  type: z.ZodLiteral<"Image">;
49
49
  mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
50
  url: z.ZodString;
@@ -56,11 +56,10 @@ export declare const Person: z.ZodObject<{
56
56
  type: "Image";
57
57
  url: string;
58
58
  mediaType?: string | null | undefined;
59
- }>>;
59
+ }>>>;
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  id: string;
62
62
  type: "Person";
63
- published: string;
64
63
  url: string;
65
64
  name: string;
66
65
  following: string;
@@ -73,11 +72,12 @@ export declare const Person: z.ZodObject<{
73
72
  owner: string;
74
73
  publicKeyPem: string;
75
74
  };
75
+ published?: string | null | undefined;
76
76
  icon?: {
77
77
  type: "Image";
78
78
  url: string;
79
79
  mediaType?: string | null | undefined;
80
- } | undefined;
80
+ } | null | undefined;
81
81
  summary?: string | null | undefined;
82
82
  endpoints?: {
83
83
  sharedInbox?: string | undefined;
@@ -86,11 +86,10 @@ export declare const Person: z.ZodObject<{
86
86
  type: "Image";
87
87
  url: string;
88
88
  mediaType?: string | null | undefined;
89
- } | undefined;
89
+ } | null | undefined;
90
90
  }, {
91
91
  id: string;
92
92
  type: "Person";
93
- published: string;
94
93
  url: string;
95
94
  name: string;
96
95
  following: string;
@@ -103,11 +102,12 @@ export declare const Person: z.ZodObject<{
103
102
  owner: string;
104
103
  publicKeyPem: string;
105
104
  };
105
+ published?: string | null | undefined;
106
106
  icon?: {
107
107
  type: "Image";
108
108
  url: string;
109
109
  mediaType?: string | null | undefined;
110
- } | undefined;
110
+ } | null | undefined;
111
111
  summary?: string | null | undefined;
112
112
  endpoints?: {
113
113
  sharedInbox?: string | undefined;
@@ -116,6 +116,6 @@ export declare const Person: z.ZodObject<{
116
116
  type: "Image";
117
117
  url: string;
118
118
  mediaType?: string | null | undefined;
119
- } | undefined;
119
+ } | null | undefined;
120
120
  }>;
121
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.28",
3
+ "version": "0.2.30",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -16,7 +16,7 @@
16
16
  "zod": "^3.24.2"
17
17
  },
18
18
  "devDependencies": {
19
- "typescript": "^5.7.3"
19
+ "typescript": "^5.8.2"
20
20
  },
21
21
  "packageManager": "yarn@4.6.0"
22
22
  }
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * Represents the relationship between accounts in Mastodon, such as following, blocking, muting, etc.
5
+ * @see https://docs.joinmastodon.org/entities/Relationship/
6
+ */
7
+ export const Relationship = z.object({
8
+ // The account ID (cast from integer but not guaranteed to be a number)
9
+ id: z.string(),
10
+
11
+ // Are you following this user?
12
+ following: z.boolean(),
13
+
14
+ // Are you receiving this user's boosts in your home timeline?
15
+ showing_reblogs: z.boolean(),
16
+
17
+ // Have you enabled notifications for this user?
18
+ notifying: z.boolean(),
19
+
20
+ // Which languages are you following from this user?
21
+ languages: z.array(z.string()),
22
+
23
+ // Are you followed by this user?
24
+ followed_by: z.boolean(),
25
+
26
+ // Are you blocking this user?
27
+ blocking: z.boolean(),
28
+
29
+ // Is this user blocking you?
30
+ blocked_by: z.boolean(),
31
+
32
+ // Are you muting this user?
33
+ muting: z.boolean(),
34
+
35
+ // Are you muting notifications from this user?
36
+ muting_notifications: z.boolean(),
37
+
38
+ // Do you have a pending follow request for this user?
39
+ requested: z.boolean(),
40
+
41
+ // Has this user requested to follow you?
42
+ requested_by: z.boolean(),
43
+
44
+ // Are you blocking this user's domain?
45
+ domain_blocking: z.boolean(),
46
+
47
+ // Are you featuring this user on your profile?
48
+ endorsed: z.boolean(),
49
+
50
+ // This user's profile bio
51
+ note: z.string(),
52
+ });
53
+
54
+ export type Relationship = z.infer<typeof Relationship>;
@@ -1,6 +1,7 @@
1
1
  export * from "./account.js";
2
2
  export * from "./account/field.js";
3
3
  export * from "./account/source.js";
4
+ export * from "./account/relationship.js";
4
5
  export * from "./customEmoji.js";
5
6
  export * from "./filterResult.js";
6
7
  export * from "./previewCard.js";
package/src/person.ts CHANGED
@@ -12,7 +12,7 @@ export const Person = z.object({
12
12
  name: z.string(),
13
13
  summary: z.string().nullish(),
14
14
  url: z.string().url(),
15
- published: z.string(),
15
+ published: z.string().nullish(),
16
16
  publicKey: z.object({
17
17
  id: z.string(),
18
18
  owner: z.string(),
@@ -23,7 +23,7 @@ export const Person = z.object({
23
23
  sharedInbox: z.string().optional(),
24
24
  })
25
25
  .optional(),
26
- icon: Image.optional(),
27
- image: Image.optional(),
26
+ icon: Image.nullish(),
27
+ image: Image.nullish(),
28
28
  });
29
29
  export type Person = z.infer<typeof Person>;