@smartkomm/plexus-cli 0.1.18 → 0.1.19

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.
@@ -1 +1 @@
1
- 1ed05b1d6d3b3105aed99411f816d92886682495715074569f573f8bb958f142
1
+ 3ded39591e0569fd405566b3337a2b6e7c20b6f78fed3e83fef89190c71ed85f
@@ -118,7 +118,8 @@ try: creating, onboarding or wiping a tenant (`config wipe`, `config prune-offer
118
118
  the `branding …` and `files put|delete` commands (a school sets its branding and
119
119
  library files through `config apply` or in the app), issuing a token for someone
120
120
  else (`tokens create --for`), every `users` command except `users groups`
121
- (the school changes memberships in the app or through `foundation.users`), the mail
121
+ (the school manages its own people with `tenant-users …` and changes memberships in
122
+ the app or through `foundation.users`), the mail
122
123
  delivery monitor (`notifications list|show|retry|self-test`), Stripe Connect and
123
124
  e-signature connections, contract resolvers (contract logic is platform code),
124
125
  retention runs, feedback triage, worker jobs and migrations. A command without
@@ -233,6 +234,7 @@ whole is the operator's (ask them; do not try).
233
234
  | [users/change-login-email.md](references/users/change-login-email.md) | Plattform | Change an account's sign-in address. |
234
235
  | [users/cli-access-for-tenant-admin.md](references/users/cli-access-for-tenant-admin.md) | Mandant + Plattform | Give a school's administrator a CLI token for exactly their tenant (minting it themselves suffices; issuing it for them with `tokens create --for` needs the operator). |
235
236
  | [users/delete-permission-group.md](references/users/delete-permission-group.md) | Mandant | Delete an orphaned permission group. |
237
+ | [users/manage-school-users.md](references/users/manage-school-users.md) | Mandant | List, deactivate (with handover), archive and reactivate the school's users; switch their mail categories, ask for a signature (`tenant-users …`). |
236
238
  | [users/grant-cross-tenant-access.md](references/users/grant-cross-tenant-access.md) | Plattform | Give every user of every tenant access to the test tenant. |
237
239
  | [users/grant-feedback-assignable.md](references/users/grant-feedback-assignable.md) | Plattform | Make a platform admin assignable for feedback. |
238
240
  | [users/set-password.md](references/users/set-password.md) | Plattform | Set or regenerate an existing user's password. |
@@ -1,7 +1,7 @@
1
1
  # plexus-cli command reference
2
2
 
3
3
  Generated from the commands the CLI registers — do not edit; `plexus-cli <command> --help` prints the same.
4
- 276 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
4
+ 286 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
5
5
  `--json` (raw JSON instead of a table) and `--allow-prod` (required for a writing run against production).
6
6
 
7
7
  - [Admission](#admission) (15)
@@ -26,6 +26,7 @@ Generated from the commands the CLI registers — do not edit; `plexus-cli <comm
26
26
  - [Signing](#signing) (13)
27
27
  - [Stammdaten](#stammdaten) (2)
28
28
  - [Stripe](#stripe) (3)
29
+ - [Tenant users](#tenant-users) (10)
29
30
  - [Users](#users) (20)
30
31
  - [Work-Items](#work-items) (5)
31
32
 
@@ -3146,6 +3147,88 @@ What each Träger's Stripe connection can do — `status` is the one the staff p
3146
3147
 
3147
3148
  - **Effect:** read — changes nothing on the deployment
3148
3149
 
3150
+ ## Tenant users
3151
+
3152
+ ### `tenant-users archive <email|userId>`
3153
+
3154
+ Archive a user in this school (groups removed, hidden from lists and pickers) — plan unless --confirm.
3155
+
3156
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3157
+
3158
+ | Option | Description |
3159
+ |---|---|
3160
+ | `--successor <value>` | Who takes over their open applications and tasks (email or account id) — required while they hold any; the dry run lists the candidates. |
3161
+ | `--confirm` | Write (without it, only the handover plan is printed). |
3162
+
3163
+ ### `tenant-users deactivate <email|userId>`
3164
+
3165
+ Deactivate a user in this school (reversible, groups kept but without effect, API tokens revoked) — plan unless --confirm.
3166
+
3167
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3168
+
3169
+ | Option | Description |
3170
+ |---|---|
3171
+ | `--successor <value>` | Who takes over their open applications and tasks (email or account id) — required while they hold any; the dry run lists the candidates. |
3172
+ | `--confirm` | Write (without it, only the handover plan is printed). |
3173
+
3174
+ ### `tenant-users groups list`
3175
+
3176
+ List the school's staff groups — the options of `tenant-users list --group`.
3177
+
3178
+ - **Effect:** read — changes nothing on the deployment
3179
+
3180
+ ### `tenant-users history <email|userId>`
3181
+
3182
+ The Verlauf of one user in the school: who changed what, newest first.
3183
+
3184
+ - **Effect:** read — changes nothing on the deployment
3185
+
3186
+ ### `tenant-users list`
3187
+
3188
+ List the school's users (Administration → Nutzer); archived ones only with --status archived.
3189
+
3190
+ - **Effect:** read — changes nothing on the deployment
3191
+
3192
+ | Option | Description |
3193
+ |---|---|
3194
+ | `--status <value>` | active, deactivated, archived or invited (active, never signed in). |
3195
+ | `--group <value>` | A staff group, by id or exact label (`tenant-users groups list`). |
3196
+ | `--search <value>` | Part of a name or address. |
3197
+
3198
+ ### `tenant-users notifications list <email|userId>`
3199
+
3200
+ A user's personal mail categories in this school and what an internal letter of each does today.
3201
+
3202
+ - **Effect:** read — changes nothing on the deployment
3203
+
3204
+ ### `tenant-users notifications set <email|userId>`
3205
+
3206
+ Switch a user's personal mail categories in this school (the person is told by mail; the latest change, theirs or yours, holds).
3207
+
3208
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
3209
+
3210
+ | Option | Description |
3211
+ |---|---|
3212
+ | `--set <value>` (required) | <category>=on\|off (repeatable). |
3213
+
3214
+ ### `tenant-users reactivate <email|userId>`
3215
+
3216
+ Reactivate a deactivated or archived user in this school (an archived one starts without groups).
3217
+
3218
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
3219
+
3220
+ ### `tenant-users show <email|userId>`
3221
+
3222
+ Show one user of the school: status, groups, last sign-in, whether a signature is stored.
3223
+
3224
+ - **Effect:** read — changes nothing on the deployment
3225
+
3226
+ ### `tenant-users signature request <email|userId>`
3227
+
3228
+ Ask a user by mail to store their own signature — only while none is stored, at most once a day.
3229
+
3230
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
3231
+
3149
3232
  ## Users
3150
3233
 
3151
3234
  ### `accounts email-changes`
@@ -2,7 +2,8 @@
2
2
 
3
3
  **When to use:** a school's own administrator (no platform rights) should run
4
4
  `plexus-cli` for **exactly their tenant**: export, plan and apply its config
5
- (`config export|apply|set`) and its admission offers (`offer …`). Example: the
5
+ (`config export|apply|set`), its admission offers (`offer …`) and its users
6
+ (`tenant-users …`, needs `administration.users.manage`). Example: the
6
7
  administrator of one school group onboarding their own offers.
7
8
 
8
9
  The person gets a `plx_…` token that acts **as them**. It reaches exactly the
@@ -114,4 +115,5 @@ platform`, setup mode (Load N / wipe), `offer delete` (the hard delete).
114
115
 
115
116
  ## Related
116
117
  - [Add a tenant admin](./add-tenant-admin.md) — the login itself.
118
+ - [Manage a school's users](./manage-school-users.md) — what the token does for the school's people.
117
119
  - [Edit a live tenant's offer](../offer/edit-live-tenant-offer.md).
@@ -0,0 +1,101 @@
1
+ # Manage a school's users
2
+
3
+ **When to use:** a school's administrator looks after the people of **their own
4
+ school** from the shell — who is there and in which status, deactivate someone
5
+ who leaves (handing their open work to a colleague), bring them back, switch
6
+ their personal mail categories, ask them to store their signature. The same as
7
+ *Administration → Nutzer* in the app, with the same rules and the same Verlauf.
8
+
9
+ A **school's token suffices**: every `tenant-users` command asks for
10
+ `administration.users.manage` in the school (the `tenant_admin` group holds it);
11
+ a platform operator passes with `_platform.users.manage`. Not here: inviting a
12
+ new person, sending a sign-in link or a password-reset link — those are not in
13
+ the CLI yet; use *Administration → Nutzer* in the app. The `users …` command group
14
+ is the platform's cross-school surface and needs a platform operator.
15
+
16
+ ## Prerequisites
17
+ - A `plx_…` token for your own account and `default_tenant` (or `--tenant <slug>`)
18
+ set — see [CLI access for a tenant admin](./cli-access-for-tenant-admin.md).
19
+ - `--env` is required for every write; prod also needs `--allow-prod`.
20
+ - A person is named by their **sign-in address** or **account id** — never by name.
21
+ An address must name exactly one account in the school, or the command refuses.
22
+
23
+ ## Steps
24
+
25
+ **1 — see the school's users:**
26
+
27
+ ```bash
28
+ plexus-cli --env <env> --tenant <slug> tenant-users list # active + deactivated
29
+ plexus-cli --env <env> --tenant <slug> tenant-users list --status invited # active, never signed in
30
+ plexus-cli --env <env> --tenant <slug> tenant-users list --status archived
31
+ plexus-cli --env <env> --tenant <slug> tenant-users groups list # labels/ids for --group
32
+ plexus-cli --env <env> --tenant <slug> tenant-users list --group "<label>" --search <part>
33
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email>
34
+ ```
35
+
36
+ **2 — deactivate someone, with a handover.** Without `--confirm` the command only
37
+ prints what would move (applications and tasks to the successor, team tasks back
38
+ to the queue) and who may take over:
39
+
40
+ ```bash
41
+ plexus-cli --env <env> --tenant <slug> tenant-users deactivate <email>
42
+ plexus-cli --env <env> --tenant <slug> tenant-users deactivate <email> --successor <colleague-email> --confirm
43
+ ```
44
+
45
+ - Deactivating is reversible: the groups stay, but give no rights; the person's
46
+ API tokens are revoked and do not come back.
47
+ - Archiving works the same way (plan, then `--confirm`), but also removes the
48
+ person's groups and hides them from lists and pickers:
49
+
50
+ ```bash
51
+ plexus-cli --env <env> --tenant <slug> tenant-users archive <email> --successor <colleague-email> --confirm
52
+ ```
53
+ - A published responsibility rule that names the person refuses either change
54
+ until the rule names someone else (workflow editor: „Person ersetzen", then
55
+ publish) — the plan prints that refusal word for word.
56
+
57
+ **3 — bring someone back:**
58
+
59
+ ```bash
60
+ plexus-cli --env <env> --tenant <slug> tenant-users reactivate <email>
61
+ ```
62
+
63
+ A deactivated person gets their groups back at once; an archived one starts
64
+ without groups — assign them in the app (needs `administration.permissions.manage`).
65
+
66
+ **4 — switch their personal mail categories:**
67
+
68
+ ```bash
69
+ plexus-cli --env <env> --tenant <slug> tenant-users notifications list <email>
70
+ plexus-cli --env <env> --tenant <slug> tenant-users notifications set <email> --set <category>=off --set <category>=on
71
+ ```
72
+
73
+ The person is told by mail; they can switch it back themselves, and the latest
74
+ change holds. Sign-in and security mail cannot be switched off.
75
+
76
+ **5 — ask for their signature** (only while none is stored, at most once a day):
77
+
78
+ ```bash
79
+ plexus-cli --env <env> --tenant <slug> tenant-users signature request <email>
80
+ ```
81
+
82
+ Only the person can store, replace or remove their own signature.
83
+
84
+ ## Verify
85
+
86
+ ```bash
87
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email> # status, groups, signature yes/no
88
+ plexus-cli --env <env> --tenant <slug> tenant-users history <email> # one Verlauf row per change
89
+ ```
90
+
91
+ ## Idempotency / gotchas
92
+ - Every change writes one Verlauf row; a mail switch that changes nothing writes none.
93
+ - Nobody changes their own status, and the last active user who may manage users
94
+ cannot be deactivated or archived — the backend refuses with the reason.
95
+ - `--successor` must be someone who may take over (listed under *candidates* in the
96
+ plan); the backend checks it on `--confirm`.
97
+ - `--json` prints the raw rows for scripts.
98
+
99
+ ## Related
100
+ - [CLI access for a tenant admin](./cli-access-for-tenant-admin.md) — the token.
101
+ - [Change, test and publish a responsibility rule](../offer/assignment-rule.md) — replace a person a rule names.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartkomm/plexus-cli",
3
- "version": "0.1.18",
3
+ "version": "0.1.19",
4
4
  "description": "Unified Plexus admin + admission-offer config CLI (Convex backend).",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",