@tenonhq/dovetail-servicenow 0.0.56 → 0.0.58
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 +20 -6
- package/dist/cli.js +15 -26
- package/dist/cliUsage.js +7 -12
- package/dist/exportApp.js +0 -1
- package/dist/exportUpdateSet.d.ts +15 -53
- package/dist/exportUpdateSet.js +65 -240
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -11
- package/dist/loadEnv.d.ts +45 -2
- package/dist/loadEnv.js +155 -5
- package/dist/mcp/registry.js +7 -10
- package/dist/mcp/schemas.d.ts +0 -9
- package/dist/mcp/schemas.js +0 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -103,6 +103,12 @@ npx dove-sn view-flow --sys-id <id> --env .env.prod
|
|
|
103
103
|
npx dove-sn add-choices --env ../envs/workshop.env --table ... --column ...
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
+
A bare instance name works too: `--env loft` → `.env.loft` in the current
|
|
107
|
+
directory, or — when it has none — the nearest `.env.loft` in a parent directory
|
|
108
|
+
(up to 8 levels, never the home directory or above, only a file owned by you; the
|
|
109
|
+
chosen path is printed to stderr), so a nested git worktree reaches the checkout's per-instance file. Paths
|
|
110
|
+
and dotted names (`.env.prod`, `loft.env`) never walk up.
|
|
111
|
+
|
|
106
112
|
`--env` (alias `--env-file`) wins over the `DOVETAIL_ENV_FILE` env var, which in
|
|
107
113
|
turn beats the default `.env`. Variables already present in the environment are
|
|
108
114
|
never overridden, so an exported `SN_INSTANCE` still takes precedence over the
|
|
@@ -1165,9 +1171,10 @@ Produce the `<unload>` document the implementation team imports on a customer
|
|
|
1165
1171
|
instance — with every secret value replaced by `__SET_DURING_INSTALL__`.
|
|
1166
1172
|
|
|
1167
1173
|
```bash
|
|
1168
|
-
# An update set
|
|
1174
|
+
# An update set, through the instance's own export servlet. A set still in
|
|
1175
|
+
# progress is marked complete first, which needs --confirm.
|
|
1169
1176
|
npx dove-sn export-update-set --update-set 0123456789abcdef0123456789abcdef \
|
|
1170
|
-
--out ./tenon-core.xml
|
|
1177
|
+
--out ./tenon-core.xml --confirm
|
|
1171
1178
|
|
|
1172
1179
|
# A whole app: publish into a new set, then export it. Dry-run first (default).
|
|
1173
1180
|
npx dove-sn export-app --app x_cadso_automate --out ./automate.xml
|
|
@@ -1214,15 +1221,22 @@ empty 200** from `export_update_set.do` (the servlet streams a document only for
|
|
|
1214
1221
|
a *complete* set, and app-publish leaves the set in progress). After stripping,
|
|
1215
1222
|
the output is re-read and verified; a secret that somehow survived fails the run.
|
|
1216
1223
|
|
|
1217
|
-
`export-update-set
|
|
1218
|
-
|
|
1224
|
+
`export-update-set` always reads the document from `export_update_set.do`, the
|
|
1225
|
+
same export the UI's **Export Update Set to XML** runs, so the file imports
|
|
1226
|
+
exactly like a UI export. A set still in progress is marked complete first — a
|
|
1227
|
+
real write, so it needs `--confirm`; a complete set exports with no write. The
|
|
1228
|
+
servlet is a `.do` page, so the instance must accept your username and password
|
|
1229
|
+
for form login (API-key-only auth cannot export). The old read-only
|
|
1230
|
+
`--mode assemble` (and its `--page-size` / `--max-rows`) is gone: it built the
|
|
1231
|
+
document from `sys_update_xml` rows without linking them to the remote update
|
|
1232
|
+
set, so its files imported with 0 updates. `export-app` publishes ~1000+
|
|
1219
1233
|
records into a new update set and is dry-run by default. Neither is the Store
|
|
1220
1234
|
publish; that is `publish-app`, which is externally visible.
|
|
1221
1235
|
|
|
1222
1236
|
Exit codes: `0` exported or dry-run, `1` bad args/unconfirmed, `2`
|
|
1223
|
-
failed/timeout. Programmatic: `exportUpdateSet({ updateSet,
|
|
1237
|
+
failed/timeout. Programmatic: `exportUpdateSet({ updateSet, confirm })`,
|
|
1224
1238
|
`exportApp({ app, confirm })`, `stripSecrets(xml, rules)`. MCP:
|
|
1225
|
-
`update_set_export` (
|
|
1239
|
+
`update_set_export` (writes when the set is in progress) and `app_export`.
|
|
1226
1240
|
|
|
1227
1241
|
`test-flow` defaults to **validate** — a safe pre-flight (published? inputs match
|
|
1228
1242
|
declared variables?) that never runs the flow; `--execute --confirm` runs it via
|
package/dist/cli.js
CHANGED
|
@@ -2575,15 +2575,14 @@ async function runPublishApp(flags) {
|
|
|
2575
2575
|
/**
|
|
2576
2576
|
* dove-sn export-update-set:
|
|
2577
2577
|
* --update-set <sys_id|name> Required. The set to export.
|
|
2578
|
-
* [--mode assemble|complete] assemble (default) is READ-ONLY; complete marks
|
|
2579
|
-
* the set complete on the instance first, which is
|
|
2580
|
-
* a real write and needs --confirm.
|
|
2581
2578
|
* [--out <file>] Write the XML here (default: stdout is NOT used —
|
|
2582
2579
|
* a document this size belongs in a file).
|
|
2583
2580
|
* [--rules <file>] JSON overrides for the secret rules.
|
|
2584
|
-
* [--page-size <n>] [--max-rows <n>]
|
|
2585
2581
|
* [--dry-run] [--json] [--confirm]
|
|
2586
2582
|
*
|
|
2583
|
+
* The document comes from the instance's own export servlet (the UI's "Export
|
|
2584
|
+
* Update Set to XML"). A set still in progress is marked complete first, which
|
|
2585
|
+
* is a real write and needs --confirm; a complete set exports with no write.
|
|
2587
2586
|
* Secret values are ALWAYS replaced with __SET_DURING_INSTALL__; there is no
|
|
2588
2587
|
* opt-out flag. A field that looks secret and is covered by no rule fails the
|
|
2589
2588
|
* run, and nothing is written.
|
|
@@ -2595,9 +2594,18 @@ async function runExportUpdateSet(flags) {
|
|
|
2595
2594
|
process.stderr.write("export-update-set: --update-set <sys_id|name> is required\n");
|
|
2596
2595
|
return 1;
|
|
2597
2596
|
}
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2597
|
+
// The read-only assemble mode was removed: its documents imported with 0
|
|
2598
|
+
// updates. Refuse its flags loudly rather than silently doing something else.
|
|
2599
|
+
if (flags.mode !== undefined && flags.mode !== "complete") {
|
|
2600
|
+
process.stderr.write("export-update-set: --mode " +
|
|
2601
|
+
flags.mode +
|
|
2602
|
+
" is no longer supported. The export always goes through the instance's " +
|
|
2603
|
+
"export servlet; drop --mode (a set still in progress needs --confirm).\n");
|
|
2604
|
+
return 1;
|
|
2605
|
+
}
|
|
2606
|
+
if (flags["page-size"] !== undefined || flags["max-rows"] !== undefined) {
|
|
2607
|
+
process.stderr.write("export-update-set: --page-size and --max-rows were removed with the assemble " +
|
|
2608
|
+
"mode; the export servlet returns the whole set. Drop them.\n");
|
|
2601
2609
|
return 1;
|
|
2602
2610
|
}
|
|
2603
2611
|
var outPath = flags.out;
|
|
@@ -2605,30 +2613,11 @@ async function runExportUpdateSet(flags) {
|
|
|
2605
2613
|
process.stderr.write("export-update-set: --out <file> is required for a real export\n");
|
|
2606
2614
|
return 1;
|
|
2607
2615
|
}
|
|
2608
|
-
var pageSize = undefined;
|
|
2609
|
-
if (flags["page-size"]) {
|
|
2610
|
-
pageSize = Number(flags["page-size"]);
|
|
2611
|
-
if (!Number.isInteger(pageSize) || pageSize < 1) {
|
|
2612
|
-
process.stderr.write("export-update-set: --page-size must be a positive integer\n");
|
|
2613
|
-
return 1;
|
|
2614
|
-
}
|
|
2615
|
-
}
|
|
2616
|
-
var maxRows = undefined;
|
|
2617
|
-
if (flags["max-rows"]) {
|
|
2618
|
-
maxRows = Number(flags["max-rows"]);
|
|
2619
|
-
if (!Number.isInteger(maxRows) || maxRows < 1) {
|
|
2620
|
-
process.stderr.write("export-update-set: --max-rows must be a positive integer\n");
|
|
2621
|
-
return 1;
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
2616
|
var result = await (0, exportUpdateSet_1.exportUpdateSet)({
|
|
2625
2617
|
updateSet: selector,
|
|
2626
|
-
mode: mode,
|
|
2627
2618
|
confirm: flags.confirm === "true",
|
|
2628
2619
|
dryRun: flags["dry-run"] === "true",
|
|
2629
2620
|
rulesPath: flags.rules,
|
|
2630
|
-
pageSize: pageSize,
|
|
2631
|
-
maxRows: maxRows,
|
|
2632
2621
|
});
|
|
2633
2622
|
if (result.status === "exported" && result.xml && outPath) {
|
|
2634
2623
|
fs.writeFileSync(path.resolve(outPath), result.xml, "utf8");
|
package/dist/cliUsage.js
CHANGED
|
@@ -822,24 +822,19 @@ exports.VERB_USAGE = {
|
|
|
822
822
|
{ flag: "out", value: "<file>", note: "Required unless --dry-run; the XML is never written to stdout." },
|
|
823
823
|
],
|
|
824
824
|
optional: [
|
|
825
|
-
{
|
|
826
|
-
flag: "mode",
|
|
827
|
-
value: "<assemble|complete>",
|
|
828
|
-
note: "assemble (default) is READ-ONLY; complete marks the set complete on the instance first.",
|
|
829
|
-
},
|
|
830
825
|
{ flag: "rules", value: "<file>", note: "JSON overrides for the secret rules." },
|
|
831
|
-
{ flag: "
|
|
832
|
-
{ flag: "max-rows", value: "<n>", note: "Positive integer." },
|
|
833
|
-
{ flag: "confirm", note: "Required for --mode complete." },
|
|
826
|
+
{ flag: "confirm", note: "Required when the set is still in progress (it is marked complete first)." },
|
|
834
827
|
DRY_RUN_FLAG,
|
|
835
828
|
JSON_FLAG,
|
|
836
829
|
],
|
|
837
|
-
gate: "
|
|
838
|
-
gateNote: "
|
|
839
|
-
example: "dove-sn export-update-set --update-set <sys_id> --out ./release.xml",
|
|
830
|
+
gate: "confirm",
|
|
831
|
+
gateNote: "The XML comes from the instance's own export servlet (the UI's Export Update Set to XML), which only streams a complete set. A set still in progress is marked complete first — a real write that needs --confirm. A complete set exports with no write.",
|
|
832
|
+
example: "dove-sn export-update-set --update-set <sys_id> --out ./release.xml --confirm",
|
|
840
833
|
notes: [
|
|
841
834
|
"Secret stripping has no opt-out; a secret-looking field covered by no rule fails the run and nothing is written.",
|
|
842
|
-
"
|
|
835
|
+
"Needs a username + password the instance accepts for form login (the servlet is a .do page); API-key-only auth cannot export.",
|
|
836
|
+
"--mode, --page-size and --max-rows were removed with the read-only assemble mode, whose files imported with 0 updates.",
|
|
837
|
+
"Exit 1 when an in-progress set runs unconfirmed; 2 on failure.",
|
|
843
838
|
],
|
|
844
839
|
},
|
|
845
840
|
"export-app": {
|
package/dist/exportApp.js
CHANGED
|
@@ -2,23 +2,20 @@
|
|
|
2
2
|
* Export a ServiceNow update set to an importable `<unload>` XML document, with
|
|
3
3
|
* secret values replaced by a sentinel before the document is ever returned.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* The document always comes from ServiceNow's own export servlet,
|
|
6
|
+
* `GET /export_update_set.do?sysparm_sys_id=<set>` — the same "Export Update Set
|
|
7
|
+
* to XML" the UI runs — so it imports exactly as a UI export does. Ground truth:
|
|
8
|
+
* `brainstorms/sn-export-app-flow.md` in the CTO repo (HAR capture, tenonworkshop
|
|
9
|
+
* 2026-06-08) plus a live run of the same flow.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `sys_update_xml` rows, with no state write at all.
|
|
11
|
+
* The servlet streams the `<unload>` only for a COMPLETE set; for a set still in
|
|
12
|
+
* progress it answers HTTP 200 with an EMPTY BODY, a silent no-op that looks like
|
|
13
|
+
* success. So an in-progress set is marked complete first — a REAL WRITE, which
|
|
14
|
+
* needs confirm. A set that is already complete is exported without any write.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* wraps them in an `<unload>`. Touches no instance state, so it is safe for
|
|
19
|
-
* packaging work against a shared instance.
|
|
20
|
-
* complete — marks the set complete (a REAL WRITE, hence confirm) and lets the
|
|
21
|
-
* servlet produce the document, for byte-fidelity with the UI export.
|
|
16
|
+
* There used to be a read-only "assemble" mode that built the document from the
|
|
17
|
+
* set's sys_update_xml rows. It is gone: its documents carried no link from the
|
|
18
|
+
* rows to the remote update set, so they imported with 0 updates.
|
|
22
19
|
*
|
|
23
20
|
* SECRETS ARE ALWAYS STRIPPED. There is no opt-out flag: a field is exempted
|
|
24
21
|
* only by a reviewed `notSecret` entry in the rules file, with a reason. If a
|
|
@@ -31,8 +28,6 @@ import type { ServiceNowClient } from "./client";
|
|
|
31
28
|
import type { FormAuth, FormSession, PostResult } from "./table";
|
|
32
29
|
import type { SecretRules } from "./secrets/secretRules";
|
|
33
30
|
import type { SecretField, ReviewFinding } from "./secrets/stripSecrets";
|
|
34
|
-
/** How the `<unload>` is produced. */
|
|
35
|
-
export type ExportMode = "assemble" | "complete";
|
|
36
31
|
/** Injectable transport, so tests never touch the network. */
|
|
37
32
|
export interface ExportTransport {
|
|
38
33
|
openSession?: (auth: FormAuth) => Promise<FormSession>;
|
|
@@ -42,37 +37,30 @@ export interface ExportTransport {
|
|
|
42
37
|
export interface ExportUpdateSetParams {
|
|
43
38
|
/** Update set sys_id, or its exact name. */
|
|
44
39
|
updateSet: string;
|
|
45
|
-
/** Default "assemble" (read-only). "complete" writes the set's state first. */
|
|
46
|
-
mode?: ExportMode;
|
|
47
40
|
/** Injectable for tests; defaults to createClient({}). */
|
|
48
41
|
client?: ServiceNowClient;
|
|
49
|
-
/** Instance host for the form session
|
|
42
|
+
/** Instance host for the form session. */
|
|
50
43
|
instance?: string;
|
|
51
44
|
user?: string;
|
|
52
45
|
password?: string;
|
|
53
|
-
/** Required
|
|
46
|
+
/** Required when the set is still in progress: marking it complete writes. */
|
|
54
47
|
confirm?: boolean;
|
|
55
48
|
/** Force a plan-only run. Wins over confirm. */
|
|
56
49
|
dryRun?: boolean;
|
|
57
50
|
/** Optional JSON rules file merged over the built-in secret rules. */
|
|
58
51
|
rulesPath?: string;
|
|
59
|
-
/** Rows per page when assembling. Default 500, max 1000 (the instance cap). */
|
|
60
|
-
pageSize?: number;
|
|
61
|
-
/** Safety stop for a runaway page loop. Default 200000 rows. */
|
|
62
|
-
maxRows?: number;
|
|
63
52
|
/** Test seam for the form session and servlet GET. */
|
|
64
53
|
transport?: ExportTransport;
|
|
65
54
|
}
|
|
66
55
|
/** Outcome of an export. */
|
|
67
56
|
export interface ExportUpdateSetResult {
|
|
68
57
|
status: "dry-run" | "exported" | "failed";
|
|
69
|
-
mode: ExportMode;
|
|
70
58
|
updateSetSysId: string;
|
|
71
59
|
updateSetName: string;
|
|
72
60
|
scope: string;
|
|
73
61
|
/** Rows the instance reports for the set. */
|
|
74
62
|
expectedRecords: number;
|
|
75
|
-
/** Rows
|
|
63
|
+
/** Rows in the servlet's document. */
|
|
76
64
|
recordCount: number;
|
|
77
65
|
/** The document. Absent on dry-run and failure. */
|
|
78
66
|
xml?: string;
|
|
@@ -85,38 +73,12 @@ export interface ExportUpdateSetResult {
|
|
|
85
73
|
/** Human-readable summary of what happened, always present. */
|
|
86
74
|
note: string;
|
|
87
75
|
}
|
|
88
|
-
/** Rows per page when assembling. */
|
|
89
|
-
export declare var DEFAULT_PAGE_SIZE: number;
|
|
90
|
-
/** The instance caps a Table API page at 1000 rows. */
|
|
91
|
-
export declare var MAX_PAGE_SIZE: number;
|
|
92
|
-
/** Safety stop so a paging bug cannot spin forever. */
|
|
93
|
-
export declare var DEFAULT_MAX_ROWS: number;
|
|
94
|
-
/**
|
|
95
|
-
* Field order of a `sys_update_xml` row inside an `<unload>`. Mirrors what the
|
|
96
|
-
* export servlet emits, so an assembled document imports the same way.
|
|
97
|
-
*/
|
|
98
|
-
export declare var UPDATE_XML_FIELDS: ReadonlyArray<string>;
|
|
99
76
|
/** Escape a value for an XML element body. */
|
|
100
77
|
export declare function xmlEscape(value: string): string;
|
|
101
|
-
/** Render one `sys_update_xml` row as an `<unload>` child element. */
|
|
102
|
-
export declare function renderUpdateXmlRow(row: Record<string, unknown>): string;
|
|
103
|
-
/** The `sys_remote_update_set` header an importable document needs. */
|
|
104
|
-
export declare function renderRemoteUpdateSet(set: {
|
|
105
|
-
sys_id: string;
|
|
106
|
-
name: string;
|
|
107
|
-
scope: string;
|
|
108
|
-
description: string;
|
|
109
|
-
}, recordCount: number, unloadDate: string): string;
|
|
110
|
-
/** Wrap rendered rows in the `<unload>` envelope. */
|
|
111
|
-
export declare function renderUnload(header: string, rows: Array<string>, unloadDate: string): string;
|
|
112
|
-
/** ServiceNow-style timestamp, e.g. "2026-09-15 18:40:02". */
|
|
113
|
-
export declare function formatUnloadDate(now: Date): string;
|
|
114
78
|
/** Rows the instance reports for a set, via the aggregate API. */
|
|
115
79
|
export declare function countUpdateXml(client: ServiceNowClient, updateSetSysId: string): Promise<number>;
|
|
116
80
|
/** Pull the count out of an /api/now/stats response. */
|
|
117
81
|
export declare function parseStatsCount(body: unknown): number;
|
|
118
|
-
/** Page every `sys_update_xml` row of a set, oldest first. */
|
|
119
|
-
export declare function fetchUpdateXmlRows(client: ServiceNowClient, updateSetSysId: string, pageSize: number, maxRows: number): Promise<Array<Record<string, unknown>>>;
|
|
120
82
|
/**
|
|
121
83
|
* Refresh the L1 (password-typed field) map from the live dictionary, so tables
|
|
122
84
|
* added by a plugin since the baseline are covered. Falls back to the baseline
|
package/dist/exportUpdateSet.js
CHANGED
|
@@ -3,23 +3,20 @@
|
|
|
3
3
|
* Export a ServiceNow update set to an importable `<unload>` XML document, with
|
|
4
4
|
* secret values replaced by a sentinel before the document is ever returned.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* The document always comes from ServiceNow's own export servlet,
|
|
7
|
+
* `GET /export_update_set.do?sysparm_sys_id=<set>` — the same "Export Update Set
|
|
8
|
+
* to XML" the UI runs — so it imports exactly as a UI export does. Ground truth:
|
|
9
|
+
* `brainstorms/sn-export-app-flow.md` in the CTO repo (HAR capture, tenonworkshop
|
|
10
|
+
* 2026-06-08) plus a live run of the same flow.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `sys_update_xml` rows, with no state write at all.
|
|
12
|
+
* The servlet streams the `<unload>` only for a COMPLETE set; for a set still in
|
|
13
|
+
* progress it answers HTTP 200 with an EMPTY BODY, a silent no-op that looks like
|
|
14
|
+
* success. So an in-progress set is marked complete first — a REAL WRITE, which
|
|
15
|
+
* needs confirm. A set that is already complete is exported without any write.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* wraps them in an `<unload>`. Touches no instance state, so it is safe for
|
|
20
|
-
* packaging work against a shared instance.
|
|
21
|
-
* complete — marks the set complete (a REAL WRITE, hence confirm) and lets the
|
|
22
|
-
* servlet produce the document, for byte-fidelity with the UI export.
|
|
17
|
+
* There used to be a read-only "assemble" mode that built the document from the
|
|
18
|
+
* set's sys_update_xml rows. It is gone: its documents carried no link from the
|
|
19
|
+
* rows to the remote update set, so they imported with 0 updates.
|
|
23
20
|
*
|
|
24
21
|
* SECRETS ARE ALWAYS STRIPPED. There is no opt-out flag: a field is exempted
|
|
25
22
|
* only by a reviewed `notSecret` entry in the rules file, with a reason. If a
|
|
@@ -29,15 +26,9 @@
|
|
|
29
26
|
* ES6 only, no optional chaining.
|
|
30
27
|
*/
|
|
31
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.UPDATE_XML_FIELDS = exports.DEFAULT_MAX_ROWS = exports.MAX_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = void 0;
|
|
33
29
|
exports.xmlEscape = xmlEscape;
|
|
34
|
-
exports.renderUpdateXmlRow = renderUpdateXmlRow;
|
|
35
|
-
exports.renderRemoteUpdateSet = renderRemoteUpdateSet;
|
|
36
|
-
exports.renderUnload = renderUnload;
|
|
37
|
-
exports.formatUnloadDate = formatUnloadDate;
|
|
38
30
|
exports.countUpdateXml = countUpdateXml;
|
|
39
31
|
exports.parseStatsCount = parseStatsCount;
|
|
40
|
-
exports.fetchUpdateXmlRows = fetchUpdateXmlRows;
|
|
41
32
|
exports.refreshTypeFields = refreshTypeFields;
|
|
42
33
|
exports.exportUpdateSet = exportUpdateSet;
|
|
43
34
|
exports.countUnloadRecords = countUnloadRecords;
|
|
@@ -45,36 +36,9 @@ const client_1 = require("./client");
|
|
|
45
36
|
const table_1 = require("./table");
|
|
46
37
|
const secretRules_1 = require("./secrets/secretRules");
|
|
47
38
|
const stripSecrets_1 = require("./secrets/stripSecrets");
|
|
48
|
-
/** Rows per page when assembling. */
|
|
49
|
-
exports.DEFAULT_PAGE_SIZE = 500;
|
|
50
39
|
/** The instance caps a Table API page at 1000 rows. */
|
|
51
|
-
|
|
52
|
-
/** Safety stop so a paging bug cannot spin forever. */
|
|
53
|
-
exports.DEFAULT_MAX_ROWS = 200000;
|
|
40
|
+
var DICTIONARY_LIMIT = 1000;
|
|
54
41
|
var SYS_ID_RE = /^[0-9a-f]{32}$/;
|
|
55
|
-
/**
|
|
56
|
-
* Field order of a `sys_update_xml` row inside an `<unload>`. Mirrors what the
|
|
57
|
-
* export servlet emits, so an assembled document imports the same way.
|
|
58
|
-
*/
|
|
59
|
-
exports.UPDATE_XML_FIELDS = [
|
|
60
|
-
"action",
|
|
61
|
-
"application",
|
|
62
|
-
"category",
|
|
63
|
-
"comments",
|
|
64
|
-
"name",
|
|
65
|
-
"payload",
|
|
66
|
-
"type",
|
|
67
|
-
"target_name",
|
|
68
|
-
"update_domain",
|
|
69
|
-
"update_guid",
|
|
70
|
-
"update_guid_history",
|
|
71
|
-
"view",
|
|
72
|
-
"replace_on_upgrade",
|
|
73
|
-
"sys_id",
|
|
74
|
-
"sys_recorded_at",
|
|
75
|
-
"sys_created_on",
|
|
76
|
-
"sys_updated_on",
|
|
77
|
-
];
|
|
78
42
|
/** Escape a value for an XML element body. */
|
|
79
43
|
function xmlEscape(value) {
|
|
80
44
|
return value
|
|
@@ -103,67 +67,6 @@ function asText(value) {
|
|
|
103
67
|
}
|
|
104
68
|
return "";
|
|
105
69
|
}
|
|
106
|
-
/** Render one `sys_update_xml` row as an `<unload>` child element. */
|
|
107
|
-
function renderUpdateXmlRow(row) {
|
|
108
|
-
var parts = ['<sys_update_xml action="INSERT_OR_UPDATE">'];
|
|
109
|
-
for (var i = 0; i < exports.UPDATE_XML_FIELDS.length; i += 1) {
|
|
110
|
-
var field = exports.UPDATE_XML_FIELDS[i];
|
|
111
|
-
if (!(field in row)) {
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
var text = asText(row[field]);
|
|
115
|
-
parts.push("<" + field + ">" + xmlEscape(text) + "</" + field + ">");
|
|
116
|
-
}
|
|
117
|
-
parts.push("</sys_update_xml>");
|
|
118
|
-
return parts.join("");
|
|
119
|
-
}
|
|
120
|
-
/** The `sys_remote_update_set` header an importable document needs. */
|
|
121
|
-
function renderRemoteUpdateSet(set, recordCount, unloadDate) {
|
|
122
|
-
return ('<sys_remote_update_set action="INSERT_OR_UPDATE">' +
|
|
123
|
-
"<application>" +
|
|
124
|
-
xmlEscape(set.scope) +
|
|
125
|
-
"</application>" +
|
|
126
|
-
"<description>" +
|
|
127
|
-
xmlEscape(set.description) +
|
|
128
|
-
"</description>" +
|
|
129
|
-
"<name>" +
|
|
130
|
-
xmlEscape(set.name) +
|
|
131
|
-
"</name>" +
|
|
132
|
-
"<origin_sys_id>" +
|
|
133
|
-
xmlEscape(set.sys_id) +
|
|
134
|
-
"</origin_sys_id>" +
|
|
135
|
-
"<remote_sys_id>" +
|
|
136
|
-
xmlEscape(set.sys_id) +
|
|
137
|
-
"</remote_sys_id>" +
|
|
138
|
-
"<state>loaded</state>" +
|
|
139
|
-
"<summary/>" +
|
|
140
|
-
"<sys_created_on>" +
|
|
141
|
-
xmlEscape(unloadDate) +
|
|
142
|
-
"</sys_created_on>" +
|
|
143
|
-
"<update_set>" +
|
|
144
|
-
xmlEscape(set.sys_id) +
|
|
145
|
-
"</update_set>" +
|
|
146
|
-
"<update_source/>" +
|
|
147
|
-
"<update_count>" +
|
|
148
|
-
String(recordCount) +
|
|
149
|
-
"</update_count>" +
|
|
150
|
-
"</sys_remote_update_set>");
|
|
151
|
-
}
|
|
152
|
-
/** Wrap rendered rows in the `<unload>` envelope. */
|
|
153
|
-
function renderUnload(header, rows, unloadDate) {
|
|
154
|
-
return ('<?xml version="1.0" encoding="UTF-8"?>' +
|
|
155
|
-
'<unload unload_date="' +
|
|
156
|
-
xmlEscape(unloadDate) +
|
|
157
|
-
'">' +
|
|
158
|
-
header +
|
|
159
|
-
rows.join("") +
|
|
160
|
-
"</unload>");
|
|
161
|
-
}
|
|
162
|
-
/** ServiceNow-style timestamp, e.g. "2026-09-15 18:40:02". */
|
|
163
|
-
function formatUnloadDate(now) {
|
|
164
|
-
var iso = now.toISOString();
|
|
165
|
-
return iso.slice(0, 10) + " " + iso.slice(11, 19);
|
|
166
|
-
}
|
|
167
70
|
async function resolveUpdateSet(client, selector) {
|
|
168
71
|
var query = SYS_ID_RE.test(selector)
|
|
169
72
|
? "sys_id=" + selector
|
|
@@ -218,47 +121,6 @@ function parseStatsCount(body) {
|
|
|
218
121
|
}
|
|
219
122
|
return n;
|
|
220
123
|
}
|
|
221
|
-
/** Page every `sys_update_xml` row of a set, oldest first. */
|
|
222
|
-
async function fetchUpdateXmlRows(client, updateSetSysId, pageSize, maxRows) {
|
|
223
|
-
var out = [];
|
|
224
|
-
var offset = 0;
|
|
225
|
-
while (true) {
|
|
226
|
-
var res = await client.now.invoke({
|
|
227
|
-
method: "GET",
|
|
228
|
-
path: "/api/now/table/sys_update_xml?sysparm_display_value=false" +
|
|
229
|
-
"&sysparm_exclude_reference_link=true" +
|
|
230
|
-
"&sysparm_fields=" +
|
|
231
|
-
encodeURIComponent(exports.UPDATE_XML_FIELDS.join(",")) +
|
|
232
|
-
"&sysparm_query=" +
|
|
233
|
-
encodeURIComponent("update_set=" + updateSetSysId + "^ORDERBYsys_recorded_at") +
|
|
234
|
-
"&sysparm_limit=" +
|
|
235
|
-
String(pageSize) +
|
|
236
|
-
"&sysparm_offset=" +
|
|
237
|
-
String(offset),
|
|
238
|
-
});
|
|
239
|
-
if (res.status !== 200) {
|
|
240
|
-
throw new Error("export-update-set: reading the set's records failed at offset " +
|
|
241
|
-
offset +
|
|
242
|
-
" (HTTP " +
|
|
243
|
-
res.status +
|
|
244
|
-
"). Nothing was written.");
|
|
245
|
-
}
|
|
246
|
-
var body = res.body;
|
|
247
|
-
var page = body && Array.isArray(body.result) ? body.result : [];
|
|
248
|
-
for (var i = 0; i < page.length; i += 1) {
|
|
249
|
-
out.push(page[i]);
|
|
250
|
-
}
|
|
251
|
-
if (page.length < pageSize) {
|
|
252
|
-
return out;
|
|
253
|
-
}
|
|
254
|
-
offset += page.length;
|
|
255
|
-
if (out.length > maxRows) {
|
|
256
|
-
throw new Error("export-update-set: the set exceeds maxRows (" +
|
|
257
|
-
maxRows +
|
|
258
|
-
") — raise it deliberately rather than exporting a truncated document.");
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
124
|
/**
|
|
263
125
|
* Refresh the L1 (password-typed field) map from the live dictionary, so tables
|
|
264
126
|
* added by a plugin since the baseline are covered. Falls back to the baseline
|
|
@@ -266,7 +128,7 @@ async function fetchUpdateXmlRows(client, updateSetSysId, pageSize, maxRows) {
|
|
|
266
128
|
* widen what ships, and the baseline is the conservative answer.
|
|
267
129
|
*/
|
|
268
130
|
async function refreshTypeFields(client, rules) {
|
|
269
|
-
var dictRows = await client.table.query("sys_dictionary", "internal_typeINpassword,password2", { limit:
|
|
131
|
+
var dictRows = await client.table.query("sys_dictionary", "internal_typeINpassword,password2", { limit: DICTIONARY_LIMIT, fields: ["name", "element", "internal_type"] });
|
|
270
132
|
if (!dictRows || dictRows.length === 0) {
|
|
271
133
|
return rules;
|
|
272
134
|
}
|
|
@@ -276,7 +138,7 @@ async function refreshTypeFields(client, rules) {
|
|
|
276
138
|
names[dictRows[i].name] = true;
|
|
277
139
|
}
|
|
278
140
|
}
|
|
279
|
-
var collectionRows = await client.table.query("sys_dictionary", "internal_type=collection^nameIN" + Object.keys(names).join(","), { limit:
|
|
141
|
+
var collectionRows = await client.table.query("sys_dictionary", "internal_type=collection^nameIN" + Object.keys(names).join(","), { limit: DICTIONARY_LIMIT, fields: ["name", "attributes"] });
|
|
280
142
|
var capturable = [];
|
|
281
143
|
for (var c = 0; c < collectionRows.length; c += 1) {
|
|
282
144
|
if ((0, secretRules_1.isCapturable)(collectionRows[c])) {
|
|
@@ -297,10 +159,9 @@ async function refreshTypeFields(client, rules) {
|
|
|
297
159
|
}
|
|
298
160
|
return rules;
|
|
299
161
|
}
|
|
300
|
-
function baseResult(set
|
|
162
|
+
function baseResult(set) {
|
|
301
163
|
return {
|
|
302
164
|
status: "failed",
|
|
303
|
-
mode: mode,
|
|
304
165
|
updateSetSysId: set.sys_id,
|
|
305
166
|
updateSetName: set.name,
|
|
306
167
|
scope: set.scope,
|
|
@@ -321,46 +182,37 @@ async function exportUpdateSet(params) {
|
|
|
321
182
|
params.updateSet.trim() === "") {
|
|
322
183
|
throw new Error("export-update-set: updateSet is required (a sys_id or the set's exact name).");
|
|
323
184
|
}
|
|
324
|
-
var mode = params.mode === "complete" ? "complete" : "assemble";
|
|
325
|
-
var pageSize = params.pageSize === undefined ? exports.DEFAULT_PAGE_SIZE : params.pageSize;
|
|
326
|
-
if (!Number.isInteger(pageSize) || pageSize < 1 || pageSize > exports.MAX_PAGE_SIZE) {
|
|
327
|
-
throw new Error("export-update-set: pageSize must be an integer between 1 and " +
|
|
328
|
-
exports.MAX_PAGE_SIZE +
|
|
329
|
-
".");
|
|
330
|
-
}
|
|
331
|
-
var maxRows = params.maxRows === undefined ? exports.DEFAULT_MAX_ROWS : params.maxRows;
|
|
332
|
-
if (!Number.isInteger(maxRows) || maxRows < 1) {
|
|
333
|
-
throw new Error("export-update-set: maxRows must be a positive integer.");
|
|
334
|
-
}
|
|
335
|
-
var live = params.dryRun !== true && (mode === "assemble" || params.confirm === true);
|
|
336
185
|
var client = params.client || (0, client_1.createClient)({});
|
|
337
|
-
var
|
|
338
|
-
var result = baseResult(
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
params.confirm !== true) {
|
|
342
|
-
result.status = "dry-run";
|
|
343
|
-
result.note =
|
|
344
|
-
"dry-run: mode=complete marks update set '" +
|
|
345
|
-
set.name +
|
|
346
|
-
"' complete on the instance before exporting — a real write. Re-run with confirm to proceed, " +
|
|
347
|
-
"or use the read-only assemble mode.";
|
|
348
|
-
return result;
|
|
349
|
-
}
|
|
350
|
-
if (!live) {
|
|
186
|
+
var target = await resolveUpdateSet(client, params.updateSet.trim());
|
|
187
|
+
var result = baseResult(target);
|
|
188
|
+
var isComplete = target.state === "complete";
|
|
189
|
+
if (params.dryRun === true) {
|
|
351
190
|
result.status = "dry-run";
|
|
352
191
|
result.note =
|
|
353
192
|
"dry-run: would export update set '" +
|
|
354
|
-
|
|
193
|
+
target.name +
|
|
355
194
|
"' (" +
|
|
356
|
-
|
|
195
|
+
target.sys_id +
|
|
357
196
|
", scope " +
|
|
358
|
-
(
|
|
197
|
+
(target.scope || "global") +
|
|
359
198
|
", state " +
|
|
360
|
-
(
|
|
361
|
-
")
|
|
362
|
-
|
|
363
|
-
|
|
199
|
+
(target.state || "unknown") +
|
|
200
|
+
") through the instance's export servlet, with secret values replaced by the sentinel" +
|
|
201
|
+
(isComplete
|
|
202
|
+
? "."
|
|
203
|
+
: ", after marking it complete (a real write; needs confirm).") +
|
|
204
|
+
" Nothing was read or written.";
|
|
205
|
+
return result;
|
|
206
|
+
}
|
|
207
|
+
if (!isComplete && params.confirm !== true) {
|
|
208
|
+
result.status = "dry-run";
|
|
209
|
+
result.note =
|
|
210
|
+
"dry-run: update set '" +
|
|
211
|
+
target.name +
|
|
212
|
+
"' is " +
|
|
213
|
+
(target.state || "not complete") +
|
|
214
|
+
". The export servlet only streams a complete set, so exporting it marks it complete " +
|
|
215
|
+
"on the instance first — a real write. Re-run with confirm to proceed.";
|
|
364
216
|
return result;
|
|
365
217
|
}
|
|
366
218
|
var rules = (0, secretRules_1.loadSecretRules)(params.rulesPath);
|
|
@@ -369,66 +221,41 @@ async function exportUpdateSet(params) {
|
|
|
369
221
|
}
|
|
370
222
|
catch (e) {
|
|
371
223
|
// Keep the baseline rules: an unreadable dictionary is a reason to be more
|
|
372
|
-
// careful, not to widen what ships.
|
|
224
|
+
// careful, not to widen what ships.
|
|
373
225
|
rules = (0, secretRules_1.loadSecretRules)(params.rulesPath);
|
|
374
226
|
}
|
|
375
|
-
var expected = await countUpdateXml(client,
|
|
227
|
+
var expected = await countUpdateXml(client, target.sys_id);
|
|
376
228
|
result.expectedRecords = expected;
|
|
377
229
|
if (expected === 0) {
|
|
378
230
|
result.status = "failed";
|
|
379
231
|
result.message = "the update set has no records";
|
|
380
232
|
result.note =
|
|
381
233
|
"export-update-set: update set '" +
|
|
382
|
-
|
|
234
|
+
target.name +
|
|
383
235
|
"' contains no records — nothing to export.";
|
|
384
236
|
return result;
|
|
385
237
|
}
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
"export-update-set: the instance reports " +
|
|
394
|
-
expected +
|
|
395
|
-
" records but paging returned " +
|
|
396
|
-
rows.length +
|
|
397
|
-
". Refusing to write a document that may be truncated.";
|
|
398
|
-
return result;
|
|
399
|
-
}
|
|
400
|
-
var unloadDate = formatUnloadDate(new Date());
|
|
401
|
-
var rendered = [];
|
|
402
|
-
for (var r = 0; r < rows.length; r += 1) {
|
|
403
|
-
rendered.push(renderUpdateXmlRow(rows[r]));
|
|
404
|
-
}
|
|
405
|
-
raw = renderUnload(renderRemoteUpdateSet(set, rows.length, unloadDate), rendered, unloadDate);
|
|
406
|
-
result.recordCount = rows.length;
|
|
238
|
+
var servlet = await exportViaServlet(params, target);
|
|
239
|
+
if (servlet.error !== "") {
|
|
240
|
+
result.status = "failed";
|
|
241
|
+
result.message = servlet.error;
|
|
242
|
+
result.note =
|
|
243
|
+
"export-update-set: " + servlet.error + " Nothing was written.";
|
|
244
|
+
return result;
|
|
407
245
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
result
|
|
419
|
-
if (result.recordCount !== expected) {
|
|
420
|
-
result.status = "failed";
|
|
421
|
-
result.message = "record count mismatch";
|
|
422
|
-
result.note =
|
|
423
|
-
"export-update-set: the servlet returned " +
|
|
424
|
-
result.recordCount +
|
|
425
|
-
" records but the set holds " +
|
|
426
|
-
expected +
|
|
427
|
-
". Refusing to write a possibly truncated document.";
|
|
428
|
-
return result;
|
|
429
|
-
}
|
|
246
|
+
result.recordCount = countUnloadRecords(servlet.xml);
|
|
247
|
+
if (result.recordCount !== expected) {
|
|
248
|
+
result.status = "failed";
|
|
249
|
+
result.message = "record count mismatch";
|
|
250
|
+
result.note =
|
|
251
|
+
"export-update-set: the servlet returned " +
|
|
252
|
+
result.recordCount +
|
|
253
|
+
" records but the set holds " +
|
|
254
|
+
expected +
|
|
255
|
+
". Refusing to write a possibly truncated document.";
|
|
256
|
+
return result;
|
|
430
257
|
}
|
|
431
|
-
var stripped = (0, stripSecrets_1.stripSecrets)(
|
|
258
|
+
var stripped = (0, stripSecrets_1.stripSecrets)(servlet.xml, rules);
|
|
432
259
|
result.status = "exported";
|
|
433
260
|
result.xml = stripped.xml;
|
|
434
261
|
result.secretFields = stripped.secretFields;
|
|
@@ -436,10 +263,8 @@ async function exportUpdateSet(params) {
|
|
|
436
263
|
"exported " +
|
|
437
264
|
result.recordCount +
|
|
438
265
|
" record(s) from '" +
|
|
439
|
-
|
|
440
|
-
"'
|
|
441
|
-
mode +
|
|
442
|
-
" mode; " +
|
|
266
|
+
target.name +
|
|
267
|
+
"' through the export servlet; " +
|
|
443
268
|
stripped.secretFields.length +
|
|
444
269
|
" secret value(s) replaced with " +
|
|
445
270
|
rules.sentinel +
|
|
@@ -452,7 +277,7 @@ function countUnloadRecords(xml) {
|
|
|
452
277
|
return m ? m.length : 0;
|
|
453
278
|
}
|
|
454
279
|
/**
|
|
455
|
-
*
|
|
280
|
+
* Mark the set complete when it is not already, then read the servlet. The state
|
|
456
281
|
* write goes through the REST table API deliberately — sys_update_set is a
|
|
457
282
|
* platform record, not a scoped app record, so the scope-safe Dovetail write
|
|
458
283
|
* path does not apply.
|
package/dist/index.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ export { invokeRest, INVOKE_REST_METHODS } from "./invokeRest";
|
|
|
39
39
|
export type { InvokeRestParams, InvokeRestResult } from "./invokeRest";
|
|
40
40
|
export { publishApp, buildStartFields, buildCreateUpdateSetFields, buildPublishToUpdateSetFields, resolveUpdateSetNaming, describeTarget, parsePublishTargets, PUBLISH_TARGETS, parseXmlAnswer, parseProgressTree, classifyProgress, flattenSteps, harvestProgressResults, parseCicdPublishResponse, parseCicdProgress, DEFAULT_PUBLISH_TIMEOUT_MS, PUBLISH_POLL_DELAYS_MS, } from "./publishApp";
|
|
41
41
|
export type { PublishAppParams, PublishAppResult, PublishTarget, PublishStep, ProgressNode, CicdProgress, PublishTransport, } from "./publishApp";
|
|
42
|
-
export { exportUpdateSet,
|
|
43
|
-
export type { ExportUpdateSetParams, ExportUpdateSetResult,
|
|
42
|
+
export { exportUpdateSet, countUnloadRecords, countUpdateXml, refreshTypeFields, parseStatsCount, xmlEscape, } from "./exportUpdateSet";
|
|
43
|
+
export type { ExportUpdateSetParams, ExportUpdateSetResult, ExportTransport, } from "./exportUpdateSet";
|
|
44
44
|
export { exportApp, buildCreateSetFields, buildPublishFields, DEFAULT_EXPORT_APP_TIMEOUT_MS, } from "./exportApp";
|
|
45
45
|
export type { ExportAppParams, ExportAppResult, ExportAppTransport, } from "./exportApp";
|
|
46
46
|
export { stripSecrets, verifyStripped, readField, readRecordTable, recordFieldNames, plannedStrips, stripField, stripJsonValue, encodeXmlEntities, encodeXmlText, escapeRegExp, } from "./secrets/stripSecrets";
|
package/dist/index.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.editFlow = exports.buildPublishModel = exports.createFlow = exports.copyFlow = exports.publishFlow = exports.readActionType = exports.readFlow = exports.formatStepPill = exports.summarizeSteps = exports.verifySteps = exports.applyStepOps = exports.validateDefineSpec = exports.planActionDefinition = exports.defineActionType = exports.editActionType = exports.publishActionType = exports.triggerPublication = exports.findStepInput = exports.fetchActionSteps = exports.slugInternalName = exports.resolveScope = exports.cloneActionType = exports.cloneSubflow = exports.verifyArtifact = exports.listTemplates = exports.sincPlugin = exports.formatCreateViewResult = exports.formatLayoutResult = exports.setRelatedLists = exports.setFormLayout = exports.setListLayout = exports.createView = exports.formatRemoveChoicesResult = exports.formatAddChoicesResult = exports.formatHostAssetsResult = exports.classifyChunks = exports.hostAssets = exports.ChoiceWriteError = exports.removeChoicesFromField = exports.addChoicesToField = exports.resolveConfigFromEnvFile = exports.createClientFromEnvFile = exports.assertWriteAllowed = exports.evaluateWriteGate = exports.isCiEnvironment = exports.resolveExecutionContext = exports.PROCESSFLOW_PATH_PREFIX = exports.isProcessflowPath = exports.resolveFlowAuth = exports.createClient = void 0;
|
|
10
10
|
exports.DEFAULT_WRITE_DOMAIN = exports.createRecord = exports.setField = exports.resolveTableAttributes = exports.setTable = exports.toStoredValue = exports.resolveAttributes = exports.setColumn = exports.CAPTURE_NOTE = exports.DEFAULT_ACCESS_METHOD = exports.XMLHTTP_PATH = exports.buildCreateScheduleFields = exports.buildCanCreateFields = exports.parseCanCreate = exports.parseAjaxAnswer = exports.captureRowName = exports.validateCreateIndex = exports.createIndex = exports.listIndexes = exports.indexMatchesColumns = exports.parseIndexColumns = exports.addIndex = exports.DESIGN_ACCESS_TABLE = exports.findDesignAccess = exports.ensureDesignAccess = exports.deriveElement = exports.resolveColumnAttributes = exports.normalizeAttributeInput = exports.missingAttributes = exports.mergeAttributes = exports.parseAttributes = exports.referenceAttrAudit = exports.addColumn = exports.DEFAULT_SAVE_ACTION = exports.DEFAULT_SUPER_CLASS = exports.TYPE_MAP = exports.defaultAccessFlags = exports.applyTableSaveOverlay = exports.resolveType = exports.normalizeColumns = exports.buildColumnXml = exports.projectTableGraph = exports.createTable = exports.WriteOrderError = exports.executeWritePlan = exports.topoSort = exports.generateSysId = exports.LEGACY_RUN_FLOW_PATH = exports.DEFAULT_RUN_FLOW_PATH = exports.testFlow = void 0;
|
|
11
|
-
exports.
|
|
12
|
-
exports.SECRET_INTERNAL_TYPES = exports.SENTINEL = exports.isCapturable = exports.secretFieldsFromDictionary = exports.mergeSecretRules = exports.loadSecretRules = exports.defaultSecretRules =
|
|
11
|
+
exports.escapeRegExp = exports.encodeXmlText = exports.encodeXmlEntities = exports.stripJsonValue = exports.stripField = exports.plannedStrips = exports.recordFieldNames = exports.readRecordTable = exports.readField = exports.verifyStripped = exports.stripSecrets = exports.DEFAULT_EXPORT_APP_TIMEOUT_MS = exports.buildPublishFields = exports.buildCreateSetFields = exports.exportApp = exports.xmlEscape = exports.parseStatsCount = exports.refreshTypeFields = exports.countUpdateXml = exports.countUnloadRecords = exports.exportUpdateSet = exports.PUBLISH_POLL_DELAYS_MS = exports.DEFAULT_PUBLISH_TIMEOUT_MS = exports.parseCicdProgress = exports.parseCicdPublishResponse = exports.harvestProgressResults = exports.flattenSteps = exports.classifyProgress = exports.parseProgressTree = exports.parseXmlAnswer = exports.PUBLISH_TARGETS = exports.parsePublishTargets = exports.describeTarget = exports.resolveUpdateSetNaming = exports.buildPublishToUpdateSetFields = exports.buildCreateUpdateSetFields = exports.buildStartFields = exports.publishApp = exports.INVOKE_REST_METHODS = exports.invokeRest = exports.verifyReadBack = exports.readBackMatches = exports.hasHtmlEntity = exports.decodeHtmlEntities = exports.formatUxEventSync = exports.parseNowUiActions = exports.syncUxEvents = exports.deleteRecord = exports.findOverrides = exports.normalizeDomain = void 0;
|
|
12
|
+
exports.SECRET_INTERNAL_TYPES = exports.SENTINEL = exports.isCapturable = exports.secretFieldsFromDictionary = exports.mergeSecretRules = exports.loadSecretRules = exports.defaultSecretRules = void 0;
|
|
13
13
|
var client_1 = require("./client");
|
|
14
14
|
Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return client_1.createClient; } });
|
|
15
15
|
Object.defineProperty(exports, "resolveFlowAuth", { enumerable: true, get: function () { return client_1.resolveFlowAuth; } });
|
|
@@ -163,20 +163,11 @@ Object.defineProperty(exports, "DEFAULT_PUBLISH_TIMEOUT_MS", { enumerable: true,
|
|
|
163
163
|
Object.defineProperty(exports, "PUBLISH_POLL_DELAYS_MS", { enumerable: true, get: function () { return publishApp_1.PUBLISH_POLL_DELAYS_MS; } });
|
|
164
164
|
var exportUpdateSet_1 = require("./exportUpdateSet");
|
|
165
165
|
Object.defineProperty(exports, "exportUpdateSet", { enumerable: true, get: function () { return exportUpdateSet_1.exportUpdateSet; } });
|
|
166
|
-
Object.defineProperty(exports, "renderUpdateXmlRow", { enumerable: true, get: function () { return exportUpdateSet_1.renderUpdateXmlRow; } });
|
|
167
|
-
Object.defineProperty(exports, "renderRemoteUpdateSet", { enumerable: true, get: function () { return exportUpdateSet_1.renderRemoteUpdateSet; } });
|
|
168
|
-
Object.defineProperty(exports, "renderUnload", { enumerable: true, get: function () { return exportUpdateSet_1.renderUnload; } });
|
|
169
166
|
Object.defineProperty(exports, "countUnloadRecords", { enumerable: true, get: function () { return exportUpdateSet_1.countUnloadRecords; } });
|
|
170
167
|
Object.defineProperty(exports, "countUpdateXml", { enumerable: true, get: function () { return exportUpdateSet_1.countUpdateXml; } });
|
|
171
|
-
Object.defineProperty(exports, "fetchUpdateXmlRows", { enumerable: true, get: function () { return exportUpdateSet_1.fetchUpdateXmlRows; } });
|
|
172
168
|
Object.defineProperty(exports, "refreshTypeFields", { enumerable: true, get: function () { return exportUpdateSet_1.refreshTypeFields; } });
|
|
173
169
|
Object.defineProperty(exports, "parseStatsCount", { enumerable: true, get: function () { return exportUpdateSet_1.parseStatsCount; } });
|
|
174
|
-
Object.defineProperty(exports, "formatUnloadDate", { enumerable: true, get: function () { return exportUpdateSet_1.formatUnloadDate; } });
|
|
175
170
|
Object.defineProperty(exports, "xmlEscape", { enumerable: true, get: function () { return exportUpdateSet_1.xmlEscape; } });
|
|
176
|
-
Object.defineProperty(exports, "UPDATE_XML_FIELDS", { enumerable: true, get: function () { return exportUpdateSet_1.UPDATE_XML_FIELDS; } });
|
|
177
|
-
Object.defineProperty(exports, "DEFAULT_PAGE_SIZE", { enumerable: true, get: function () { return exportUpdateSet_1.DEFAULT_PAGE_SIZE; } });
|
|
178
|
-
Object.defineProperty(exports, "MAX_PAGE_SIZE", { enumerable: true, get: function () { return exportUpdateSet_1.MAX_PAGE_SIZE; } });
|
|
179
|
-
Object.defineProperty(exports, "DEFAULT_MAX_ROWS", { enumerable: true, get: function () { return exportUpdateSet_1.DEFAULT_MAX_ROWS; } });
|
|
180
171
|
var exportApp_1 = require("./exportApp");
|
|
181
172
|
Object.defineProperty(exports, "exportApp", { enumerable: true, get: function () { return exportApp_1.exportApp; } });
|
|
182
173
|
Object.defineProperty(exports, "buildCreateSetFields", { enumerable: true, get: function () { return exportApp_1.buildCreateSetFields; } });
|
package/dist/loadEnv.d.ts
CHANGED
|
@@ -16,10 +16,53 @@ export declare var SN_CONNECTION_KEYS: string[];
|
|
|
16
16
|
* - a bare name that exists as a file in cwd (e.g. `--env my.env`) → that file;
|
|
17
17
|
* - a bare name like `loft` → `<cwd>/.env.loft`, matching the MCP tool's
|
|
18
18
|
* per-call `env` resolution; a `.env`-prefixed basename is used as-is.
|
|
19
|
+
* When `<cwd>/.env.loft` does not exist, the parent directories are
|
|
20
|
+
* searched (findEnvFileUpward) and the nearest existing `.env.loft` wins,
|
|
21
|
+
* so a nested git worktree can use the per-instance file of the checkout
|
|
22
|
+
* it lives in. Nothing found → `<cwd>/.env.loft`, as before. Same rule as
|
|
23
|
+
* `dove`'s resolveEnvArgPath (packages/core/src/envArg.ts).
|
|
19
24
|
*
|
|
20
|
-
*
|
|
25
|
+
* Only the bare-name case walks up. Existence is checked with stat only — no
|
|
26
|
+
* file is read here. Returns the resolved path; loadEnvFile checks existence.
|
|
21
27
|
*/
|
|
22
|
-
export declare function resolveEnvSelection(raw: string, cwd?: string): string;
|
|
28
|
+
export declare function resolveEnvSelection(raw: string, cwd?: string, options?: EnvWalkUpOptions): string;
|
|
29
|
+
/**
|
|
30
|
+
* How many parent directories a bare instance name's file is looked for in,
|
|
31
|
+
* above the cwd. Mirrored in packages/core/src/envArg.ts.
|
|
32
|
+
*/
|
|
33
|
+
export declare var ENV_WALK_UP_MAX_LEVELS: number;
|
|
34
|
+
/** Options for the parent-directory lookup of a bare instance name. */
|
|
35
|
+
export interface EnvWalkUpOptions {
|
|
36
|
+
/** Home directory to stop below (defaults to os.homedir()). Injectable for tests. */
|
|
37
|
+
homeDir?: string;
|
|
38
|
+
/** Called with the chosen path when the file was found in a parent directory. */
|
|
39
|
+
onParentMatch?: (foundPath: string) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Owner a parent match must have (defaults to process.getuid(); a negative
|
|
42
|
+
* value, or a platform without getuid, skips the check). Injectable for tests.
|
|
43
|
+
*/
|
|
44
|
+
ownerUid?: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Look for `fileName` in the parent directories of `startDir` (not in
|
|
48
|
+
* `startDir` itself) and return the nearest one that exists as a regular file
|
|
49
|
+
* owned by the current user. Bounds: at most `maxLevels` parents (default
|
|
50
|
+
* ENV_WALK_UP_MAX_LEVELS); never the home directory or anything above it;
|
|
51
|
+
* never the filesystem root. A file owned by someone else (e.g. planted in a
|
|
52
|
+
* shared or world-writable ancestor such as /tmp when the cwd is outside the
|
|
53
|
+
* home directory) is skipped, never selected. Uses stat only and never reads
|
|
54
|
+
* a file. Never throws: bad input or no match returns null.
|
|
55
|
+
*
|
|
56
|
+
* Keep behaviorally identical to findEnvFileUpward in
|
|
57
|
+
* packages/core/src/envArg.ts — tests/envWalkUpParity.test.ts runs both.
|
|
58
|
+
*/
|
|
59
|
+
export declare function findEnvFileUpward(args: {
|
|
60
|
+
fileName: string;
|
|
61
|
+
startDir: string;
|
|
62
|
+
homeDir?: string;
|
|
63
|
+
maxLevels?: number;
|
|
64
|
+
ownerUid?: number;
|
|
65
|
+
}): string | null;
|
|
23
66
|
/**
|
|
24
67
|
* Loads ServiceNow credentials for the `dove-sn` CLI and its MCP server.
|
|
25
68
|
*
|
package/dist/loadEnv.js
CHANGED
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SN_CONNECTION_KEYS = void 0;
|
|
6
|
+
exports.ENV_WALK_UP_MAX_LEVELS = exports.SN_CONNECTION_KEYS = void 0;
|
|
7
7
|
exports.resolveEnvSelection = resolveEnvSelection;
|
|
8
|
+
exports.findEnvFileUpward = findEnvFileUpward;
|
|
8
9
|
exports.loadEnvFile = loadEnvFile;
|
|
9
10
|
const fs_1 = __importDefault(require("fs"));
|
|
10
11
|
const dotenv_1 = __importDefault(require("dotenv"));
|
|
12
|
+
const os_1 = __importDefault(require("os"));
|
|
11
13
|
const path_1 = __importDefault(require("path"));
|
|
12
14
|
const createClientFromEnvFile_1 = require("./createClientFromEnvFile");
|
|
13
15
|
/**
|
|
@@ -48,10 +50,16 @@ exports.SN_CONNECTION_KEYS = [
|
|
|
48
50
|
* - a bare name that exists as a file in cwd (e.g. `--env my.env`) → that file;
|
|
49
51
|
* - a bare name like `loft` → `<cwd>/.env.loft`, matching the MCP tool's
|
|
50
52
|
* per-call `env` resolution; a `.env`-prefixed basename is used as-is.
|
|
53
|
+
* When `<cwd>/.env.loft` does not exist, the parent directories are
|
|
54
|
+
* searched (findEnvFileUpward) and the nearest existing `.env.loft` wins,
|
|
55
|
+
* so a nested git worktree can use the per-instance file of the checkout
|
|
56
|
+
* it lives in. Nothing found → `<cwd>/.env.loft`, as before. Same rule as
|
|
57
|
+
* `dove`'s resolveEnvArgPath (packages/core/src/envArg.ts).
|
|
51
58
|
*
|
|
52
|
-
*
|
|
59
|
+
* Only the bare-name case walks up. Existence is checked with stat only — no
|
|
60
|
+
* file is read here. Returns the resolved path; loadEnvFile checks existence.
|
|
53
61
|
*/
|
|
54
|
-
function resolveEnvSelection(raw, cwd) {
|
|
62
|
+
function resolveEnvSelection(raw, cwd, options) {
|
|
55
63
|
if (typeof raw !== "string" || raw.trim().length === 0) {
|
|
56
64
|
throw new Error("--env must be a non-empty env-file name or path.");
|
|
57
65
|
}
|
|
@@ -67,7 +75,143 @@ function resolveEnvSelection(raw, cwd) {
|
|
|
67
75
|
if (value.indexOf(".env") === 0) {
|
|
68
76
|
return literal;
|
|
69
77
|
}
|
|
70
|
-
|
|
78
|
+
var fileName = BARE_NAME_PREFIX + value;
|
|
79
|
+
var inCwd = path_1.default.resolve(base, fileName);
|
|
80
|
+
if (isExistingFile(inCwd)) {
|
|
81
|
+
return inCwd;
|
|
82
|
+
}
|
|
83
|
+
// A dotted value (`loft.env`) is not a bare instance name: keep the
|
|
84
|
+
// legacy `<cwd>/.env.<value>` result and never walk up for it.
|
|
85
|
+
if (value.indexOf(".") !== -1) {
|
|
86
|
+
return inCwd;
|
|
87
|
+
}
|
|
88
|
+
var opts = options || {};
|
|
89
|
+
var found = findEnvFileUpward({
|
|
90
|
+
fileName: fileName,
|
|
91
|
+
startDir: base,
|
|
92
|
+
homeDir: opts.homeDir,
|
|
93
|
+
ownerUid: opts.ownerUid,
|
|
94
|
+
});
|
|
95
|
+
if (found === null) {
|
|
96
|
+
return inCwd;
|
|
97
|
+
}
|
|
98
|
+
if (typeof opts.onParentMatch === "function") {
|
|
99
|
+
try {
|
|
100
|
+
opts.onParentMatch(found);
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
// A logging callback must never change which file is selected.
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return found;
|
|
107
|
+
}
|
|
108
|
+
// Prefix a bare instance name is expanded with (`loft` → `.env.loft`).
|
|
109
|
+
var BARE_NAME_PREFIX = ".env.";
|
|
110
|
+
/**
|
|
111
|
+
* How many parent directories a bare instance name's file is looked for in,
|
|
112
|
+
* above the cwd. Mirrored in packages/core/src/envArg.ts.
|
|
113
|
+
*/
|
|
114
|
+
exports.ENV_WALK_UP_MAX_LEVELS = 8;
|
|
115
|
+
/**
|
|
116
|
+
* Look for `fileName` in the parent directories of `startDir` (not in
|
|
117
|
+
* `startDir` itself) and return the nearest one that exists as a regular file
|
|
118
|
+
* owned by the current user. Bounds: at most `maxLevels` parents (default
|
|
119
|
+
* ENV_WALK_UP_MAX_LEVELS); never the home directory or anything above it;
|
|
120
|
+
* never the filesystem root. A file owned by someone else (e.g. planted in a
|
|
121
|
+
* shared or world-writable ancestor such as /tmp when the cwd is outside the
|
|
122
|
+
* home directory) is skipped, never selected. Uses stat only and never reads
|
|
123
|
+
* a file. Never throws: bad input or no match returns null.
|
|
124
|
+
*
|
|
125
|
+
* Keep behaviorally identical to findEnvFileUpward in
|
|
126
|
+
* packages/core/src/envArg.ts — tests/envWalkUpParity.test.ts runs both.
|
|
127
|
+
*/
|
|
128
|
+
function findEnvFileUpward(args) {
|
|
129
|
+
if (!args || typeof args.fileName !== "string" || typeof args.startDir !== "string") {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
var fileName = args.fileName;
|
|
133
|
+
if (fileName.length === 0 || /[\\/]/.test(fileName) || fileName === "." || fileName === "..") {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
if (args.startDir.length === 0) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
var maxLevels = typeof args.maxLevels === "number" && isFinite(args.maxLevels) && args.maxLevels >= 0
|
|
140
|
+
? Math.floor(args.maxLevels)
|
|
141
|
+
: exports.ENV_WALK_UP_MAX_LEVELS;
|
|
142
|
+
var home = typeof args.homeDir === "string" ? args.homeDir : safeHomeDir();
|
|
143
|
+
var homeResolved = home.length > 0 ? path_1.default.resolve(home) : "";
|
|
144
|
+
var ownerUid = typeof args.ownerUid === "number" && isFinite(args.ownerUid) ? args.ownerUid : currentUid();
|
|
145
|
+
var dir = path_1.default.resolve(args.startDir);
|
|
146
|
+
for (var level = 0; level < maxLevels; level++) {
|
|
147
|
+
var parent = path_1.default.dirname(dir);
|
|
148
|
+
if (parent === dir) {
|
|
149
|
+
break; // already at the root
|
|
150
|
+
}
|
|
151
|
+
dir = parent;
|
|
152
|
+
if (path_1.default.dirname(dir) === dir) {
|
|
153
|
+
break; // never the filesystem root
|
|
154
|
+
}
|
|
155
|
+
if (homeResolved.length > 0 && isSameOrAncestor({ dir: dir, of: homeResolved })) {
|
|
156
|
+
break; // never the home directory or above it
|
|
157
|
+
}
|
|
158
|
+
var candidate = path_1.default.join(dir, fileName);
|
|
159
|
+
if (isOwnedFile({ candidate: candidate, ownerUid: ownerUid })) {
|
|
160
|
+
return candidate;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
// True when the path is a regular file owned by `ownerUid` (any owner when
|
|
166
|
+
// `ownerUid` is negative). Stat only. Never throws.
|
|
167
|
+
function isOwnedFile(args) {
|
|
168
|
+
try {
|
|
169
|
+
var stat = fs_1.default.statSync(args.candidate);
|
|
170
|
+
if (!stat.isFile()) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
return args.ownerUid < 0 || stat.uid === args.ownerUid;
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
// process.getuid(), or -1 where it does not exist (Windows), which disables
|
|
180
|
+
// the ownership check. Never throws.
|
|
181
|
+
function currentUid() {
|
|
182
|
+
try {
|
|
183
|
+
return typeof process.getuid === "function" ? process.getuid() : -1;
|
|
184
|
+
}
|
|
185
|
+
catch (e) {
|
|
186
|
+
return -1;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
// True when `dir` is `of` itself or one of its ancestors. Both absolute.
|
|
190
|
+
function isSameOrAncestor(args) {
|
|
191
|
+
var rel = path_1.default.relative(args.dir, args.of);
|
|
192
|
+
if (rel === "") {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
return rel.indexOf("..") !== 0 && !path_1.default.isAbsolute(rel);
|
|
196
|
+
}
|
|
197
|
+
// True when the path exists and is a regular file. Never throws.
|
|
198
|
+
function isExistingFile(candidate) {
|
|
199
|
+
try {
|
|
200
|
+
return fs_1.default.statSync(candidate).isFile();
|
|
201
|
+
}
|
|
202
|
+
catch (e) {
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// os.homedir(), or "" when it cannot be determined. Never throws.
|
|
207
|
+
function safeHomeDir() {
|
|
208
|
+
try {
|
|
209
|
+
var home = os_1.default.homedir();
|
|
210
|
+
return typeof home === "string" ? home : "";
|
|
211
|
+
}
|
|
212
|
+
catch (e) {
|
|
213
|
+
return "";
|
|
214
|
+
}
|
|
71
215
|
}
|
|
72
216
|
/**
|
|
73
217
|
* Loads ServiceNow credentials for the `dove-sn` CLI and its MCP server.
|
|
@@ -98,7 +242,13 @@ function loadEnvFile(explicitSelection) {
|
|
|
98
242
|
dotenv_1.default.config();
|
|
99
243
|
return undefined;
|
|
100
244
|
}
|
|
101
|
-
var resolved = resolveEnvSelection(raw
|
|
245
|
+
var resolved = resolveEnvSelection(raw, undefined, {
|
|
246
|
+
onParentMatch: function (foundPath) {
|
|
247
|
+
// stderr, never stdout (stdout carries --json output and the MCP protocol).
|
|
248
|
+
// The path only — never anything from the file.
|
|
249
|
+
process.stderr.write("dove-sn: --env " + raw + ": using " + foundPath + " (found in a parent directory)\n");
|
|
250
|
+
},
|
|
251
|
+
});
|
|
102
252
|
if (!fs_1.default.existsSync(resolved)) {
|
|
103
253
|
throw new Error("env file not found: '" + resolved + "' (from --env '" + raw + "'). " +
|
|
104
254
|
"Refusing to fall back to the default environment — pass an existing env-file " +
|
package/dist/mcp/registry.js
CHANGED
|
@@ -1028,14 +1028,14 @@ function buildDescriptors(deps = {}) {
|
|
|
1028
1028
|
},
|
|
1029
1029
|
{
|
|
1030
1030
|
name: "update_set_export",
|
|
1031
|
-
annotations: dovetail_mcp_kit_1.
|
|
1031
|
+
annotations: dovetail_mcp_kit_1.WRITE_OVERWRITE,
|
|
1032
1032
|
description: "Export one update set to an importable <unload> XML document, with every secret value " +
|
|
1033
|
-
"replaced by the __SET_DURING_INSTALL__ sentinel.
|
|
1034
|
-
"
|
|
1035
|
-
"
|
|
1036
|
-
"
|
|
1037
|
-
"and
|
|
1038
|
-
"
|
|
1033
|
+
"replaced by the __SET_DURING_INSTALL__ sentinel. The document comes from the instance's " +
|
|
1034
|
+
"own export servlet (the UI's Export Update Set to XML), so it imports exactly like a UI " +
|
|
1035
|
+
"export. The servlet only streams a COMPLETE set, so a set still in progress is marked " +
|
|
1036
|
+
"complete first — a REAL WRITE, so it needs confirm:true; without it the plan is returned " +
|
|
1037
|
+
"and nothing changes. A set that is already complete exports with no write. Needs a " +
|
|
1038
|
+
"username and password the instance accepts for form login. The export REFUSES to " +
|
|
1039
1039
|
"produce a document when the row count does not match the set, or when a field looks " +
|
|
1040
1040
|
"secret and no rule covers it: adjudicate it in the rules file as a strip rule or as " +
|
|
1041
1041
|
"notSecret with a reason. Secret stripping cannot be disabled. The result carries the XML, " +
|
|
@@ -1046,10 +1046,7 @@ function buildDescriptors(deps = {}) {
|
|
|
1046
1046
|
var p = schemas_1.exportUpdateSetSchema.parse(args);
|
|
1047
1047
|
var params = {
|
|
1048
1048
|
updateSet: p.updateSet,
|
|
1049
|
-
mode: p.mode,
|
|
1050
1049
|
rulesPath: p.rulesPath,
|
|
1051
|
-
pageSize: p.pageSize,
|
|
1052
|
-
maxRows: p.maxRows,
|
|
1053
1050
|
confirm: p.confirm,
|
|
1054
1051
|
dryRun: p.dryRun,
|
|
1055
1052
|
};
|
package/dist/mcp/schemas.d.ts
CHANGED
|
@@ -2298,28 +2298,19 @@ export declare var syncUxEventsSchema: z.ZodObject<{
|
|
|
2298
2298
|
}>;
|
|
2299
2299
|
export declare var exportUpdateSetSchema: z.ZodObject<{
|
|
2300
2300
|
updateSet: z.ZodString;
|
|
2301
|
-
mode: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"assemble">, z.ZodLiteral<"complete">]>>;
|
|
2302
2301
|
rulesPath: z.ZodOptional<z.ZodString>;
|
|
2303
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
2304
|
-
maxRows: z.ZodOptional<z.ZodNumber>;
|
|
2305
2302
|
confirm: z.ZodOptional<z.ZodBoolean>;
|
|
2306
2303
|
dryRun: z.ZodOptional<z.ZodBoolean>;
|
|
2307
2304
|
}, "strip", z.ZodTypeAny, {
|
|
2308
2305
|
updateSet: string;
|
|
2309
2306
|
confirm?: boolean | undefined;
|
|
2310
|
-
mode?: "complete" | "assemble" | undefined;
|
|
2311
2307
|
dryRun?: boolean | undefined;
|
|
2312
2308
|
rulesPath?: string | undefined;
|
|
2313
|
-
pageSize?: number | undefined;
|
|
2314
|
-
maxRows?: number | undefined;
|
|
2315
2309
|
}, {
|
|
2316
2310
|
updateSet: string;
|
|
2317
2311
|
confirm?: boolean | undefined;
|
|
2318
|
-
mode?: "complete" | "assemble" | undefined;
|
|
2319
2312
|
dryRun?: boolean | undefined;
|
|
2320
2313
|
rulesPath?: string | undefined;
|
|
2321
|
-
pageSize?: number | undefined;
|
|
2322
|
-
maxRows?: number | undefined;
|
|
2323
2314
|
}>;
|
|
2324
2315
|
export declare var exportAppSchema: z.ZodObject<{
|
|
2325
2316
|
app: z.ZodString;
|
package/dist/mcp/schemas.js
CHANGED
|
@@ -578,10 +578,7 @@ exports.syncUxEventsSchema = zod_1.z.object({
|
|
|
578
578
|
// that looks secret and no rule covers fails the call instead of shipping.
|
|
579
579
|
exports.exportUpdateSetSchema = zod_1.z.object({
|
|
580
580
|
updateSet: zod_1.z.string().min(1),
|
|
581
|
-
mode: zod_1.z.union([zod_1.z.literal("assemble"), zod_1.z.literal("complete")]).optional(),
|
|
582
581
|
rulesPath: zod_1.z.string().optional(),
|
|
583
|
-
pageSize: zod_1.z.number().int().positive().optional(),
|
|
584
|
-
maxRows: zod_1.z.number().int().positive().optional(),
|
|
585
582
|
confirm: zod_1.z.boolean().optional(),
|
|
586
583
|
dryRun: zod_1.z.boolean().optional(),
|
|
587
584
|
});
|