@zalosai/zalos-cli 0.2.18 → 0.2.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.
package/PUBLISHING.md CHANGED
@@ -59,6 +59,12 @@ Do not publish with uncommitted package changes or reuse an existing version.
59
59
 
60
60
  ## Central developer access release
61
61
 
62
+ Version 0.2.19 adds Custom Page sidebar group management with
63
+ `zl custom-page navigation get --manage` and `zl custom-page navigation set --file`.
64
+ Groups support named views and optional child icons. Changes preview by default
65
+ and require `--apply` to save. Using these commands requires the corresponding
66
+ Mesh API deployment in the selected environment.
67
+
62
68
  Version 0.2.17 bundles Custom Page authoring guidance for team-local navigation and self-contained
63
69
  downloads. Custom Page navigation never starts workflows, and downloads are limited to supplied
64
70
  in-memory content.
package/README.md CHANGED
@@ -11,7 +11,7 @@ Requires Node.js 22 or newer. The product CLI is public on npm and does not
11
11
  require GitHub CLI or GitHub Packages access.
12
12
 
13
13
  ```bash
14
- npm install --global @zalosai/zalos-cli@0.2.18
14
+ npm install --global @zalosai/zalos-cli@0.2.19
15
15
  ```
16
16
 
17
17
  Installing the CLI does not grant access.
@@ -166,8 +166,45 @@ export async function validateCustomPageAction(options) {
166
166
  if (problems.length)
167
167
  throw new ValidationError('html', problems.join('; '));
168
168
  }
169
+ const navigationPath = '/custom-pages/navigation';
170
+ export async function getCustomPageNavigationAction(options) {
171
+ printJson(dataRow(await client.get(navigationPath, { manage: String(options.manage ?? false) })));
172
+ }
173
+ export async function setCustomPageNavigationAction(options) {
174
+ let config;
175
+ try {
176
+ const contents = await readFile(options.file, 'utf8');
177
+ config = JSON.parse(contents);
178
+ }
179
+ catch {
180
+ throw new ValidationError('file', 'Provide a readable JSON file from custom-page navigation get --manage');
181
+ }
182
+ if (!config ||
183
+ !Number.isSafeInteger(config.revision) ||
184
+ Number(config.revision) < 0 ||
185
+ !Array.isArray(config.groups))
186
+ throw new ValidationError('file', 'Expected a revision and groups from custom-page navigation get --manage');
187
+ if (!options.apply || options.dryRun) {
188
+ printJson({ dryRun: true, method: 'PUT', path: navigationPath, config });
189
+ return;
190
+ }
191
+ printJson(dataRow(await client.put(navigationPath, config)));
192
+ }
169
193
  export function registerCustomPageCommand(program) {
170
194
  const page = program.command('custom-page').description('Manage team-scoped HTML Custom Pages');
195
+ const navigation = page
196
+ .command('navigation')
197
+ .description('Manage team sidebar groups for Custom Pages');
198
+ navigation
199
+ .command('get')
200
+ .option('--manage', 'Include all groups and children (owner only)')
201
+ .action(async (options) => action(() => getCustomPageNavigationAction(options)));
202
+ navigation
203
+ .command('set')
204
+ .requiredOption('--file <json>', 'Full navigation configuration with its current revision')
205
+ .option('--apply', 'Save the navigation configuration')
206
+ .option('--dry-run', 'Preview the configuration')
207
+ .action(async (options) => action(() => setCustomPageNavigationAction(options)));
171
208
  page
172
209
  .command('list')
173
210
  .option('--manage', 'Include disabled pages (owner only)')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zalosai/zalos-cli",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "API-only product command-line interface for Zalos",
5
5
  "repository": {
6
6
  "type": "git",