@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.
@@ -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. */