@tenonhq/dovetail-core 0.0.124 → 0.0.125
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 +2 -1
- package/dist/commander.js +71 -4
- package/dist/pullRecord.js +608 -0
- package/dist/pullRecordCommand.js +161 -0
- package/dist/snClient.js +33 -0
- package/dist/tests/commanderStrict.test.js +41 -0
- package/dist/tests/pullRecord.test.js +609 -0
- package/package.json +1 -1
- package/release-manifest.json +261 -240
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ Quick reference:
|
|
|
26
26
|
```bash
|
|
27
27
|
npx dove watch # HUMAN-ONLY local dev: multi-scope watch + dashboard (hidden from --help; stop before git checkout — see #155)
|
|
28
28
|
npx dove push # build + push current files
|
|
29
|
-
npx dove refresh # pull manifest + new files (
|
|
29
|
+
npx dove refresh # pull manifest + new files, scope-wide (alias: r; bare `dove pull` does the same)
|
|
30
|
+
npx dove pull <table> <sys_id> # mirror ONE record: its folder + its manifest key, nothing else (--dry-run, --sys-ids, --from-update-set)
|
|
30
31
|
npx dove build # local build only
|
|
31
32
|
npx dove deploy # deploy built artifacts
|
|
32
33
|
npx dove dashboard # update-set dashboard web UI
|
package/dist/commander.js
CHANGED
|
@@ -13,6 +13,7 @@ const schemaCommand_1 = require("./schemaCommand");
|
|
|
13
13
|
const claudeCommand_1 = require("./claudeCommand");
|
|
14
14
|
const createRecordCommand_1 = require("./createRecordCommand");
|
|
15
15
|
const deleteRecordCommand_1 = require("./deleteRecordCommand");
|
|
16
|
+
const pullRecordCommand_1 = require("./pullRecordCommand");
|
|
16
17
|
const reconcileCommand_1 = require("./reconcileCommand");
|
|
17
18
|
const migrateCommand_1 = require("./migrateCommand");
|
|
18
19
|
const clickupCommands_1 = require("./clickupCommands");
|
|
@@ -87,10 +88,7 @@ function configureCli(cli) {
|
|
|
87
88
|
}, async (args) => {
|
|
88
89
|
await (0, allScopesCommands_1.watchAllScopesCommand)(args);
|
|
89
90
|
})
|
|
90
|
-
.command(
|
|
91
|
-
// `pull` is the verb people reach for ("pull before push") and it appears
|
|
92
|
-
// in downstream docs and scripts — alias it rather than silently no-op.
|
|
93
|
-
["refresh", "r", "pull"], "Pull latest manifest and file contents from the ServiceNow instance", (cmdArgs) => {
|
|
91
|
+
.command(["refresh", "r"], "Pull latest manifest and file contents from the ServiceNow instance (scope-wide; for one record see `dove pull <table> <sysId>`)", (cmdArgs) => {
|
|
94
92
|
cmdArgs.options({
|
|
95
93
|
...sharedOptions,
|
|
96
94
|
force: {
|
|
@@ -128,6 +126,75 @@ function configureCli(cli) {
|
|
|
128
126
|
return cmdArgs;
|
|
129
127
|
}, async (args) => {
|
|
130
128
|
await (0, commands_1.refreshCommand)(args);
|
|
129
|
+
})
|
|
130
|
+
.command(
|
|
131
|
+
// Two commands in one verb, chosen by the positional:
|
|
132
|
+
// dove pull → the historic alias of `dove refresh`
|
|
133
|
+
// ("pull before push" is in dozens of
|
|
134
|
+
// docs and scripts), scope-wide.
|
|
135
|
+
// dove pull <table> <sysId...> → per-record mirror (TenonHQ/Dovetail#319):
|
|
136
|
+
// ONE record folder + ONE manifest entry,
|
|
137
|
+
// every other entry byte-identical.
|
|
138
|
+
// The refresh-only flags (-t/--table, --metadata-only, --benchmark) are
|
|
139
|
+
// deliberately NOT declared here: -t would collide with the positional
|
|
140
|
+
// table, and strictCommands tolerates undeclared flags, so the handler
|
|
141
|
+
// turns a stray -t into an error instead of a silent no-op.
|
|
142
|
+
"pull [table] [sysId..]", "Mirror one or more records by sys_id into the repo without a scope refresh; with no table, same as `dove refresh`", (cmdArgs) => {
|
|
143
|
+
cmdArgs
|
|
144
|
+
.positional("table", {
|
|
145
|
+
type: "string",
|
|
146
|
+
describe: "ServiceNow table of the record(s), e.g. sys_security_acl",
|
|
147
|
+
})
|
|
148
|
+
// Singular on purpose: yargs camel-cases `--sys-ids` to `sysIds`, and a
|
|
149
|
+
// positional of the same name would swallow the flag.
|
|
150
|
+
.positional("sysId", {
|
|
151
|
+
type: "string",
|
|
152
|
+
describe: "One or more record sys_ids (space- or comma-separated)",
|
|
153
|
+
})
|
|
154
|
+
.options({
|
|
155
|
+
...sharedOptions,
|
|
156
|
+
"sys-ids": {
|
|
157
|
+
type: "string",
|
|
158
|
+
describe: "Comma-separated sys_ids (alternative to the positional list)",
|
|
159
|
+
},
|
|
160
|
+
"from-update-set": {
|
|
161
|
+
type: "string",
|
|
162
|
+
describe: "Pull every per-record capture (<table>_<sys_id>) in this update set; schema/choice-set captures are reported and skipped",
|
|
163
|
+
},
|
|
164
|
+
scope: {
|
|
165
|
+
alias: "s",
|
|
166
|
+
type: "string",
|
|
167
|
+
describe: "Target scope. Per-record: every record must belong to it (a mismatch refuses the whole pull). Bare pull: refresh this scope only.",
|
|
168
|
+
},
|
|
169
|
+
force: {
|
|
170
|
+
alias: "f",
|
|
171
|
+
type: "boolean",
|
|
172
|
+
default: false,
|
|
173
|
+
describe: "Overwrite local files even when content matches the instance",
|
|
174
|
+
},
|
|
175
|
+
"dry-run": {
|
|
176
|
+
type: "boolean",
|
|
177
|
+
default: false,
|
|
178
|
+
describe: "Per-record only: list the files and manifest keys the pull would touch, write nothing",
|
|
179
|
+
},
|
|
180
|
+
});
|
|
181
|
+
return cmdArgs;
|
|
182
|
+
}, async (args) => {
|
|
183
|
+
const pullArgs = args;
|
|
184
|
+
if (!pullArgs.table && !pullArgs.fromUpdateSet) {
|
|
185
|
+
// Bare pull == refresh. The refresh-only flags arrive undeclared
|
|
186
|
+
// (strictCommands tolerates them, yargs still camel-cases them), so
|
|
187
|
+
// they pass straight through; a bare `-t <table>` is re-mapped to
|
|
188
|
+
// refresh's --table so the old `dove pull -t x` spelling keeps working.
|
|
189
|
+
const refreshArgs = args;
|
|
190
|
+
const stray = pullArgs.t;
|
|
191
|
+
if (typeof stray === "string" || Array.isArray(stray)) {
|
|
192
|
+
refreshArgs.table = stray;
|
|
193
|
+
}
|
|
194
|
+
await (0, commands_1.refreshCommand)(refreshArgs);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
await (0, pullRecordCommand_1.pullRecordCommand)(pullArgs);
|
|
131
198
|
})
|
|
132
199
|
.command(["push [target]"], "[DESTRUCTIVE] Push all files from current local files to ServiceNow instance.", (cmdArgs) => {
|
|
133
200
|
cmdArgs.options({
|