@smartkomm/plexus-cli 0.1.39 → 0.1.41

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
- e79c7ddd2b7ce40782fa3813de5edb28dadf96246635c7b9cd2deacb1c445aed
1
+ 97ed43a07bdbd351b2e176afad2d57b55182eb948a5f0cc68739f55a1d25c6ec
@@ -225,6 +225,7 @@ whole is the operator's (ask them; do not try).
225
225
  | [offer/wire-contract-generator.md](references/offer/wire-contract-generator.md) | Mandant + Plattform | Pin a contract generator or package, cockpit fields, export form fields, re-stamp formExports, test the new version. |
226
226
  | [offer/workflow-default-channels.md](references/offer/workflow-default-channels.md) | Mandant | Fixed team chat channels for every application of an offer. |
227
227
  | [persons/purge-deleted-person.md](references/persons/purge-deleted-person.md) | Plattform | Delete a soft-deleted person for good. |
228
+ | [platform/rename-tenant.md](references/platform/rename-tenant.md) | Plattform | Change a tenant's slug and display name in place, then its accounts' addresses. |
228
229
  | [resolver/manage-contract-package.md](references/resolver/manage-contract-package.md) | Mandant + Plattform | Create, review and seal a contract package from one file by key. |
229
230
  | [resolver/manage-contract-resolver.md](references/resolver/manage-contract-resolver.md) | Mandant | Create, test, seal, assign and revise a contract resolver. |
230
231
  | [resolver/register-input-keys.md](references/resolver/register-input-keys.md) | Plattform | Register the platform-wide contract input keys a generator's fields need. |
@@ -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
- 286 commands. Every network command also takes `--env <local|staging|prod>`, `--tenant <slug>`,
4
+ 287 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)
@@ -31,7 +31,7 @@ Generated from the commands the CLI registers — do not edit; `plexus-cli <comm
31
31
  - [Organisation (school token)](#organisation-school-token) (8)
32
32
  - [Persons (platform operator)](#persons-platform-operator) (1)
33
33
  - [Persons (school token)](#persons-school-token) (1)
34
- - [Platform (platform operator)](#platform-platform-operator) (5)
34
+ - [Platform (platform operator)](#platform-platform-operator) (6)
35
35
  - [Setup (platform operator)](#setup-platform-operator) (5)
36
36
  - [Signing (platform operator)](#signing-platform-operator) (5)
37
37
  - [Signing (school token)](#signing-school-token) (8)
@@ -3070,6 +3070,19 @@ Read the privileged-access log (platform-admin)
3070
3070
  | `--actor <value>` | Employee email to report accesses BY (tenant-scoped) |
3071
3071
  | `--with-actor` | Include the employee identity (needs _platform.audit.readActor) |
3072
3072
 
3073
+ ### `platform tenant rename`
3074
+
3075
+ Change a tenant's slug and name in place (plan unless --confirm)
3076
+
3077
+ - **Right:** platform operator — needs a `_platform.*` right; a school's token is refused
3078
+ - **Effect:** plan by default — writes only with `--confirm` (and `--env`; on production also `--allow-prod`)
3079
+
3080
+ | Option | Description |
3081
+ |---|---|
3082
+ | `--to <value>` (required) | The new slug (the first URL segment). |
3083
+ | `--name <value>` (required) | The new display name. |
3084
+ | `--confirm` | Write the change (without it, only the plan is printed). |
3085
+
3073
3086
  ### `platform workers list`
3074
3087
 
3075
3088
  List live job workers (platform-admin)
@@ -0,0 +1,71 @@
1
+ # Rename a tenant
2
+
3
+ **When to use:** a tenant was created under the wrong name — its slug (the first
4
+ URL segment) and its display name must change, everything else stays. The tenant
5
+ id stays, so applications, persons, units, legal entities and access rows follow
6
+ without a write.
7
+
8
+ ## Prerequisites
9
+ - A platform token with `_platform.config.manage` for the target env
10
+ (`_platform.users.manage` too for step 3).
11
+ - The new slug is free (`plexus-cli --env <env> tenants`) — the verb refuses a
12
+ taken, malformed or reserved slug in the plan already.
13
+ - The backend release that carries `platformAdmin:renameTenant` is live on the env.
14
+
15
+ ## What moves, what refuses, what stays
16
+
17
+ | | |
18
+ |---|---|
19
+ | **Moves in one transaction** | `tenants.slug` + `tenants.name`; `storage_uploads.tenantSlug` (every ticket of the slug); `stripe_payments.returnPath`; each member's and operator's dashboard notepad (prosemirror-sync id embeds the slug — snapshot and later steps are copied, the old document deleted) |
20
+ | **Refuses, naming the reason** | mail of the tenant still `queued`/`sending` (its params carry the old slug — let the queue drain); a Stripe checkout still `requires_session`, `open` or `processing` (its success URL at Stripe names the old slug); any contract generator revision (`implementationKey` begins with the slug and is sealed into contract snapshots); upload tickets or a member's notepad already under the new slug (left by onboarding or a deleted tenant); more rows than one transaction holds (4 000 upload tickets, 2 000 payments, 1 000 accesses, 2 000 notepad steps past their last snapshot) |
21
+ | **Stays as written** | links in mail already sent; bookmarks; rendered mail previews; feedback page paths; GlitchTip tags; settled deliveries; `setup_exports.tenantSlug` (the slug at export time); config exports and setup files taken before the rename; the display name of user accounts; the notepad of someone who no longer has access (the component cannot list documents by prefix) |
22
+
23
+ **There is no redirect from the old slug.** `/<old-slug>/…` answers like any
24
+ unknown tenant; users must use the new URL. A redirect would need former slugs
25
+ stored on the tenant, kept unique against every later slug and resolved by every
26
+ `client` gate — not built.
27
+
28
+ ## Steps
29
+ ```bash
30
+ # 1. Plan — runs every check, writes nothing, prints the count per table
31
+ plexus-cli --env <env> --tenant <old-slug> platform tenant rename --to <new-slug> --name "<New Name>"
32
+
33
+ # 2. Apply (--allow-prod only on prod)
34
+ plexus-cli --env <env> --tenant <old-slug> platform tenant rename --to <new-slug> --name "<New Name>" --confirm --allow-prod
35
+
36
+ # 3. Accounts whose address names the old tenant — the one e-mail change verb.
37
+ # AFTER the rename: set-email queues a notice letter, and queued mail refuses the rename.
38
+ plexus-cli --env <env> --tenant <new-slug> tenant-users list | grep <old-slug>
39
+ plexus-cli --env <env> platform users set-email admin@<old-slug>.plexus.swop.schule --to admin@<new-slug>.plexus.swop.schule
40
+ plexus-cli --env <env> platform users set-email admin@<old-slug>.plexus.swop.schule --to admin@<new-slug>.plexus.swop.schule --confirm --allow-prod
41
+
42
+ # 4. Re-export the config — an export taken before the rename names the old slug,
43
+ # and `config apply` finds a tenant by slug: it would create a SECOND tenant
44
+ plexus-cli --env <env> --tenant <new-slug> config export --out <scratch>/config
45
+ ```
46
+
47
+ ## Verify
48
+ ```bash
49
+ plexus-cli --env <env> tenants # same id, new slug + name; old slug gone
50
+ plexus-cli --env <env> platform users show admin@<new-slug>.plexus.swop.schule # same tenants, now under <new-slug>
51
+ plexus-cli --env <env> platform users show admin@<old-slug>.plexus.swop.schule # → No user with email …
52
+ ```
53
+ Open `https://plexus.swop.schule/<new-slug>` signed in (platform-admin deep link:
54
+ `/login?as=admin@plexus.swop.schule&redirect=/<new-slug>`).
55
+
56
+ URLs change from `https://plexus.swop.schule/<old-slug>/…` to
57
+ `https://plexus.swop.schule/<new-slug>/…`, the applicant portal (`/<new-slug>/e/…`)
58
+ included.
59
+
60
+ ## Gotchas
61
+ - `--tenant` is required explicitly; the configured default tenant is not used.
62
+ - Renaming back (A → B → A) right after a rename: wait a minute — the old
63
+ notepad steps are deleted by a job the notepad component schedules, and under
64
+ the same id it would take the copied ones with it.
65
+ - Subdomain addresses (`admin@<slug>.plexus.swop.schule`) receive no mail — only
66
+ the apex has MX. `set-email` resets the mailbox proof of the new address, so an
67
+ account that signs in by password is unaffected; one that needs a sign-in link
68
+ cannot get it there.
69
+ - The display name of an account (e.g. „<Old Name> Administration") is not part
70
+ of the rename.
71
+ - Unit slugs and legal-entity keys are not touched — they are their own identities.