@tenonhq/dovetail-servicenow 0.0.58 → 0.0.60
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 +7 -2
- package/dist/appDependencies.d.ts +136 -0
- package/dist/appDependencies.js +616 -0
- package/dist/cli.js +70 -0
- package/dist/cliUsage.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -2
- package/dist/mcp/registry.d.ts +1 -1
- package/dist/mcp/registry.js +33 -2
- package/dist/mcp/schemas.d.ts +200 -1957
- package/dist/mcp/schemas.js +24 -8
- package/dist/table/buildTableSave.js +5 -2
- package/dist/uxEvents.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -670,7 +670,9 @@ graph + the physical table + seeded ACLs. Before the save it switches the form
|
|
|
670
670
|
session's **current application** to the target scope (the new table's scope is
|
|
671
671
|
governed by the session app, not a form field), so the table, columns, ACLs, and
|
|
672
672
|
module all land in `--scope`. Friendly column types are mapped to ServiceNow
|
|
673
|
-
internal types (`string` → `string_full_utf8`, Studio's real String type
|
|
673
|
+
internal types (`string` → `string_full_utf8`, Studio's real String type; `phone` →
|
|
674
|
+
`phone_number_e164`, the E.164 Phone Number type). Any ServiceNow internal type on the
|
|
675
|
+
allow-list in `buildTableSave.ts` also passes through as-is.
|
|
674
676
|
|
|
675
677
|
`--dry-run` returns the plan + the column XML + the projected graph with no session
|
|
676
678
|
and no writes. **Validated live 2026-06-13** (tenonworkstudio): a 6-column create
|
|
@@ -1331,7 +1333,10 @@ the SOURCE app's update set and read back; CLI `dove-sn design-access --source <
|
|
|
1331
1333
|
read back from the `v_db_index` view - uniqueness enforcement is always reported
|
|
1332
1334
|
unverified) / `index_list` (read-only: a table's database indexes from `v_db_index`,
|
|
1333
1335
|
the only index read surface - `sys_index` is API-level-ACL 403 and `sys_index_column`
|
|
1334
|
-
does not exist) / `
|
|
1336
|
+
does not exist) / `app_dependencies` (read-only: each application's required apps and plugins, and the
|
|
1337
|
+
inverse required-by view; `sys_package_dependency_m2m` is usually HTTP 403, so `auto` derives
|
|
1338
|
+
the rows from the current `sys_update_version` captures and reports uncaptured rows and
|
|
1339
|
+
deletions unverified; CLI `dove-sn app-dependencies`) / `index_create` (create an index, composite and non-unique included, by
|
|
1335
1340
|
replaying the Database Indexes dialog's own processor calls; dry-run by default, idempotent,
|
|
1336
1341
|
pinned to a required update set, read back from `v_db_index` and the capture row read back
|
|
1337
1342
|
from `sys_update_xml`), the record-write verbs `set_field` (update scalar fields on an
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* appDependencies — which applications and plugins each application on an instance
|
|
3
|
+
* REQUIRES, and (inverted) which applications require each one.
|
|
4
|
+
*
|
|
5
|
+
* WHERE THE DATA LIVES, AND WHY THERE ARE THREE READ PATHS. An application's
|
|
6
|
+
* dependencies are rows of `sys_package_dependency_m2m` (sys_package = the app that
|
|
7
|
+
* requires, dependency = what it requires, min_version). That table, its child
|
|
8
|
+
* `sys_package_dependency_item`, `sys_package`, `sys_plugins` and `sys_store_app` all
|
|
9
|
+
* answer the Table API with HTTP 403 for the identity Dovetail normally holds — verified
|
|
10
|
+
* live on two Tenon instances on 2026-11-18. So, in "auto" order:
|
|
11
|
+
*
|
|
12
|
+
* 1. source "server" GETs the Dovetail Core op `/api/cadso/dovetail_core/appDependencies`
|
|
13
|
+
* (source: servicenow/dovetail/sys_ws_operation/appDependencies.js), which reads
|
|
14
|
+
* the table server-side in the Dovetail app and returns both sides' name, scope and
|
|
15
|
+
* version. Authoritative. Called through now.invoke, so a 404 (op not deployed)
|
|
16
|
+
* never flips the client's other Dovetail ops to the legacy path.
|
|
17
|
+
* 2. source "table" reads `sys_package_dependency_m2m` over the Table API, with the
|
|
18
|
+
* names, scopes and versions of both sides dot-walked in. Authoritative. Works only
|
|
19
|
+
* for an identity the table's ACL admits.
|
|
20
|
+
* 3. source "update-versions" reads the CURRENT `sys_update_version` capture of every
|
|
21
|
+
* `sys_package_dependency_m2m_<sys_id>` record. A dependency row is an application
|
|
22
|
+
* file, so adding or editing one in Studio captures it, and the capture's payload
|
|
23
|
+
* carries both sides' sys_id, display name and scope (the `source` attribute) plus
|
|
24
|
+
* min_version. `sys_update_version` IS readable with the same identity.
|
|
25
|
+
*
|
|
26
|
+
* "auto" (the default) moves down the list only on: the op answering 404 or 403, the
|
|
27
|
+
* table answering 403, or the table answering with no rows (a row-level ACL). A 401, a
|
|
28
|
+
* network failure or any other error propagates — a bad credential must never read as
|
|
29
|
+
* "no dependencies". An explicit source never falls back.
|
|
30
|
+
*
|
|
31
|
+
* WHAT THE UPDATE-VERSION PATH CANNOT PROVE (always named in `unverified`):
|
|
32
|
+
* - a dependency row created WITHOUT a capture (a system process, an install) is
|
|
33
|
+
* invisible to it;
|
|
34
|
+
* - a row deleted without a DELETE capture still reads as present. A captured DELETE
|
|
35
|
+
* is honored (the edge is dropped and counted in `removed`).
|
|
36
|
+
* Two rows for the same (app, dependency) pair are reported in `duplicates` rather
|
|
37
|
+
* than silently merged — on the update-version path one of them is often such a stale
|
|
38
|
+
* capture, and only the table read (or the app's Dependencies list) can say which.
|
|
39
|
+
*
|
|
40
|
+
* Off the server path, installed versions come from `sys_scope` (readable), so they are
|
|
41
|
+
* filled for APPLICATIONS only. A plugin is not a sys_scope row: its installed version stays ""
|
|
42
|
+
* and its `kind` reads "plugin-or-unknown".
|
|
43
|
+
*
|
|
44
|
+
* Read-only: GETs only (Table API + the read-only Dovetail Core op). ES6 only, no optional chaining, no `any`.
|
|
45
|
+
*/
|
|
46
|
+
import type { ServiceNowClient } from "./client";
|
|
47
|
+
export declare var DEPENDENCY_TABLE: string;
|
|
48
|
+
export type AppDependencySource = "auto" | "server" | "table" | "update-versions";
|
|
49
|
+
/** The read-only Dovetail Core op (Dovetail app scope) that reads the table server-side. */
|
|
50
|
+
export declare var SERVER_OP_PATH: string;
|
|
51
|
+
/** One side of a dependency edge. */
|
|
52
|
+
export interface AppRef {
|
|
53
|
+
sysId: string;
|
|
54
|
+
name: string;
|
|
55
|
+
/** App scope (x_cadso_core) or plugin id (com.glide.hub.flow_trigger). "" when unknown. */
|
|
56
|
+
scope: string;
|
|
57
|
+
/** Installed version. "" when not readable (always for a plugin). */
|
|
58
|
+
version: string;
|
|
59
|
+
/** "application" when the sys_id is a sys_scope row on this instance. */
|
|
60
|
+
kind: "application" | "plugin-or-unknown";
|
|
61
|
+
}
|
|
62
|
+
export interface AppDependencyEdge {
|
|
63
|
+
/** The application that REQUIRES. */
|
|
64
|
+
app: AppRef;
|
|
65
|
+
/** The application or plugin it requires. */
|
|
66
|
+
dependency: AppRef;
|
|
67
|
+
minVersion: string;
|
|
68
|
+
/** sys_id of the sys_package_dependency_m2m row. */
|
|
69
|
+
dependencySysId: string;
|
|
70
|
+
/** Update-version path only: the update set (or other source) holding the current capture. */
|
|
71
|
+
capturedIn: string;
|
|
72
|
+
}
|
|
73
|
+
export interface RequiredByEntry {
|
|
74
|
+
dependency: AppRef;
|
|
75
|
+
/**
|
|
76
|
+
* One entry per requiring app. `rowCount` > 1 means the pair carries duplicate rows
|
|
77
|
+
* (see `duplicates`); `minVersion` is then the highest of them.
|
|
78
|
+
*/
|
|
79
|
+
requiredBy: Array<{
|
|
80
|
+
app: AppRef;
|
|
81
|
+
minVersion: string;
|
|
82
|
+
rowCount: number;
|
|
83
|
+
}>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Compare dotted versions numerically part by part ("4.0.20261014" > "3.4.1").
|
|
87
|
+
* A non-numeric part compares as text. Empty sorts lowest.
|
|
88
|
+
*/
|
|
89
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
90
|
+
export interface DuplicatePair {
|
|
91
|
+
appScope: string;
|
|
92
|
+
dependencyScope: string;
|
|
93
|
+
dependencySysIds: Array<string>;
|
|
94
|
+
minVersions: Array<string>;
|
|
95
|
+
}
|
|
96
|
+
export interface AppDependenciesParams {
|
|
97
|
+
client: ServiceNowClient;
|
|
98
|
+
/** Keep only edges whose REQUIRING app's scope starts with this. */
|
|
99
|
+
appScopePrefix?: string;
|
|
100
|
+
/** Keep only edges whose DEPENDENCY's scope starts with this. */
|
|
101
|
+
dependencyScopePrefix?: string;
|
|
102
|
+
source?: AppDependencySource;
|
|
103
|
+
}
|
|
104
|
+
export interface AppDependenciesResult {
|
|
105
|
+
/** The path that produced the rows (never "auto"). */
|
|
106
|
+
source: "server" | "table" | "update-versions";
|
|
107
|
+
edges: Array<AppDependencyEdge>;
|
|
108
|
+
/** The inverse view: per dependency, the apps that require it. Sorted by dependency name. */
|
|
109
|
+
requiredBy: Array<RequiredByEntry>;
|
|
110
|
+
duplicates: Array<DuplicatePair>;
|
|
111
|
+
/** Update-version path: dependency rows whose current capture is a DELETE (dropped). */
|
|
112
|
+
removed: number;
|
|
113
|
+
/** True when MAX_PAGES was hit — the scan is incomplete. */
|
|
114
|
+
truncated: boolean;
|
|
115
|
+
unverified: Array<string>;
|
|
116
|
+
note: string;
|
|
117
|
+
}
|
|
118
|
+
/** Decode the five predefined XML entities plus numeric references. */
|
|
119
|
+
export declare function xmlUnescape(value: string): string;
|
|
120
|
+
export interface ParsedDependencyCapture {
|
|
121
|
+
action: string;
|
|
122
|
+
m2mSysId: string;
|
|
123
|
+
appSysId: string;
|
|
124
|
+
appName: string;
|
|
125
|
+
appScope: string;
|
|
126
|
+
depSysId: string;
|
|
127
|
+
depName: string;
|
|
128
|
+
depScope: string;
|
|
129
|
+
minVersion: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Parse one `sys_update_version.payload` for a sys_package_dependency_m2m record.
|
|
133
|
+
* Returns null for anything that is not such a payload — never throws on bad input.
|
|
134
|
+
*/
|
|
135
|
+
export declare function parseDependencyCapture(payload: unknown): ParsedDependencyCapture | null;
|
|
136
|
+
export declare function appDependencies(params: AppDependenciesParams): Promise<AppDependenciesResult>;
|