@smartkomm/plexus-cli 0.1.33 → 0.1.34

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
- 813edf9dc8e6e04f68ce3219db5546a854bfea5a75a251a7acba9a984965e65a
1
+ 61c290e371b0fa98a247559cf6e15b83e499adde8bbebfbc277078b3a60c8f14
@@ -198,7 +198,7 @@ whole is the operator's (ask them; do not try).
198
198
  | [offer/add-workflow-node.md](references/offer/add-workflow-node.md) | Mandant | Insert a node (approval, form, contract, collectPayment, end …) into the workflow. |
199
199
  | [offer/addresses.md](references/offer/addresses.md) | Mandant | How a node reads by full address ($node…, $task…, $derived…, $env…), which flag sets which field, and the gate codes. |
200
200
  | [offer/appointment-task.md](references/offer/appointment-task.md) | Mandant | Give a booked appointment its appointment task (held by the host, due N days after the end). |
201
- | [offer/assignment-rule.md](references/offer/assignment-rule.md) | Mandant + Plattform | Change, test and publish who is responsible per slot; replace a person who leaves (`users unset-group` runs with the school's token). |
201
+ | [offer/assignment-rule.md](references/offer/assignment-rule.md) | Mandant + Plattform | Change, test and publish who is responsible per slot; replace a person who leaves (`tenant-users groups revoke`). |
202
202
  | [offer/attach-form-to-workflow.md](references/offer/attach-form-to-workflow.md) | Mandant | Bind an existing or new SmartForm to a form node. |
203
203
  | [offer/author-form-scenarios.md](references/offer/author-form-scenarios.md) | Mandant | Add a form's test scenarios and $env variables. |
204
204
  | [offer/author-manifest-meta.md](references/offer/author-manifest-meta.md) | Mandant | Set the selection config and display order of an offer. |
@@ -244,7 +244,8 @@ whole is the operator's (ask them; do not try).
244
244
  | [users/change-login-email.md](references/users/change-login-email.md) | Plattform | Change an account's sign-in address. |
245
245
  | [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). |
246
246
  | [users/delete-permission-group.md](references/users/delete-permission-group.md) | Mandant | Delete an orphaned permission group. |
247
- | [users/manage-school-users.md](references/users/manage-school-users.md) | Mandant | List, invite, deactivate (with handover), archive and reactivate the school's users; send a sign-in or password-reset link, switch their mail categories, ask for a signature (`tenant-users …`). |
247
+ | [users/manage-school-users.md](references/users/manage-school-users.md) | Mandant | List, invite, deactivate (with handover), archive and reactivate the school's users; send a sign-in or password-reset link, switch their mail categories, ask for a signature, give or take groups (`tenant-users …`). |
248
+ | [users/set-staff-config-key.md](references/users/set-staff-config-key.md) | Mandant | Give a staff member the config key rules and the configuration name them by (`tenant-users set-key`, `invite --key`). |
248
249
  | [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. |
249
250
  | [users/grant-feedback-assignable.md](references/users/grant-feedback-assignable.md) | Plattform | Make a platform admin assignable for feedback. |
250
251
  | [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
- 284 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
4
+ 285 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 (offline)](#admission-offline) (1)
@@ -37,9 +37,9 @@ Generated from the commands the CLI registers — do not edit; `plexus-cli <comm
37
37
  - [Signing (school token)](#signing-school-token) (8)
38
38
  - [Stammdaten (platform operator)](#stammdaten-platform-operator) (2)
39
39
  - [Stripe (school token)](#stripe-school-token) (3)
40
- - [Tenant users (school token)](#tenant-users-school-token) (14)
40
+ - [Tenant users (school token)](#tenant-users-school-token) (17)
41
41
  - [Users (platform operator)](#users-platform-operator) (15)
42
- - [Users (school token)](#users-school-token) (5)
42
+ - [Users (school token)](#users-school-token) (3)
43
43
  - [Work-Items (school token)](#work-items-school-token) (5)
44
44
 
45
45
  ## Admission (offline)
@@ -3371,6 +3371,18 @@ Deactivate a user in this school (reversible, groups kept but without effect, AP
3371
3371
  | `--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. |
3372
3372
  | `--confirm` | Write (without it, only the handover plan is printed). |
3373
3373
 
3374
+ ### `tenant-users groups add <email|userId>`
3375
+
3376
+ Add a user of the school to a permission group, school-wide or in one unit (needs administration.permissions.manage).
3377
+
3378
+ - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3379
+ - **Effect:** write — needs `--env`; on production also `--allow-prod`
3380
+
3381
+ | Option | Description |
3382
+ |---|---|
3383
+ | `--group <value>` (required) | A staff group, by key, id or exact label (`tenant-users groups list`). |
3384
+ | `--unit <value>` | The unit the group applies in, by key (`tenant-users units list`); school-wide without it. |
3385
+
3374
3386
  ### `tenant-users groups list`
3375
3387
 
3376
3388
  List the school's staff groups — the options of `tenant-users list --group` and `tenant-users invite --group`.
@@ -3378,6 +3390,20 @@ List the school's staff groups — the options of `tenant-users list --group` an
3378
3390
  - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3379
3391
  - **Effect:** read — changes nothing on the deployment
3380
3392
 
3393
+ ### `tenant-users groups revoke <email|userId>`
3394
+
3395
+ Remove a user of the school from a permission group (needs administration.permissions.manage) — plan unless --confirm; the last staff group ends their staff status.
3396
+
3397
+ - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3398
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3399
+
3400
+ | Option | Description |
3401
+ |---|---|
3402
+ | `--group <value>` (required) | The group, by key, id or exact label. |
3403
+ | `--unit <value>` | The membership's unit, by key; the school-wide membership without it. |
3404
+ | `--successor <value>` | Who takes over their open applications and tasks (email or account id), when this ends their staff status. |
3405
+ | `--confirm` | Write (without it, only the plan is printed). |
3406
+
3381
3407
  ### `tenant-users history <email|userId>`
3382
3408
 
3383
3409
  The Verlauf of one user in the school: who changed what, newest first.
@@ -3400,6 +3426,7 @@ Invite a new member of staff to this school: account, access and a one-time sign
3400
3426
  | `--language <value>` (required) | de or en — the letters' language of a new account. |
3401
3427
  | `--group <value>` | A staff group, by key, id or exact label (`tenant-users groups list`); needs administration.permissions.manage. |
3402
3428
  | `--unit <value>` | The group's unit, by its key (`tenant-users units list`); only with --group. |
3429
+ | `--key <value>` | The person's config key — the handle assignment rules and tenant config name them by (unique in the school; see `tenant-users set-key`). |
3403
3430
  | `--confirm` | Write and mail (without it, only the plan is printed). |
3404
3431
 
3405
3432
  ### `tenant-users list`
@@ -3454,9 +3481,21 @@ Mail a user of this school a password-reset link (active users only); only the p
3454
3481
  - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3455
3482
  - **Effect:** write — needs `--env`; on production also `--allow-prod`
3456
3483
 
3484
+ ### `tenant-users set-key <email|userId>`
3485
+
3486
+ Set a staff member's config key — the handle assignment rules and tenant config name them by (unique in the school) — plan unless --confirm.
3487
+
3488
+ - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3489
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3490
+
3491
+ | Option | Description |
3492
+ |---|---|
3493
+ | `--key <value>` (required) | Lower-case letters, digits, - and _, starting with a letter (at most 64). |
3494
+ | `--confirm` | Write (without it, only the plan is printed). |
3495
+
3457
3496
  ### `tenant-users show <email|userId>`
3458
3497
 
3459
- Show one user of the school: status, groups, last sign-in, whether a signature is stored.
3498
+ Show one user of the school: status, groups, config key (and who gave it), last sign-in, whether a signature is stored.
3460
3499
 
3461
3500
  - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3462
3501
  - **Effect:** read — changes nothing on the deployment
@@ -3678,29 +3717,6 @@ Delete a tenant permission group (hard; refuses while in use).
3678
3717
  |---|---|
3679
3718
  | `--confirm` | Required: actually delete (else dry-run) |
3680
3719
 
3681
- ### `users set-group <email>`
3682
-
3683
- Add a user to a permission group in a tenant.
3684
-
3685
- - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3686
- - **Effect:** write — needs `--env`; on production also `--allow-prod`
3687
-
3688
- | Option | Description |
3689
- |---|---|
3690
- | `--group <value>` (required) | Permission group key. |
3691
-
3692
- ### `users unset-group <email>`
3693
-
3694
- Remove a user from a permission group in a tenant.
3695
-
3696
- - **Right:** school token — a module permission inside one school (the school's own administrator runs it)
3697
- - **Effect:** write — needs `--env`; on production also `--allow-prod`
3698
-
3699
- | Option | Description |
3700
- |---|---|
3701
- | `--group <value>` (required) | Permission group key. |
3702
- | `--replace-with <value>` | configKey of the staff member who takes over their active applications — required while they are responsible for any. A rule naming them refuses regardless: change it first (workflow editor: „Person ersetzen“, then publish) |
3703
-
3704
3720
  ## Work-Items (school token)
3705
3721
 
3706
3722
  ### `work-items assign <workItemId>`
@@ -131,7 +131,7 @@ a fixed person.
131
131
 
132
132
  ## A staff member leaves
133
133
 
134
- A person a rule names — as a row's person or in a „Reihum" pool — cannot leave the staff (`platform users revoke`, `users unset-group`,
134
+ A person a rule names — as a row's person or in a „Reihum" pool — cannot leave the staff (`platform users revoke`, `tenant-users groups revoke`,
135
135
  `platform users archive`), leave a team whose slot names them, and a team a rule has a slot
136
136
  for cannot be deleted — refused (`[CONFLICT] [assignment/ruleReferences] …`), naming offer
137
137
  (label + status), slot and row. The check reads every `wip` and published offer
@@ -144,11 +144,11 @@ version (archived ones only run pinned test starts, which fail loud instead). Or
144
144
  3. Only then remove the group membership:
145
145
 
146
146
  ```bash
147
- plexus-cli --env staging --tenant <slug> users unset-group ada@example.com --group sekretariat \
148
- --replace-with <successorConfigKey>
147
+ plexus-cli --env staging --tenant <slug> tenant-users groups revoke ada@example.com --group sekretariat \
148
+ --successor <successor-email> --confirm
149
149
  ```
150
150
 
151
- `--replace-with` only hands the person's **active applications** over (required
151
+ `--successor` only hands the person's **active applications** over (required
152
152
  while they are responsible for any); it never rewrites a rule.
153
153
  4. Nothing to export or keep elsewhere — the server is the source of truth.
154
154
 
@@ -61,7 +61,7 @@ sequence, and the address never reaches the visible text.
61
61
  - The password is shown **once**; if you didn't capture it, re-run with `--out …`
62
62
  to mint a fresh one.
63
63
  - This both **grants tenant access and creates a login credential** — contrast
64
- `platform users grant` / `users set-group`, which only adjust access and group membership for
64
+ `platform users grant` / `tenant-users groups add`, which only adjust access and group membership for
65
65
  a user who already exists. `platform users grant` REFUSES an unknown address (it
66
66
  has no name or password channel, so any identity it created could never log in);
67
67
  provision the account first, here.
@@ -9,7 +9,7 @@ create and rename but **not** delete.
9
9
  - A stray group ("Neue Berechtigungsgruppe") with no members.
10
10
  - A team that was retired and whose work has been re-pointed elsewhere.
11
11
 
12
- Not for: taking someone's access away — that is `users unset-group` (leave the
12
+ Not for: taking someone's access away — that is `tenant-users groups revoke` (leave the
13
13
  group, keep the tenant) or `platform users revoke` (revoke tenant access).
14
14
 
15
15
  ## Prerequisites
@@ -46,7 +46,7 @@ platform operator can confirm it in a `config export` (`foundation.permissionGro
46
46
 
47
47
  | Refusal | Meaning | Fix first |
48
48
  |---|---|---|
49
- | `has-members` | Someone is still in the group (the message names them) | `users unset-group` each |
49
+ | `has-members` | Someone is still in the group (the message names them) | `tenant-users groups revoke` each |
50
50
  | `owns-teams` | A running application binds this group as a work owner | Re-assign those applications |
51
51
  | `referenced-by-workflow` | A stored graph routes a decision/assign (or a not-yet-migrated legacy team-owner binding) to this key | Re-point the node, re-publish |
52
52
  | `structural` | It is `tenant_admin` | — (never deletable) |
@@ -60,7 +60,7 @@ plexus-cli --env <env> --tenant <slug> tenant-users reactivate <email>
60
60
  ```
61
61
 
62
62
  A deactivated person gets their groups back at once; an archived one starts
63
- without groups — assign them in the app (needs `administration.permissions.manage`).
63
+ without groups — give them with step 8 (needs `administration.permissions.manage`).
64
64
 
65
65
  **4 — invite a new person.** Without `--confirm` the command only prints whom it
66
66
  would invite, in which group and unit; with it, the account and the access are
@@ -115,10 +115,27 @@ plexus-cli --env <env> --tenant <slug> tenant-users signature request <email>
115
115
 
116
116
  Only the person can store, replace or remove their own signature.
117
117
 
118
+ **8 — give or take a permission group** (needs `administration.permissions.manage`
119
+ as well — tenant-wide for a group without `--unit`, for that unit with it):
120
+
121
+ ```bash
122
+ plexus-cli --env <env> --tenant <slug> tenant-users groups add <email> --group <key> [--unit <unit-key>]
123
+ plexus-cli --env <env> --tenant <slug> tenant-users groups revoke <email> --group <key> [--unit <unit-key>]
124
+ plexus-cli --env <env> --tenant <slug> tenant-users groups revoke <email> --group <key> --successor <colleague-email> --confirm
125
+ ```
126
+
127
+ `groups revoke` plans unless `--confirm`. If it takes the person's last staff
128
+ group they leave the staff: refused while a responsibility rule names them, and
129
+ their open applications and tasks need `--successor` (the plan of
130
+ `tenant-users deactivate <email>` lists what would move and who may take over).
131
+
132
+ **9 — give them a config key** — the handle responsibility rules and the
133
+ configuration name them by: [Give a staff member a config key](./set-staff-config-key.md).
134
+
118
135
  ## Verify
119
136
 
120
137
  ```bash
121
- plexus-cli --env <env> --tenant <slug> tenant-users show <email> # status, groups, signature yes/no
138
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email> # status, groups, key, signature yes/no
122
139
  plexus-cli --env <env> --tenant <slug> tenant-users history <email> # one Verlauf row per change
123
140
  ```
124
141
 
@@ -0,0 +1,70 @@
1
+ # Give a staff member a config key
2
+
3
+ **When to use:** a responsibility rule or the school's configuration must name a
4
+ member of staff — and that person has no key yet (they were invited in the app or
5
+ the CLI), or their key should read better than a drawn `staff_…` one. The key is
6
+ the stable handle rules and configuration name a person by: it survives a change
7
+ of the sign-in address, never their name.
8
+
9
+ A **school's token suffices**: `tenant-users set-key` asks for
10
+ `administration.users.manage` in the school, like every `tenant-users` command.
11
+
12
+ ## Prerequisites
13
+ - A `plx_…` token and `default_tenant` (or `--tenant <slug>`) — see
14
+ [CLI access for a tenant admin](./cli-access-for-tenant-admin.md).
15
+ - `--env` is required for every write; prod also needs `--allow-prod`.
16
+ - The person is a user of the school (`tenant-users list`), not archived.
17
+
18
+ ## Steps
19
+
20
+ **1 — see who holds which key** (the `key` column names who gave it: `config` —
21
+ declared in the configuration, `rule` — drawn when a rule picked the person,
22
+ `admin` — set in the user administration):
23
+
24
+ ```bash
25
+ plexus-cli --env <env> --tenant <slug> tenant-users list
26
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email>
27
+ ```
28
+
29
+ **2 — set the key.** Without `--confirm` the command prints the old and the new
30
+ key; with it, the key is written and one Verlauf row records it:
31
+
32
+ ```bash
33
+ plexus-cli --env <env> --tenant <slug> tenant-users set-key <email> --key <key>
34
+ plexus-cli --env <env> --tenant <slug> tenant-users set-key <email> --key <key> --confirm
35
+ ```
36
+
37
+ A new member can get the key with the invitation:
38
+
39
+ ```bash
40
+ plexus-cli --env <env> --tenant <slug> tenant-users invite --first-name <first> --last-name <last> --email <email> --language de --key <key> --confirm
41
+ ```
42
+
43
+ In the app: *Administration → Nutzer* → the person → *Konto* → *Schlüssel* →
44
+ „Ändern".
45
+
46
+ ## Verify
47
+
48
+ ```bash
49
+ plexus-cli --env <env> --tenant <slug> tenant-users show <email> # key <key> (admin)
50
+ plexus-cli --env <env> --tenant <slug> tenant-users history <email> # key … → <key>
51
+ ```
52
+
53
+ ## Idempotency / gotchas
54
+ - A key is lower-case letters, digits, `-` and `_`, starts with a letter and has
55
+ at most 64 characters (`[tenantUsers/configKey]` otherwise).
56
+ - A key names one person per school: a key someone else holds is refused, naming
57
+ them (`[tenantUsers/configKeyTaken]`) — nothing is taken away from anyone.
58
+ - Renaming a key a responsibility rule names is refused
59
+ (`[assignment/ruleReferences]`, the same refusal as for a configuration that
60
+ re-keys the person): change the rule first (workflow editor, then publish).
61
+ - Setting the key the person already holds changes nothing and writes no Verlauf row.
62
+ - A key declared in the configuration stays the configuration's: the next
63
+ `config apply` writes the configured key back. Change it there instead
64
+ (`config export`, edit `foundation.users`, `config apply`).
65
+ - A key set here (or drawn by a rule) does not make the person a configuration
66
+ user: `config export` leaves them out of `foundation.users`.
67
+
68
+ ## Related
69
+ - [Manage a school's users](./manage-school-users.md) — invite, groups, deactivate.
70
+ - [Change, test and publish a responsibility rule](../offer/assignment-rule.md) — rules name people by this key.