@llun/activities.schema 0.2.8 → 0.2.10

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.
@@ -6,7 +6,9 @@ const attachment_js_1 = require("./attachment.js");
6
6
  const tag_js_1 = require("./tag.js");
7
7
  exports.BaseContent = zod_1.z.object({
8
8
  id: zod_1.z.string(),
9
- url: zod_1.z.string({ description: "Note URL" }),
9
+ url: zod_1.z
10
+ .string({ description: "Note URL. This is optional for Pleloma" })
11
+ .nullish(),
10
12
  attributedTo: zod_1.z.string({ description: "Note publisher" }),
11
13
  to: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
12
14
  cc: zod_1.z.union([zod_1.z.string(), zod_1.z.string().array()]),
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HashTag = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.HashTag = zod_1.z.object({
6
+ type: zod_1.z.literal("Hashtag"),
7
+ href: zod_1.z.string().url(),
8
+ name: zod_1.z.string().startsWith("#"),
9
+ });
@@ -4,4 +4,5 @@ exports.Tag = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const emoji_js_1 = require("./emoji.js");
6
6
  const mention_js_1 = require("./mention.js");
7
- exports.Tag = zod_1.z.union([mention_js_1.Mention, emoji_js_1.Emoji]);
7
+ const hashtag_js_1 = require("./hashtag.js");
8
+ exports.Tag = zod_1.z.union([mention_js_1.Mention, emoji_js_1.Emoji, hashtag_js_1.HashTag]);
@@ -3,7 +3,9 @@ import { Attachment } from "./attachment.js";
3
3
  import { Tag } from "./tag.js";
4
4
  export const BaseContent = z.object({
5
5
  id: z.string(),
6
- url: z.string({ description: "Note URL" }),
6
+ url: z
7
+ .string({ description: "Note URL. This is optional for Pleloma" })
8
+ .nullish(),
7
9
  attributedTo: z.string({ description: "Note publisher" }),
8
10
  to: z.union([z.string(), z.string().array()]),
9
11
  cc: z.union([z.string(), z.string().array()]),
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export const HashTag = z.object({
3
+ type: z.literal("Hashtag"),
4
+ href: z.string().url(),
5
+ name: z.string().startsWith("#"),
6
+ });
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
2
  import { Emoji } from "./emoji.js";
3
3
  import { Mention } from "./mention.js";
4
- export const Tag = z.union([Mention, Emoji]);
4
+ import { HashTag } from "./hashtag.js";
5
+ export const Tag = z.union([Mention, Emoji, HashTag]);
@@ -5,7 +5,7 @@ export declare const Like: z.ZodObject<{
5
5
  actor: z.ZodString;
6
6
  object: z.ZodUnion<[z.ZodString, z.ZodObject<z.objectUtil.extendShape<{
7
7
  id: z.ZodString;
8
- url: z.ZodString;
8
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
9
  attributedTo: z.ZodString;
10
10
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
11
11
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
@@ -140,6 +140,18 @@ export declare const Like: z.ZodObject<{
140
140
  mediaType: string;
141
141
  url: string;
142
142
  };
143
+ }>, z.ZodObject<{
144
+ type: z.ZodLiteral<"Hashtag">;
145
+ href: z.ZodString;
146
+ name: z.ZodString;
147
+ }, "strip", z.ZodTypeAny, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
151
+ }, {
152
+ type: "Hashtag";
153
+ name: string;
154
+ href: string;
143
155
  }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
144
156
  type: z.ZodLiteral<"Mention">;
145
157
  href: z.ZodString;
@@ -187,6 +199,18 @@ export declare const Like: z.ZodObject<{
187
199
  mediaType: string;
188
200
  url: string;
189
201
  };
202
+ }>, z.ZodObject<{
203
+ type: z.ZodLiteral<"Hashtag">;
204
+ href: z.ZodString;
205
+ name: z.ZodString;
206
+ }, "strip", z.ZodTypeAny, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
210
+ }, {
211
+ type: "Hashtag";
212
+ name: string;
213
+ href: string;
190
214
  }>]>, "many">]>;
191
215
  published: z.ZodString;
192
216
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -198,7 +222,6 @@ export declare const Like: z.ZodObject<{
198
222
  published: string;
199
223
  to: string | string[];
200
224
  cc: string | string[];
201
- url: string;
202
225
  attributedTo: string;
203
226
  tag: {
204
227
  type: "Emoji";
@@ -213,6 +236,10 @@ export declare const Like: z.ZodObject<{
213
236
  type: "Mention";
214
237
  name: string;
215
238
  href: string;
239
+ } | {
240
+ type: "Hashtag";
241
+ name: string;
242
+ href: string;
216
243
  } | ({
217
244
  type: "Emoji";
218
245
  name: string;
@@ -226,7 +253,12 @@ export declare const Like: z.ZodObject<{
226
253
  type: "Mention";
227
254
  name: string;
228
255
  href: string;
256
+ } | {
257
+ type: "Hashtag";
258
+ name: string;
259
+ href: string;
229
260
  })[];
261
+ url?: string | null | undefined;
230
262
  updated?: string | null | undefined;
231
263
  inReplyTo?: string | null | undefined;
232
264
  summary?: string | null | undefined;
@@ -266,7 +298,6 @@ export declare const Like: z.ZodObject<{
266
298
  published: string;
267
299
  to: string | string[];
268
300
  cc: string | string[];
269
- url: string;
270
301
  attributedTo: string;
271
302
  tag: {
272
303
  type: "Emoji";
@@ -281,6 +312,10 @@ export declare const Like: z.ZodObject<{
281
312
  type: "Mention";
282
313
  name: string;
283
314
  href: string;
315
+ } | {
316
+ type: "Hashtag";
317
+ name: string;
318
+ href: string;
284
319
  } | ({
285
320
  type: "Emoji";
286
321
  name: string;
@@ -294,7 +329,12 @@ export declare const Like: z.ZodObject<{
294
329
  type: "Mention";
295
330
  name: string;
296
331
  href: string;
332
+ } | {
333
+ type: "Hashtag";
334
+ name: string;
335
+ href: string;
297
336
  })[];
337
+ url?: string | null | undefined;
298
338
  updated?: string | null | undefined;
299
339
  inReplyTo?: string | null | undefined;
300
340
  summary?: string | null | undefined;
@@ -336,7 +376,6 @@ export declare const Like: z.ZodObject<{
336
376
  published: string;
337
377
  to: string | string[];
338
378
  cc: string | string[];
339
- url: string;
340
379
  attributedTo: string;
341
380
  tag: {
342
381
  type: "Emoji";
@@ -351,6 +390,10 @@ export declare const Like: z.ZodObject<{
351
390
  type: "Mention";
352
391
  name: string;
353
392
  href: string;
393
+ } | {
394
+ type: "Hashtag";
395
+ name: string;
396
+ href: string;
354
397
  } | ({
355
398
  type: "Emoji";
356
399
  name: string;
@@ -364,7 +407,12 @@ export declare const Like: z.ZodObject<{
364
407
  type: "Mention";
365
408
  name: string;
366
409
  href: string;
410
+ } | {
411
+ type: "Hashtag";
412
+ name: string;
413
+ href: string;
367
414
  })[];
415
+ url?: string | null | undefined;
368
416
  updated?: string | null | undefined;
369
417
  inReplyTo?: string | null | undefined;
370
418
  summary?: string | null | undefined;
@@ -409,7 +457,6 @@ export declare const Like: z.ZodObject<{
409
457
  published: string;
410
458
  to: string | string[];
411
459
  cc: string | string[];
412
- url: string;
413
460
  attributedTo: string;
414
461
  tag: {
415
462
  type: "Emoji";
@@ -424,6 +471,10 @@ export declare const Like: z.ZodObject<{
424
471
  type: "Mention";
425
472
  name: string;
426
473
  href: string;
474
+ } | {
475
+ type: "Hashtag";
476
+ name: string;
477
+ href: string;
427
478
  } | ({
428
479
  type: "Emoji";
429
480
  name: string;
@@ -437,7 +488,12 @@ export declare const Like: z.ZodObject<{
437
488
  type: "Mention";
438
489
  name: string;
439
490
  href: string;
491
+ } | {
492
+ type: "Hashtag";
493
+ name: string;
494
+ href: string;
440
495
  })[];
496
+ url?: string | null | undefined;
441
497
  updated?: string | null | undefined;
442
498
  inReplyTo?: string | null | undefined;
443
499
  summary?: string | null | undefined;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const BaseContent: z.ZodObject<{
3
3
  id: z.ZodString;
4
- url: z.ZodString;
4
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
5
  attributedTo: z.ZodString;
6
6
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
7
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
@@ -136,6 +136,18 @@ export declare const BaseContent: z.ZodObject<{
136
136
  mediaType: string;
137
137
  url: string;
138
138
  };
139
+ }>, z.ZodObject<{
140
+ type: z.ZodLiteral<"Hashtag">;
141
+ href: z.ZodString;
142
+ name: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ type: "Hashtag";
145
+ name: string;
146
+ href: string;
147
+ }, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
139
151
  }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
140
152
  type: z.ZodLiteral<"Mention">;
141
153
  href: z.ZodString;
@@ -183,6 +195,18 @@ export declare const BaseContent: z.ZodObject<{
183
195
  mediaType: string;
184
196
  url: string;
185
197
  };
198
+ }>, z.ZodObject<{
199
+ type: z.ZodLiteral<"Hashtag">;
200
+ href: z.ZodString;
201
+ name: z.ZodString;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: "Hashtag";
204
+ name: string;
205
+ href: string;
206
+ }, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
186
210
  }>]>, "many">]>;
187
211
  published: z.ZodString;
188
212
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -191,7 +215,6 @@ export declare const BaseContent: z.ZodObject<{
191
215
  published: string;
192
216
  to: string | string[];
193
217
  cc: string | string[];
194
- url: string;
195
218
  attributedTo: string;
196
219
  tag: {
197
220
  type: "Emoji";
@@ -206,6 +229,10 @@ export declare const BaseContent: z.ZodObject<{
206
229
  type: "Mention";
207
230
  name: string;
208
231
  href: string;
232
+ } | {
233
+ type: "Hashtag";
234
+ name: string;
235
+ href: string;
209
236
  } | ({
210
237
  type: "Emoji";
211
238
  name: string;
@@ -219,7 +246,12 @@ export declare const BaseContent: z.ZodObject<{
219
246
  type: "Mention";
220
247
  name: string;
221
248
  href: string;
249
+ } | {
250
+ type: "Hashtag";
251
+ name: string;
252
+ href: string;
222
253
  })[];
254
+ url?: string | null | undefined;
223
255
  updated?: string | null | undefined;
224
256
  inReplyTo?: string | null | undefined;
225
257
  summary?: string | null | undefined;
@@ -258,7 +290,6 @@ export declare const BaseContent: z.ZodObject<{
258
290
  published: string;
259
291
  to: string | string[];
260
292
  cc: string | string[];
261
- url: string;
262
293
  attributedTo: string;
263
294
  tag: {
264
295
  type: "Emoji";
@@ -273,6 +304,10 @@ export declare const BaseContent: z.ZodObject<{
273
304
  type: "Mention";
274
305
  name: string;
275
306
  href: string;
307
+ } | {
308
+ type: "Hashtag";
309
+ name: string;
310
+ href: string;
276
311
  } | ({
277
312
  type: "Emoji";
278
313
  name: string;
@@ -286,7 +321,12 @@ export declare const BaseContent: z.ZodObject<{
286
321
  type: "Mention";
287
322
  name: string;
288
323
  href: string;
324
+ } | {
325
+ type: "Hashtag";
326
+ name: string;
327
+ href: string;
289
328
  })[];
329
+ url?: string | null | undefined;
290
330
  updated?: string | null | undefined;
291
331
  inReplyTo?: string | null | undefined;
292
332
  summary?: string | null | undefined;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export declare const HashTag: z.ZodObject<{
3
+ type: z.ZodLiteral<"Hashtag">;
4
+ href: z.ZodString;
5
+ name: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ type: "Hashtag";
8
+ name: string;
9
+ href: string;
10
+ }, {
11
+ type: "Hashtag";
12
+ name: string;
13
+ href: string;
14
+ }>;
15
+ export type HashTag = z.infer<typeof HashTag>;
@@ -46,5 +46,17 @@ export declare const Tag: z.ZodUnion<[z.ZodObject<{
46
46
  mediaType: string;
47
47
  url: string;
48
48
  };
49
+ }>, z.ZodObject<{
50
+ type: z.ZodLiteral<"Hashtag">;
51
+ href: z.ZodString;
52
+ name: z.ZodString;
53
+ }, "strip", z.ZodTypeAny, {
54
+ type: "Hashtag";
55
+ name: string;
56
+ href: string;
57
+ }, {
58
+ type: "Hashtag";
59
+ name: string;
60
+ href: string;
49
61
  }>]>;
50
62
  export type Tag = z.infer<typeof Tag>;
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
3
3
  id: z.ZodString;
4
- url: z.ZodString;
4
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
5
  attributedTo: z.ZodString;
6
6
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
7
7
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
@@ -136,6 +136,18 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
136
136
  mediaType: string;
137
137
  url: string;
138
138
  };
139
+ }>, z.ZodObject<{
140
+ type: z.ZodLiteral<"Hashtag">;
141
+ href: z.ZodString;
142
+ name: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ type: "Hashtag";
145
+ name: string;
146
+ href: string;
147
+ }, {
148
+ type: "Hashtag";
149
+ name: string;
150
+ href: string;
139
151
  }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
140
152
  type: z.ZodLiteral<"Mention">;
141
153
  href: z.ZodString;
@@ -183,6 +195,18 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
183
195
  mediaType: string;
184
196
  url: string;
185
197
  };
198
+ }>, z.ZodObject<{
199
+ type: z.ZodLiteral<"Hashtag">;
200
+ href: z.ZodString;
201
+ name: z.ZodString;
202
+ }, "strip", z.ZodTypeAny, {
203
+ type: "Hashtag";
204
+ name: string;
205
+ href: string;
206
+ }, {
207
+ type: "Hashtag";
208
+ name: string;
209
+ href: string;
186
210
  }>]>, "many">]>;
187
211
  published: z.ZodString;
188
212
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -194,7 +218,6 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
194
218
  published: string;
195
219
  to: string | string[];
196
220
  cc: string | string[];
197
- url: string;
198
221
  attributedTo: string;
199
222
  tag: {
200
223
  type: "Emoji";
@@ -209,6 +232,10 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
209
232
  type: "Mention";
210
233
  name: string;
211
234
  href: string;
235
+ } | {
236
+ type: "Hashtag";
237
+ name: string;
238
+ href: string;
212
239
  } | ({
213
240
  type: "Emoji";
214
241
  name: string;
@@ -222,7 +249,12 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
222
249
  type: "Mention";
223
250
  name: string;
224
251
  href: string;
252
+ } | {
253
+ type: "Hashtag";
254
+ name: string;
255
+ href: string;
225
256
  })[];
257
+ url?: string | null | undefined;
226
258
  updated?: string | null | undefined;
227
259
  inReplyTo?: string | null | undefined;
228
260
  summary?: string | null | undefined;
@@ -262,7 +294,6 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
262
294
  published: string;
263
295
  to: string | string[];
264
296
  cc: string | string[];
265
- url: string;
266
297
  attributedTo: string;
267
298
  tag: {
268
299
  type: "Emoji";
@@ -277,6 +308,10 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
277
308
  type: "Mention";
278
309
  name: string;
279
310
  href: string;
311
+ } | {
312
+ type: "Hashtag";
313
+ name: string;
314
+ href: string;
280
315
  } | ({
281
316
  type: "Emoji";
282
317
  name: string;
@@ -290,7 +325,12 @@ export declare const Note: z.ZodObject<z.objectUtil.extendShape<{
290
325
  type: "Mention";
291
326
  name: string;
292
327
  href: string;
328
+ } | {
329
+ type: "Hashtag";
330
+ name: string;
331
+ href: string;
293
332
  })[];
333
+ url?: string | null | undefined;
294
334
  updated?: string | null | undefined;
295
335
  inReplyTo?: string | null | undefined;
296
336
  summary?: string | null | undefined;
@@ -9,7 +9,7 @@ export declare const Undo: z.ZodObject<{
9
9
  actor: z.ZodString;
10
10
  object: z.ZodUnion<[z.ZodString, z.ZodObject<z.objectUtil.extendShape<{
11
11
  id: z.ZodString;
12
- url: z.ZodString;
12
+ url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
13
  attributedTo: z.ZodString;
14
14
  to: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
15
15
  cc: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>;
@@ -144,6 +144,18 @@ export declare const Undo: z.ZodObject<{
144
144
  mediaType: string;
145
145
  url: string;
146
146
  };
147
+ }>, z.ZodObject<{
148
+ type: z.ZodLiteral<"Hashtag">;
149
+ href: z.ZodString;
150
+ name: z.ZodString;
151
+ }, "strip", z.ZodTypeAny, {
152
+ type: "Hashtag";
153
+ name: string;
154
+ href: string;
155
+ }, {
156
+ type: "Hashtag";
157
+ name: string;
158
+ href: string;
147
159
  }>]>, z.ZodArray<z.ZodUnion<[z.ZodObject<{
148
160
  type: z.ZodLiteral<"Mention">;
149
161
  href: z.ZodString;
@@ -191,6 +203,18 @@ export declare const Undo: z.ZodObject<{
191
203
  mediaType: string;
192
204
  url: string;
193
205
  };
206
+ }>, z.ZodObject<{
207
+ type: z.ZodLiteral<"Hashtag">;
208
+ href: z.ZodString;
209
+ name: z.ZodString;
210
+ }, "strip", z.ZodTypeAny, {
211
+ type: "Hashtag";
212
+ name: string;
213
+ href: string;
214
+ }, {
215
+ type: "Hashtag";
216
+ name: string;
217
+ href: string;
194
218
  }>]>, "many">]>;
195
219
  published: z.ZodString;
196
220
  updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -202,7 +226,6 @@ export declare const Undo: z.ZodObject<{
202
226
  published: string;
203
227
  to: string | string[];
204
228
  cc: string | string[];
205
- url: string;
206
229
  attributedTo: string;
207
230
  tag: {
208
231
  type: "Emoji";
@@ -217,6 +240,10 @@ export declare const Undo: z.ZodObject<{
217
240
  type: "Mention";
218
241
  name: string;
219
242
  href: string;
243
+ } | {
244
+ type: "Hashtag";
245
+ name: string;
246
+ href: string;
220
247
  } | ({
221
248
  type: "Emoji";
222
249
  name: string;
@@ -230,7 +257,12 @@ export declare const Undo: z.ZodObject<{
230
257
  type: "Mention";
231
258
  name: string;
232
259
  href: string;
260
+ } | {
261
+ type: "Hashtag";
262
+ name: string;
263
+ href: string;
233
264
  })[];
265
+ url?: string | null | undefined;
234
266
  updated?: string | null | undefined;
235
267
  inReplyTo?: string | null | undefined;
236
268
  summary?: string | null | undefined;
@@ -270,7 +302,6 @@ export declare const Undo: z.ZodObject<{
270
302
  published: string;
271
303
  to: string | string[];
272
304
  cc: string | string[];
273
- url: string;
274
305
  attributedTo: string;
275
306
  tag: {
276
307
  type: "Emoji";
@@ -285,6 +316,10 @@ export declare const Undo: z.ZodObject<{
285
316
  type: "Mention";
286
317
  name: string;
287
318
  href: string;
319
+ } | {
320
+ type: "Hashtag";
321
+ name: string;
322
+ href: string;
288
323
  } | ({
289
324
  type: "Emoji";
290
325
  name: string;
@@ -298,7 +333,12 @@ export declare const Undo: z.ZodObject<{
298
333
  type: "Mention";
299
334
  name: string;
300
335
  href: string;
336
+ } | {
337
+ type: "Hashtag";
338
+ name: string;
339
+ href: string;
301
340
  })[];
341
+ url?: string | null | undefined;
302
342
  updated?: string | null | undefined;
303
343
  inReplyTo?: string | null | undefined;
304
344
  summary?: string | null | undefined;
@@ -340,7 +380,6 @@ export declare const Undo: z.ZodObject<{
340
380
  published: string;
341
381
  to: string | string[];
342
382
  cc: string | string[];
343
- url: string;
344
383
  attributedTo: string;
345
384
  tag: {
346
385
  type: "Emoji";
@@ -355,6 +394,10 @@ export declare const Undo: z.ZodObject<{
355
394
  type: "Mention";
356
395
  name: string;
357
396
  href: string;
397
+ } | {
398
+ type: "Hashtag";
399
+ name: string;
400
+ href: string;
358
401
  } | ({
359
402
  type: "Emoji";
360
403
  name: string;
@@ -368,7 +411,12 @@ export declare const Undo: z.ZodObject<{
368
411
  type: "Mention";
369
412
  name: string;
370
413
  href: string;
414
+ } | {
415
+ type: "Hashtag";
416
+ name: string;
417
+ href: string;
371
418
  })[];
419
+ url?: string | null | undefined;
372
420
  updated?: string | null | undefined;
373
421
  inReplyTo?: string | null | undefined;
374
422
  summary?: string | null | undefined;
@@ -413,7 +461,6 @@ export declare const Undo: z.ZodObject<{
413
461
  published: string;
414
462
  to: string | string[];
415
463
  cc: string | string[];
416
- url: string;
417
464
  attributedTo: string;
418
465
  tag: {
419
466
  type: "Emoji";
@@ -428,6 +475,10 @@ export declare const Undo: z.ZodObject<{
428
475
  type: "Mention";
429
476
  name: string;
430
477
  href: string;
478
+ } | {
479
+ type: "Hashtag";
480
+ name: string;
481
+ href: string;
431
482
  } | ({
432
483
  type: "Emoji";
433
484
  name: string;
@@ -441,7 +492,12 @@ export declare const Undo: z.ZodObject<{
441
492
  type: "Mention";
442
493
  name: string;
443
494
  href: string;
495
+ } | {
496
+ type: "Hashtag";
497
+ name: string;
498
+ href: string;
444
499
  })[];
500
+ url?: string | null | undefined;
445
501
  updated?: string | null | undefined;
446
502
  inReplyTo?: string | null | undefined;
447
503
  summary?: string | null | undefined;
@@ -508,7 +564,6 @@ export declare const Undo: z.ZodObject<{
508
564
  published: string;
509
565
  to: string | string[];
510
566
  cc: string | string[];
511
- url: string;
512
567
  attributedTo: string;
513
568
  tag: {
514
569
  type: "Emoji";
@@ -523,6 +578,10 @@ export declare const Undo: z.ZodObject<{
523
578
  type: "Mention";
524
579
  name: string;
525
580
  href: string;
581
+ } | {
582
+ type: "Hashtag";
583
+ name: string;
584
+ href: string;
526
585
  } | ({
527
586
  type: "Emoji";
528
587
  name: string;
@@ -536,7 +595,12 @@ export declare const Undo: z.ZodObject<{
536
595
  type: "Mention";
537
596
  name: string;
538
597
  href: string;
598
+ } | {
599
+ type: "Hashtag";
600
+ name: string;
601
+ href: string;
539
602
  })[];
603
+ url?: string | null | undefined;
540
604
  updated?: string | null | undefined;
541
605
  inReplyTo?: string | null | undefined;
542
606
  summary?: string | null | undefined;
@@ -591,7 +655,6 @@ export declare const Undo: z.ZodObject<{
591
655
  published: string;
592
656
  to: string | string[];
593
657
  cc: string | string[];
594
- url: string;
595
658
  attributedTo: string;
596
659
  tag: {
597
660
  type: "Emoji";
@@ -606,6 +669,10 @@ export declare const Undo: z.ZodObject<{
606
669
  type: "Mention";
607
670
  name: string;
608
671
  href: string;
672
+ } | {
673
+ type: "Hashtag";
674
+ name: string;
675
+ href: string;
609
676
  } | ({
610
677
  type: "Emoji";
611
678
  name: string;
@@ -619,7 +686,12 @@ export declare const Undo: z.ZodObject<{
619
686
  type: "Mention";
620
687
  name: string;
621
688
  href: string;
689
+ } | {
690
+ type: "Hashtag";
691
+ name: string;
692
+ href: string;
622
693
  })[];
694
+ url?: string | null | undefined;
623
695
  updated?: string | null | undefined;
624
696
  inReplyTo?: string | null | undefined;
625
697
  summary?: string | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llun/activities.schema",
3
- "version": "0.2.8",
3
+ "version": "0.2.10",
4
4
  "description": "Validate ActivityPub and Mastodon with Zod",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -4,7 +4,9 @@ import { Tag } from "./tag.js";
4
4
 
5
5
  export const BaseContent = z.object({
6
6
  id: z.string(),
7
- url: z.string({ description: "Note URL" }),
7
+ url: z
8
+ .string({ description: "Note URL. This is optional for Pleloma" })
9
+ .nullish(),
8
10
  attributedTo: z.string({ description: "Note publisher" }),
9
11
 
10
12
  to: z.union([z.string(), z.string().array()]),
@@ -0,0 +1,9 @@
1
+ import { z } from "zod";
2
+
3
+ export const HashTag = z.object({
4
+ type: z.literal("Hashtag"),
5
+ href: z.string().url(),
6
+ name: z.string().startsWith("#"),
7
+ });
8
+
9
+ export type HashTag = z.infer<typeof HashTag>;
package/src/note/tag.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { Emoji } from "./emoji.js";
3
3
  import { Mention } from "./mention.js";
4
+ import { HashTag } from "./hashtag.js";
4
5
 
5
- export const Tag = z.union([Mention, Emoji]);
6
+ export const Tag = z.union([Mention, Emoji, HashTag]);
6
7
  export type Tag = z.infer<typeof Tag>;