@snutils/snu 0.3.4 → 0.3.6
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/dist/cli/format.d.ts +0 -3
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +45 -3
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +46 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +12 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/nowsdk/NowSdkBuild.d.ts +53 -0
- package/dist/nowsdk/NowSdkBuild.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkBuild.js +152 -0
- package/dist/nowsdk/NowSdkBuild.js.map +1 -0
- package/dist/nowsdk/NowSdkChoices.d.ts +6 -0
- package/dist/nowsdk/NowSdkChoices.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkChoices.js +105 -0
- package/dist/nowsdk/NowSdkChoices.js.map +1 -0
- package/dist/nowsdk/NowSdkFlows.d.ts +99 -0
- package/dist/nowsdk/NowSdkFlows.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkFlows.js +203 -0
- package/dist/nowsdk/NowSdkFlows.js.map +1 -0
- package/dist/nowsdk/NowSdkProject.d.ts +71 -0
- package/dist/nowsdk/NowSdkProject.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkProject.js +341 -0
- package/dist/nowsdk/NowSdkProject.js.map +1 -0
- package/dist/nowsdk/NowSdkPull.d.ts +147 -0
- package/dist/nowsdk/NowSdkPull.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkPull.js +824 -0
- package/dist/nowsdk/NowSdkPull.js.map +1 -0
- package/dist/nowsdk/NowSdkSource.d.ts +6 -0
- package/dist/nowsdk/NowSdkSource.d.ts.map +1 -0
- package/dist/nowsdk/NowSdkSource.js +102 -0
- package/dist/nowsdk/NowSdkSource.js.map +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +114 -0
- package/dist/registry.js.map +1 -1
- package/dist/server/dispatcher.d.ts +1 -0
- package/dist/server/dispatcher.d.ts.map +1 -1
- package/dist/server/dispatcher.js +65 -0
- package/dist/server/dispatcher.js.map +1 -1
- package/dist/server/httpBridge.d.ts.map +1 -1
- package/dist/server/httpBridge.js +2 -0
- package/dist/server/httpBridge.js.map +1 -1
- package/dist/server/policy.d.ts.map +1 -1
- package/dist/server/policy.js +8 -0
- package/dist/server/policy.js.map +1 -1
- package/dist/server/wsBridge.d.ts.map +1 -1
- package/dist/server/wsBridge.js +7 -1
- package/dist/server/wsBridge.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export declare const NOW_CONFIG_FILE = "now.config.json";
|
|
2
|
+
export interface NowSdkProject {
|
|
3
|
+
root: string;
|
|
4
|
+
name: string;
|
|
5
|
+
scope: string;
|
|
6
|
+
scopeId: string;
|
|
7
|
+
version: string;
|
|
8
|
+
appOutputDir: string;
|
|
9
|
+
packOutputDir: string;
|
|
10
|
+
/** now.config.json `type`: 'package' (default) or 'configuration'. */
|
|
11
|
+
type: string;
|
|
12
|
+
/** now.config.json `installAs`, e.g. 'store'. */
|
|
13
|
+
installAs: string;
|
|
14
|
+
hasHostedPlugins: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** ServiceNow SDK versions whose packages and install protocol match what ScriptSync sends. */
|
|
17
|
+
export declare const SUPPORTED_SDK: {
|
|
18
|
+
min: string;
|
|
19
|
+
belowMajor: number;
|
|
20
|
+
};
|
|
21
|
+
export interface NowSdkDeployLink {
|
|
22
|
+
instance: string;
|
|
23
|
+
url: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class NowSdkProjectError extends Error {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The NOW SDK project root that contains `filePath`, or null. When `stopAt` is
|
|
29
|
+
* given, only directories from the file's folder up to and including `stopAt`
|
|
30
|
+
* are checked, so a project outside that folder never matches.
|
|
31
|
+
*/
|
|
32
|
+
export declare function findNowSdkProjectRoot(filePath: string, stopAt?: string): string | null;
|
|
33
|
+
export declare function readNowSdkProject(root: string): NowSdkProject;
|
|
34
|
+
/**
|
|
35
|
+
* Refuse app types ScriptSync does not deploy or pull the way the SDK does,
|
|
36
|
+
* with a pointer to `now-sdk install` / `now-sdk transform` for them.
|
|
37
|
+
*/
|
|
38
|
+
export declare function assertSupportedProject(project: NowSdkProject): void;
|
|
39
|
+
/** The ServiceNow SDK version installed in the project, or null when it is not installed. */
|
|
40
|
+
export declare function readSdkVersion(root: string): string | null;
|
|
41
|
+
/** Refuse SDK versions outside the range whose packages ScriptSync handles. */
|
|
42
|
+
export declare function assertSupportedSdk(root: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Flow and action record ids in the built app, for activating them after an
|
|
45
|
+
* install (the SDK's own post-install step). Read from the build output file
|
|
46
|
+
* names, which follow `<table>_<sys_id>.xml`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function listFlowRecordIds(appOutputDir: string): {
|
|
49
|
+
flows: string[];
|
|
50
|
+
actions: string[];
|
|
51
|
+
};
|
|
52
|
+
/** The zip path reported by `now-sdk pack`, or null. */
|
|
53
|
+
export declare function parsePackOutput(output: string): string | null;
|
|
54
|
+
/** Newest `.zip` in a folder, used when the pack output could not be parsed. */
|
|
55
|
+
export declare function findNewestZip(dir: string): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The instance this project deploys to. Stored in `.snu/deploy.json` inside the
|
|
58
|
+
* project, next to a `.gitignore` that keeps the folder out of git: the link is
|
|
59
|
+
* a personal choice, not project configuration.
|
|
60
|
+
*/
|
|
61
|
+
export declare function readDeployLink(root: string): NowSdkDeployLink | null;
|
|
62
|
+
export declare function writeDeployLink(root: string, link: NowSdkDeployLink): void;
|
|
63
|
+
/** NOW SDK project roots under `root`, a few levels deep, skipping build and dependency folders. */
|
|
64
|
+
export declare function findNowSdkProjects(root: string, maxDepth?: number): string[];
|
|
65
|
+
/**
|
|
66
|
+
* The project an agent asked for. `projectPath` (relative to `root`, or
|
|
67
|
+
* absolute) must stay inside `root`, symlinks included. Without it, `root`
|
|
68
|
+
* must contain exactly one project.
|
|
69
|
+
*/
|
|
70
|
+
export declare function resolveNowSdkProjectRoot(root: string, projectPath?: string): string;
|
|
71
|
+
//# sourceMappingURL=NowSdkProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowSdkProject.d.ts","sourceRoot":"","sources":["../../src/nowsdk/NowSdkProject.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAIjD,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC1B;AAED,+FAA+F;AAC/F,eAAO,MAAM,aAAa;;;CAAkC,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACZ;AAED,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAqBhD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYtF;AAoBD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAwB7D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAWnE;AAOD,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO1D;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAgB9F;AAED,wDAAwD;AACxD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG7D;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBxD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAQpE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAM1E;AAID,oGAAoG;AACpG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,MAAM,EAAE,CAsBvE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAqBnF"}
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ServiceNow SDK (NOW SDK / Fluent) project support.
|
|
3
|
+
//
|
|
4
|
+
// A folder containing `now.config.json` is a NOW SDK project. Its sources
|
|
5
|
+
// (`*.now.ts`, `src/server/**`) compile into an application package; they are
|
|
6
|
+
// never ScriptSync field files, so the field sync must skip them entirely and
|
|
7
|
+
// the app is deployed as a whole package instead (see NowSdkDeploy.ts).
|
|
8
|
+
//
|
|
9
|
+
// Kept free of `vscode` imports so it can be unit tested under plain Node.
|
|
10
|
+
// packages/snu/src/nowsdk/ holds a byte-identical copy for the standalone
|
|
11
|
+
// bridge; src/test/nowSdkShared.test.ts fails when the two drift.
|
|
12
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
15
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
16
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
17
|
+
}
|
|
18
|
+
Object.defineProperty(o, k2, desc);
|
|
19
|
+
}) : (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
o[k2] = m[k];
|
|
22
|
+
}));
|
|
23
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
24
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
25
|
+
}) : function(o, v) {
|
|
26
|
+
o["default"] = v;
|
|
27
|
+
});
|
|
28
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
29
|
+
var ownKeys = function(o) {
|
|
30
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
31
|
+
var ar = [];
|
|
32
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
33
|
+
return ar;
|
|
34
|
+
};
|
|
35
|
+
return ownKeys(o);
|
|
36
|
+
};
|
|
37
|
+
return function (mod) {
|
|
38
|
+
if (mod && mod.__esModule) return mod;
|
|
39
|
+
var result = {};
|
|
40
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
41
|
+
__setModuleDefault(result, mod);
|
|
42
|
+
return result;
|
|
43
|
+
};
|
|
44
|
+
})();
|
|
45
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.NowSdkProjectError = exports.SUPPORTED_SDK = exports.NOW_CONFIG_FILE = void 0;
|
|
47
|
+
exports.findNowSdkProjectRoot = findNowSdkProjectRoot;
|
|
48
|
+
exports.readNowSdkProject = readNowSdkProject;
|
|
49
|
+
exports.assertSupportedProject = assertSupportedProject;
|
|
50
|
+
exports.readSdkVersion = readSdkVersion;
|
|
51
|
+
exports.assertSupportedSdk = assertSupportedSdk;
|
|
52
|
+
exports.listFlowRecordIds = listFlowRecordIds;
|
|
53
|
+
exports.parsePackOutput = parsePackOutput;
|
|
54
|
+
exports.findNewestZip = findNewestZip;
|
|
55
|
+
exports.readDeployLink = readDeployLink;
|
|
56
|
+
exports.writeDeployLink = writeDeployLink;
|
|
57
|
+
exports.findNowSdkProjects = findNowSdkProjects;
|
|
58
|
+
exports.resolveNowSdkProjectRoot = resolveNowSdkProjectRoot;
|
|
59
|
+
const fs = __importStar(require("fs"));
|
|
60
|
+
const path = __importStar(require("path"));
|
|
61
|
+
exports.NOW_CONFIG_FILE = 'now.config.json';
|
|
62
|
+
const LINK_DIR = '.snu';
|
|
63
|
+
const LINK_FILE = 'deploy.json';
|
|
64
|
+
/** ServiceNow SDK versions whose packages and install protocol match what ScriptSync sends. */
|
|
65
|
+
exports.SUPPORTED_SDK = { min: '4.1.0', belowMajor: 5 };
|
|
66
|
+
class NowSdkProjectError extends Error {
|
|
67
|
+
}
|
|
68
|
+
exports.NowSdkProjectError = NowSdkProjectError;
|
|
69
|
+
// Directory -> "contains now.config.json", briefly cached because the field
|
|
70
|
+
// sync asks for every saved and watched file.
|
|
71
|
+
const CACHE_TTL_MS = 5000;
|
|
72
|
+
const configCache = new Map();
|
|
73
|
+
function dirHasNowConfig(dir) {
|
|
74
|
+
const cached = configCache.get(dir);
|
|
75
|
+
const now = Date.now();
|
|
76
|
+
if (cached && now - cached.at < CACHE_TTL_MS)
|
|
77
|
+
return cached.has;
|
|
78
|
+
let has = false;
|
|
79
|
+
try {
|
|
80
|
+
has = fs.statSync(path.join(dir, exports.NOW_CONFIG_FILE)).isFile();
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
has = false;
|
|
84
|
+
}
|
|
85
|
+
configCache.set(dir, { has, at: now });
|
|
86
|
+
return has;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The NOW SDK project root that contains `filePath`, or null. When `stopAt` is
|
|
90
|
+
* given, only directories from the file's folder up to and including `stopAt`
|
|
91
|
+
* are checked, so a project outside that folder never matches.
|
|
92
|
+
*/
|
|
93
|
+
function findNowSdkProjectRoot(filePath, stopAt) {
|
|
94
|
+
if (!filePath)
|
|
95
|
+
return null;
|
|
96
|
+
const limit = stopAt ? path.resolve(stopAt) : undefined;
|
|
97
|
+
let dir = path.dirname(path.resolve(filePath));
|
|
98
|
+
if (limit && dir !== limit && !dir.startsWith(limit + path.sep))
|
|
99
|
+
return null;
|
|
100
|
+
while (true) {
|
|
101
|
+
if (dirHasNowConfig(dir))
|
|
102
|
+
return dir;
|
|
103
|
+
if (limit && dir === limit)
|
|
104
|
+
return null;
|
|
105
|
+
const parent = path.dirname(dir);
|
|
106
|
+
if (parent === dir)
|
|
107
|
+
return null;
|
|
108
|
+
dir = parent;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function readJson(file) {
|
|
112
|
+
try {
|
|
113
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
throw new NowSdkProjectError(`Could not read ${path.basename(file)}: ${e?.message || e}`);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/** Resolve a configured output folder, refusing anything outside the project. */
|
|
120
|
+
function projectDir(root, configured, fallback) {
|
|
121
|
+
const rel = typeof configured === 'string' && configured.trim() ? configured.trim() : fallback;
|
|
122
|
+
const resolved = path.resolve(root, rel);
|
|
123
|
+
if (resolved !== root && !resolved.startsWith(root + path.sep)) {
|
|
124
|
+
throw new NowSdkProjectError(`Output folder "${rel}" is outside the project.`);
|
|
125
|
+
}
|
|
126
|
+
return resolved;
|
|
127
|
+
}
|
|
128
|
+
function readNowSdkProject(root) {
|
|
129
|
+
const resolvedRoot = path.resolve(root);
|
|
130
|
+
const config = readJson(path.join(resolvedRoot, exports.NOW_CONFIG_FILE));
|
|
131
|
+
const pkg = readJson(path.join(resolvedRoot, 'package.json'));
|
|
132
|
+
const scope = String(config?.scope || '');
|
|
133
|
+
const scopeId = String(config?.scopeId || '');
|
|
134
|
+
const version = String(pkg?.version || '');
|
|
135
|
+
if (!/^[a-z][a-z0-9_]{1,17}$/.test(scope))
|
|
136
|
+
throw new NowSdkProjectError(`Invalid scope "${scope}" in ${exports.NOW_CONFIG_FILE}.`);
|
|
137
|
+
if (!/^([0-9a-f]{32}|global)$/.test(scopeId))
|
|
138
|
+
throw new NowSdkProjectError(`Invalid scopeId "${scopeId}" in ${exports.NOW_CONFIG_FILE}.`);
|
|
139
|
+
if (!/^[0-9A-Za-z.+-]{1,32}$/.test(version))
|
|
140
|
+
throw new NowSdkProjectError(`Invalid or missing version in package.json.`);
|
|
141
|
+
return {
|
|
142
|
+
root: resolvedRoot,
|
|
143
|
+
name: String(config?.name || scope),
|
|
144
|
+
scope,
|
|
145
|
+
scopeId,
|
|
146
|
+
version,
|
|
147
|
+
appOutputDir: projectDir(resolvedRoot, config?.appOutputDir, path.join('dist', 'app')),
|
|
148
|
+
packOutputDir: projectDir(resolvedRoot, config?.packOutputDir, 'target'),
|
|
149
|
+
type: String(config?.type || 'package'),
|
|
150
|
+
installAs: String(config?.installAs || ''),
|
|
151
|
+
hasHostedPlugins: !!config?.hostedPlugins && Object.keys(config.hostedPlugins).length > 0,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Refuse app types ScriptSync does not deploy or pull the way the SDK does,
|
|
156
|
+
* with a pointer to `now-sdk install` / `now-sdk transform` for them.
|
|
157
|
+
*/
|
|
158
|
+
function assertSupportedProject(project) {
|
|
159
|
+
const fallback = 'Use the ServiceNow SDK itself (now-sdk install / now-sdk transform) for this app.';
|
|
160
|
+
if (project.type === 'configuration') {
|
|
161
|
+
throw new NowSdkProjectError(`${project.name} is a configuration project, which the SDK installs into an update set. That is not supported yet. ${fallback}`);
|
|
162
|
+
}
|
|
163
|
+
if (project.installAs === 'store' || project.hasHostedPlugins) {
|
|
164
|
+
throw new NowSdkProjectError(`${project.name} installs as a Store app (installAs "store" or hostedPlugins). That is not supported yet. ${fallback}`);
|
|
165
|
+
}
|
|
166
|
+
if (project.scope === 'global' || project.scopeId === 'global') {
|
|
167
|
+
throw new NowSdkProjectError(`${project.name} is a global-scope app. That is not supported yet. ${fallback}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function versionParts(version) {
|
|
171
|
+
const m = /^(\d+)\.(\d+)\.(\d+)/.exec(version || '');
|
|
172
|
+
return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : null;
|
|
173
|
+
}
|
|
174
|
+
/** The ServiceNow SDK version installed in the project, or null when it is not installed. */
|
|
175
|
+
function readSdkVersion(root) {
|
|
176
|
+
try {
|
|
177
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(root, 'node_modules', '@servicenow', 'sdk', 'package.json'), 'utf8'));
|
|
178
|
+
return typeof pkg?.version === 'string' ? pkg.version : null;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/** Refuse SDK versions outside the range whose packages ScriptSync handles. */
|
|
185
|
+
function assertSupportedSdk(root) {
|
|
186
|
+
const version = readSdkVersion(root);
|
|
187
|
+
if (!version) {
|
|
188
|
+
throw new NowSdkProjectError(`The ServiceNow SDK is not installed in ${path.basename(root)}. Run npm install in the project first.`);
|
|
189
|
+
}
|
|
190
|
+
const have = versionParts(version);
|
|
191
|
+
const min = versionParts(exports.SUPPORTED_SDK.min);
|
|
192
|
+
const tooOld = !have || have[0] < min[0] || (have[0] === min[0] && (have[1] < min[1] || (have[1] === min[1] && have[2] < min[2])));
|
|
193
|
+
if (tooOld || (have && have[0] >= exports.SUPPORTED_SDK.belowMajor)) {
|
|
194
|
+
throw new NowSdkProjectError(`${path.basename(root)} uses ServiceNow SDK ${version}; ScriptSync supports ${exports.SUPPORTED_SDK.min} up to ${exports.SUPPORTED_SDK.belowMajor - 1}.x. Use now-sdk install and now-sdk transform, or update the SDK in the project.`);
|
|
195
|
+
}
|
|
196
|
+
return version;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Flow and action record ids in the built app, for activating them after an
|
|
200
|
+
* install (the SDK's own post-install step). Read from the build output file
|
|
201
|
+
* names, which follow `<table>_<sys_id>.xml`.
|
|
202
|
+
*/
|
|
203
|
+
function listFlowRecordIds(appOutputDir) {
|
|
204
|
+
const flows = [];
|
|
205
|
+
const actions = [];
|
|
206
|
+
let files = [];
|
|
207
|
+
try {
|
|
208
|
+
files = fs.readdirSync(path.join(appOutputDir, 'update'));
|
|
209
|
+
}
|
|
210
|
+
catch {
|
|
211
|
+
return { flows, actions };
|
|
212
|
+
}
|
|
213
|
+
for (const f of files) {
|
|
214
|
+
let m = /^sys_hub_flow_([0-9a-f]{32})\.xml$/.exec(f);
|
|
215
|
+
if (m) {
|
|
216
|
+
flows.push(m[1]);
|
|
217
|
+
continue;
|
|
218
|
+
}
|
|
219
|
+
m = /^sys_hub_action_type_definition_([0-9a-f]{32})\.xml$/.exec(f);
|
|
220
|
+
if (m)
|
|
221
|
+
actions.push(m[1]);
|
|
222
|
+
}
|
|
223
|
+
return { flows, actions };
|
|
224
|
+
}
|
|
225
|
+
/** The zip path reported by `now-sdk pack`, or null. */
|
|
226
|
+
function parsePackOutput(output) {
|
|
227
|
+
const m = /artifact emitted as "([^"]+\.zip)"/i.exec(output || '');
|
|
228
|
+
return m ? m[1] : null;
|
|
229
|
+
}
|
|
230
|
+
/** Newest `.zip` in a folder, used when the pack output could not be parsed. */
|
|
231
|
+
function findNewestZip(dir) {
|
|
232
|
+
let newest = null;
|
|
233
|
+
let entries = [];
|
|
234
|
+
try {
|
|
235
|
+
entries = fs.readdirSync(dir);
|
|
236
|
+
}
|
|
237
|
+
catch {
|
|
238
|
+
return null;
|
|
239
|
+
}
|
|
240
|
+
for (const f of entries) {
|
|
241
|
+
if (!f.toLowerCase().endsWith('.zip'))
|
|
242
|
+
continue;
|
|
243
|
+
const full = path.join(dir, f);
|
|
244
|
+
try {
|
|
245
|
+
const mtime = fs.statSync(full).mtimeMs;
|
|
246
|
+
if (!newest || mtime > newest.mtime)
|
|
247
|
+
newest = { file: full, mtime };
|
|
248
|
+
}
|
|
249
|
+
catch { }
|
|
250
|
+
}
|
|
251
|
+
return newest ? newest.file : null;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* The instance this project deploys to. Stored in `.snu/deploy.json` inside the
|
|
255
|
+
* project, next to a `.gitignore` that keeps the folder out of git: the link is
|
|
256
|
+
* a personal choice, not project configuration.
|
|
257
|
+
*/
|
|
258
|
+
function readDeployLink(root) {
|
|
259
|
+
try {
|
|
260
|
+
const link = JSON.parse(fs.readFileSync(path.join(root, LINK_DIR, LINK_FILE), 'utf8'));
|
|
261
|
+
if (link && typeof link.instance === 'string' && link.instance && typeof link.url === 'string' && /^https?:\/\//.test(link.url)) {
|
|
262
|
+
return { instance: link.instance, url: link.url };
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch { }
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
function writeDeployLink(root, link) {
|
|
269
|
+
const dir = path.join(root, LINK_DIR);
|
|
270
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
271
|
+
const ignore = path.join(dir, '.gitignore');
|
|
272
|
+
if (!fs.existsSync(ignore))
|
|
273
|
+
fs.writeFileSync(ignore, '*\n');
|
|
274
|
+
fs.writeFileSync(path.join(dir, LINK_FILE), JSON.stringify({ instance: link.instance, url: link.url }, null, 2) + '\n');
|
|
275
|
+
}
|
|
276
|
+
const SKIP_DIRS = new Set(['node_modules', '.git', 'dist', 'target', '.snu', '.vscode']);
|
|
277
|
+
/** NOW SDK project roots under `root`, a few levels deep, skipping build and dependency folders. */
|
|
278
|
+
function findNowSdkProjects(root, maxDepth = 3) {
|
|
279
|
+
const found = [];
|
|
280
|
+
const walk = (dir, depth) => {
|
|
281
|
+
if (dirHasNowConfig(dir)) {
|
|
282
|
+
found.push(dir);
|
|
283
|
+
return; // a project does not contain further projects
|
|
284
|
+
}
|
|
285
|
+
if (depth >= maxDepth)
|
|
286
|
+
return;
|
|
287
|
+
let entries = [];
|
|
288
|
+
try {
|
|
289
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
290
|
+
}
|
|
291
|
+
catch {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
for (const e of entries) {
|
|
295
|
+
if (e.isDirectory() && !e.isSymbolicLink() && !SKIP_DIRS.has(e.name) && !e.name.startsWith('.')) {
|
|
296
|
+
walk(path.join(dir, e.name), depth + 1);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
walk(path.resolve(root), 0);
|
|
301
|
+
return found.sort();
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The project an agent asked for. `projectPath` (relative to `root`, or
|
|
305
|
+
* absolute) must stay inside `root`, symlinks included. Without it, `root`
|
|
306
|
+
* must contain exactly one project.
|
|
307
|
+
*/
|
|
308
|
+
function resolveNowSdkProjectRoot(root, projectPath) {
|
|
309
|
+
const base = path.resolve(root);
|
|
310
|
+
let realBase = base;
|
|
311
|
+
try {
|
|
312
|
+
realBase = fs.realpathSync(base);
|
|
313
|
+
}
|
|
314
|
+
catch { }
|
|
315
|
+
if (projectPath) {
|
|
316
|
+
const target = path.resolve(base, projectPath);
|
|
317
|
+
const inside = (p, r) => p === r || p.startsWith(r + path.sep);
|
|
318
|
+
if (!inside(target, base))
|
|
319
|
+
throw new NowSdkProjectError(`projectPath must be inside ${base}.`);
|
|
320
|
+
let realTarget = target;
|
|
321
|
+
try {
|
|
322
|
+
realTarget = fs.realpathSync(target);
|
|
323
|
+
}
|
|
324
|
+
catch {
|
|
325
|
+
throw new NowSdkProjectError(`projectPath not found: ${projectPath}`);
|
|
326
|
+
}
|
|
327
|
+
if (!inside(realTarget, realBase))
|
|
328
|
+
throw new NowSdkProjectError(`projectPath must be inside ${base}.`);
|
|
329
|
+
const dir = fs.statSync(realTarget).isDirectory() ? realTarget : path.dirname(realTarget);
|
|
330
|
+
if (!dirHasNowConfig(dir))
|
|
331
|
+
throw new NowSdkProjectError(`No ${exports.NOW_CONFIG_FILE} in ${projectPath}.`);
|
|
332
|
+
return dir;
|
|
333
|
+
}
|
|
334
|
+
const projects = findNowSdkProjects(base);
|
|
335
|
+
if (projects.length === 1)
|
|
336
|
+
return projects[0];
|
|
337
|
+
if (projects.length === 0)
|
|
338
|
+
throw new NowSdkProjectError(`No NOW SDK project (${exports.NOW_CONFIG_FILE}) found under ${base}.`);
|
|
339
|
+
throw new NowSdkProjectError(`Several NOW SDK projects found; pass projectPath: ${projects.map((p) => path.relative(base, p) || '.').join(', ')}`);
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=NowSdkProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowSdkProject.js","sourceRoot":"","sources":["../../src/nowsdk/NowSdkProject.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,kEAAkE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DlE,sDAYC;AAoBD,8CAwBC;AAMD,wDAWC;AAQD,wCAOC;AAGD,gDAYC;AAOD,8CAgBC;AAGD,0CAGC;AAGD,sCAiBC;AAOD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C,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC1F,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,kBAAkB,CAAC,MAAM,uBAAe,OAAO,WAAW,GAAG,CAAC,CAAC;QACpG,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,kBAAkB,CAAC,uBAAuB,uBAAe,iBAAiB,IAAI,GAAG,CAAC,CAAC;IACxH,MAAM,IAAI,kBAAkB,CAAC,qDAAqD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpJ,CAAC"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
export declare const MAX_DOWNLOAD_BYTES: number;
|
|
2
|
+
export type PullChangeStatus = 'modified' | 'added' | 'removed';
|
|
3
|
+
export interface PullChange {
|
|
4
|
+
/** Path relative to the project root, with forward slashes. */
|
|
5
|
+
path: string;
|
|
6
|
+
status: PullChangeStatus;
|
|
7
|
+
}
|
|
8
|
+
export interface PullStaging {
|
|
9
|
+
/** Temporary folder holding everything for this pull; remove with cleanupPull. */
|
|
10
|
+
tempDir: string;
|
|
11
|
+
/** The project copy the SDK converted the instance package into. */
|
|
12
|
+
stagingRoot: string;
|
|
13
|
+
changes: PullChange[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Unpack a zip into `dest` with Node's zlib. Supports stored and deflated
|
|
17
|
+
* entries, which is what the instance produces. Entry names that would land
|
|
18
|
+
* outside `dest` are refused.
|
|
19
|
+
*/
|
|
20
|
+
export declare function extractZip(zip: Buffer, dest: string): string[];
|
|
21
|
+
/** Project files (forward-slash relative paths), leaving out build output, dependencies and .snu. */
|
|
22
|
+
export declare function listProjectFiles(root: string): string[];
|
|
23
|
+
/** Files that differ between the project and the staged copy. */
|
|
24
|
+
export declare function diffProjects(projectRoot: string, stagingRoot: string): PullChange[];
|
|
25
|
+
/**
|
|
26
|
+
* Convert a downloaded application package into Fluent in a temporary copy of
|
|
27
|
+
* the project and report what differs. The project itself is not touched.
|
|
28
|
+
*/
|
|
29
|
+
export declare function stagePull(projectRoot: string, packageZip: Buffer, onOutput?: (text: string) => void): Promise<PullStaging>;
|
|
30
|
+
/** Copy the chosen changes from the staged copy into the project. */
|
|
31
|
+
export declare function applyPullChanges(projectRoot: string, stagingRoot: string, changes: PullChange[]): void;
|
|
32
|
+
/** What a pull changed, to put the project back with undoPull. */
|
|
33
|
+
export interface PullUndo {
|
|
34
|
+
/** Previous content per path; null means the pull added the file. */
|
|
35
|
+
files: Array<{
|
|
36
|
+
path: string;
|
|
37
|
+
previous: Buffer | null;
|
|
38
|
+
}>;
|
|
39
|
+
/** What ScriptSync knew about the instance before the pull, put back by an undo. */
|
|
40
|
+
sync?: SyncState;
|
|
41
|
+
}
|
|
42
|
+
/** The baseline for an instance and the pull marker, as saved before a pull. */
|
|
43
|
+
export interface SyncState {
|
|
44
|
+
instance: string;
|
|
45
|
+
/** Baseline files by name (the format file included); null when there was none. */
|
|
46
|
+
baseline: Map<string, Buffer> | null;
|
|
47
|
+
pullMarker: Buffer | null;
|
|
48
|
+
}
|
|
49
|
+
/** Save the baseline for an instance and the pull marker, to put back later. */
|
|
50
|
+
export declare function captureSyncState(projectRoot: string, instanceName: string): SyncState;
|
|
51
|
+
/** Put back a state saved with captureSyncState. */
|
|
52
|
+
export declare function restoreSyncState(projectRoot: string, state: SyncState): void;
|
|
53
|
+
/**
|
|
54
|
+
* Apply every added and modified file and remember what was there before.
|
|
55
|
+
* Removals are never applied this way: a file missing from the instance
|
|
56
|
+
* package is left for the user to delete.
|
|
57
|
+
*/
|
|
58
|
+
export declare function applyPullWithUndo(projectRoot: string, stagingRoot: string, changes: PullChange[], instanceName?: string): PullUndo;
|
|
59
|
+
/** Put back what a pull changed: restore previous contents, remove added files. */
|
|
60
|
+
export declare function undoPull(projectRoot: string, undo: PullUndo): void;
|
|
61
|
+
/**
|
|
62
|
+
* Of `paths` (relative to the project), the ones with uncommitted changes in
|
|
63
|
+
* git. null when the project is not in a git repository or git is missing, in
|
|
64
|
+
* which case a pull is reviewed file by file instead.
|
|
65
|
+
*/
|
|
66
|
+
export declare function gitUncommittedPaths(projectRoot: string, paths: string[]): Promise<string[] | null>;
|
|
67
|
+
export interface InstanceChange {
|
|
68
|
+
/** Record label, e.g. "Script Include SpikeNew". */
|
|
69
|
+
label: string;
|
|
70
|
+
status: 'changed' | 'new' | 'removed';
|
|
71
|
+
/**
|
|
72
|
+
* The record comes from the project's source in a way the SDK's pull
|
|
73
|
+
* cannot write back to (see `reason`): a pull cannot bring the change in,
|
|
74
|
+
* and the next deploy overwrites it.
|
|
75
|
+
*/
|
|
76
|
+
generated?: boolean;
|
|
77
|
+
/** Why a pull cannot bring the change in, e.g. "compiled from your server source". */
|
|
78
|
+
reason?: string;
|
|
79
|
+
/** At a deploy: the fields changed on the instance that the build would overwrite. */
|
|
80
|
+
fields?: string[];
|
|
81
|
+
/** The record's file name in the package's update or author_elective_update folder. */
|
|
82
|
+
file?: string;
|
|
83
|
+
}
|
|
84
|
+
export declare const TABLE_LABELS: Record<string, string>;
|
|
85
|
+
/** A baseline in the current format exists; an older one counts as none until the next sync. */
|
|
86
|
+
export declare function hasBaseline(projectRoot: string, instanceName: string): boolean;
|
|
87
|
+
/** The app's records in a downloaded package, keyed by file name. */
|
|
88
|
+
export declare function readPackageRecords(packageZip: Buffer): Map<string, string>;
|
|
89
|
+
/**
|
|
90
|
+
* Record the instance's version of the app (a downloaded package) as the
|
|
91
|
+
* baseline. Files in `keep` stay at their previous baseline version (or stay
|
|
92
|
+
* absent), so changes a pull could not bring in keep being reported.
|
|
93
|
+
*/
|
|
94
|
+
export declare function saveBaselineFromPackage(projectRoot: string, instanceName: string, packageZip: Buffer, _onOutput?: (text: string) => void, keep?: string[]): Promise<void>;
|
|
95
|
+
/** One record of the baseline (the state after the last sync), if any. */
|
|
96
|
+
export declare function readBaselineRecord(projectRoot: string, instanceName: string, file: string): string | undefined;
|
|
97
|
+
/** A record's fields (history fields left out), values as stored. */
|
|
98
|
+
export declare function readRecordFields(xml: string): Map<string, string>;
|
|
99
|
+
/** Of `fields`, the ones whose value in `builtXml` differs from `instanceXml` (compared as a deploy check does). */
|
|
100
|
+
export declare function fieldsBuiltDifferently(builtXml: string | undefined, instanceXml: string, fields: string[]): string[];
|
|
101
|
+
/** The fields that differ between two versions of a record (compared as a deploy check does). */
|
|
102
|
+
export declare function changedFieldNames(beforeXml: string, afterXml: string): string[];
|
|
103
|
+
/** One record of the last build (dist/app/update), if any. */
|
|
104
|
+
export declare function readBuiltRecord(appOutputDir: string, file: string): string | undefined;
|
|
105
|
+
/** keys.ts: record sys_id -> the Now.ID name it is defined with. */
|
|
106
|
+
export declare function readKeyNames(projectRoot: string): Map<string, string>;
|
|
107
|
+
/** A record as readable text, one field per section, for a diff view. */
|
|
108
|
+
export declare function recordForReading(xml: string | undefined): string;
|
|
109
|
+
/**
|
|
110
|
+
* Accept that the next deploy overwrites a change made on the instance: the
|
|
111
|
+
* baseline takes the instance version of that record, so it is no longer
|
|
112
|
+
* reported. `instanceXml` undefined means the record was deleted there.
|
|
113
|
+
*/
|
|
114
|
+
export declare function dismissInstanceChange(projectRoot: string, instanceName: string, file: string, instanceXml: string | undefined): void;
|
|
115
|
+
/** Records that changed on the instance since the baseline, from records already read. */
|
|
116
|
+
export declare function instanceChangesFromRecords(projectRoot: string, instanceName: string, now: Map<string, string>): InstanceChange[];
|
|
117
|
+
/** Records that changed on the instance since the baseline, from a downloaded package. */
|
|
118
|
+
export declare function instanceChangesFromPackage(projectRoot: string, instanceName: string, packageZip: Buffer, _onOutput?: (text: string) => void): Promise<InstanceChange[]>;
|
|
119
|
+
/**
|
|
120
|
+
* At a deploy, with the app just built: which instance changes since the
|
|
121
|
+
* baseline the install would overwrite. A record counts only when a field
|
|
122
|
+
* changed on the instance differs from the build, so changes already in the
|
|
123
|
+
* source (for example pulled) do not. Records that exist only on the instance
|
|
124
|
+
* are left alone by an install and are reported separately.
|
|
125
|
+
*/
|
|
126
|
+
export declare function deployConflicts(projectRoot: string, instanceName: string, packageZip: Buffer, appOutputDir: string): {
|
|
127
|
+
overwritten: InstanceChange[];
|
|
128
|
+
instanceOnly: InstanceChange[];
|
|
129
|
+
};
|
|
130
|
+
/** Whether this project was pulled before (the first pull also writes out SDK defaults). */
|
|
131
|
+
export declare function hasPulledBefore(projectRoot: string): boolean;
|
|
132
|
+
export interface SyncMarker {
|
|
133
|
+
instance: string;
|
|
134
|
+
/** ISO timestamp. */
|
|
135
|
+
at: string;
|
|
136
|
+
}
|
|
137
|
+
/** When the app was last deployed and pulled from this project. */
|
|
138
|
+
export declare function readSyncMarkers(projectRoot: string): {
|
|
139
|
+
deploy: SyncMarker | null;
|
|
140
|
+
pull: SyncMarker | null;
|
|
141
|
+
};
|
|
142
|
+
/** Remember the last successful deploy. */
|
|
143
|
+
export declare function markDeployed(projectRoot: string, instanceName: string): void;
|
|
144
|
+
/** Remember the last pull. */
|
|
145
|
+
export declare function markPulled(projectRoot: string, instanceName: string): void;
|
|
146
|
+
export declare function cleanupPull(tempDir: string): void;
|
|
147
|
+
//# sourceMappingURL=NowSdkPull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NowSdkPull.d.ts","sourceRoot":"","sources":["../../src/nowsdk/NowSdkPull.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,kBAAkB,QAAmB,CAAC;AAOnD,MAAM,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