@llun/activities.schema 0.2.31 → 0.2.33

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
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Person = void 0;
3
+ exports.Service = exports.Person = exports.Actor = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const image_js_1 = require("./image.js");
6
- exports.Person = zod_1.z.object({
6
+ exports.Actor = zod_1.z.object({
7
7
  id: zod_1.z.string(),
8
- type: zod_1.z.literal("Person"),
9
- following: zod_1.z.string().url(),
8
+ type: zod_1.z.union([zod_1.z.literal("Person"), zod_1.z.literal("Service")]),
9
+ following: zod_1.z.string().url().optional(),
10
10
  followers: zod_1.z.string().url(),
11
11
  inbox: zod_1.z.string().url(),
12
12
  outbox: zod_1.z.string().url(),
@@ -15,6 +15,7 @@ exports.Person = zod_1.z.object({
15
15
  summary: zod_1.z.string().nullish(),
16
16
  url: zod_1.z.string().url(),
17
17
  published: zod_1.z.string().nullish(),
18
+ manuallyApprovesFollowers: zod_1.z.boolean().optional(),
18
19
  publicKey: zod_1.z.object({
19
20
  id: zod_1.z.string(),
20
21
  owner: zod_1.z.string(),
@@ -22,9 +23,11 @@ exports.Person = zod_1.z.object({
22
23
  }),
23
24
  endpoints: zod_1.z
24
25
  .object({
25
- sharedInbox: zod_1.z.string().optional(),
26
+ sharedInbox: zod_1.z.string().url().optional(),
26
27
  })
27
28
  .optional(),
28
29
  icon: image_js_1.Image.nullish(),
29
30
  image: image_js_1.Image.nullish(),
30
31
  });
32
+ exports.Person = exports.Actor;
33
+ exports.Service = exports.Actor;
package/dist/cjs/index.js CHANGED
@@ -29,5 +29,5 @@ __exportStar(require("./note/emoji.js"), exports);
29
29
  __exportStar(require("./note/mention.js"), exports);
30
30
  __exportStar(require("./note/hashtag.js"), exports);
31
31
  __exportStar(require("./note/document.js"), exports);
32
- __exportStar(require("./person.js"), exports);
32
+ __exportStar(require("./actor.js"), exports);
33
33
  exports.Mastodon = require("./mastodon/index.js");
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { Image } from "./image.js";
3
- export const Person = z.object({
3
+ export const Actor = z.object({
4
4
  id: z.string(),
5
- type: z.literal("Person"),
6
- following: z.string().url(),
5
+ type: z.union([z.literal("Person"), z.literal("Service")]),
6
+ following: z.string().url().optional(),
7
7
  followers: z.string().url(),
8
8
  inbox: z.string().url(),
9
9
  outbox: z.string().url(),
@@ -12,6 +12,7 @@ export const Person = z.object({
12
12
  summary: z.string().nullish(),
13
13
  url: z.string().url(),
14
14
  published: z.string().nullish(),
15
+ manuallyApprovesFollowers: z.boolean().optional(),
15
16
  publicKey: z.object({
16
17
  id: z.string(),
17
18
  owner: z.string(),
@@ -19,9 +20,11 @@ export const Person = z.object({
19
20
  }),
20
21
  endpoints: z
21
22
  .object({
22
- sharedInbox: z.string().optional(),
23
+ sharedInbox: z.string().url().optional(),
23
24
  })
24
25
  .optional(),
25
26
  icon: Image.nullish(),
26
27
  image: Image.nullish(),
27
28
  });
29
+ export const Person = Actor;
30
+ export const Service = Actor;
package/dist/esm/index.js CHANGED
@@ -12,5 +12,5 @@ export * from "./note/emoji.js";
12
12
  export * from "./note/mention.js";
13
13
  export * from "./note/hashtag.js";
14
14
  export * from "./note/document.js";
15
- export * from "./person.js";
15
+ export * from "./actor.js";
16
16
  export * as Mastodon from "./mastodon/index.js";
@@ -0,0 +1,370 @@
1
+ import { z } from "zod";
2
+ export declare const Actor: z.ZodObject<{
3
+ id: z.ZodString;
4
+ type: z.ZodUnion<[z.ZodLiteral<"Person">, z.ZodLiteral<"Service">]>;
5
+ following: z.ZodOptional<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
+ manuallyApprovesFollowers: z.ZodOptional<z.ZodBoolean>;
15
+ publicKey: z.ZodObject<{
16
+ id: z.ZodString;
17
+ owner: z.ZodString;
18
+ publicKeyPem: z.ZodString;
19
+ }, "strip", z.ZodTypeAny, {
20
+ id: string;
21
+ owner: string;
22
+ publicKeyPem: string;
23
+ }, {
24
+ id: string;
25
+ owner: string;
26
+ publicKeyPem: string;
27
+ }>;
28
+ endpoints: z.ZodOptional<z.ZodObject<{
29
+ sharedInbox: z.ZodOptional<z.ZodString>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ sharedInbox?: string | undefined;
32
+ }, {
33
+ sharedInbox?: string | undefined;
34
+ }>>;
35
+ icon: z.ZodOptional<z.ZodNullable<z.ZodObject<{
36
+ type: z.ZodLiteral<"Image">;
37
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
38
+ url: z.ZodString;
39
+ }, "strip", z.ZodTypeAny, {
40
+ type: "Image";
41
+ url: string;
42
+ mediaType?: string | null | undefined;
43
+ }, {
44
+ type: "Image";
45
+ url: string;
46
+ mediaType?: string | null | undefined;
47
+ }>>>;
48
+ image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
49
+ type: z.ZodLiteral<"Image">;
50
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ url: z.ZodString;
52
+ }, "strip", z.ZodTypeAny, {
53
+ type: "Image";
54
+ url: string;
55
+ mediaType?: string | null | undefined;
56
+ }, {
57
+ type: "Image";
58
+ url: string;
59
+ mediaType?: string | null | undefined;
60
+ }>>>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ id: string;
63
+ type: "Person" | "Service";
64
+ url: string;
65
+ followers: string;
66
+ inbox: string;
67
+ outbox: string;
68
+ preferredUsername: string;
69
+ name: string;
70
+ publicKey: {
71
+ id: string;
72
+ owner: string;
73
+ publicKeyPem: string;
74
+ };
75
+ following?: string | undefined;
76
+ summary?: string | null | undefined;
77
+ published?: string | null | undefined;
78
+ manuallyApprovesFollowers?: boolean | undefined;
79
+ endpoints?: {
80
+ sharedInbox?: string | undefined;
81
+ } | undefined;
82
+ icon?: {
83
+ type: "Image";
84
+ url: string;
85
+ mediaType?: string | null | undefined;
86
+ } | null | undefined;
87
+ image?: {
88
+ type: "Image";
89
+ url: string;
90
+ mediaType?: string | null | undefined;
91
+ } | null | undefined;
92
+ }, {
93
+ id: string;
94
+ type: "Person" | "Service";
95
+ url: string;
96
+ followers: string;
97
+ inbox: string;
98
+ outbox: string;
99
+ preferredUsername: string;
100
+ name: string;
101
+ publicKey: {
102
+ id: string;
103
+ owner: string;
104
+ publicKeyPem: string;
105
+ };
106
+ following?: string | undefined;
107
+ summary?: string | null | undefined;
108
+ published?: string | null | undefined;
109
+ manuallyApprovesFollowers?: boolean | undefined;
110
+ endpoints?: {
111
+ sharedInbox?: string | undefined;
112
+ } | undefined;
113
+ icon?: {
114
+ type: "Image";
115
+ url: string;
116
+ mediaType?: string | null | undefined;
117
+ } | null | undefined;
118
+ image?: {
119
+ type: "Image";
120
+ url: string;
121
+ mediaType?: string | null | undefined;
122
+ } | null | undefined;
123
+ }>;
124
+ export type Actor = z.infer<typeof Actor>;
125
+ export declare const Person: z.ZodObject<{
126
+ id: z.ZodString;
127
+ type: z.ZodUnion<[z.ZodLiteral<"Person">, z.ZodLiteral<"Service">]>;
128
+ following: z.ZodOptional<z.ZodString>;
129
+ followers: z.ZodString;
130
+ inbox: z.ZodString;
131
+ outbox: z.ZodString;
132
+ preferredUsername: z.ZodString;
133
+ name: z.ZodString;
134
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
+ url: z.ZodString;
136
+ published: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
+ manuallyApprovesFollowers: z.ZodOptional<z.ZodBoolean>;
138
+ publicKey: z.ZodObject<{
139
+ id: z.ZodString;
140
+ owner: z.ZodString;
141
+ publicKeyPem: z.ZodString;
142
+ }, "strip", z.ZodTypeAny, {
143
+ id: string;
144
+ owner: string;
145
+ publicKeyPem: string;
146
+ }, {
147
+ id: string;
148
+ owner: string;
149
+ publicKeyPem: string;
150
+ }>;
151
+ endpoints: z.ZodOptional<z.ZodObject<{
152
+ sharedInbox: z.ZodOptional<z.ZodString>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ sharedInbox?: string | undefined;
155
+ }, {
156
+ sharedInbox?: string | undefined;
157
+ }>>;
158
+ icon: z.ZodOptional<z.ZodNullable<z.ZodObject<{
159
+ type: z.ZodLiteral<"Image">;
160
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
161
+ url: z.ZodString;
162
+ }, "strip", z.ZodTypeAny, {
163
+ type: "Image";
164
+ url: string;
165
+ mediaType?: string | null | undefined;
166
+ }, {
167
+ type: "Image";
168
+ url: string;
169
+ mediaType?: string | null | undefined;
170
+ }>>>;
171
+ image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
172
+ type: z.ZodLiteral<"Image">;
173
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
+ url: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ type: "Image";
177
+ url: string;
178
+ mediaType?: string | null | undefined;
179
+ }, {
180
+ type: "Image";
181
+ url: string;
182
+ mediaType?: string | null | undefined;
183
+ }>>>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ id: string;
186
+ type: "Person" | "Service";
187
+ url: string;
188
+ followers: string;
189
+ inbox: string;
190
+ outbox: string;
191
+ preferredUsername: string;
192
+ name: string;
193
+ publicKey: {
194
+ id: string;
195
+ owner: string;
196
+ publicKeyPem: string;
197
+ };
198
+ following?: string | undefined;
199
+ summary?: string | null | undefined;
200
+ published?: string | null | undefined;
201
+ manuallyApprovesFollowers?: boolean | undefined;
202
+ endpoints?: {
203
+ sharedInbox?: string | undefined;
204
+ } | undefined;
205
+ icon?: {
206
+ type: "Image";
207
+ url: string;
208
+ mediaType?: string | null | undefined;
209
+ } | null | undefined;
210
+ image?: {
211
+ type: "Image";
212
+ url: string;
213
+ mediaType?: string | null | undefined;
214
+ } | null | undefined;
215
+ }, {
216
+ id: string;
217
+ type: "Person" | "Service";
218
+ url: string;
219
+ followers: string;
220
+ inbox: string;
221
+ outbox: string;
222
+ preferredUsername: string;
223
+ name: string;
224
+ publicKey: {
225
+ id: string;
226
+ owner: string;
227
+ publicKeyPem: string;
228
+ };
229
+ following?: string | undefined;
230
+ summary?: string | null | undefined;
231
+ published?: string | null | undefined;
232
+ manuallyApprovesFollowers?: boolean | undefined;
233
+ endpoints?: {
234
+ sharedInbox?: string | undefined;
235
+ } | undefined;
236
+ icon?: {
237
+ type: "Image";
238
+ url: string;
239
+ mediaType?: string | null | undefined;
240
+ } | null | undefined;
241
+ image?: {
242
+ type: "Image";
243
+ url: string;
244
+ mediaType?: string | null | undefined;
245
+ } | null | undefined;
246
+ }>;
247
+ export type Person = z.infer<typeof Person>;
248
+ export declare const Service: z.ZodObject<{
249
+ id: z.ZodString;
250
+ type: z.ZodUnion<[z.ZodLiteral<"Person">, z.ZodLiteral<"Service">]>;
251
+ following: z.ZodOptional<z.ZodString>;
252
+ followers: z.ZodString;
253
+ inbox: z.ZodString;
254
+ outbox: z.ZodString;
255
+ preferredUsername: z.ZodString;
256
+ name: z.ZodString;
257
+ summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
+ url: z.ZodString;
259
+ published: z.ZodOptional<z.ZodNullable<z.ZodString>>;
260
+ manuallyApprovesFollowers: z.ZodOptional<z.ZodBoolean>;
261
+ publicKey: z.ZodObject<{
262
+ id: z.ZodString;
263
+ owner: z.ZodString;
264
+ publicKeyPem: z.ZodString;
265
+ }, "strip", z.ZodTypeAny, {
266
+ id: string;
267
+ owner: string;
268
+ publicKeyPem: string;
269
+ }, {
270
+ id: string;
271
+ owner: string;
272
+ publicKeyPem: string;
273
+ }>;
274
+ endpoints: z.ZodOptional<z.ZodObject<{
275
+ sharedInbox: z.ZodOptional<z.ZodString>;
276
+ }, "strip", z.ZodTypeAny, {
277
+ sharedInbox?: string | undefined;
278
+ }, {
279
+ sharedInbox?: string | undefined;
280
+ }>>;
281
+ icon: z.ZodOptional<z.ZodNullable<z.ZodObject<{
282
+ type: z.ZodLiteral<"Image">;
283
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
+ url: z.ZodString;
285
+ }, "strip", z.ZodTypeAny, {
286
+ type: "Image";
287
+ url: string;
288
+ mediaType?: string | null | undefined;
289
+ }, {
290
+ type: "Image";
291
+ url: string;
292
+ mediaType?: string | null | undefined;
293
+ }>>>;
294
+ image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
295
+ type: z.ZodLiteral<"Image">;
296
+ mediaType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
+ url: z.ZodString;
298
+ }, "strip", z.ZodTypeAny, {
299
+ type: "Image";
300
+ url: string;
301
+ mediaType?: string | null | undefined;
302
+ }, {
303
+ type: "Image";
304
+ url: string;
305
+ mediaType?: string | null | undefined;
306
+ }>>>;
307
+ }, "strip", z.ZodTypeAny, {
308
+ id: string;
309
+ type: "Person" | "Service";
310
+ url: string;
311
+ followers: string;
312
+ inbox: string;
313
+ outbox: string;
314
+ preferredUsername: string;
315
+ name: string;
316
+ publicKey: {
317
+ id: string;
318
+ owner: string;
319
+ publicKeyPem: string;
320
+ };
321
+ following?: string | undefined;
322
+ summary?: string | null | undefined;
323
+ published?: string | null | undefined;
324
+ manuallyApprovesFollowers?: boolean | undefined;
325
+ endpoints?: {
326
+ sharedInbox?: string | undefined;
327
+ } | undefined;
328
+ icon?: {
329
+ type: "Image";
330
+ url: string;
331
+ mediaType?: string | null | undefined;
332
+ } | null | undefined;
333
+ image?: {
334
+ type: "Image";
335
+ url: string;
336
+ mediaType?: string | null | undefined;
337
+ } | null | undefined;
338
+ }, {
339
+ id: string;
340
+ type: "Person" | "Service";
341
+ url: string;
342
+ followers: string;
343
+ inbox: string;
344
+ outbox: string;
345
+ preferredUsername: string;
346
+ name: string;
347
+ publicKey: {
348
+ id: string;
349
+ owner: string;
350
+ publicKeyPem: string;
351
+ };
352
+ following?: string | undefined;
353
+ summary?: string | null | undefined;
354
+ published?: string | null | undefined;
355
+ manuallyApprovesFollowers?: boolean | undefined;
356
+ endpoints?: {
357
+ sharedInbox?: string | undefined;
358
+ } | undefined;
359
+ icon?: {
360
+ type: "Image";
361
+ url: string;
362
+ mediaType?: string | null | undefined;
363
+ } | null | undefined;
364
+ image?: {
365
+ type: "Image";
366
+ url: string;
367
+ mediaType?: string | null | undefined;
368
+ } | null | undefined;
369
+ }>;
370
+ export type Service = z.infer<typeof Service>;
@@ -12,5 +12,5 @@ export * from "./note/emoji.js";
12
12
  export * from "./note/mention.js";
13
13
  export * from "./note/hashtag.js";
14
14
  export * from "./note/document.js";
15
- export * from "./person.js";
15
+ export * from "./actor.js";
16
16
  export * as Mastodon from "./mastodon/index.js";