@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/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { notificationStatsSchema, pushNotificationSchema, } from './notifications.js';
|
|
3
|
-
import { accessTokenSchema, accountInteractionsSchema, accountNameSchema, accountSchema, answerSchema, applicationDataSchema, groupDataSchema, groupRoleSchema, groupSchema, guestDataSchema, hashtagSchema, inviteLinkSchema, latLngSchema, locationSchema, mediaAttachmentSchema, mentionDataSchema, postDataUnionSchema, postTypeSchema, profileDataSchema, profileStatsSchema, reactionDataSchema, reportDataSchema, reportSchema, resourceSchema, rsvpSchema, scopeSchema, visibilityTypeSchema, } from './models.js';
|
|
3
|
+
import { accessTokenSchema, accountInteractionsSchema, accountNameSchema, accountSchema, answerSchema, applicationDataSchema, groupDataSchema, groupRoleSchema, groupSchema, guestDataSchema, hashtagSchema, inviteLinkSchema, jamRecordingStatusSchema, latLngSchema, locationSchema, mediaAttachmentSchema, mentionDataSchema, postDataUnionSchema, postTypeSchema, profileDataSchema, profileStatsSchema, reactionDataSchema, roleDataSchema, reportDataSchema, reportSchema, resourceSchema, rsvpSchema, scopeSchema, visibilityTypeSchema, } from './models.js';
|
|
4
4
|
import { groupWithMetaSchema } from './internal.js';
|
|
5
5
|
import { communityConfigSchema } from './config.js';
|
|
6
6
|
import { extendZodWithOpenApi } from '@asteasolutions/zod-to-openapi';
|
|
@@ -16,6 +16,11 @@ export const publicAccountSchema = z
|
|
|
16
16
|
emailValidated: z.boolean().default(false),
|
|
17
17
|
})
|
|
18
18
|
.openapi('Account', { type: 'object' });
|
|
19
|
+
/** Role identity on public profiles — capabilities stay internal. */
|
|
20
|
+
export const publicRoleSchema = roleDataSchema.pick({
|
|
21
|
+
key: true,
|
|
22
|
+
displayName: true,
|
|
23
|
+
});
|
|
19
24
|
export const publicProfileSchema = z.object({
|
|
20
25
|
id: z.string().uuid(),
|
|
21
26
|
type: z.enum(['local', 'guest', 'federated']),
|
|
@@ -31,6 +36,7 @@ export const publicProfileSchema = z.object({
|
|
|
31
36
|
locked: z.boolean().optional(),
|
|
32
37
|
bot: z.boolean().optional(),
|
|
33
38
|
discoverable: z.boolean().optional(),
|
|
39
|
+
roles: publicRoleSchema.array().optional(),
|
|
34
40
|
memberships: z
|
|
35
41
|
.array(groupRoleSchema.extend({
|
|
36
42
|
group: groupSchema,
|
|
@@ -45,6 +51,8 @@ export const publicProfileSchema = z.object({
|
|
|
45
51
|
.max(4)
|
|
46
52
|
.optional(),
|
|
47
53
|
profileStats: profileStatsSchema.optional(),
|
|
54
|
+
pinnedPostId: z.string().optional(),
|
|
55
|
+
blockedByMe: z.boolean().optional(),
|
|
48
56
|
});
|
|
49
57
|
export const publicAccessTokenSchema = accessTokenSchema
|
|
50
58
|
.omit({ signedToken: true })
|
|
@@ -92,7 +100,11 @@ export const entryWithPublicProfileSchema = z.discriminatedUnion('type', [
|
|
|
92
100
|
const reactionWithPublicProfileSchema = reactionDataSchema.extend({
|
|
93
101
|
profile: publicProfileSchema,
|
|
94
102
|
});
|
|
95
|
-
|
|
103
|
+
const repostWithPublicProfileSchema = z.object({
|
|
104
|
+
profile: publicProfileSchema,
|
|
105
|
+
createdAt: z.string().datetime(),
|
|
106
|
+
});
|
|
107
|
+
const publicReplyPostObject = z.object({
|
|
96
108
|
id: z.string(),
|
|
97
109
|
type: postTypeSchema,
|
|
98
110
|
profile: publicProfileSchema,
|
|
@@ -103,6 +115,12 @@ export const publicReplyPostSchema = z.object({
|
|
|
103
115
|
visibility: visibilityTypeSchema,
|
|
104
116
|
group: groupWithMetaSchema.optional().nullable(),
|
|
105
117
|
audience: z.array(publicProfileSchema).optional().nullable(),
|
|
118
|
+
seen: z.boolean().optional(),
|
|
119
|
+
inReplyToId: z.string().optional().nullable(),
|
|
120
|
+
hidden: z.boolean().optional(),
|
|
121
|
+
});
|
|
122
|
+
export const publicReplyPostSchema = publicReplyPostObject.extend({
|
|
123
|
+
replyTo: publicReplyPostObject.optional().nullable(),
|
|
106
124
|
});
|
|
107
125
|
export const publicApplicationSchema = applicationDataSchema.pick({
|
|
108
126
|
name: true,
|
|
@@ -116,6 +134,13 @@ const basePublicPostSchema = publicReplyPostSchema.extend({
|
|
|
116
134
|
repostCount: z.number(),
|
|
117
135
|
replyCount: z.number(),
|
|
118
136
|
reactions: reactionWithPublicProfileSchema.array(),
|
|
137
|
+
/** Capped lean list of who reposted (most recent). Count stays in repostCount. */
|
|
138
|
+
reposts: repostWithPublicProfileSchema.array(),
|
|
139
|
+
/** Newest conversation descendants for a nested timeline preview. */
|
|
140
|
+
latestReplies: publicReplyPostSchema.array().optional(),
|
|
141
|
+
latestRepliesHasMore: z.boolean().optional(),
|
|
142
|
+
/** Last reply or reaction on the conversation root; feeds sort by this. */
|
|
143
|
+
lastActivityAt: z.string().datetime().optional(),
|
|
119
144
|
application: publicApplicationSchema.optional(),
|
|
120
145
|
mentions: z.array(mentionWithPublicProfileSchema),
|
|
121
146
|
tags: z.array(hashtagSchema),
|
|
@@ -125,6 +150,9 @@ const basePublicPostSchema = publicReplyPostSchema.extend({
|
|
|
125
150
|
accountInteractions: accountInteractionsSchema.optional(),
|
|
126
151
|
rsvps: publicRsvpSchema.array(),
|
|
127
152
|
seen: z.boolean().optional(),
|
|
153
|
+
occurrenceRecurrenceId: z.string().datetime().optional(),
|
|
154
|
+
occurrenceStart: z.string().datetime().optional(),
|
|
155
|
+
occurrenceEnd: z.string().datetime().optional(),
|
|
128
156
|
});
|
|
129
157
|
const withReplyPostSchema = basePublicPostSchema.extend({
|
|
130
158
|
inReplyToId: z.string().optional().nullable(),
|
|
@@ -171,6 +199,7 @@ export const accountCreationDataSchema = z.object({
|
|
|
171
199
|
handle: z.string().min(4).max(255),
|
|
172
200
|
avatar: z.string().url().optional(),
|
|
173
201
|
displayName: profileDataSchema.shape.displayName,
|
|
202
|
+
bot: profileDataSchema.shape.bot,
|
|
174
203
|
}),
|
|
175
204
|
});
|
|
176
205
|
export const accountUpdateDataSchema = z.object({
|
|
@@ -181,8 +210,23 @@ export const accountUpdateDataSchema = z.object({
|
|
|
181
210
|
});
|
|
182
211
|
export const serverInfoSchema = z.object({
|
|
183
212
|
version: z.string(),
|
|
213
|
+
/** Optional CI/image build identifier (`BUILD`). */
|
|
214
|
+
build: z.string().optional(),
|
|
184
215
|
environment: z.string(),
|
|
185
216
|
publicContent: z.boolean(),
|
|
217
|
+
/** Process start time (ISO). */
|
|
218
|
+
startedAt: z.iso.datetime(),
|
|
219
|
+
uptimeSeconds: z.number().nonnegative(),
|
|
220
|
+
/** Local media-folder size and volume free space; null when unreadable. */
|
|
221
|
+
disk: z
|
|
222
|
+
.object({
|
|
223
|
+
folderBytes: z.number().nonnegative(),
|
|
224
|
+
freeBytes: z.number().nonnegative(),
|
|
225
|
+
totalBytes: z.number().nonnegative(),
|
|
226
|
+
})
|
|
227
|
+
.nullable(),
|
|
228
|
+
/** Latest post view (`post_seen.created_at`); null if none yet. */
|
|
229
|
+
lastAccessed: z.iso.datetime().nullable(),
|
|
186
230
|
maxProfiles: z.number().int().nonnegative().optional(),
|
|
187
231
|
communityConfig: communityConfigSchema,
|
|
188
232
|
jams: z.object({
|
|
@@ -207,12 +251,20 @@ export const serverInfoSchema = z.object({
|
|
|
207
251
|
}),
|
|
208
252
|
}),
|
|
209
253
|
}),
|
|
210
|
-
sso: z
|
|
254
|
+
sso: z
|
|
255
|
+
.object({
|
|
256
|
+
onlySSO: z.boolean().optional(),
|
|
257
|
+
generic: z.array(z.object({
|
|
258
|
+
id: z.string(),
|
|
259
|
+
name: z.string(),
|
|
260
|
+
loginLink: z.string(),
|
|
261
|
+
})),
|
|
211
262
|
oidc: z.array(z.object({
|
|
212
263
|
id: z.string(),
|
|
213
264
|
name: z.string(),
|
|
214
265
|
})),
|
|
215
|
-
})
|
|
266
|
+
})
|
|
267
|
+
.optional(),
|
|
216
268
|
});
|
|
217
269
|
export const unseenPostCountsSchema = z.object({
|
|
218
270
|
groups: z.record(z.string(), z.number()),
|
|
@@ -291,6 +343,7 @@ export const registerRequestSchema = z.object({
|
|
|
291
343
|
confirmPassword: z.string().optional(),
|
|
292
344
|
privacyPolicyAccepted: z.boolean(),
|
|
293
345
|
inviteCode: z.string().optional(),
|
|
346
|
+
bot: profileDataSchema.shape.bot,
|
|
294
347
|
});
|
|
295
348
|
export const registerFormSchema = registerRequestSchema
|
|
296
349
|
.refine((data) => data.password === data.confirmPassword, {
|
|
@@ -333,9 +386,10 @@ const focusCoordinatesPattern = /^-?\d+,-?\d+$/;
|
|
|
333
386
|
// they actually got a `File` / `Blob` instance.
|
|
334
387
|
export const mediaStorageRequestSchema = z.object({
|
|
335
388
|
description: z.string().optional(),
|
|
336
|
-
file: z
|
|
337
|
-
|
|
338
|
-
|
|
389
|
+
file: z.any().openapi({
|
|
390
|
+
type: 'string',
|
|
391
|
+
format: 'binary',
|
|
392
|
+
}),
|
|
339
393
|
thumbnail: z
|
|
340
394
|
.any()
|
|
341
395
|
.optional()
|
|
@@ -368,8 +422,21 @@ export const mediaStreamRequestSchema = z
|
|
|
368
422
|
url: z.string().url(),
|
|
369
423
|
})
|
|
370
424
|
.openapi('MediaStreamRequest');
|
|
371
|
-
export const updateProfileRequestSchema = profileDataSchema
|
|
425
|
+
export const updateProfileRequestSchema = profileDataSchema
|
|
426
|
+
.omit({ pinnedPostId: true })
|
|
427
|
+
.partial({
|
|
372
428
|
handle: true,
|
|
429
|
+
})
|
|
430
|
+
.superRefine((value, ctx) => {
|
|
431
|
+
if (value.handle === undefined || value.type === 'federated')
|
|
432
|
+
return;
|
|
433
|
+
if (!accountNameSchema.safeParse(value.handle).success) {
|
|
434
|
+
ctx.addIssue({
|
|
435
|
+
code: 'custom',
|
|
436
|
+
path: ['handle'],
|
|
437
|
+
message: 'Handle must be 1–16 characters: letters, numbers, underscores, or hyphens (no spaces or punctuation)',
|
|
438
|
+
});
|
|
439
|
+
}
|
|
373
440
|
});
|
|
374
441
|
export const updateAccountPasswordRequestSchema = z.object({
|
|
375
442
|
email: z.string().email().optional(),
|
|
@@ -414,6 +481,7 @@ export const publicReportSchema = reportSchema.extend({
|
|
|
414
481
|
export const chronologicalInfiniteQueryParamsSchema = z.object({
|
|
415
482
|
start: z.string().optional(),
|
|
416
483
|
limit: z.coerce.number().optional(),
|
|
484
|
+
format: z.enum(['threaded', 'linear']).optional(),
|
|
417
485
|
});
|
|
418
486
|
export const offsetInfiniteQueryParamsSchema = z.object({
|
|
419
487
|
offset: z.coerce.number().optional(),
|
|
@@ -448,19 +516,19 @@ export const postCreationDataSchema = z.object({
|
|
|
448
516
|
});
|
|
449
517
|
export const postCreationDataFormSchema = postCreationDataSchema
|
|
450
518
|
.refine((data) => {
|
|
451
|
-
if (data.type !==
|
|
519
|
+
if (data.type !== 'event')
|
|
452
520
|
return true;
|
|
453
|
-
if (data.data.type !==
|
|
521
|
+
if (data.data.type !== 'event')
|
|
454
522
|
return true;
|
|
455
523
|
return !!data.data.name;
|
|
456
524
|
}, {
|
|
457
|
-
message:
|
|
458
|
-
path: [
|
|
525
|
+
message: 'Name is required',
|
|
526
|
+
path: ['data', 'name'],
|
|
459
527
|
})
|
|
460
528
|
.refine((data) => {
|
|
461
|
-
if (data.type !==
|
|
529
|
+
if (data.type !== 'event')
|
|
462
530
|
return true;
|
|
463
|
-
if (data.data.type !==
|
|
531
|
+
if (data.data.type !== 'event')
|
|
464
532
|
return true;
|
|
465
533
|
const { start, end } = data.data;
|
|
466
534
|
if (end && start && new Date(end) < new Date(start)) {
|
|
@@ -468,8 +536,8 @@ export const postCreationDataFormSchema = postCreationDataSchema
|
|
|
468
536
|
}
|
|
469
537
|
return true;
|
|
470
538
|
}, {
|
|
471
|
-
message:
|
|
472
|
-
path: [
|
|
539
|
+
message: 'End date cannot be before start date',
|
|
540
|
+
path: ['data', 'end'],
|
|
473
541
|
});
|
|
474
542
|
const answerWithPublicProfileSchema = answerSchema.extend({
|
|
475
543
|
profile: publicProfileSchema,
|
|
@@ -480,6 +548,16 @@ export const paymentCheckoutSchema = successFailureResponseSchema.extend({
|
|
|
480
548
|
export const jamObserverResponseSchema = z.object({
|
|
481
549
|
path: z.string().optional(),
|
|
482
550
|
});
|
|
551
|
+
export const jamRtmpStreamRequestSchema = z.object({
|
|
552
|
+
url: z.string().min(1),
|
|
553
|
+
streamKey: z.string().min(1),
|
|
554
|
+
});
|
|
555
|
+
export const jamRtmpStreamResponseSchema = z.object({
|
|
556
|
+
id: z.string(),
|
|
557
|
+
status: jamRecordingStatusSchema,
|
|
558
|
+
destinationHost: z.string().optional(),
|
|
559
|
+
egressId: z.string().optional(),
|
|
560
|
+
});
|
|
483
561
|
export const accessTokenCreationDataSchema = z.object({
|
|
484
562
|
name: z.string(),
|
|
485
563
|
description: z.string().optional(),
|
package/dist/types/auth.d.ts
CHANGED
|
@@ -14,11 +14,10 @@ export declare const authorizationSchema: z.ZodObject<{
|
|
|
14
14
|
resource: z.ZodObject<{
|
|
15
15
|
type: z.ZodEnum<{
|
|
16
16
|
self: "self";
|
|
17
|
+
"*": "*";
|
|
17
18
|
db: "db";
|
|
18
19
|
jams: "jams";
|
|
19
20
|
profiles: "profiles";
|
|
20
|
-
"*": "*";
|
|
21
|
-
jam: "jam";
|
|
22
21
|
notifications: "notifications";
|
|
23
22
|
posts: "posts";
|
|
24
23
|
groups: "groups";
|
|
@@ -71,11 +70,10 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
71
70
|
resource: z.ZodOptional<z.ZodObject<{
|
|
72
71
|
type: z.ZodEnum<{
|
|
73
72
|
self: "self";
|
|
73
|
+
"*": "*";
|
|
74
74
|
db: "db";
|
|
75
75
|
jams: "jams";
|
|
76
76
|
profiles: "profiles";
|
|
77
|
-
"*": "*";
|
|
78
|
-
jam: "jam";
|
|
79
77
|
notifications: "notifications";
|
|
80
78
|
posts: "posts";
|
|
81
79
|
groups: "groups";
|
|
@@ -87,9 +85,11 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
87
85
|
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>>;
|
|
88
86
|
}, z.core.$strip>>;
|
|
89
87
|
}, z.core.$strip>>;
|
|
88
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
90
89
|
roles: z.ZodArray<z.ZodObject<{
|
|
91
90
|
key: z.ZodString;
|
|
92
91
|
default: z.ZodBoolean;
|
|
92
|
+
baseVersion: z.ZodOptional<z.ZodString>;
|
|
93
93
|
displayName: z.ZodString;
|
|
94
94
|
description: z.ZodOptional<z.ZodString>;
|
|
95
95
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
@@ -139,11 +139,10 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
139
139
|
resource: z.ZodOptional<z.ZodObject<{
|
|
140
140
|
type: z.ZodEnum<{
|
|
141
141
|
self: "self";
|
|
142
|
+
"*": "*";
|
|
142
143
|
db: "db";
|
|
143
144
|
jams: "jams";
|
|
144
145
|
profiles: "profiles";
|
|
145
|
-
"*": "*";
|
|
146
|
-
jam: "jam";
|
|
147
146
|
notifications: "notifications";
|
|
148
147
|
posts: "posts";
|
|
149
148
|
groups: "groups";
|
|
@@ -155,6 +154,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
155
154
|
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>>;
|
|
156
155
|
}, z.core.$strip>>;
|
|
157
156
|
}, z.core.$strip>>;
|
|
157
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
158
158
|
id: z.ZodUUID;
|
|
159
159
|
createdAt: z.ZodISODateTime;
|
|
160
160
|
updatedAt: z.ZodISODateTime;
|
|
@@ -198,11 +198,10 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
198
198
|
resource: z.ZodOptional<z.ZodObject<{
|
|
199
199
|
type: z.ZodEnum<{
|
|
200
200
|
self: "self";
|
|
201
|
+
"*": "*";
|
|
201
202
|
db: "db";
|
|
202
203
|
jams: "jams";
|
|
203
204
|
profiles: "profiles";
|
|
204
|
-
"*": "*";
|
|
205
|
-
jam: "jam";
|
|
206
205
|
notifications: "notifications";
|
|
207
206
|
posts: "posts";
|
|
208
207
|
groups: "groups";
|
|
@@ -214,6 +213,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
214
213
|
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>>;
|
|
215
214
|
}, z.core.$strip>>;
|
|
216
215
|
}, z.core.$strip>>;
|
|
216
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
217
217
|
id: z.ZodUUID;
|
|
218
218
|
createdAt: z.ZodISODateTime;
|
|
219
219
|
updatedAt: z.ZodISODateTime;
|
|
@@ -234,8 +234,9 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
234
234
|
none: "none";
|
|
235
235
|
local: "local";
|
|
236
236
|
member: "member";
|
|
237
|
-
admin: "admin";
|
|
238
237
|
moderator: "moderator";
|
|
238
|
+
admin: "admin";
|
|
239
|
+
owner: "owner";
|
|
239
240
|
invited: "invited";
|
|
240
241
|
}>>>>;
|
|
241
242
|
group: z.ZodObject<{
|
|
@@ -263,6 +264,15 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
263
264
|
followersCount: z.ZodNumber;
|
|
264
265
|
followingCount: z.ZodNumber;
|
|
265
266
|
}, z.core.$strip>;
|
|
267
|
+
blockingIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
268
|
+
blockedByIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
269
|
+
followedHashtags: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
270
|
+
tag: z.ZodOptional<z.ZodString>;
|
|
271
|
+
id: z.ZodUUID;
|
|
272
|
+
createdAt: z.ZodISODateTime;
|
|
273
|
+
updatedAt: z.ZodISODateTime;
|
|
274
|
+
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
275
|
+
}, z.core.$strip>>>;
|
|
266
276
|
id: z.ZodUUID;
|
|
267
277
|
createdAt: z.ZodISODateTime;
|
|
268
278
|
updatedAt: z.ZodISODateTime;
|
|
@@ -315,11 +325,10 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
315
325
|
resource: z.ZodOptional<z.ZodObject<{
|
|
316
326
|
type: z.ZodEnum<{
|
|
317
327
|
self: "self";
|
|
328
|
+
"*": "*";
|
|
318
329
|
db: "db";
|
|
319
330
|
jams: "jams";
|
|
320
331
|
profiles: "profiles";
|
|
321
|
-
"*": "*";
|
|
322
|
-
jam: "jam";
|
|
323
332
|
notifications: "notifications";
|
|
324
333
|
posts: "posts";
|
|
325
334
|
groups: "groups";
|
|
@@ -331,6 +340,7 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
331
340
|
id: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<"*">]>>;
|
|
332
341
|
}, z.core.$strip>>;
|
|
333
342
|
}, z.core.$strip>>;
|
|
343
|
+
pinnedPostId: z.ZodOptional<z.ZodString>;
|
|
334
344
|
id: z.ZodUUID;
|
|
335
345
|
createdAt: z.ZodISODateTime;
|
|
336
346
|
updatedAt: z.ZodISODateTime;
|
|
@@ -347,11 +357,10 @@ export declare const authorizationDataSchema: z.ZodObject<{
|
|
|
347
357
|
resource: z.ZodObject<{
|
|
348
358
|
type: z.ZodEnum<{
|
|
349
359
|
self: "self";
|
|
360
|
+
"*": "*";
|
|
350
361
|
db: "db";
|
|
351
362
|
jams: "jams";
|
|
352
363
|
profiles: "profiles";
|
|
353
|
-
"*": "*";
|
|
354
|
-
jam: "jam";
|
|
355
364
|
notifications: "notifications";
|
|
356
365
|
posts: "posts";
|
|
357
366
|
groups: "groups";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type ObjectType = 'post' | 'group' | 'profile' | 'report' | 'community' | 'accessToken';
|
|
2
2
|
export declare const postRelationships: readonly ["none", "local", "audience", "mentioned", "attendee", "collaborator"];
|
|
3
|
-
export declare const defaultGroupRoles: readonly ["member", "admin", "
|
|
4
|
-
export declare const groupRelationships: readonly ["member", "admin", "
|
|
5
|
-
export declare const profileRelationships: readonly ["none", "local", "self", "following", "followed-by", "blocked-by", "muted-by"];
|
|
3
|
+
export declare const defaultGroupRoles: readonly ["member", "moderator", "admin", "owner"];
|
|
4
|
+
export declare const groupRelationships: readonly ["member", "moderator", "admin", "owner", "none", "local", "invited"];
|
|
5
|
+
export declare const profileRelationships: readonly ["none", "local", "self", "following", "followed-by", "blocked", "blocked-by", "muted-by"];
|
|
6
6
|
export declare const reportRelationships: readonly ["none", "local", "reporter", "reported", "acted-on"];
|
|
7
7
|
export declare const accessTokenRelationships: readonly ["none", "local", "owner"];
|
|
8
8
|
export type PostRelationship = (typeof postRelationships)[number];
|
|
@@ -11,7 +11,14 @@ export type ProfileRelationship = (typeof profileRelationships)[number];
|
|
|
11
11
|
export type ReportRelationship = (typeof reportRelationships)[number];
|
|
12
12
|
export type AccessTokenRelationship = (typeof accessTokenRelationships)[number];
|
|
13
13
|
export declare const postCapabilities: readonly ["core-posts-read", "core-posts-update", "core-posts-delete", "core-posts-vote", "core-posts-react", "core-posts-rsvp", "core-posts-reply", "core-posts-jam-moderate", "core-posts-jam-speak", "core-posts-jam-read"];
|
|
14
|
-
export declare const groupCapabilities: readonly ["core-groups-read", "core-groups-update", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article"];
|
|
14
|
+
export declare const groupCapabilities: readonly ["core-groups-read", "core-groups-update", "core-groups-updateCapabilities", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article"];
|
|
15
|
+
/** Caps an owner can toggle per relationship in the group editor. */
|
|
16
|
+
export declare const groupCapabilityEditorKeys: readonly ["core-groups-read", "core-groups-update", "core-groups-updateCapabilities", "core-groups-delete", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note", "core-posts-create-event", "core-posts-create-poll", "core-posts-create-article", "core-posts-read", "core-posts-delete", "core-posts-react", "core-posts-reply", "core-posts-rsvp", "core-posts-vote", "core-posts-create-*", "core-posts-*", "core-groups-*"];
|
|
17
|
+
/** Owner is omitted — `*` / `core-groups-*` already grants every editor cap. */
|
|
18
|
+
export declare const groupCapabilityEditorRelationships: readonly ["none", "local", "member", "moderator", "admin"];
|
|
19
|
+
/** Explicit admin list — `core-groups-*` would also grant delete and cap edits. */
|
|
20
|
+
export declare const defaultGroupAdminCapabilityAdds: readonly ["core-posts-*", "core-groups-read", "core-groups-update", "core-groups-join", "core-groups-leave", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole"];
|
|
21
|
+
export declare const defaultGroupOwnerCapabilityAdds: readonly ["core-posts-*", "core-groups-*"];
|
|
15
22
|
export declare const profileCapabilities: readonly ["core-profiles-read", "core-profiles-update", "core-profiles-delete", "core-profiles-requestFollow", "core-profiles-follow", "core-profiles-unfollow", "core-profiles-block", "core-profiles-unblock", "core-profiles-mute", "core-profiles-unmute"];
|
|
16
23
|
export declare const reportCapabilities: readonly ["core-reports-create", "core-reports-read"];
|
|
17
24
|
export declare const accessTokenCapabilities: readonly ["core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-delete"];
|
|
@@ -20,5 +27,19 @@ export type GroupCapability = (typeof groupCapabilities)[number];
|
|
|
20
27
|
export type ProfileCapability = (typeof profileCapabilities)[number];
|
|
21
28
|
export type ReportCapability = (typeof reportCapabilities)[number];
|
|
22
29
|
export type AccessTokenCapability = (typeof accessTokenCapabilities)[number];
|
|
23
|
-
export declare const roleCapabilities: readonly ["core-local", "core-accounts-read", "core-accounts-create", "core-accounts-update", "core-accounts-delete", "core-reports-create", "core-reports-update", "core-groups-create", "core-groups-read", "core-groups-delete", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note-local", "core-posts-create-note-public", "core-posts-create-note-direct", "core-posts-create-note-private", "core-posts-create-event-local", "core-posts-create-event-public", "core-posts-create-event-direct", "core-posts-create-event-private", "core-posts-create-poll-local", "core-posts-create-poll-public", "core-posts-create-poll-direct", "core-posts-create-poll-private", "core-posts-create-article-local", "core-posts-create-article-public", "core-posts-create-article-direct", "core-posts-create-article-private", "core-posts-read-local", "core-posts-announce", "core-posts-delete", "core-profiles-read", "core-profiles-roles-update", "core-profiles-delete", "core-profiles-suspend", "core-profiles-update", "core-profiles-impersonate", "core-analytics-read", "core-config-update", "core-config-read", "core-customization-read", "core-customization-update", "core-capabilities-read", "core-capabilities-update", "core-backups-create", "core-backups-read", "core-backups-download", "core-backups-restore", "core-db-access", "core-i18n-update", "core-logs-read", "core-roles-read", "core-roles-update", "core-maintenance-restart", "core-inviteLinks-create", "core-inviteLinks-read", "core-inviteLinks-update", "core-inviteLinks-delete", "core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-update", "core-serviceTokens-delete"];
|
|
30
|
+
export declare const roleCapabilities: readonly ["core-local", "core-accounts-read", "core-accounts-create", "core-accounts-update", "core-accounts-delete", "core-reports-create", "core-reports-update", "core-groups-create", "core-groups-read", "core-groups-delete", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note-local", "core-posts-create-note-public", "core-posts-create-note-direct", "core-posts-create-note-private", "core-posts-create-event-local", "core-posts-create-event-public", "core-posts-create-event-direct", "core-posts-create-event-private", "core-posts-create-poll-local", "core-posts-create-poll-public", "core-posts-create-poll-direct", "core-posts-create-poll-private", "core-posts-create-article-local", "core-posts-create-article-public", "core-posts-create-article-direct", "core-posts-create-article-private", "core-posts-read-local", "core-posts-announce", "core-posts-delete", "core-profiles-read", "core-profiles-roles-update", "core-profiles-delete", "core-profiles-suspend", "core-profiles-update", "core-profiles-impersonate", "core-analytics-read", "core-config-update", "core-config-read", "core-customization-read", "core-customization-update", "core-capabilities-read", "core-capabilities-update", "core-backups-create", "core-backups-read", "core-backups-download", "core-backups-restore", "core-db-access", "core-i18n-update", "core-logs-read", "core-roles-read", "core-roles-update", "core-maintenance-restart", "core-inviteLinks-create", "core-inviteLinks-read", "core-inviteLinks-update", "core-inviteLinks-delete", "core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-update", "core-serviceTokens-delete", "core-plugins-manage"];
|
|
24
31
|
export type RoleCapability = (typeof roleCapabilities)[number];
|
|
32
|
+
/**
|
|
33
|
+
* Capability keys an instance admin can toggle for each role (leaves) plus the
|
|
34
|
+
* wildcard allow-all keys an editor exposes. `*` covers capabilities that do not
|
|
35
|
+
* fall under a `core-<domain>-*` category (e.g. `core-local`).
|
|
36
|
+
*/
|
|
37
|
+
export declare const roleCapabilityEditorKeys: readonly ["core-local", "core-accounts-read", "core-accounts-create", "core-accounts-update", "core-accounts-delete", "core-reports-create", "core-reports-update", "core-groups-create", "core-groups-read", "core-groups-delete", "core-groups-addMember", "core-groups-removeMember", "core-groups-changeMemberRole", "core-posts-create-note-local", "core-posts-create-note-public", "core-posts-create-note-direct", "core-posts-create-note-private", "core-posts-create-event-local", "core-posts-create-event-public", "core-posts-create-event-direct", "core-posts-create-event-private", "core-posts-create-poll-local", "core-posts-create-poll-public", "core-posts-create-poll-direct", "core-posts-create-poll-private", "core-posts-create-article-local", "core-posts-create-article-public", "core-posts-create-article-direct", "core-posts-create-article-private", "core-posts-read-local", "core-posts-announce", "core-posts-delete", "core-profiles-read", "core-profiles-roles-update", "core-profiles-delete", "core-profiles-suspend", "core-profiles-update", "core-profiles-impersonate", "core-analytics-read", "core-config-update", "core-config-read", "core-customization-read", "core-customization-update", "core-capabilities-read", "core-capabilities-update", "core-backups-create", "core-backups-read", "core-backups-download", "core-backups-restore", "core-db-access", "core-i18n-update", "core-logs-read", "core-roles-read", "core-roles-update", "core-maintenance-restart", "core-inviteLinks-create", "core-inviteLinks-read", "core-inviteLinks-update", "core-inviteLinks-delete", "core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-update", "core-serviceTokens-delete", "core-plugins-manage", "*", "core-accounts-*", "core-analytics-*", "core-backups-*", "core-capabilities-*", "core-config-*", "core-customization-*", "core-db-*", "core-groups-*", "core-i18n-*", "core-inviteLinks-*", "core-logs-*", "core-maintenance-*", "core-plugins-*", "core-profiles-*", "core-posts-create-*", "core-posts-*", "core-reports-*", "core-roles-*", "core-serviceTokens-*"];
|
|
38
|
+
/** Capability keys an admin can toggle per relationship for posts. */
|
|
39
|
+
export declare const postCapabilityEditorKeys: readonly ["core-posts-read", "core-posts-update", "core-posts-delete", "core-posts-vote", "core-posts-react", "core-posts-rsvp", "core-posts-reply", "core-posts-jam-moderate", "core-posts-jam-speak", "core-posts-jam-read", "core-posts-*"];
|
|
40
|
+
/** Capability keys an admin can toggle per relationship for profiles. */
|
|
41
|
+
export declare const profileCapabilityEditorKeys: readonly ["core-profiles-read", "core-profiles-update", "core-profiles-delete", "core-profiles-requestFollow", "core-profiles-follow", "core-profiles-unfollow", "core-profiles-block", "core-profiles-unblock", "core-profiles-mute", "core-profiles-unmute", "core-posts-read", "core-posts-update", "core-posts-delete", "core-posts-vote", "core-posts-react", "core-posts-rsvp", "core-posts-reply", "core-posts-jam-moderate", "core-posts-jam-speak", "core-posts-jam-read", "core-profiles-*", "core-posts-*"];
|
|
42
|
+
/** Capability keys an admin can toggle per relationship for reports. */
|
|
43
|
+
export declare const reportCapabilityEditorKeys: readonly ["core-reports-create", "core-reports-read", "core-reports-*"];
|
|
44
|
+
/** Capability keys an admin can toggle per relationship for access tokens. */
|
|
45
|
+
export declare const accessTokenCapabilityEditorKeys: readonly ["core-serviceTokens-create", "core-serviceTokens-read", "core-serviceTokens-delete", "core-serviceTokens-*"];
|
|
@@ -6,7 +6,12 @@ export const postRelationships = [
|
|
|
6
6
|
'attendee',
|
|
7
7
|
'collaborator',
|
|
8
8
|
];
|
|
9
|
-
export const defaultGroupRoles = [
|
|
9
|
+
export const defaultGroupRoles = [
|
|
10
|
+
'member',
|
|
11
|
+
'moderator',
|
|
12
|
+
'admin',
|
|
13
|
+
'owner',
|
|
14
|
+
];
|
|
10
15
|
export const groupRelationships = [
|
|
11
16
|
...defaultGroupRoles,
|
|
12
17
|
'none',
|
|
@@ -19,6 +24,7 @@ export const profileRelationships = [
|
|
|
19
24
|
'self',
|
|
20
25
|
'following',
|
|
21
26
|
'followed-by',
|
|
27
|
+
'blocked',
|
|
22
28
|
'blocked-by',
|
|
23
29
|
'muted-by',
|
|
24
30
|
];
|
|
@@ -45,6 +51,7 @@ export const postCapabilities = [
|
|
|
45
51
|
export const groupCapabilities = [
|
|
46
52
|
'core-groups-read',
|
|
47
53
|
'core-groups-update',
|
|
54
|
+
'core-groups-updateCapabilities',
|
|
48
55
|
'core-groups-delete',
|
|
49
56
|
'core-groups-join',
|
|
50
57
|
'core-groups-leave',
|
|
@@ -56,6 +63,42 @@ export const groupCapabilities = [
|
|
|
56
63
|
'core-posts-create-poll',
|
|
57
64
|
'core-posts-create-article',
|
|
58
65
|
];
|
|
66
|
+
/** Caps an owner can toggle per relationship in the group editor. */
|
|
67
|
+
export const groupCapabilityEditorKeys = [
|
|
68
|
+
...groupCapabilities,
|
|
69
|
+
'core-posts-read',
|
|
70
|
+
'core-posts-delete',
|
|
71
|
+
'core-posts-react',
|
|
72
|
+
'core-posts-reply',
|
|
73
|
+
'core-posts-rsvp',
|
|
74
|
+
'core-posts-vote',
|
|
75
|
+
'core-posts-create-*',
|
|
76
|
+
'core-posts-*',
|
|
77
|
+
'core-groups-*',
|
|
78
|
+
];
|
|
79
|
+
/** Owner is omitted — `*` / `core-groups-*` already grants every editor cap. */
|
|
80
|
+
export const groupCapabilityEditorRelationships = [
|
|
81
|
+
'none',
|
|
82
|
+
'local',
|
|
83
|
+
'member',
|
|
84
|
+
'moderator',
|
|
85
|
+
'admin',
|
|
86
|
+
];
|
|
87
|
+
/** Explicit admin list — `core-groups-*` would also grant delete and cap edits. */
|
|
88
|
+
export const defaultGroupAdminCapabilityAdds = [
|
|
89
|
+
'core-posts-*',
|
|
90
|
+
'core-groups-read',
|
|
91
|
+
'core-groups-update',
|
|
92
|
+
'core-groups-join',
|
|
93
|
+
'core-groups-leave',
|
|
94
|
+
'core-groups-addMember',
|
|
95
|
+
'core-groups-removeMember',
|
|
96
|
+
'core-groups-changeMemberRole',
|
|
97
|
+
];
|
|
98
|
+
export const defaultGroupOwnerCapabilityAdds = [
|
|
99
|
+
'core-posts-*',
|
|
100
|
+
'core-groups-*',
|
|
101
|
+
];
|
|
59
102
|
export const profileCapabilities = [
|
|
60
103
|
'core-profiles-read',
|
|
61
104
|
'core-profiles-update',
|
|
@@ -141,4 +184,55 @@ export const roleCapabilities = [
|
|
|
141
184
|
'core-serviceTokens-read',
|
|
142
185
|
'core-serviceTokens-update',
|
|
143
186
|
'core-serviceTokens-delete',
|
|
187
|
+
'core-plugins-manage',
|
|
188
|
+
];
|
|
189
|
+
/**
|
|
190
|
+
* Capability keys an instance admin can toggle for each role (leaves) plus the
|
|
191
|
+
* wildcard allow-all keys an editor exposes. `*` covers capabilities that do not
|
|
192
|
+
* fall under a `core-<domain>-*` category (e.g. `core-local`).
|
|
193
|
+
*/
|
|
194
|
+
export const roleCapabilityEditorKeys = [
|
|
195
|
+
...roleCapabilities,
|
|
196
|
+
'*',
|
|
197
|
+
'core-accounts-*',
|
|
198
|
+
'core-analytics-*',
|
|
199
|
+
'core-backups-*',
|
|
200
|
+
'core-capabilities-*',
|
|
201
|
+
'core-config-*',
|
|
202
|
+
'core-customization-*',
|
|
203
|
+
'core-db-*',
|
|
204
|
+
'core-groups-*',
|
|
205
|
+
'core-i18n-*',
|
|
206
|
+
'core-inviteLinks-*',
|
|
207
|
+
'core-logs-*',
|
|
208
|
+
'core-maintenance-*',
|
|
209
|
+
'core-plugins-*',
|
|
210
|
+
'core-profiles-*',
|
|
211
|
+
'core-posts-create-*',
|
|
212
|
+
'core-posts-*',
|
|
213
|
+
'core-reports-*',
|
|
214
|
+
'core-roles-*',
|
|
215
|
+
'core-serviceTokens-*',
|
|
216
|
+
];
|
|
217
|
+
/** Capability keys an admin can toggle per relationship for posts. */
|
|
218
|
+
export const postCapabilityEditorKeys = [
|
|
219
|
+
...postCapabilities,
|
|
220
|
+
'core-posts-*',
|
|
221
|
+
];
|
|
222
|
+
/** Capability keys an admin can toggle per relationship for profiles. */
|
|
223
|
+
export const profileCapabilityEditorKeys = [
|
|
224
|
+
...profileCapabilities,
|
|
225
|
+
...postCapabilities,
|
|
226
|
+
'core-profiles-*',
|
|
227
|
+
'core-posts-*',
|
|
228
|
+
];
|
|
229
|
+
/** Capability keys an admin can toggle per relationship for reports. */
|
|
230
|
+
export const reportCapabilityEditorKeys = [
|
|
231
|
+
...reportCapabilities,
|
|
232
|
+
'core-reports-*',
|
|
233
|
+
];
|
|
234
|
+
/** Capability keys an admin can toggle per relationship for access tokens. */
|
|
235
|
+
export const accessTokenCapabilityEditorKeys = [
|
|
236
|
+
...accessTokenCapabilities,
|
|
237
|
+
'core-serviceTokens-*',
|
|
144
238
|
];
|