@llun/activities.schema 0.2.29 → 0.2.31

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);
@@ -11,6 +11,8 @@ const customEmoji_js_1 = require("../customEmoji.js");
11
11
  const index_js_2 = require("../poll/index.js");
12
12
  const previewCard_js_1 = require("../previewCard.js");
13
13
  const filterResult_js_1 = require("../filterResult.js");
14
+ const mention_js_1 = require("./mention.js");
15
+ const tag_js_1 = require("./tag.js");
14
16
  exports.BaseStatus = zod_1.z.object({
15
17
  id: zod_1.z.string({
16
18
  description: "ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI",
@@ -30,6 +32,8 @@ exports.BaseStatus = zod_1.z.object({
30
32
  media_attachments: index_js_1.MediaAttachment.array(),
31
33
  application: application_js_1.Application.optional(),
32
34
  emojis: customEmoji_js_1.CustomEmoji.array().describe("Custom emoji to be used when rendering status content"),
35
+ mentions: mention_js_1.Mention.array().describe("Mentions of users within the status content"),
36
+ tags: tag_js_1.Tag.array().describe("Hashtags used within the status content"),
33
37
  reblogs_count: zod_1.z.number({
34
38
  description: "How many boosts this status has received",
35
39
  }),
@@ -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";
@@ -8,6 +8,8 @@ import { CustomEmoji } from "../customEmoji.js";
8
8
  import { Poll } from "../poll/index.js";
9
9
  import { PreviewCard } from "../previewCard.js";
10
10
  import { FilterResult } from "../filterResult.js";
11
+ import { Mention } from "./mention.js";
12
+ import { Tag } from "./tag.js";
11
13
  export const BaseStatus = z.object({
12
14
  id: z.string({
13
15
  description: "ID of the status in the database, for Mastodon, it is numeric casting to string. For Activities.next, this is equal to status URI",
@@ -27,6 +29,8 @@ export const BaseStatus = z.object({
27
29
  media_attachments: MediaAttachment.array(),
28
30
  application: Application.optional(),
29
31
  emojis: CustomEmoji.array().describe("Custom emoji to be used when rendering status content"),
32
+ mentions: Mention.array().describe("Mentions of users within the status content"),
33
+ tags: Tag.array().describe("Hashtags used within the status content"),
30
34
  reblogs_count: z.number({
31
35
  description: "How many boosts this status has received",
32
36
  }),
@@ -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";
@@ -1090,6 +1090,32 @@ export declare const BaseStatus: z.ZodObject<{
1090
1090
  visible_in_picker: boolean;
1091
1091
  category: string | null;
1092
1092
  }>, "many">;
1093
+ mentions: z.ZodArray<z.ZodObject<{
1094
+ id: z.ZodString;
1095
+ username: z.ZodString;
1096
+ url: z.ZodString;
1097
+ acct: z.ZodString;
1098
+ }, "strip", z.ZodTypeAny, {
1099
+ id: string;
1100
+ url: string;
1101
+ username: string;
1102
+ acct: string;
1103
+ }, {
1104
+ id: string;
1105
+ url: string;
1106
+ username: string;
1107
+ acct: string;
1108
+ }>, "many">;
1109
+ tags: z.ZodArray<z.ZodObject<{
1110
+ name: z.ZodString;
1111
+ url: z.ZodString;
1112
+ }, "strip", z.ZodTypeAny, {
1113
+ url: string;
1114
+ name: string;
1115
+ }, {
1116
+ url: string;
1117
+ name: string;
1118
+ }>, "many">;
1093
1119
  reblogs_count: z.ZodNumber;
1094
1120
  favourites_count: z.ZodNumber;
1095
1121
  replies_count: z.ZodNumber;
@@ -1562,6 +1588,16 @@ export declare const BaseStatus: z.ZodObject<{
1562
1588
  preview_url: string | null;
1563
1589
  remote_url: string | null;
1564
1590
  })[];
1591
+ mentions: {
1592
+ id: string;
1593
+ url: string;
1594
+ username: string;
1595
+ acct: string;
1596
+ }[];
1597
+ tags: {
1598
+ url: string;
1599
+ name: string;
1600
+ }[];
1565
1601
  reblogs_count: number;
1566
1602
  favourites_count: number;
1567
1603
  replies_count: number;
@@ -1865,6 +1901,16 @@ export declare const BaseStatus: z.ZodObject<{
1865
1901
  preview_url: string | null;
1866
1902
  remote_url: string | null;
1867
1903
  })[];
1904
+ mentions: {
1905
+ id: string;
1906
+ url: string;
1907
+ username: string;
1908
+ acct: string;
1909
+ }[];
1910
+ tags: {
1911
+ url: string;
1912
+ name: string;
1913
+ }[];
1868
1914
  reblogs_count: number;
1869
1915
  favourites_count: number;
1870
1916
  replies_count: number;
@@ -1090,6 +1090,32 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
1090
1090
  visible_in_picker: boolean;
1091
1091
  category: string | null;
1092
1092
  }>, "many">;
1093
+ mentions: z.ZodArray<z.ZodObject<{
1094
+ id: z.ZodString;
1095
+ username: z.ZodString;
1096
+ url: z.ZodString;
1097
+ acct: z.ZodString;
1098
+ }, "strip", z.ZodTypeAny, {
1099
+ id: string;
1100
+ url: string;
1101
+ username: string;
1102
+ acct: string;
1103
+ }, {
1104
+ id: string;
1105
+ url: string;
1106
+ username: string;
1107
+ acct: string;
1108
+ }>, "many">;
1109
+ tags: z.ZodArray<z.ZodObject<{
1110
+ name: z.ZodString;
1111
+ url: z.ZodString;
1112
+ }, "strip", z.ZodTypeAny, {
1113
+ url: string;
1114
+ name: string;
1115
+ }, {
1116
+ url: string;
1117
+ name: string;
1118
+ }>, "many">;
1093
1119
  reblogs_count: z.ZodNumber;
1094
1120
  favourites_count: z.ZodNumber;
1095
1121
  replies_count: z.ZodNumber;
@@ -2424,6 +2450,32 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2424
2450
  visible_in_picker: boolean;
2425
2451
  category: string | null;
2426
2452
  }>, "many">;
2453
+ mentions: z.ZodArray<z.ZodObject<{
2454
+ id: z.ZodString;
2455
+ username: z.ZodString;
2456
+ url: z.ZodString;
2457
+ acct: z.ZodString;
2458
+ }, "strip", z.ZodTypeAny, {
2459
+ id: string;
2460
+ url: string;
2461
+ username: string;
2462
+ acct: string;
2463
+ }, {
2464
+ id: string;
2465
+ url: string;
2466
+ username: string;
2467
+ acct: string;
2468
+ }>, "many">;
2469
+ tags: z.ZodArray<z.ZodObject<{
2470
+ name: z.ZodString;
2471
+ url: z.ZodString;
2472
+ }, "strip", z.ZodTypeAny, {
2473
+ url: string;
2474
+ name: string;
2475
+ }, {
2476
+ url: string;
2477
+ name: string;
2478
+ }>, "many">;
2427
2479
  reblogs_count: z.ZodNumber;
2428
2480
  favourites_count: z.ZodNumber;
2429
2481
  replies_count: z.ZodNumber;
@@ -2896,6 +2948,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
2896
2948
  preview_url: string | null;
2897
2949
  remote_url: string | null;
2898
2950
  })[];
2951
+ mentions: {
2952
+ id: string;
2953
+ url: string;
2954
+ username: string;
2955
+ acct: string;
2956
+ }[];
2957
+ tags: {
2958
+ url: string;
2959
+ name: string;
2960
+ }[];
2899
2961
  reblogs_count: number;
2900
2962
  favourites_count: number;
2901
2963
  replies_count: number;
@@ -3199,6 +3261,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3199
3261
  preview_url: string | null;
3200
3262
  remote_url: string | null;
3201
3263
  })[];
3264
+ mentions: {
3265
+ id: string;
3266
+ url: string;
3267
+ username: string;
3268
+ acct: string;
3269
+ }[];
3270
+ tags: {
3271
+ url: string;
3272
+ name: string;
3273
+ }[];
3202
3274
  reblogs_count: number;
3203
3275
  favourites_count: number;
3204
3276
  replies_count: number;
@@ -3503,6 +3575,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3503
3575
  preview_url: string | null;
3504
3576
  remote_url: string | null;
3505
3577
  })[];
3578
+ mentions: {
3579
+ id: string;
3580
+ url: string;
3581
+ username: string;
3582
+ acct: string;
3583
+ }[];
3584
+ tags: {
3585
+ url: string;
3586
+ name: string;
3587
+ }[];
3506
3588
  reblogs_count: number;
3507
3589
  favourites_count: number;
3508
3590
  replies_count: number;
@@ -3777,6 +3859,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
3777
3859
  preview_url: string | null;
3778
3860
  remote_url: string | null;
3779
3861
  })[];
3862
+ mentions: {
3863
+ id: string;
3864
+ url: string;
3865
+ username: string;
3866
+ acct: string;
3867
+ }[];
3868
+ tags: {
3869
+ url: string;
3870
+ name: string;
3871
+ }[];
3780
3872
  reblogs_count: number;
3781
3873
  favourites_count: number;
3782
3874
  replies_count: number;
@@ -4110,6 +4202,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
4110
4202
  preview_url: string | null;
4111
4203
  remote_url: string | null;
4112
4204
  })[];
4205
+ mentions: {
4206
+ id: string;
4207
+ url: string;
4208
+ username: string;
4209
+ acct: string;
4210
+ }[];
4211
+ tags: {
4212
+ url: string;
4213
+ name: string;
4214
+ }[];
4113
4215
  reblogs_count: number;
4114
4216
  favourites_count: number;
4115
4217
  replies_count: number;
@@ -4384,6 +4486,16 @@ export declare const Status: z.ZodObject<z.objectUtil.extendShape<{
4384
4486
  preview_url: string | null;
4385
4487
  remote_url: string | null;
4386
4488
  })[];
4489
+ mentions: {
4490
+ id: string;
4491
+ url: string;
4492
+ username: string;
4493
+ acct: string;
4494
+ }[];
4495
+ tags: {
4496
+ url: string;
4497
+ name: string;
4498
+ }[];
4387
4499
  reblogs_count: number;
4388
4500
  favourites_count: number;
4389
4501
  replies_count: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.29",
3
+ "version": "0.2.31",
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";
@@ -8,6 +8,8 @@ import { CustomEmoji } from "../customEmoji.js";
8
8
  import { Poll } from "../poll/index.js";
9
9
  import { PreviewCard } from "../previewCard.js";
10
10
  import { FilterResult } from "../filterResult.js";
11
+ import { Mention } from "./mention.js";
12
+ import { Tag } from "./tag.js";
11
13
 
12
14
  export const BaseStatus = z.object({
13
15
  id: z.string({
@@ -36,6 +38,11 @@ export const BaseStatus = z.object({
36
38
  "Custom emoji to be used when rendering status content"
37
39
  ),
38
40
 
41
+ mentions: Mention.array().describe(
42
+ "Mentions of users within the status content"
43
+ ),
44
+ tags: Tag.array().describe("Hashtags used within the status content"),
45
+
39
46
  reblogs_count: z.number({
40
47
  description: "How many boosts this status has received",
41
48
  }),