@dboio/cli 0.6.9 → 0.6.10

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/README.md CHANGED
@@ -156,6 +156,7 @@ All configuration is **directory-scoped**. Each project folder maintains its own
156
156
  | `AppUID` | string | App UID |
157
157
  | `AppName` | string | App display name |
158
158
  | `AppShortName` | string | App short name (used for `dbo clone --app`) |
159
+ | `AppModifyKey` | string | ModifyKey for locked/production apps (set by `dbo clone`, used for submission guards) |
159
160
  | `ContentPlacement` | `bin` \| `path` \| `ask` | Where to place content files during clone |
160
161
  | `MediaPlacement` | `bin` \| `fullpath` \| `ask` | Where to place media files during clone |
161
162
  | `<Entity>FilenameCol` | column name | Filename column for entity-dir records (e.g., `ExtensionFilenameCol`) |
@@ -239,7 +240,7 @@ dbo init --domain my-domain.com --app myapp --clone
239
240
  #### What clone does
240
241
 
241
242
  1. **Loads app JSON** — from a local file, server API, or interactive prompt
242
- 2. **Updates `.dbo/config.json`** — saves `AppID`, `AppUID`, `AppName`, `AppShortName`
243
+ 2. **Updates `.dbo/config.json`** — saves `AppID`, `AppUID`, `AppName`, `AppShortName`, and `AppModifyKey` (if the app is locked)
243
244
  3. **Updates `package.json`** — populates `name`, `productName`, `description`, `homepage`, and `deploy` script
244
245
  4. **Creates directories** — processes `children.bin` to build the directory hierarchy based on `ParentBinID` relationships
245
246
  5. **Saves `.dbo/structure.json`** — maps BinIDs to directory paths for file placement
@@ -487,6 +488,7 @@ dbo input -d 'RowUID:abc;column:content.Content@file.css' -v
487
488
  | `-f, --file <field=@path>` | File attachment for multipart upload (repeatable) |
488
489
  | `-C, --confirm <true\|false>` | Commit changes (default: `true`). Use `false` for validation only |
489
490
  | `--ticket <id>` | Override ticket ID (`_OverrideTicketID`) |
491
+ | `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
490
492
  | `--login` | Auto-login user created by this submission |
491
493
  | `--transactional` | Use transactional processing |
492
494
  | `--json` | Output raw JSON response |
@@ -629,6 +631,7 @@ dbo input -d 'RowUID:albain3dwkofbhnd1qtd1q;column:content.Content@assets/css/co
629
631
  | `<filepath>` | Local file path |
630
632
  | `-C, --confirm <true\|false>` | Commit (default: `true`) |
631
633
  | `--ticket <id>` | Override ticket ID |
634
+ | `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
632
635
 
633
636
  #### `dbo content pull`
634
637
 
@@ -939,6 +942,7 @@ The `@colors.css` reference tells push to read the content from that file. All o
939
942
  | `<path>` | File or directory to push |
940
943
  | `-C, --confirm <true\|false>` | Commit (default: `true`) |
941
944
  | `--ticket <id>` | Override ticket ID |
945
+ | `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
942
946
  | `--meta-only` | Only push metadata, skip file content |
943
947
  | `--content-only` | Only push file content, skip metadata |
944
948
  | `-y, --yes` | Auto-accept all prompts |
@@ -1101,6 +1105,7 @@ The `@colors.css` reference tells the CLI to read the file content from `colors.
1101
1105
  | `<path>` | File or `.` to scan current directory |
1102
1106
  | `-C, --confirm <true\|false>` | Commit (default: `true`) |
1103
1107
  | `--ticket <id>` | Override ticket ID |
1108
+ | `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
1104
1109
  | `-y, --yes` | Auto-accept all prompts |
1105
1110
  | `--json` | Output raw JSON |
1106
1111
  | `--jq <expr>` | Filter JSON response |
@@ -1192,6 +1197,36 @@ Stores ticket IDs for automatic application during submissions:
1192
1197
  - `records` — Per-record tickets (auto-cleared after successful submission)
1193
1198
  - `--ticket` flag always takes precedence over stored tickets
1194
1199
 
1200
+ #### ModifyKey protection (locked/production apps)
1201
+
1202
+ When an app has a `ModifyKey` set (production/locked mode), the CLI guards all submission commands (`push`, `input`, `add`, `content deploy`, `deploy`) with an interactive prompt:
1203
+
1204
+ ```
1205
+ ⚠ This app is locked (production mode). A ModifyKey is required to submit changes.
1206
+ ? This app has a ModifyKey set. How would you like to proceed?
1207
+ ❯ Enter the ModifyKey to proceed
1208
+ Cancel submission
1209
+ ```
1210
+
1211
+ The ModifyKey is detected and stored during `dbo clone`. If the key wasn't stored locally but the server requires one, the CLI reactively prompts after the first failed submission:
1212
+
1213
+ ```
1214
+ ⚠ This app requires a ModifyKey. The key has not been set locally (try re-running `dbo clone`).
1215
+ ? A ModifyKey is required. How would you like to proceed?
1216
+ ❯ Enter the ModifyKey to retry
1217
+ Cancel submission
1218
+ ```
1219
+
1220
+ On successful reactive entry, the key is saved to `.dbo/config.json` for future use.
1221
+
1222
+ To bypass the interactive prompt entirely, pass `--modify-key <key>` on any submission command:
1223
+
1224
+ ```bash
1225
+ dbo push . --modify-key mySecretKey
1226
+ dbo input -d '...' --modify-key mySecretKey
1227
+ dbo add myfile.css --modify-key mySecretKey
1228
+ ```
1229
+
1195
1230
  #### User identity required
1196
1231
 
1197
1232
  When the server returns an error mentioning `LoggedInUser_UID`, `LoggedInUserID`, `CurrentUserID`, or `UserID`, the CLI checks for a stored user identity from `dbo login`:
@@ -1291,6 +1326,7 @@ dbo deploy css:colors --confirm false
1291
1326
  | `--all` | Deploy all entries in the manifest |
1292
1327
  | `-C, --confirm <true\|false>` | Commit (default: `true`) |
1293
1328
  | `--ticket <id>` | Override ticket ID |
1329
+ | `--modify-key <key>` | Provide ModifyKey directly (skips interactive prompt) |
1294
1330
 
1295
1331
  #### `dbo.deploy.json` manifest
1296
1332
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dboio/cli",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "CLI for the DBO.io framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,7 +18,7 @@ export const addCommand = new Command('add')
18
18
  .argument('<path>', 'File or "." to scan current directory')
19
19
  .option('-C, --confirm <value>', 'Commit: true (default) or false', 'true')
20
20
  .option('--ticket <id>', 'Override ticket ID')
21
- .option('--modifyKey <key>', 'Provide ModifyKey directly (skips interactive prompt)')
21
+ .option('--modify-key <key>', 'Provide ModifyKey directly (skips interactive prompt)')
22
22
  .option('-y, --yes', 'Auto-accept all prompts')
23
23
  .option('--json', 'Output raw JSON')
24
24
  .option('--jq <expr>', 'Filter JSON response')
@@ -29,7 +29,7 @@ const deployCmd = new Command('deploy')
29
29
  .argument('<filepath>', 'Local file path')
30
30
  .option('-C, --confirm <value>', 'Commit: true (default) or false', 'true')
31
31
  .option('--ticket <id>', 'Override ticket ID')
32
- .option('--modifyKey <key>', 'Provide ModifyKey directly (skips interactive prompt)')
32
+ .option('--modify-key <key>', 'Provide ModifyKey directly (skips interactive prompt)')
33
33
  .option('--json', 'Output raw JSON')
34
34
  .option('-v, --verbose', 'Show HTTP request details')
35
35
  .option('--domain <host>', 'Override domain')
@@ -14,7 +14,7 @@ export const deployCommand = new Command('deploy')
14
14
  .option('--all', 'Deploy all entries in the manifest')
15
15
  .option('-C, --confirm <value>', 'Commit: true (default) or false', 'true')
16
16
  .option('--ticket <id>', 'Override ticket ID')
17
- .option('--modifyKey <key>', 'Provide ModifyKey directly (skips interactive prompt)')
17
+ .option('--modify-key <key>', 'Provide ModifyKey directly (skips interactive prompt)')
18
18
  .option('--json', 'Output raw JSON')
19
19
  .option('-v, --verbose', 'Show HTTP request details')
20
20
  .option('--domain <host>', 'Override domain')
@@ -17,7 +17,7 @@ export const inputCommand = new Command('input')
17
17
  .option('-f, --file <field=@path>', 'File attachment for multipart upload (repeatable)', collect, [])
18
18
  .option('-C, --confirm <value>', 'Commit changes: true (default) or false for validation only', 'true')
19
19
  .option('--ticket <id>', 'Override ticket ID (_OverrideTicketID)')
20
- .option('--modifyKey <key>', 'Provide ModifyKey directly (skips interactive prompt)')
20
+ .option('--modify-key <key>', 'Provide ModifyKey directly (skips interactive prompt)')
21
21
  .option('--login', 'Auto-login user created by this submission')
22
22
  .option('--transactional', 'Use transactional processing')
23
23
  .option('--json', 'Output raw JSON response')
@@ -19,7 +19,7 @@ export const pushCommand = new Command('push')
19
19
  .argument('<path>', 'File or directory to push')
20
20
  .option('-C, --confirm <value>', 'Commit: true (default) or false', 'true')
21
21
  .option('--ticket <id>', 'Override ticket ID')
22
- .option('--modifyKey <key>', 'Provide ModifyKey directly (skips interactive prompt)')
22
+ .option('--modify-key <key>', 'Provide ModifyKey directly (skips interactive prompt)')
23
23
  .option('--meta-only', 'Only push metadata changes, skip file content')
24
24
  .option('--content-only', 'Only push file content, skip metadata columns')
25
25
  .option('-y, --yes', 'Auto-accept all prompts (path refactoring, etc.)')
@@ -9,7 +9,7 @@ import { log } from './logger.js';
9
9
  * - Returns { modifyKey: null, cancel: true } on mismatch or cancel.
10
10
  */
11
11
  export async function checkModifyKey(options = {}) {
12
- // --modifyKey flag takes precedence (mirrors --ticket / --confirm behavior)
12
+ // --modify-key flag takes precedence (mirrors --ticket / --confirm behavior)
13
13
  if (options.modifyKey) return { modifyKey: options.modifyKey, cancel: false };
14
14
 
15
15
  const storedKey = await loadAppModifyKey();