@byline/admin 3.10.1 → 3.11.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/abilities.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { registerAdminActivityAbilities } from "./modules/admin-activity/abilities.js";
1
2
  import { registerAdminPermissionsAbilities } from "./modules/admin-permissions/abilities.js";
2
3
  import { registerAdminRolesAbilities } from "./modules/admin-roles/abilities.js";
3
4
  import { registerAdminUsersAbilities } from "./modules/admin-users/abilities.js";
@@ -5,5 +6,6 @@ function registerAdminAbilities(registry) {
5
6
  registerAdminUsersAbilities(registry);
6
7
  registerAdminRolesAbilities(registry);
7
8
  registerAdminPermissionsAbilities(registry);
9
+ registerAdminActivityAbilities(registry);
8
10
  }
9
11
  export { registerAdminAbilities };
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ export { registerAdminAbilities } from './abilities.js';
24
24
  export { assertAdminActor, requireAdminActor } from './lib/assert-admin-actor.js';
25
25
  export { type Command, type CreateCommandAuthSpec, type CreateCommandHandlerArgs, type CreateCommandSpec, createCommand, } from './lib/create-command.js';
26
26
  export * from './modules/admin-account/index.js';
27
+ export * from './modules/admin-activity/index.js';
27
28
  export * from './modules/admin-permissions/index.js';
28
29
  export * from './modules/admin-roles/index.js';
29
30
  export * from './modules/admin-users/index.js';
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./modules/admin-account/index.js";
2
+ export * from "./modules/admin-activity/index.js";
2
3
  export * from "./modules/admin-permissions/index.js";
3
4
  export * from "./modules/admin-roles/index.js";
4
5
  export * from "./modules/admin-users/index.js";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+ import type { AbilityRegistry } from '@byline/auth';
9
+ /**
10
+ * Ability keys for the admin-activity module (docs/AUDIT.md — Workstream 4).
11
+ *
12
+ * `read` gates the system-wide activity area — the `/admin/activity` report
13
+ * over the version-stream + audit-log union. It is deliberately a **separate**
14
+ * ability from any collection's `collections.<path>.read`: the activity feed is
15
+ * not reachable transitively from a content ability, so an auditor role can be
16
+ * granted visibility into who-changed-what without being granted read (let
17
+ * alone write) access to the documents themselves.
18
+ *
19
+ * Read-only by design — there is no write counterpart. The audit log is
20
+ * append-only and is written by the lifecycle write-points, never edited.
21
+ */
22
+ export declare const ADMIN_ACTIVITY_ABILITIES: {
23
+ readonly read: "admin.activity.read";
24
+ };
25
+ export type AdminActivityAbilityKey = (typeof ADMIN_ACTIVITY_ABILITIES)[keyof typeof ADMIN_ACTIVITY_ABILITIES];
26
+ /**
27
+ * Called from `registerAdminAbilities(registry)` at package level, which
28
+ * fans out to every admin module's registrar so the webapp wiring stays a
29
+ * single line.
30
+ */
31
+ export declare function registerAdminActivityAbilities(registry: AbilityRegistry): void;
@@ -0,0 +1,13 @@
1
+ const ADMIN_ACTIVITY_ABILITIES = {
2
+ read: 'admin.activity.read'
3
+ };
4
+ function registerAdminActivityAbilities(registry) {
5
+ registry.register({
6
+ key: ADMIN_ACTIVITY_ABILITIES.read,
7
+ label: 'Read system activity',
8
+ description: "View the system-wide activity report — content saves and audit-log events (status / path / locale changes, deletions) across all collections.",
9
+ group: 'admin.activity',
10
+ source: 'admin'
11
+ });
12
+ }
13
+ export { ADMIN_ACTIVITY_ABILITIES, registerAdminActivityAbilities };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+ /**
9
+ * `@byline/admin/admin-activity` — the system-wide activity area
10
+ * (docs/AUDIT.md — Workstream 4).
11
+ *
12
+ * Unlike the other admin modules this one owns no table and no AdminStore
13
+ * repository: the activity feed is a read over the document db adapter's
14
+ * version stream + audit log (`IAuditQueries.findAuditLog`), assembled at the
15
+ * host transport layer. This module contributes only the `admin.activity.read`
16
+ * ability — registered at `initBylineCore()` time through the `AbilityRegistry`
17
+ * — so the feed is grantable independently of any content ability.
18
+ */
19
+ export { ADMIN_ACTIVITY_ABILITIES, type AdminActivityAbilityKey, registerAdminActivityAbilities, } from './abilities.js';
@@ -0,0 +1 @@
1
+ export { ADMIN_ACTIVITY_ABILITIES, registerAdminActivityAbilities } from "./abilities.js";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@byline/admin",
3
3
  "private": false,
4
4
  "license": "MPL-2.0",
5
- "version": "3.10.1",
5
+ "version": "3.11.0",
6
6
  "engines": {
7
7
  "node": ">=20.9.0"
8
8
  },
@@ -146,10 +146,10 @@
146
146
  "uuid": "^14.0.0",
147
147
  "zod": "^4.4.3",
148
148
  "zod-form-data": "^3.0.1",
149
- "@byline/auth": "3.10.1",
150
- "@byline/core": "3.10.1",
151
- "@byline/i18n": "3.10.1",
152
- "@byline/ui": "3.10.1"
149
+ "@byline/auth": "3.11.0",
150
+ "@byline/core": "3.11.0",
151
+ "@byline/i18n": "3.11.0",
152
+ "@byline/ui": "3.11.0"
153
153
  },
154
154
  "peerDependencies": {
155
155
  "react": "^19.0.0",
package/src/abilities.ts CHANGED
@@ -8,6 +8,7 @@
8
8
 
9
9
  import type { AbilityRegistry } from '@byline/auth'
10
10
 
11
+ import { registerAdminActivityAbilities } from './modules/admin-activity/abilities.js'
11
12
  import { registerAdminPermissionsAbilities } from './modules/admin-permissions/abilities.js'
12
13
  import { registerAdminRolesAbilities } from './modules/admin-roles/abilities.js'
13
14
  import { registerAdminUsersAbilities } from './modules/admin-users/abilities.js'
@@ -28,5 +29,6 @@ export function registerAdminAbilities(registry: AbilityRegistry): void {
28
29
  registerAdminUsersAbilities(registry)
29
30
  registerAdminRolesAbilities(registry)
30
31
  registerAdminPermissionsAbilities(registry)
32
+ registerAdminActivityAbilities(registry)
31
33
  // registerAccountAbilities(registry) — added when that module lands
32
34
  }
package/src/index.ts CHANGED
@@ -32,6 +32,7 @@ export {
32
32
  createCommand,
33
33
  } from './lib/create-command.js'
34
34
  export * from './modules/admin-account/index.js'
35
+ export * from './modules/admin-activity/index.js'
35
36
  export * from './modules/admin-permissions/index.js'
36
37
  export * from './modules/admin-roles/index.js'
37
38
  export * from './modules/admin-users/index.js'
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ import type { AbilityRegistry } from '@byline/auth'
10
+
11
+ /**
12
+ * Ability keys for the admin-activity module (docs/AUDIT.md — Workstream 4).
13
+ *
14
+ * `read` gates the system-wide activity area — the `/admin/activity` report
15
+ * over the version-stream + audit-log union. It is deliberately a **separate**
16
+ * ability from any collection's `collections.<path>.read`: the activity feed is
17
+ * not reachable transitively from a content ability, so an auditor role can be
18
+ * granted visibility into who-changed-what without being granted read (let
19
+ * alone write) access to the documents themselves.
20
+ *
21
+ * Read-only by design — there is no write counterpart. The audit log is
22
+ * append-only and is written by the lifecycle write-points, never edited.
23
+ */
24
+ export const ADMIN_ACTIVITY_ABILITIES = {
25
+ read: 'admin.activity.read',
26
+ } as const
27
+
28
+ export type AdminActivityAbilityKey =
29
+ (typeof ADMIN_ACTIVITY_ABILITIES)[keyof typeof ADMIN_ACTIVITY_ABILITIES]
30
+
31
+ /**
32
+ * Called from `registerAdminAbilities(registry)` at package level, which
33
+ * fans out to every admin module's registrar so the webapp wiring stays a
34
+ * single line.
35
+ */
36
+ export function registerAdminActivityAbilities(registry: AbilityRegistry): void {
37
+ registry.register({
38
+ key: ADMIN_ACTIVITY_ABILITIES.read,
39
+ label: 'Read system activity',
40
+ description:
41
+ 'View the system-wide activity report — content saves and audit-log ' +
42
+ 'events (status / path / locale changes, deletions) across all collections.',
43
+ group: 'admin.activity',
44
+ source: 'admin',
45
+ })
46
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * This Source Code is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
+ *
6
+ * Copyright (c) Infonomic Company Limited
7
+ */
8
+
9
+ /**
10
+ * `@byline/admin/admin-activity` — the system-wide activity area
11
+ * (docs/AUDIT.md — Workstream 4).
12
+ *
13
+ * Unlike the other admin modules this one owns no table and no AdminStore
14
+ * repository: the activity feed is a read over the document db adapter's
15
+ * version stream + audit log (`IAuditQueries.findAuditLog`), assembled at the
16
+ * host transport layer. This module contributes only the `admin.activity.read`
17
+ * ability — registered at `initBylineCore()` time through the `AbilityRegistry`
18
+ * — so the feed is grantable independently of any content ability.
19
+ */
20
+
21
+ export {
22
+ ADMIN_ACTIVITY_ABILITIES,
23
+ type AdminActivityAbilityKey,
24
+ registerAdminActivityAbilities,
25
+ } from './abilities.js'