@openpeepshq/common 0.1.43 → 0.1.45

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 (55) hide show
  1. package/dist/lib/adminSections.d.ts +4 -0
  2. package/dist/lib/adminSections.js +5 -0
  3. package/dist/lib/capabilitiesHelpers.d.ts +7 -7
  4. package/dist/lib/capabilitiesHelpers.js +4 -11
  5. package/dist/lib/eventIcs.js +56 -2
  6. package/dist/lib/eventRecurrence.d.ts +30 -0
  7. package/dist/lib/eventRecurrence.js +279 -0
  8. package/dist/lib/eventTime.d.ts +22 -0
  9. package/dist/lib/eventTime.js +127 -0
  10. package/dist/lib/groupHelpers.d.ts +63 -41
  11. package/dist/lib/groupHelpers.js +155 -45
  12. package/dist/lib/groupTemplateHelpers.d.ts +16 -0
  13. package/dist/lib/groupTemplateHelpers.js +51 -0
  14. package/dist/lib/index.d.ts +5 -0
  15. package/dist/lib/index.js +5 -0
  16. package/dist/lib/jamHelpers.d.ts +28 -2
  17. package/dist/lib/jamHelpers.js +56 -8
  18. package/dist/lib/markdownHelpers.d.ts +14 -0
  19. package/dist/lib/markdownHelpers.js +41 -0
  20. package/dist/lib/postHelpers.d.ts +24 -6
  21. package/dist/lib/postHelpers.js +79 -21
  22. package/dist/lib/profileHelpers.d.ts +11 -0
  23. package/dist/lib/profileHelpers.js +29 -0
  24. package/dist/lib/pushHelpers.d.ts +3 -1
  25. package/dist/lib/pushHelpers.js +13 -0
  26. package/dist/lib/reportHelpers.d.ts +2 -0
  27. package/dist/lib/reportHelpers.js +2 -0
  28. package/dist/lib/ssoLoginUrl.d.ts +24 -0
  29. package/dist/lib/ssoLoginUrl.js +75 -0
  30. package/dist/lib/text.d.ts +2 -0
  31. package/dist/lib/text.js +2 -0
  32. package/dist/lib/tokenHelpers.d.ts +5 -0
  33. package/dist/lib/tokenHelpers.js +19 -0
  34. package/dist/lib/utils.d.ts +4 -0
  35. package/dist/types/analytics.d.ts +86 -0
  36. package/dist/types/analytics.js +21 -0
  37. package/dist/types/api.d.ts +2392 -355
  38. package/dist/types/api.js +44 -18
  39. package/dist/types/auth.d.ts +2 -7
  40. package/dist/types/capabilities.d.ts +11 -4
  41. package/dist/types/capabilities.js +44 -1
  42. package/dist/types/config.d.ts +50 -24
  43. package/dist/types/config.js +28 -15
  44. package/dist/types/db.d.ts +738 -66
  45. package/dist/types/db.js +3 -3
  46. package/dist/types/internal.d.ts +6189 -2604
  47. package/dist/types/internal.js +10 -1
  48. package/dist/types/models.d.ts +280 -9
  49. package/dist/types/models.js +59 -5
  50. package/dist/types/notifications.d.ts +39 -1
  51. package/dist/types/notifications.js +12 -0
  52. package/dist/types/plugins.d.ts +21 -1
  53. package/dist/types/plugins.js +9 -1
  54. package/dist/types/stats.d.ts +1284 -184
  55. package/package.json +1 -1
@@ -1,5 +1,4 @@
1
1
  import { z } from 'zod';
2
- import { NotificationStats } from './api';
3
2
  import { RoleCapability } from './capabilities';
4
3
  import { ExpandedNotification } from './internal';
5
4
  export declare const actionSchema: z.ZodObject<{
@@ -45,10 +44,48 @@ export declare const pushNotificationSchema: z.ZodObject<{
45
44
  invalidateQueries: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
46
45
  }, z.core.$strip>;
47
46
  export type PushNotification = z.infer<typeof pushNotificationSchema>;
47
+ export declare const notificationStatsSchema: z.ZodObject<{
48
+ unread: z.ZodNumber;
49
+ unseen: z.ZodNumber;
50
+ }, z.core.$strip>;
51
+ export type NotificationStats = z.infer<typeof notificationStatsSchema>;
48
52
  export interface PushMessage {
49
53
  notificationStats: NotificationStats;
50
54
  notification: PushNotification;
51
55
  }
56
+ /** Session SSE / presence platform. */
57
+ export declare const sessionPlatformSchema: z.ZodEnum<{
58
+ ios: "ios";
59
+ android: "android";
60
+ web: "web";
61
+ }>;
62
+ export type SessionPlatform = z.infer<typeof sessionPlatformSchema>;
63
+ /** Invalidate-light envelope mirrored from web push. */
64
+ export declare const sessionEventSchema: z.ZodObject<{
65
+ type: z.ZodLiteral<"invalidate">;
66
+ notification: z.ZodOptional<z.ZodObject<{
67
+ title: z.ZodOptional<z.ZodString>;
68
+ options: z.ZodOptional<z.ZodObject<{
69
+ body: z.ZodOptional<z.ZodString>;
70
+ icon: z.ZodOptional<z.ZodString>;
71
+ image: z.ZodOptional<z.ZodString>;
72
+ link: z.ZodOptional<z.ZodString>;
73
+ tag: z.ZodOptional<z.ZodString>;
74
+ badge: z.ZodOptional<z.ZodNumber>;
75
+ data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
76
+ actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
77
+ action: z.ZodString;
78
+ title: z.ZodString;
79
+ }, z.core.$strip>>>;
80
+ }, z.core.$strip>>;
81
+ invalidateQueries: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
82
+ }, z.core.$strip>>;
83
+ notificationStats: z.ZodOptional<z.ZodObject<{
84
+ unread: z.ZodNumber;
85
+ unseen: z.ZodNumber;
86
+ }, z.core.$strip>>;
87
+ }, z.core.$strip>;
88
+ export type SessionEvent = z.infer<typeof sessionEventSchema>;
52
89
  export interface NotificationHandler {
53
90
  type: string;
54
91
  event: string;
@@ -128,6 +165,7 @@ export declare const notificationTypeSchema: z.ZodObject<{
128
165
  "core-inviteLinks-update": "core-inviteLinks-update";
129
166
  "core-inviteLinks-delete": "core-inviteLinks-delete";
130
167
  "core-serviceTokens-update": "core-serviceTokens-update";
168
+ "core-plugins-manage": "core-plugins-manage";
131
169
  }>>>;
132
170
  defaultSettings: z.ZodOptional<z.ZodObject<{
133
171
  create: z.ZodBoolean;
@@ -19,6 +19,18 @@ export const pushNotificationSchema = z.object({
19
19
  options: notificationOptionsSchema.optional(),
20
20
  invalidateQueries: z.array(z.array(z.string())).optional(),
21
21
  });
22
+ export const notificationStatsSchema = z.object({
23
+ unread: z.number(),
24
+ unseen: z.number(),
25
+ });
26
+ /** Session SSE / presence platform. */
27
+ export const sessionPlatformSchema = z.enum(['web', 'ios', 'android']);
28
+ /** Invalidate-light envelope mirrored from web push. */
29
+ export const sessionEventSchema = z.object({
30
+ type: z.literal('invalidate'),
31
+ notification: pushNotificationSchema.optional(),
32
+ notificationStats: notificationStatsSchema.optional(),
33
+ });
22
34
  export const notificationTypeSchema = z.object({
23
35
  type: z.string(),
24
36
  requiredCapabilities: z.enum(roleCapabilities).array().optional(),
@@ -6,7 +6,7 @@ export interface Plugin {
6
6
  name: string;
7
7
  info: PackageJson;
8
8
  path: string;
9
- status?: 'loaded' | 'failed';
9
+ status?: 'loaded' | 'failed' | 'disabled';
10
10
  error?: string;
11
11
  }
12
12
  export declare const pluginInfoSchema: z.ZodObject<{
@@ -19,9 +19,28 @@ export declare const pluginInfoSchema: z.ZodObject<{
19
19
  status: z.ZodOptional<z.ZodEnum<{
20
20
  failed: "failed";
21
21
  loaded: "loaded";
22
+ disabled: "disabled";
22
23
  }>>;
23
24
  }, z.core.$strip>;
24
25
  export type PluginInfo = z.infer<typeof pluginInfoSchema>;
26
+ export declare const adminPluginInfoSchema: z.ZodObject<{
27
+ key: z.ZodString;
28
+ namespace: z.ZodString;
29
+ name: z.ZodString;
30
+ version: z.ZodOptional<z.ZodString>;
31
+ displayName: z.ZodOptional<z.ZodString>;
32
+ description: z.ZodOptional<z.ZodString>;
33
+ status: z.ZodOptional<z.ZodEnum<{
34
+ failed: "failed";
35
+ loaded: "loaded";
36
+ disabled: "disabled";
37
+ }>>;
38
+ error: z.ZodOptional<z.ZodString>;
39
+ enabled: z.ZodBoolean;
40
+ repositoryUrl: z.ZodOptional<z.ZodString>;
41
+ installed: z.ZodOptional<z.ZodBoolean>;
42
+ }, z.core.$strip>;
43
+ export type AdminPluginInfo = z.infer<typeof adminPluginInfoSchema>;
25
44
  export declare const pluginManifestSchema: z.ZodObject<{
26
45
  components: z.ZodDefault<z.ZodArray<z.ZodObject<{
27
46
  slot: z.ZodString;
@@ -40,6 +59,7 @@ export declare const pluginEntrySchema: z.ZodObject<{
40
59
  status: z.ZodOptional<z.ZodEnum<{
41
60
  failed: "failed";
42
61
  loaded: "loaded";
62
+ disabled: "disabled";
43
63
  }>>;
44
64
  manifest: z.ZodOptional<z.ZodObject<{
45
65
  components: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -6,7 +6,15 @@ export const pluginInfoSchema = z.object({
6
6
  version: z.string().optional(),
7
7
  displayName: z.string().optional(),
8
8
  description: z.string().optional(),
9
- status: z.enum(['loaded', 'failed']).optional(),
9
+ status: z.enum(['loaded', 'failed', 'disabled']).optional(),
10
+ });
11
+ export const adminPluginInfoSchema = pluginInfoSchema.extend({
12
+ error: z.string().optional(),
13
+ /** Persisted desired state (DB override, falling back to the static gate). */
14
+ enabled: z.boolean(),
15
+ repositoryUrl: z.string().optional(),
16
+ /** True when installed via the admin UI (can be uninstalled). */
17
+ installed: z.boolean().optional(),
10
18
  });
11
19
  export const pluginManifestSchema = z.object({
12
20
  components: z