@openpeepshq/common 0.1.43

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.
Files changed (78) hide show
  1. package/LICENSE.md +21 -0
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +3 -0
  4. package/dist/lib/adminSections.d.ts +53 -0
  5. package/dist/lib/adminSections.js +62 -0
  6. package/dist/lib/attachmentHelpers.d.ts +1 -0
  7. package/dist/lib/attachmentHelpers.js +13 -0
  8. package/dist/lib/capabilitiesHelpers.d.ts +118 -0
  9. package/dist/lib/capabilitiesHelpers.js +238 -0
  10. package/dist/lib/colors.d.ts +5 -0
  11. package/dist/lib/colors.js +17 -0
  12. package/dist/lib/csvHelpers.d.ts +6 -0
  13. package/dist/lib/csvHelpers.js +17 -0
  14. package/dist/lib/eventIcs.d.ts +4 -0
  15. package/dist/lib/eventIcs.js +83 -0
  16. package/dist/lib/groupHelpers.d.ts +134 -0
  17. package/dist/lib/groupHelpers.js +216 -0
  18. package/dist/lib/index.d.ts +17 -0
  19. package/dist/lib/index.js +17 -0
  20. package/dist/lib/jamHelpers.d.ts +5 -0
  21. package/dist/lib/jamHelpers.js +37 -0
  22. package/dist/lib/markdownHelpers.d.ts +1 -0
  23. package/dist/lib/markdownHelpers.js +24 -0
  24. package/dist/lib/mediaDimensions.d.ts +19 -0
  25. package/dist/lib/mediaDimensions.js +19 -0
  26. package/dist/lib/postHelpers.d.ts +146 -0
  27. package/dist/lib/postHelpers.js +144 -0
  28. package/dist/lib/profileHelpers.d.ts +30 -0
  29. package/dist/lib/profileHelpers.js +75 -0
  30. package/dist/lib/pushHelpers.d.ts +4 -0
  31. package/dist/lib/pushHelpers.js +6 -0
  32. package/dist/lib/scopeHelpers.d.ts +25 -0
  33. package/dist/lib/scopeHelpers.js +85 -0
  34. package/dist/lib/text.d.ts +3 -0
  35. package/dist/lib/text.js +18 -0
  36. package/dist/lib/tokenHelpers.d.ts +21 -0
  37. package/dist/lib/tokenHelpers.js +81 -0
  38. package/dist/lib/utils.d.ts +43 -0
  39. package/dist/lib/utils.js +200 -0
  40. package/dist/types/admin-db.d.ts +62 -0
  41. package/dist/types/admin-db.js +41 -0
  42. package/dist/types/admin-email.d.ts +39 -0
  43. package/dist/types/admin-email.js +41 -0
  44. package/dist/types/admin-jobs.d.ts +15 -0
  45. package/dist/types/admin-jobs.js +14 -0
  46. package/dist/types/admin-performance.d.ts +23 -0
  47. package/dist/types/admin-performance.js +14 -0
  48. package/dist/types/analytics.d.ts +583 -0
  49. package/dist/types/analytics.js +213 -0
  50. package/dist/types/api.d.ts +20076 -0
  51. package/dist/types/api.js +492 -0
  52. package/dist/types/apple-app-site-association.d.ts +50 -0
  53. package/dist/types/apple-app-site-association.js +38 -0
  54. package/dist/types/auth.d.ts +367 -0
  55. package/dist/types/auth.js +17 -0
  56. package/dist/types/capabilities.d.ts +24 -0
  57. package/dist/types/capabilities.js +144 -0
  58. package/dist/types/config.d.ts +858 -0
  59. package/dist/types/config.js +352 -0
  60. package/dist/types/db.d.ts +8780 -0
  61. package/dist/types/db.js +65 -0
  62. package/dist/types/index.d.ts +18 -0
  63. package/dist/types/index.js +18 -0
  64. package/dist/types/internal.d.ts +44337 -0
  65. package/dist/types/internal.js +154 -0
  66. package/dist/types/models.d.ts +2619 -0
  67. package/dist/types/models.js +599 -0
  68. package/dist/types/notifications.d.ts +148 -0
  69. package/dist/types/notifications.js +40 -0
  70. package/dist/types/plugins.d.ts +66 -0
  71. package/dist/types/plugins.js +29 -0
  72. package/dist/types/stats.d.ts +10216 -0
  73. package/dist/types/stats.js +109 -0
  74. package/dist/types/stripe.d.ts +42 -0
  75. package/dist/types/stripe.js +35 -0
  76. package/dist/types/utils.d.ts +84 -0
  77. package/dist/types/utils.js +39 -0
  78. package/package.json +54 -0
@@ -0,0 +1,65 @@
1
+ import { z } from "zod";
2
+ import { answerSchema, hashtagSchema, mentionDataSchema, notificationSchema, postDataUnionSchema, postSchema, profileSchema, reactionDataSchema, rsvpSchema } from "./models.js";
3
+ import { groupWithMetaSchema } from "./internal.js";
4
+ export const dbNotificationSchema = notificationSchema.extend({
5
+ post: postSchema.nullable().optional(),
6
+ });
7
+ const entryWithProfileSchema = z.discriminatedUnion('type', [
8
+ z.object({
9
+ type: z.literal('create'),
10
+ data: postDataUnionSchema,
11
+ profile: profileSchema,
12
+ createdAt: z.string().datetime(),
13
+ }),
14
+ z.object({
15
+ type: z.literal('edit'),
16
+ data: postDataUnionSchema,
17
+ profile: profileSchema,
18
+ createdAt: z.string().datetime(),
19
+ }),
20
+ z.object({
21
+ type: z.literal('delete'),
22
+ data: z.any(),
23
+ profile: profileSchema,
24
+ createdAt: z.string().datetime(),
25
+ }),
26
+ z.object({
27
+ type: z.literal('answer'),
28
+ data: answerSchema,
29
+ profile: profileSchema,
30
+ createdAt: z.string().datetime(),
31
+ }),
32
+ z.object({
33
+ type: z.literal('rsvp'),
34
+ data: rsvpSchema,
35
+ profile: profileSchema,
36
+ createdAt: z.string().datetime(),
37
+ }),
38
+ ]);
39
+ const mentionWithProfileSchema = mentionDataSchema.extend({
40
+ profile: profileSchema,
41
+ });
42
+ const reactionWithProfileSchema = reactionDataSchema.extend({
43
+ profile: profileSchema,
44
+ });
45
+ export const dbBasePostSchema = postSchema.extend({
46
+ entries: entryWithProfileSchema.array(),
47
+ audience: profileSchema.array(),
48
+ group: groupWithMetaSchema,
49
+ mentions: mentionWithProfileSchema.array(),
50
+ replyCount: z.number(),
51
+ repostCount: z.number(),
52
+ reactions: reactionWithProfileSchema.array(),
53
+ tags: hashtagSchema.array(),
54
+ profile: profileSchema,
55
+ data: postDataUnionSchema,
56
+ groupId: z.string().nullable().optional(),
57
+ seen: z.boolean().optional(),
58
+ });
59
+ export const dbPostWithReplySchema = dbBasePostSchema.extend({
60
+ replyTo: dbBasePostSchema.nullable().optional(),
61
+ inReplyToId: z.string().nullable().optional(),
62
+ });
63
+ export const dbPostSchema = dbPostWithReplySchema.extend({
64
+ repost: dbPostWithReplySchema.nullable().optional(),
65
+ });
@@ -0,0 +1,18 @@
1
+ export * from './models';
2
+ export * from './apple-app-site-association';
3
+ export * from './capabilities';
4
+ export * from './api';
5
+ export * from './plugins';
6
+ export * from './internal';
7
+ export * from './utils';
8
+ export * from './config';
9
+ export * from './auth';
10
+ export * from './stats';
11
+ export * from './analytics';
12
+ export * from './notifications';
13
+ export * from './stripe';
14
+ export * from './db';
15
+ export * from './admin-email';
16
+ export * from './admin-jobs';
17
+ export * from './admin-db';
18
+ export * from './admin-performance';
@@ -0,0 +1,18 @@
1
+ export * from './models.js';
2
+ export * from './apple-app-site-association.js';
3
+ export * from './capabilities.js';
4
+ export * from './api.js';
5
+ export * from './plugins.js';
6
+ export * from './internal.js';
7
+ export * from './utils.js';
8
+ export * from './config.js';
9
+ export * from './auth.js';
10
+ export * from './stats.js';
11
+ export * from './analytics.js';
12
+ export * from './notifications.js';
13
+ export * from './stripe.js';
14
+ export * from './db.js';
15
+ export * from './admin-email.js';
16
+ export * from './admin-jobs.js';
17
+ export * from './admin-db.js';
18
+ export * from './admin-performance.js';