@openpeepshq/common 0.29.0 → 0.31.0
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.js +19 -6
- package/dist/lib/postHelpers.d.ts +10 -2
- package/dist/lib/postHelpers.js +13 -2
- package/dist/types/api.d.ts +78 -0
- package/dist/types/api.js +6 -0
- package/dist/types/auditLog.d.ts +33 -0
- package/dist/types/auditLog.js +32 -0
- package/dist/types/capabilities.d.ts +2 -2
- package/dist/types/capabilities.js +2 -0
- package/dist/types/db.d.ts +8 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/internal.d.ts +4 -0
- package/dist/types/models.d.ts +2 -0
- package/dist/types/models.js +2 -0
- package/dist/types/notifications.d.ts +1 -0
- package/dist/types/roleDefaults.js +17 -0
- package/dist/types/stats.d.ts +72 -0
- package/package.json +1 -1
- package/src/lib/adminSections.ts +5 -0
- package/src/lib/capabilitiesHelpers.ts +18 -2
- package/src/lib/postHelpers.ts +14 -2
- package/src/types/api.ts +6 -0
- package/src/types/auditLog.ts +41 -0
- package/src/types/capabilities.ts +2 -0
- package/src/types/index.ts +1 -0
- package/src/types/internal.ts +4 -0
- package/src/types/models.ts +2 -0
- package/src/types/roleDefaults.ts +26 -0
package/src/types/models.ts
CHANGED
|
@@ -736,6 +736,8 @@ export const postDataSchema = z.object({
|
|
|
736
736
|
capabilitiesNeeded: z.string().array().optional(),
|
|
737
737
|
data: postDataUnionSchema.optional(),
|
|
738
738
|
creatorId: z.string(),
|
|
739
|
+
/** ISO publish timestamp; null/absent while the post is a draft. */
|
|
740
|
+
publishedAt: z.string().datetime().optional().nullable(),
|
|
739
741
|
});
|
|
740
742
|
export type PostData = z.infer<typeof postDataSchema>;
|
|
741
743
|
export const postSchema = modelSchema(postDataSchema);
|
|
@@ -139,6 +139,19 @@ const adminCanManageFederation = (roles: RoleData[]): RoleData[] =>
|
|
|
139
139
|
: role,
|
|
140
140
|
);
|
|
141
141
|
|
|
142
|
+
const adminCanReadAuditLog = (roles: RoleData[]): RoleData[] =>
|
|
143
|
+
roles.map((role) =>
|
|
144
|
+
role.key === 'admin'
|
|
145
|
+
? {
|
|
146
|
+
...role,
|
|
147
|
+
capabilities: {
|
|
148
|
+
add: [...(role.capabilities?.add ?? []), 'core-auditLog-read'],
|
|
149
|
+
remove: [...(role.capabilities?.remove ?? [])],
|
|
150
|
+
},
|
|
151
|
+
}
|
|
152
|
+
: role,
|
|
153
|
+
);
|
|
154
|
+
|
|
142
155
|
export const roleDefaultsHistory: RoleDefaultsVersion[] = [
|
|
143
156
|
{
|
|
144
157
|
version: '2026-10-06',
|
|
@@ -155,6 +168,19 @@ export const roleDefaultsHistory: RoleDefaultsVersion[] = [
|
|
|
155
168
|
adminCanManageFederation(adminCanManageMedia(builtinRoles)),
|
|
156
169
|
),
|
|
157
170
|
},
|
|
171
|
+
{
|
|
172
|
+
// Appended (never edited in place): a stored role anchored at
|
|
173
|
+
// '2026-11-26' rebases against this entry's baseline, which is
|
|
174
|
+
// what makes `rebaseRoleToCurrentDefaults` grant `core-auditLog-read`
|
|
175
|
+
// to customized admin roles.
|
|
176
|
+
version: '2026-11-27',
|
|
177
|
+
roles: versionedRoles(
|
|
178
|
+
'2026-11-27',
|
|
179
|
+
adminCanReadAuditLog(
|
|
180
|
+
adminCanManageFederation(adminCanManageMedia(builtinRoles)),
|
|
181
|
+
),
|
|
182
|
+
),
|
|
183
|
+
},
|
|
158
184
|
];
|
|
159
185
|
|
|
160
186
|
/** The current (last) version — the one in use. */
|