@llun/activities.schema 0.2.31 → 0.2.32

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.
@@ -1,10 +1,10 @@
1
1
  import { z } from "zod";
2
2
  import { Image } from "./image.js";
3
3
 
4
- export const Person = z.object({
4
+ export const Actor = z.object({
5
5
  id: z.string(),
6
- type: z.literal("Person"),
7
- following: z.string().url(),
6
+ type: z.union([z.literal("Person"), z.literal("Service")]),
7
+ following: z.string().url().optional(),
8
8
  followers: z.string().url(),
9
9
  inbox: z.string().url(),
10
10
  outbox: z.string().url(),
@@ -13,6 +13,7 @@ export const Person = z.object({
13
13
  summary: z.string().nullish(),
14
14
  url: z.string().url(),
15
15
  published: z.string().nullish(),
16
+ manuallyApprovesFollowers: z.boolean().optional(),
16
17
  publicKey: z.object({
17
18
  id: z.string(),
18
19
  owner: z.string(),
@@ -20,10 +21,16 @@ export const Person = z.object({
20
21
  }),
21
22
  endpoints: z
22
23
  .object({
23
- sharedInbox: z.string().optional(),
24
+ sharedInbox: z.string().url().optional(),
24
25
  })
25
26
  .optional(),
26
27
  icon: Image.nullish(),
27
28
  image: Image.nullish(),
28
29
  });
30
+ export type Actor = z.infer<typeof Actor>;
31
+
32
+ export const Person = Actor;
29
33
  export type Person = z.infer<typeof Person>;
34
+
35
+ export const Service = Actor;
36
+ export type Service = z.infer<typeof Service>;
package/src/index.ts CHANGED
@@ -14,6 +14,6 @@ export * from "./note/mention.js";
14
14
  export * from "./note/hashtag.js";
15
15
  export * from "./note/document.js";
16
16
 
17
- export * from "./person.js";
17
+ export * from "./actor.js";
18
18
 
19
19
  export * as Mastodon from "./mastodon/index.js";
@@ -1,121 +0,0 @@
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.ZodOptional<z.ZodNullable<z.ZodString>>;
12
- url: z.ZodString;
13
- published: z.ZodOptional<z.ZodNullable<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.ZodNullable<z.ZodObject<{
35
- type: z.ZodLiteral<"Image">;
36
- mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
- url: z.ZodString;
38
- }, "strip", z.ZodTypeAny, {
39
- type: "Image";
40
- url: string;
41
- mediaType?: string | null | undefined;
42
- }, {
43
- type: "Image";
44
- url: string;
45
- mediaType?: string | null | undefined;
46
- }>>>;
47
- image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
48
- type: z.ZodLiteral<"Image">;
49
- mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
50
- url: z.ZodString;
51
- }, "strip", z.ZodTypeAny, {
52
- type: "Image";
53
- url: string;
54
- mediaType?: string | null | undefined;
55
- }, {
56
- type: "Image";
57
- url: string;
58
- mediaType?: string | null | undefined;
59
- }>>>;
60
- }, "strip", z.ZodTypeAny, {
61
- id: string;
62
- type: "Person";
63
- url: string;
64
- name: string;
65
- following: string;
66
- followers: string;
67
- inbox: string;
68
- outbox: string;
69
- preferredUsername: string;
70
- publicKey: {
71
- id: string;
72
- owner: string;
73
- publicKeyPem: string;
74
- };
75
- published?: string | null | undefined;
76
- icon?: {
77
- type: "Image";
78
- url: string;
79
- mediaType?: string | null | undefined;
80
- } | null | undefined;
81
- summary?: string | null | undefined;
82
- endpoints?: {
83
- sharedInbox?: string | undefined;
84
- } | undefined;
85
- image?: {
86
- type: "Image";
87
- url: string;
88
- mediaType?: string | null | undefined;
89
- } | null | undefined;
90
- }, {
91
- id: string;
92
- type: "Person";
93
- url: string;
94
- name: string;
95
- following: string;
96
- followers: string;
97
- inbox: string;
98
- outbox: string;
99
- preferredUsername: string;
100
- publicKey: {
101
- id: string;
102
- owner: string;
103
- publicKeyPem: string;
104
- };
105
- published?: string | null | undefined;
106
- icon?: {
107
- type: "Image";
108
- url: string;
109
- mediaType?: string | null | undefined;
110
- } | null | undefined;
111
- summary?: string | null | undefined;
112
- endpoints?: {
113
- sharedInbox?: string | undefined;
114
- } | undefined;
115
- image?: {
116
- type: "Image";
117
- url: string;
118
- mediaType?: string | null | undefined;
119
- } | null | undefined;
120
- }>;
121
- export type Person = z.infer<typeof Person>;