@openpeepshq/common 0.1.44 → 0.1.46
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.
- package/dist/lib/adminSections.d.ts +4 -0
- package/dist/lib/adminSections.js +5 -0
- package/dist/lib/capabilitiesHelpers.d.ts +9 -7
- package/dist/lib/capabilitiesHelpers.js +21 -13
- package/dist/lib/eventIcs.d.ts +17 -0
- package/dist/lib/eventIcs.js +138 -2
- package/dist/lib/eventRecurrence.d.ts +32 -0
- package/dist/lib/eventRecurrence.js +284 -0
- package/dist/lib/eventTime.d.ts +29 -0
- package/dist/lib/eventTime.js +143 -0
- package/dist/lib/federationHosts.d.ts +3 -0
- package/dist/lib/federationHosts.js +17 -0
- package/dist/lib/feedCursor.d.ts +14 -0
- package/dist/lib/feedCursor.js +22 -0
- package/dist/lib/feedFormat.d.ts +12 -0
- package/dist/lib/feedFormat.js +14 -0
- package/dist/lib/groupHelpers.d.ts +63 -41
- package/dist/lib/groupHelpers.js +155 -45
- package/dist/lib/groupTemplateHelpers.d.ts +16 -0
- package/dist/lib/groupTemplateHelpers.js +51 -0
- package/dist/lib/index.d.ts +11 -0
- package/dist/lib/index.js +11 -0
- package/dist/lib/jamHelpers.d.ts +38 -3
- package/dist/lib/jamHelpers.js +93 -8
- package/dist/lib/legacyThemeRoot.d.ts +3 -0
- package/dist/lib/legacyThemeRoot.js +10 -0
- package/dist/lib/markdownHelpers.d.ts +22 -0
- package/dist/lib/markdownHelpers.js +73 -3
- package/dist/lib/postHelpers.d.ts +164 -9
- package/dist/lib/postHelpers.js +353 -11
- package/dist/lib/profileHelpers.d.ts +11 -0
- package/dist/lib/profileHelpers.js +31 -0
- package/dist/lib/pushHelpers.d.ts +3 -1
- package/dist/lib/pushHelpers.js +13 -0
- package/dist/lib/reactions.d.ts +17 -0
- package/dist/lib/reactions.js +37 -0
- package/dist/lib/scopeHelpers.d.ts +31 -2
- package/dist/lib/scopeHelpers.js +37 -3
- package/dist/lib/ssoLoginUrl.d.ts +24 -0
- package/dist/lib/ssoLoginUrl.js +75 -0
- package/dist/lib/ssoProviders.d.ts +72 -0
- package/dist/lib/ssoProviders.js +370 -0
- package/dist/lib/text.d.ts +2 -0
- package/dist/lib/text.js +2 -0
- package/dist/lib/timeZone.d.ts +9 -0
- package/dist/lib/timeZone.js +44 -0
- package/dist/lib/tokenHelpers.d.ts +5 -0
- package/dist/lib/tokenHelpers.js +19 -0
- package/dist/types/analytics.d.ts +20 -0
- package/dist/types/analytics.js +4 -0
- package/dist/types/api.d.ts +42669 -10689
- package/dist/types/api.js +94 -16
- package/dist/types/auth.d.ts +22 -13
- package/dist/types/capabilities.d.ts +26 -5
- package/dist/types/capabilities.js +95 -1
- package/dist/types/config.d.ts +93 -6
- package/dist/types/config.js +56 -5
- package/dist/types/db.d.ts +1911 -248
- package/dist/types/db.js +17 -3
- package/dist/types/export.d.ts +120 -0
- package/dist/types/export.js +7 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/internal.d.ts +8313 -2675
- package/dist/types/internal.js +16 -1
- package/dist/types/models.d.ts +343 -16
- package/dist/types/models.js +98 -7
- package/dist/types/notifications.d.ts +1 -0
- package/dist/types/plugins.d.ts +43 -1
- package/dist/types/plugins.js +75 -1
- package/dist/types/roleDefaults.d.ts +31 -0
- package/dist/types/roleDefaults.js +110 -0
- package/dist/types/stats.d.ts +54359 -4718
- package/dist/types/stats.js +30 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.js +1 -3
- package/package.json +1 -1
package/dist/types/db.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { answerSchema, hashtagSchema, mentionDataSchema, notificationSchema, postDataUnionSchema, postSchema, profileSchema, reactionDataSchema, rsvpSchema } from
|
|
3
|
-
import { groupWithMetaSchema } from
|
|
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
4
|
export const dbNotificationSchema = notificationSchema.extend({
|
|
5
5
|
post: postSchema.nullable().optional(),
|
|
6
6
|
});
|
|
@@ -35,6 +35,20 @@ const entryWithProfileSchema = z.discriminatedUnion('type', [
|
|
|
35
35
|
profile: profileSchema,
|
|
36
36
|
createdAt: z.string().datetime(),
|
|
37
37
|
}),
|
|
38
|
+
z.object({
|
|
39
|
+
type: z.literal('reaction'),
|
|
40
|
+
data: z.object({ reaction: z.string().min(1) }),
|
|
41
|
+
uri: z.string().url().optional(),
|
|
42
|
+
profile: profileSchema,
|
|
43
|
+
createdAt: z.string().datetime(),
|
|
44
|
+
}),
|
|
45
|
+
z.object({
|
|
46
|
+
type: z.literal('unreaction'),
|
|
47
|
+
data: z.object({ reaction: z.string().min(1) }),
|
|
48
|
+
uri: z.string().url().optional(),
|
|
49
|
+
profile: profileSchema,
|
|
50
|
+
createdAt: z.string().datetime(),
|
|
51
|
+
}),
|
|
38
52
|
]);
|
|
39
53
|
const mentionWithProfileSchema = mentionDataSchema.extend({
|
|
40
54
|
profile: profileSchema,
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Data a user can download as their account export. */
|
|
3
|
+
export declare const accountExportSchema: z.ZodObject<{
|
|
4
|
+
account: z.ZodObject<{
|
|
5
|
+
id: z.ZodUUID;
|
|
6
|
+
email: z.ZodEmail;
|
|
7
|
+
emailValidated: z.ZodDefault<z.ZodBoolean>;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
profiles: z.ZodArray<z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
type: z.ZodEnum<{
|
|
12
|
+
local: "local";
|
|
13
|
+
guest: "guest";
|
|
14
|
+
federated: "federated";
|
|
15
|
+
}>;
|
|
16
|
+
createdAt: z.ZodString;
|
|
17
|
+
updatedAt: z.ZodString;
|
|
18
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
19
|
+
handle: z.ZodString;
|
|
20
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
21
|
+
header: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
23
|
+
bio: z.ZodOptional<z.ZodString>;
|
|
24
|
+
location: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
text: z.ZodString;
|
|
26
|
+
coordinates: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
lat: z.ZodNumber;
|
|
28
|
+
lng: z.ZodNumber;
|
|
29
|
+
alt: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
locked: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
+
bot: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
+
discoverable: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
36
|
+
key: z.ZodString;
|
|
37
|
+
displayName: z.ZodString;
|
|
38
|
+
}, z.core.$strip>>>;
|
|
39
|
+
memberships: z.ZodPipe<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
40
|
+
roles: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
41
|
+
none: "none";
|
|
42
|
+
local: "local";
|
|
43
|
+
member: "member";
|
|
44
|
+
moderator: "moderator";
|
|
45
|
+
admin: "admin";
|
|
46
|
+
owner: "owner";
|
|
47
|
+
invited: "invited";
|
|
48
|
+
}>>>>;
|
|
49
|
+
group: z.ZodObject<{
|
|
50
|
+
handle: z.ZodString;
|
|
51
|
+
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
52
|
+
header: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
53
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
54
|
+
description: z.ZodOptional<z.ZodString>;
|
|
55
|
+
rules: z.ZodOptional<z.ZodString>;
|
|
56
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
discoverable: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
capabilities: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{
|
|
59
|
+
add: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
remove: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
}, z.core.$strip>>>;
|
|
62
|
+
id: z.ZodUUID;
|
|
63
|
+
createdAt: z.ZodISODateTime;
|
|
64
|
+
updatedAt: z.ZodISODateTime;
|
|
65
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
}, z.core.$strip>>>, z.ZodTransform<{
|
|
68
|
+
group: {
|
|
69
|
+
handle: string;
|
|
70
|
+
capabilities: Record<string, {
|
|
71
|
+
add?: string[] | undefined;
|
|
72
|
+
remove?: string[] | undefined;
|
|
73
|
+
} | undefined>;
|
|
74
|
+
id: string;
|
|
75
|
+
createdAt: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
avatar?: string | null | undefined;
|
|
78
|
+
header?: string | null | undefined;
|
|
79
|
+
displayName?: string | undefined;
|
|
80
|
+
description?: string | undefined;
|
|
81
|
+
rules?: string | undefined;
|
|
82
|
+
pinnedPostId?: string | undefined;
|
|
83
|
+
discoverable?: boolean | undefined;
|
|
84
|
+
deletedAt?: string | null | undefined;
|
|
85
|
+
};
|
|
86
|
+
roles?: ("none" | "local" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
|
|
87
|
+
}[] | undefined, {
|
|
88
|
+
group: {
|
|
89
|
+
handle: string;
|
|
90
|
+
capabilities: Record<string, {
|
|
91
|
+
add?: string[] | undefined;
|
|
92
|
+
remove?: string[] | undefined;
|
|
93
|
+
} | undefined>;
|
|
94
|
+
id: string;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
updatedAt: string;
|
|
97
|
+
avatar?: string | null | undefined;
|
|
98
|
+
header?: string | null | undefined;
|
|
99
|
+
displayName?: string | undefined;
|
|
100
|
+
description?: string | undefined;
|
|
101
|
+
rules?: string | undefined;
|
|
102
|
+
pinnedPostId?: string | undefined;
|
|
103
|
+
discoverable?: boolean | undefined;
|
|
104
|
+
deletedAt?: string | null | undefined;
|
|
105
|
+
};
|
|
106
|
+
roles?: ("none" | "local" | "member" | "moderator" | "admin" | "owner" | "invited")[] | null | undefined;
|
|
107
|
+
}[] | undefined>>;
|
|
108
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
value: z.ZodString;
|
|
111
|
+
}, z.core.$strip>>>;
|
|
112
|
+
profileStats: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
followersCount: z.ZodNumber;
|
|
114
|
+
followingCount: z.ZodNumber;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
blockedByMe: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>;
|
|
120
|
+
export type AccountExport = z.infer<typeof accountExportSchema>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { publicAccountSchema, publicProfileSchema } from './api.js';
|
|
3
|
+
/** Data a user can download as their account export. */
|
|
4
|
+
export const accountExportSchema = z.object({
|
|
5
|
+
account: publicAccountSchema,
|
|
6
|
+
profiles: publicProfileSchema.array(),
|
|
7
|
+
});
|
package/dist/types/index.d.ts
CHANGED