@ubercode/channelvault 0.3.0-rc.4 → 0.3.0-rc.5
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/CHANGELOG.md +18 -0
- package/README.md +6 -4
- package/dist/cli.js +421 -165
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@ubercode/channelvault` are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the version follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
+
## [0.3.0-rc.5] — 2026-11-27
|
|
6
|
+
|
|
7
|
+
Release candidate, published under the npm `next` tag.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`push --config-map-key <name>`** (repeatable) pushes named configuration-map keys without `--whole-server` ([#24](https://github.com/MichaelLeeHobbs/channelvault/issues/24)). Alone it pushes only those keys; with `--channel`, `--library` or `--global-scripts` it pushes them too. The plan lists each key, never its value. The push backs up first (the undo includes `--overwrite-config-map`), reads the server's map again right before the save, keeps every other key as the server holds it, saves the keys before any channel, and checks the map afterwards. A named key edited, created or deleted on the server since the last pull is refused unless `--force`; removing a key needs `--allow-deletes`.
|
|
12
|
+
- `pull`, `adopt` and `push --whole-server --overwrite-config-map` record a hash of each configuration-map key per installation in `~/.channelvault/config-map-baselines/` (owner-only, outside the tree; never the value). Without one on this machine a key push is refused until a pull or adopt (or `--force`).
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- `diff` and a plain scoped `push` compare the configuration map by key: Mirth returns it in its own order, so a key added anywhere but last no longer reads as a difference after it is pushed.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **`diff` no longer reports every secret as drifted when the checkout has no env file.** When a placeholder compared with the server can't be filled from the env file or the environment, `diff` exits 2 (was 1): `[env-missing]` names the env file it looked for, `[env-incomplete]` names the variables an existing env file lacks, and both suggest `--dotenv` or a profile `dotenv`. Placeholders used only by resources the server doesn't have yet are named in a note and don't stop the diff. A scheduled drift check now reads "can't compare secrets" instead of "differences found" ([#26](https://github.com/MichaelLeeHobbs/channelvault/issues/26)).
|
|
21
|
+
|
|
5
22
|
## [0.3.0-rc.4] — 2026-11-27
|
|
6
23
|
|
|
7
24
|
Release candidate, published under the npm `next` tag.
|
|
@@ -121,6 +138,7 @@ First release. Tested against Mirth Connect 4.5.2; the offline round trip is als
|
|
|
121
138
|
- `backup` / `restore`: the server's own configuration XML saved as `.backup/<server>-<UTC time>.xml`, identified by Mirth's server ID, restored with a preview, an undo backup and a version check. `push` backs up first unless `--no-backup`.
|
|
122
139
|
- `diff` exits 0 when the tree matches the server, 1 when it differs, 2 on error.
|
|
123
140
|
|
|
141
|
+
[0.3.0-rc.5]: https://github.com/MichaelLeeHobbs/channelvault/releases/tag/v0.3.0-rc.5
|
|
124
142
|
[0.3.0-rc.4]: https://github.com/MichaelLeeHobbs/channelvault/releases/tag/v0.3.0-rc.4
|
|
125
143
|
[0.3.0-rc.3]: https://github.com/MichaelLeeHobbs/channelvault/releases/tag/v0.3.0-rc.3
|
|
126
144
|
[0.3.0-rc.2]: https://github.com/MichaelLeeHobbs/channelvault/releases/tag/v0.3.0-rc.2
|
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ channelvault profile list|add|set-password|check|repin # saved connections (se
|
|
|
82
82
|
|
|
83
83
|
`channelvault <command> --help` lists the flags. The server connection comes from a saved profile (`--profile`, `MIRTH_PROFILE`, or the profile matching the tree), or from the login flags and `MIRTH_HOST`, `MIRTH_PORT`, `MIRTH_USER`, `MIRTH_PASS`; see [Connection profiles](#connection-profiles). Errors start with a reason code in brackets, such as `error: [profile-not-typed] …`, for scripts and agents to route on.
|
|
84
84
|
|
|
85
|
-
`diff` exits 0 when the tree matches the server, 1 when they differ, and 2 on any error (including a bad flag), so a scheduled drift check can tell drift from an outage. It compares content: Mirth bumps revision numbers and timestamps on any save (even an unchanged one in the Administrator) and on a restore, so those are reported as a note ("pull to update the tree's baseline") and don't count as differences.
|
|
85
|
+
`diff` exits 0 when the tree matches the server, 1 when they differ, and 2 on any error (including a bad flag), so a scheduled drift check can tell drift from an outage. It compares content: Mirth bumps revision numbers and timestamps on any save (even an unchanged one in the Administrator) and on a restore, so those are reported as a note ("pull to update the tree's baseline") and don't count as differences. When a `{{env:NAME}}` placeholder at a value the server also holds can't be filled, from the env file or the environment, `diff` exits 2 rather than reporting every secret as drift: `[env-missing]` when the env file it looked for doesn't exist (the message names it), `[env-incomplete]` naming the variables an existing env file lacks. Pass `--dotenv`, or set the profile's `dotenv`. A placeholder used only by a resource the server doesn't have yet (a new channel) is named in a note instead.
|
|
86
86
|
|
|
87
87
|
For scripts, CI and AI agents, `status`, `diff` and `push --plan-only` take `--json` and print one JSON document on stdout; errors still go to stderr with the usual exit code.
|
|
88
88
|
|
|
@@ -147,6 +147,7 @@ Secrets inside values are caught too: credentials in URLs and connection strings
|
|
|
147
147
|
channelvault push ./mirth # everything that changed
|
|
148
148
|
channelvault push ./mirth --channel "ADT Router" # just this channel (repeat --channel for more)
|
|
149
149
|
channelvault push ./mirth --library Formatting --deploy # one library, then redeploy the channels using it
|
|
150
|
+
channelvault push ./mirth --config-map-key HL7_TEXT_LEGACY # just this configuration-map key (repeatable)
|
|
150
151
|
```
|
|
151
152
|
|
|
152
153
|
- **Copies**: `implode`, `diff`, and `push` discover new `channels/<folder>/channel.json`, `codeTemplates/<folder>/library.json`, and `channelGroups/<name>.json` files; no manual skeleton reference is needed. Code sidecars are still included through their `@file` markers. Every channel, library and code template is saved by its `id`, and a copied directory keeps its source's. Give each copy a new UUID and name, and give copied templates new IDs too. Duplicate IDs and resource paths outside the tree are refused. `push` also refuses a save under a name another channel holds (case-insensitive), even one a delete or rename in the same push frees: push that delete or rename first.
|
|
@@ -157,7 +158,8 @@ channelvault push ./mirth --library Formatting --deploy # one library, then red
|
|
|
157
158
|
- **Snapshots**: live reads require the configuration wrapper, an engine version, and a valid channels collection. Present library, template and group collections are checked too. Empty or malformed success responses are refused before tree replacement or push planning; valid empty collections and plugin fields are preserved.
|
|
158
159
|
- **`--deploy`** redeploys the channels that changed and the channels a changed code-template library is enabled for, but only those deployed when planning and still deployed immediately before their redeploy. Channels taken down during the push are skipped and reported. Status-read failures prevent that channel's redeploy and are reported per channel. Keep a single-writer change window: Mirth's status check and deployment are separate requests.
|
|
159
160
|
- After a push the tree's revision numbers are updated from the server, so `diff` and the next `push` stay clean.
|
|
160
|
-
-
|
|
161
|
+
- **Configuration-map keys**: `--config-map-key <name>` (repeatable) pushes those keys of the tree's configuration map. Alone it pushes only the keys; with `--channel`, `--library` or `--global-scripts` it pushes those too. The plan lists each key as a `configuration-map key` change (`changes[].kind` is `configMapKey` in `--json`), never its value. Mirth saves the map only as a whole, so push reads the server's map again right before the save, replaces the named entries, keeps every other key as the server holds it, and checks the map after saving. The keys are saved before any channel, so a channel this push saves or redeploys can read them. Conflicts work like revisions: `pull` and `adopt` record a hash of each key per installation in `~/.channelvault/config-map-baselines/` (owner-only, outside the tree, so every checkout and worktree on the machine shares it; never the value), and push refuses a named key that was edited, created or deleted on the server since then, unless `--force`. Without a baseline on this machine (the tree was pulled elsewhere, or by an older version) every key push is refused: pull or adopt first, or pass `--force`. `diff` and a plain `push` compare the map by key, since Mirth returns it in its own order. Removing a key from the tree deletes it only with `--allow-deletes`. The undo command includes `--overwrite-config-map`.
|
|
162
|
+
- Server settings, the rest of the configuration map, channel groups and tags are **not** pushed; `push` names them if they differ. `--whole-server` replaces the entire server configuration instead. It shows the same change list and needs the same `--allow-deletes` / `--force`, and it can't be combined with `--channel`, `--library` or `--config-map-key`.
|
|
161
163
|
- A tree exploded from an XML backup is refused (its shape differs from the live API's); `--ignore-origin` overrides that.
|
|
162
164
|
- Before it changes anything, `push` backs up the server (see below) and prints a configuration undo command with the original target (`--profile <name>`, or the host, port, user and TLS options), and the backup directory. It includes `--overwrite-config-map` when the push overwrites that map. Passwords are omitted; without a profile, supply the server's credential through `MIRTH_PASS`. `--no-backup` skips the backup. Backups do not capture runtime deployment state; review targeted redeployment separately after a configuration undo.
|
|
163
165
|
- Without a terminal, `push` needs `--yes`.
|
|
@@ -208,7 +210,7 @@ An agent can safely edit a tree and check its work. Pushing, restoring and anyth
|
|
|
208
210
|
- Edit the `.js` and `.json` files; leave `id`, `revision`, `channelvault.json` and the `{"@file": …}` / `{"@ref": …}` markers alone. A new channel or template needs its own new UUID for `id`; a copied directory keeps the old one.
|
|
209
211
|
- Mirth runs these scripts in Rhino, not Node: no `async`/`await`, optional chaining (`?.`), classes, `require`, `import` or shorthand object properties (`{ status }`; write `{ status: status }`). `let`, `const` and arrow functions work.
|
|
210
212
|
- `{{env:NAME}}` is a placeholder for a secret kept outside git. Never replace one with a real value, and never read, print or copy `.env`, `.secrets/`, `.backup/`, `~/.channelvault/credentials`, a profile's env file or `~/.channelvault/backups/`.
|
|
211
|
-
- channelvault finds the server itself: the tree's `channelvault.json` names its installation, and the matching connection profile supplies the login. Don't pass `--host`, `--pass` or `--insecure`, and don't set `MIRTH_*` variables. If a command fails with a reason code such as `[no-connection]`, `[no-password]` or `[tls-pin-mismatch]`, stop and tell a person; only they can add a profile, set its password or repin its certificate.
|
|
213
|
+
- channelvault finds the server itself: the tree's `channelvault.json` names its installation, and the matching connection profile supplies the login. Don't pass `--host`, `--pass` or `--insecure`, and don't set `MIRTH_*` variables. If a command fails with a reason code such as `[no-connection]`, `[no-password]`, `[env-missing]`, `[env-incomplete]` or `[tls-pin-mismatch]`, stop and tell a person; only they can add a profile, set its password or repin its certificate.
|
|
212
214
|
- Check your work with `channelvault diff mirth --json` (exit 0: matches the server, 1: differs) and `channelvault push mirth --plan-only --json`, which shows what a push would change and `wouldStop` reasons.
|
|
213
215
|
- Do not run `channelvault push` (other than with `--plan-only`), `restore` or `pull`, and never pass `--force`, `--allow-deletes` or `--yes`. Summarise the plan and let a person push.
|
|
214
216
|
```
|
|
@@ -259,7 +261,7 @@ channelvault diff ./destination --profile destination --dotenv .env.destination
|
|
|
259
261
|
channelvault push ./destination --profile destination --dotenv .env.destination --channel "Report Distributor"
|
|
260
262
|
```
|
|
261
263
|
|
|
262
|
-
Review the destination differences before overriding an independent revision history with `--force`. The initial source baseline cannot establish whether an independently managed destination changed since its last review. After the first successful push, keep the destination working copy and its refreshed baseline for subsequent changes. `--force` permits overwriting concurrent edits, while deletions still require `--allow-deletes`. A scoped push
|
|
264
|
+
Review the destination differences before overriding an independent revision history with `--force`. The initial source baseline cannot establish whether an independently managed destination changed since its last review. After the first successful push, keep the destination working copy and its refreshed baseline for subsequent changes. `--force` permits overwriting concurrent edits, while deletions still require `--allow-deletes`. A scoped push promotes the configuration map only key by key, with `--config-map-key`, and no other server settings; manage those separately.
|
|
263
265
|
|
|
264
266
|
### Checks
|
|
265
267
|
|