@openpeepshq/common 0.3.0 → 0.3.1

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.
@@ -716,12 +716,21 @@ export declare const visibilityTypeSchema: z.ZodEnum<{
716
716
  }>;
717
717
  export type VisibilityType = z.infer<typeof visibilityTypeSchema>;
718
718
  export declare const postTypeSchema: z.ZodEnum<{
719
+ resource: "resource";
719
720
  note: "note";
720
721
  question: "question";
721
722
  event: "event";
722
723
  article: "article";
723
724
  }>;
724
725
  export type PostType = z.infer<typeof postTypeSchema>;
726
+ export declare const resourceKindSchema: z.ZodEnum<{
727
+ link: "link";
728
+ file: "file";
729
+ video: "video";
730
+ gallery: "gallery";
731
+ audio: "audio";
732
+ }>;
733
+ export type ResourceKind = z.infer<typeof resourceKindSchema>;
725
734
  export declare const mediaAttachmentStatusSchema: z.ZodEnum<{
726
735
  processing: "processing";
727
736
  ready: "ready";
@@ -942,6 +951,58 @@ export declare const articleSchema: z.ZodObject<{
942
951
  title: z.ZodOptional<z.ZodString>;
943
952
  }, z.core.$strip>;
944
953
  export type Article = z.infer<typeof articleSchema>;
954
+ export declare const resourcePostSchema: z.ZodObject<{
955
+ content: z.ZodOptional<z.ZodString>;
956
+ sensitive: z.ZodOptional<z.ZodBoolean>;
957
+ spoilerText: z.ZodOptional<z.ZodString>;
958
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
959
+ type: z.ZodString;
960
+ url: z.ZodURL;
961
+ previewUrl: z.ZodNullable<z.ZodURL>;
962
+ textUrl: z.ZodNull;
963
+ filename: z.ZodString;
964
+ meta: z.ZodObject<{
965
+ usage: z.ZodOptional<z.ZodString>;
966
+ focus: z.ZodOptional<z.ZodObject<{
967
+ x: z.ZodNumber;
968
+ y: z.ZodNumber;
969
+ }, z.core.$strip>>;
970
+ mimetype: z.ZodOptional<z.ZodString>;
971
+ size: z.ZodOptional<z.ZodNumber>;
972
+ }, z.core.$strip>;
973
+ description: z.ZodOptional<z.ZodString>;
974
+ blurhash: z.ZodOptional<z.ZodString>;
975
+ status: z.ZodOptional<z.ZodEnum<{
976
+ processing: "processing";
977
+ ready: "ready";
978
+ failed: "failed";
979
+ }>>;
980
+ error: z.ZodOptional<z.ZodString>;
981
+ }, z.core.$strip>>>;
982
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
983
+ shortcode: z.ZodString;
984
+ url: z.ZodURL;
985
+ staticUrl: z.ZodURL;
986
+ visibleInPicker: z.ZodBoolean;
987
+ category: z.ZodString;
988
+ }, z.core.$strip>>>;
989
+ language: z.ZodOptional<z.ZodEnum<{
990
+ [x: string]: string;
991
+ }>>;
992
+ type: z.ZodLiteral<"resource">;
993
+ title: z.ZodString;
994
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
995
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
996
+ resourceKind: z.ZodEnum<{
997
+ link: "link";
998
+ file: "file";
999
+ video: "video";
1000
+ gallery: "gallery";
1001
+ audio: "audio";
1002
+ }>;
1003
+ url: z.ZodOptional<z.ZodURL>;
1004
+ }, z.core.$strip>;
1005
+ export type ResourcePost = z.infer<typeof resourcePostSchema>;
945
1006
  export declare const eventIsoDatetimeSchema: z.ZodISODateTime;
946
1007
  export declare const recurrenceFreqSchema: z.ZodEnum<{
947
1008
  DAILY: "DAILY";
@@ -1333,10 +1394,61 @@ export declare const postDataUnionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1333
1394
  type: z.ZodLiteral<"article">;
1334
1395
  image: z.ZodOptional<z.ZodURL>;
1335
1396
  title: z.ZodOptional<z.ZodString>;
1397
+ }, z.core.$strip>, z.ZodObject<{
1398
+ content: z.ZodOptional<z.ZodString>;
1399
+ sensitive: z.ZodOptional<z.ZodBoolean>;
1400
+ spoilerText: z.ZodOptional<z.ZodString>;
1401
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1402
+ type: z.ZodString;
1403
+ url: z.ZodURL;
1404
+ previewUrl: z.ZodNullable<z.ZodURL>;
1405
+ textUrl: z.ZodNull;
1406
+ filename: z.ZodString;
1407
+ meta: z.ZodObject<{
1408
+ usage: z.ZodOptional<z.ZodString>;
1409
+ focus: z.ZodOptional<z.ZodObject<{
1410
+ x: z.ZodNumber;
1411
+ y: z.ZodNumber;
1412
+ }, z.core.$strip>>;
1413
+ mimetype: z.ZodOptional<z.ZodString>;
1414
+ size: z.ZodOptional<z.ZodNumber>;
1415
+ }, z.core.$strip>;
1416
+ description: z.ZodOptional<z.ZodString>;
1417
+ blurhash: z.ZodOptional<z.ZodString>;
1418
+ status: z.ZodOptional<z.ZodEnum<{
1419
+ processing: "processing";
1420
+ ready: "ready";
1421
+ failed: "failed";
1422
+ }>>;
1423
+ error: z.ZodOptional<z.ZodString>;
1424
+ }, z.core.$strip>>>;
1425
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
1426
+ shortcode: z.ZodString;
1427
+ url: z.ZodURL;
1428
+ staticUrl: z.ZodURL;
1429
+ visibleInPicker: z.ZodBoolean;
1430
+ category: z.ZodString;
1431
+ }, z.core.$strip>>>;
1432
+ language: z.ZodOptional<z.ZodEnum<{
1433
+ [x: string]: string;
1434
+ }>>;
1435
+ type: z.ZodLiteral<"resource">;
1436
+ title: z.ZodString;
1437
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1438
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1439
+ resourceKind: z.ZodEnum<{
1440
+ link: "link";
1441
+ file: "file";
1442
+ video: "video";
1443
+ gallery: "gallery";
1444
+ audio: "audio";
1445
+ }>;
1446
+ url: z.ZodOptional<z.ZodURL>;
1336
1447
  }, z.core.$strip>], "type">;
1337
1448
  export type PostDataUnion = z.infer<typeof postDataUnionSchema>;
1338
1449
  export declare const postDataSchema: z.ZodObject<{
1339
1450
  type: z.ZodEnum<{
1451
+ resource: "resource";
1340
1452
  note: "note";
1341
1453
  question: "question";
1342
1454
  event: "event";
@@ -1582,12 +1694,63 @@ export declare const postDataSchema: z.ZodObject<{
1582
1694
  type: z.ZodLiteral<"article">;
1583
1695
  image: z.ZodOptional<z.ZodURL>;
1584
1696
  title: z.ZodOptional<z.ZodString>;
1697
+ }, z.core.$strip>, z.ZodObject<{
1698
+ content: z.ZodOptional<z.ZodString>;
1699
+ sensitive: z.ZodOptional<z.ZodBoolean>;
1700
+ spoilerText: z.ZodOptional<z.ZodString>;
1701
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
1702
+ type: z.ZodString;
1703
+ url: z.ZodURL;
1704
+ previewUrl: z.ZodNullable<z.ZodURL>;
1705
+ textUrl: z.ZodNull;
1706
+ filename: z.ZodString;
1707
+ meta: z.ZodObject<{
1708
+ usage: z.ZodOptional<z.ZodString>;
1709
+ focus: z.ZodOptional<z.ZodObject<{
1710
+ x: z.ZodNumber;
1711
+ y: z.ZodNumber;
1712
+ }, z.core.$strip>>;
1713
+ mimetype: z.ZodOptional<z.ZodString>;
1714
+ size: z.ZodOptional<z.ZodNumber>;
1715
+ }, z.core.$strip>;
1716
+ description: z.ZodOptional<z.ZodString>;
1717
+ blurhash: z.ZodOptional<z.ZodString>;
1718
+ status: z.ZodOptional<z.ZodEnum<{
1719
+ processing: "processing";
1720
+ ready: "ready";
1721
+ failed: "failed";
1722
+ }>>;
1723
+ error: z.ZodOptional<z.ZodString>;
1724
+ }, z.core.$strip>>>;
1725
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
1726
+ shortcode: z.ZodString;
1727
+ url: z.ZodURL;
1728
+ staticUrl: z.ZodURL;
1729
+ visibleInPicker: z.ZodBoolean;
1730
+ category: z.ZodString;
1731
+ }, z.core.$strip>>>;
1732
+ language: z.ZodOptional<z.ZodEnum<{
1733
+ [x: string]: string;
1734
+ }>>;
1735
+ type: z.ZodLiteral<"resource">;
1736
+ title: z.ZodString;
1737
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
1738
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
1739
+ resourceKind: z.ZodEnum<{
1740
+ link: "link";
1741
+ file: "file";
1742
+ video: "video";
1743
+ gallery: "gallery";
1744
+ audio: "audio";
1745
+ }>;
1746
+ url: z.ZodOptional<z.ZodURL>;
1585
1747
  }, z.core.$strip>], "type">>;
1586
1748
  creatorId: z.ZodString;
1587
1749
  }, z.core.$strip>;
1588
1750
  export type PostData = z.infer<typeof postDataSchema>;
1589
1751
  export declare const postSchema: z.ZodObject<{
1590
1752
  type: z.ZodEnum<{
1753
+ resource: "resource";
1591
1754
  note: "note";
1592
1755
  question: "question";
1593
1756
  event: "event";
@@ -1833,6 +1996,56 @@ export declare const postSchema: z.ZodObject<{
1833
1996
  type: z.ZodLiteral<"article">;
1834
1997
  image: z.ZodOptional<z.ZodURL>;
1835
1998
  title: z.ZodOptional<z.ZodString>;
1999
+ }, z.core.$strip>, z.ZodObject<{
2000
+ content: z.ZodOptional<z.ZodString>;
2001
+ sensitive: z.ZodOptional<z.ZodBoolean>;
2002
+ spoilerText: z.ZodOptional<z.ZodString>;
2003
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
2004
+ type: z.ZodString;
2005
+ url: z.ZodURL;
2006
+ previewUrl: z.ZodNullable<z.ZodURL>;
2007
+ textUrl: z.ZodNull;
2008
+ filename: z.ZodString;
2009
+ meta: z.ZodObject<{
2010
+ usage: z.ZodOptional<z.ZodString>;
2011
+ focus: z.ZodOptional<z.ZodObject<{
2012
+ x: z.ZodNumber;
2013
+ y: z.ZodNumber;
2014
+ }, z.core.$strip>>;
2015
+ mimetype: z.ZodOptional<z.ZodString>;
2016
+ size: z.ZodOptional<z.ZodNumber>;
2017
+ }, z.core.$strip>;
2018
+ description: z.ZodOptional<z.ZodString>;
2019
+ blurhash: z.ZodOptional<z.ZodString>;
2020
+ status: z.ZodOptional<z.ZodEnum<{
2021
+ processing: "processing";
2022
+ ready: "ready";
2023
+ failed: "failed";
2024
+ }>>;
2025
+ error: z.ZodOptional<z.ZodString>;
2026
+ }, z.core.$strip>>>;
2027
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
2028
+ shortcode: z.ZodString;
2029
+ url: z.ZodURL;
2030
+ staticUrl: z.ZodURL;
2031
+ visibleInPicker: z.ZodBoolean;
2032
+ category: z.ZodString;
2033
+ }, z.core.$strip>>>;
2034
+ language: z.ZodOptional<z.ZodEnum<{
2035
+ [x: string]: string;
2036
+ }>>;
2037
+ type: z.ZodLiteral<"resource">;
2038
+ title: z.ZodString;
2039
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
2040
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
2041
+ resourceKind: z.ZodEnum<{
2042
+ link: "link";
2043
+ file: "file";
2044
+ video: "video";
2045
+ gallery: "gallery";
2046
+ audio: "audio";
2047
+ }>;
2048
+ url: z.ZodOptional<z.ZodURL>;
1836
2049
  }, z.core.$strip>], "type">>;
1837
2050
  creatorId: z.ZodString;
1838
2051
  id: z.ZodUUID;
@@ -2108,6 +2321,56 @@ export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2108
2321
  type: z.ZodLiteral<"article">;
2109
2322
  image: z.ZodOptional<z.ZodURL>;
2110
2323
  title: z.ZodOptional<z.ZodString>;
2324
+ }, z.core.$strip>, z.ZodObject<{
2325
+ content: z.ZodOptional<z.ZodString>;
2326
+ sensitive: z.ZodOptional<z.ZodBoolean>;
2327
+ spoilerText: z.ZodOptional<z.ZodString>;
2328
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
2329
+ type: z.ZodString;
2330
+ url: z.ZodURL;
2331
+ previewUrl: z.ZodNullable<z.ZodURL>;
2332
+ textUrl: z.ZodNull;
2333
+ filename: z.ZodString;
2334
+ meta: z.ZodObject<{
2335
+ usage: z.ZodOptional<z.ZodString>;
2336
+ focus: z.ZodOptional<z.ZodObject<{
2337
+ x: z.ZodNumber;
2338
+ y: z.ZodNumber;
2339
+ }, z.core.$strip>>;
2340
+ mimetype: z.ZodOptional<z.ZodString>;
2341
+ size: z.ZodOptional<z.ZodNumber>;
2342
+ }, z.core.$strip>;
2343
+ description: z.ZodOptional<z.ZodString>;
2344
+ blurhash: z.ZodOptional<z.ZodString>;
2345
+ status: z.ZodOptional<z.ZodEnum<{
2346
+ processing: "processing";
2347
+ ready: "ready";
2348
+ failed: "failed";
2349
+ }>>;
2350
+ error: z.ZodOptional<z.ZodString>;
2351
+ }, z.core.$strip>>>;
2352
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
2353
+ shortcode: z.ZodString;
2354
+ url: z.ZodURL;
2355
+ staticUrl: z.ZodURL;
2356
+ visibleInPicker: z.ZodBoolean;
2357
+ category: z.ZodString;
2358
+ }, z.core.$strip>>>;
2359
+ language: z.ZodOptional<z.ZodEnum<{
2360
+ [x: string]: string;
2361
+ }>>;
2362
+ type: z.ZodLiteral<"resource">;
2363
+ title: z.ZodString;
2364
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
2365
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
2366
+ resourceKind: z.ZodEnum<{
2367
+ link: "link";
2368
+ file: "file";
2369
+ video: "video";
2370
+ gallery: "gallery";
2371
+ audio: "audio";
2372
+ }>;
2373
+ url: z.ZodOptional<z.ZodURL>;
2111
2374
  }, z.core.$strip>], "type">;
2112
2375
  }, z.core.$strip>, z.ZodObject<{
2113
2376
  type: z.ZodLiteral<"edit">;
@@ -2341,6 +2604,56 @@ export declare const entryDataSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2341
2604
  type: z.ZodLiteral<"article">;
2342
2605
  image: z.ZodOptional<z.ZodURL>;
2343
2606
  title: z.ZodOptional<z.ZodString>;
2607
+ }, z.core.$strip>, z.ZodObject<{
2608
+ content: z.ZodOptional<z.ZodString>;
2609
+ sensitive: z.ZodOptional<z.ZodBoolean>;
2610
+ spoilerText: z.ZodOptional<z.ZodString>;
2611
+ attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
2612
+ type: z.ZodString;
2613
+ url: z.ZodURL;
2614
+ previewUrl: z.ZodNullable<z.ZodURL>;
2615
+ textUrl: z.ZodNull;
2616
+ filename: z.ZodString;
2617
+ meta: z.ZodObject<{
2618
+ usage: z.ZodOptional<z.ZodString>;
2619
+ focus: z.ZodOptional<z.ZodObject<{
2620
+ x: z.ZodNumber;
2621
+ y: z.ZodNumber;
2622
+ }, z.core.$strip>>;
2623
+ mimetype: z.ZodOptional<z.ZodString>;
2624
+ size: z.ZodOptional<z.ZodNumber>;
2625
+ }, z.core.$strip>;
2626
+ description: z.ZodOptional<z.ZodString>;
2627
+ blurhash: z.ZodOptional<z.ZodString>;
2628
+ status: z.ZodOptional<z.ZodEnum<{
2629
+ processing: "processing";
2630
+ ready: "ready";
2631
+ failed: "failed";
2632
+ }>>;
2633
+ error: z.ZodOptional<z.ZodString>;
2634
+ }, z.core.$strip>>>;
2635
+ customEmojis: z.ZodOptional<z.ZodArray<z.ZodObject<{
2636
+ shortcode: z.ZodString;
2637
+ url: z.ZodURL;
2638
+ staticUrl: z.ZodURL;
2639
+ visibleInPicker: z.ZodBoolean;
2640
+ category: z.ZodString;
2641
+ }, z.core.$strip>>>;
2642
+ language: z.ZodOptional<z.ZodEnum<{
2643
+ [x: string]: string;
2644
+ }>>;
2645
+ type: z.ZodLiteral<"resource">;
2646
+ title: z.ZodString;
2647
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
2648
+ categoryPath: z.ZodOptional<z.ZodArray<z.ZodString>>;
2649
+ resourceKind: z.ZodEnum<{
2650
+ link: "link";
2651
+ file: "file";
2652
+ video: "video";
2653
+ gallery: "gallery";
2654
+ audio: "audio";
2655
+ }>;
2656
+ url: z.ZodOptional<z.ZodURL>;
2344
2657
  }, z.core.$strip>], "type">;
2345
2658
  }, z.core.$strip>, z.ZodObject<{
2346
2659
  type: z.ZodLiteral<"delete">;
@@ -288,7 +288,20 @@ export const visibilityTypeValues = [
288
288
  'report',
289
289
  ];
290
290
  export const visibilityTypeSchema = z.enum(visibilityTypeValues);
291
- export const postTypeSchema = z.enum(['note', 'question', 'event', 'article']);
291
+ export const postTypeSchema = z.enum([
292
+ 'note',
293
+ 'question',
294
+ 'event',
295
+ 'article',
296
+ 'resource',
297
+ ]);
298
+ export const resourceKindSchema = z.enum([
299
+ 'video',
300
+ 'file',
301
+ 'gallery',
302
+ 'audio',
303
+ 'link',
304
+ ]);
292
305
  export const mediaAttachmentStatusSchema = z.enum([
293
306
  'processing',
294
307
  'ready',
@@ -371,6 +384,16 @@ export const articleSchema = noteSchema
371
384
  title: z.string().optional(),
372
385
  })
373
386
  .openapi('Article');
387
+ export const resourcePostSchema = noteSchema
388
+ .extend({
389
+ type: z.literal('resource'),
390
+ title: z.string(),
391
+ tags: z.array(z.string().min(1)).optional(),
392
+ categoryPath: z.array(z.string().min(1)).optional(),
393
+ resourceKind: resourceKindSchema,
394
+ url: z.url().optional(),
395
+ })
396
+ .openapi('ResourcePost');
374
397
  export const eventIsoDatetimeSchema = z.iso.datetime({
375
398
  offset: true,
376
399
  precision: 3,
@@ -431,6 +454,7 @@ export const postDataUnionSchema = z.discriminatedUnion('type', [
431
454
  questionSchema,
432
455
  eventSchema,
433
456
  articleSchema,
457
+ resourcePostSchema,
434
458
  ]);
435
459
  export const postDataSchema = z.object({
436
460
  type: postTypeSchema,
@@ -138,6 +138,10 @@ export declare const notificationTypeSchema: z.ZodObject<{
138
138
  "core-posts-create-article-public": "core-posts-create-article-public";
139
139
  "core-posts-create-article-direct": "core-posts-create-article-direct";
140
140
  "core-posts-create-article-private": "core-posts-create-article-private";
141
+ "core-posts-create-resource-local": "core-posts-create-resource-local";
142
+ "core-posts-create-resource-public": "core-posts-create-resource-public";
143
+ "core-posts-create-resource-direct": "core-posts-create-resource-direct";
144
+ "core-posts-create-resource-private": "core-posts-create-resource-private";
141
145
  "core-posts-read-local": "core-posts-read-local";
142
146
  "core-posts-announce": "core-posts-announce";
143
147
  "core-profiles-roles-update": "core-profiles-roles-update";