@onlyflows/servicenow-mcp 1.0.0
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/LICENSE +21 -0
- package/README.md +267 -0
- package/dist/client.d.ts +40 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +145 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +46 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/aggregate.d.ts +67 -0
- package/dist/tools/aggregate.d.ts.map +1 -0
- package/dist/tools/aggregate.js +77 -0
- package/dist/tools/aggregate.js.map +1 -0
- package/dist/tools/atf.d.ts +95 -0
- package/dist/tools/atf.d.ts.map +1 -0
- package/dist/tools/atf.js +357 -0
- package/dist/tools/atf.js.map +1 -0
- package/dist/tools/attach.d.ts +74 -0
- package/dist/tools/attach.d.ts.map +1 -0
- package/dist/tools/attach.js +156 -0
- package/dist/tools/attach.js.map +1 -0
- package/dist/tools/batch.d.ts +68 -0
- package/dist/tools/batch.d.ts.map +1 -0
- package/dist/tools/batch.js +120 -0
- package/dist/tools/batch.js.map +1 -0
- package/dist/tools/codesearch.d.ts +52 -0
- package/dist/tools/codesearch.d.ts.map +1 -0
- package/dist/tools/codesearch.js +87 -0
- package/dist/tools/codesearch.js.map +1 -0
- package/dist/tools/create.d.ts +39 -0
- package/dist/tools/create.d.ts.map +1 -0
- package/dist/tools/create.js +44 -0
- package/dist/tools/create.js.map +1 -0
- package/dist/tools/delete.d.ts +45 -0
- package/dist/tools/delete.d.ts.map +1 -0
- package/dist/tools/delete.js +53 -0
- package/dist/tools/delete.js.map +1 -0
- package/dist/tools/discover.d.ts +53 -0
- package/dist/tools/discover.d.ts.map +1 -0
- package/dist/tools/discover.js +137 -0
- package/dist/tools/discover.js.map +1 -0
- package/dist/tools/get.d.ts +52 -0
- package/dist/tools/get.d.ts.map +1 -0
- package/dist/tools/get.js +52 -0
- package/dist/tools/get.js.map +1 -0
- package/dist/tools/health.d.ts +32 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +172 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/index.d.ts +43 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +110 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/nl.d.ts +52 -0
- package/dist/tools/nl.d.ts.map +1 -0
- package/dist/tools/nl.js +433 -0
- package/dist/tools/nl.js.map +1 -0
- package/dist/tools/query.d.ts +73 -0
- package/dist/tools/query.d.ts.map +1 -0
- package/dist/tools/query.js +75 -0
- package/dist/tools/query.js.map +1 -0
- package/dist/tools/relationships.d.ts +74 -0
- package/dist/tools/relationships.d.ts.map +1 -0
- package/dist/tools/relationships.js +228 -0
- package/dist/tools/relationships.js.map +1 -0
- package/dist/tools/schema.d.ts +38 -0
- package/dist/tools/schema.d.ts.map +1 -0
- package/dist/tools/schema.js +60 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/tools/script.d.ts +52 -0
- package/dist/tools/script.d.ts.map +1 -0
- package/dist/tools/script.js +51 -0
- package/dist/tools/script.js.map +1 -0
- package/dist/tools/syslog.d.ts +74 -0
- package/dist/tools/syslog.d.ts.map +1 -0
- package/dist/tools/syslog.js +93 -0
- package/dist/tools/syslog.js.map +1 -0
- package/dist/tools/update.d.ts +46 -0
- package/dist/tools/update.d.ts.map +1 -0
- package/dist/tools/update.js +44 -0
- package/dist/tools/update.js.map +1 -0
- package/dist/utils.d.ts +44 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +72 -0
- package/dist/utils.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ServiceNowClient } from "../client.js";
|
|
3
|
+
import { ServiceNowConfig } from "../config.js";
|
|
4
|
+
export declare const definition: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: {
|
|
10
|
+
table: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
type: {
|
|
15
|
+
type: string;
|
|
16
|
+
enum: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
query: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
field: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
group_by: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
display_value: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
required: string[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const schema: z.ZodObject<{
|
|
40
|
+
table: z.ZodString;
|
|
41
|
+
type: z.ZodEnum<["COUNT", "AVG", "MIN", "MAX", "SUM"]>;
|
|
42
|
+
query: z.ZodOptional<z.ZodString>;
|
|
43
|
+
field: z.ZodOptional<z.ZodString>;
|
|
44
|
+
group_by: z.ZodOptional<z.ZodString>;
|
|
45
|
+
display_value: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
table: string;
|
|
48
|
+
type: "COUNT" | "AVG" | "MIN" | "MAX" | "SUM";
|
|
49
|
+
query?: string | undefined;
|
|
50
|
+
display_value?: string | undefined;
|
|
51
|
+
field?: string | undefined;
|
|
52
|
+
group_by?: string | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
table: string;
|
|
55
|
+
type: "COUNT" | "AVG" | "MIN" | "MAX" | "SUM";
|
|
56
|
+
query?: string | undefined;
|
|
57
|
+
display_value?: string | undefined;
|
|
58
|
+
field?: string | undefined;
|
|
59
|
+
group_by?: string | undefined;
|
|
60
|
+
}>;
|
|
61
|
+
export declare function handler(args: z.infer<typeof schema>, client: ServiceNowClient, config: ServiceNowConfig): Promise<{
|
|
62
|
+
content: Array<{
|
|
63
|
+
type: "text";
|
|
64
|
+
text: string;
|
|
65
|
+
}>;
|
|
66
|
+
}>;
|
|
67
|
+
//# sourceMappingURL=aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCtB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;EAOjB,CAAC;AAEH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,EAC5B,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,gBAAgB;;;;;GA4BzB"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = exports.definition = void 0;
|
|
4
|
+
exports.handler = handler;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const utils_js_1 = require("../utils.js");
|
|
7
|
+
exports.definition = {
|
|
8
|
+
name: "sn_aggregate",
|
|
9
|
+
description: "Run aggregate queries (COUNT, AVG, MIN, MAX, SUM) on a ServiceNow table with optional grouping.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
table: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "ServiceNow table name (e.g. incident)",
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["COUNT", "AVG", "MIN", "MAX", "SUM"],
|
|
20
|
+
description: "Aggregation type",
|
|
21
|
+
},
|
|
22
|
+
query: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "ServiceNow encoded query filter",
|
|
25
|
+
},
|
|
26
|
+
field: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Field to aggregate on (required for AVG, MIN, MAX, SUM)",
|
|
29
|
+
},
|
|
30
|
+
group_by: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Group results by this field",
|
|
33
|
+
},
|
|
34
|
+
display_value: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "Display values mode: true, false, or all",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ["table", "type"],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.schema = zod_1.z.object({
|
|
43
|
+
table: zod_1.z.string(),
|
|
44
|
+
type: zod_1.z.enum(["COUNT", "AVG", "MIN", "MAX", "SUM"]),
|
|
45
|
+
query: zod_1.z.string().optional(),
|
|
46
|
+
field: zod_1.z.string().optional(),
|
|
47
|
+
group_by: zod_1.z.string().optional(),
|
|
48
|
+
display_value: zod_1.z.string().optional(),
|
|
49
|
+
});
|
|
50
|
+
async function handler(args, client, config) {
|
|
51
|
+
try {
|
|
52
|
+
const aggType = args.type.toUpperCase();
|
|
53
|
+
if (aggType !== "COUNT" && !args.field) {
|
|
54
|
+
return (0, utils_js_1.err)(`${aggType} requires a field parameter`);
|
|
55
|
+
}
|
|
56
|
+
const params = {};
|
|
57
|
+
if (aggType === "COUNT") {
|
|
58
|
+
params.sysparm_count = "true";
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
params[`sysparm_${aggType.toLowerCase()}_fields`] = args.field;
|
|
62
|
+
}
|
|
63
|
+
if (args.query)
|
|
64
|
+
params.sysparm_query = args.query;
|
|
65
|
+
if (args.group_by)
|
|
66
|
+
params.sysparm_group_by = args.group_by;
|
|
67
|
+
if (args.display_value) {
|
|
68
|
+
params.sysparm_display_value = args.display_value;
|
|
69
|
+
}
|
|
70
|
+
const resp = await client.get(`/api/now/stats/${args.table}`, params);
|
|
71
|
+
return (0, utils_js_1.ok)(resp.result);
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
return (0, utils_js_1.err)((0, utils_js_1.formatError)(error));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=aggregate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../src/tools/aggregate.ts"],"names":[],"mappings":";;;AAmDA,0BA+BC;AAlFD,6BAAwB;AAGxB,0CAAmD;AAEtC,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,iGAAiG;IACnG,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;gBAC3C,WAAW,EAAE,kBAAkB;aAChC;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACvE;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B;aAC3C;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0CAA0C;aACxD;SACF;QACD,QAA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,QAAQ,CAAC;QAC3D,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,CAAC;QACpD,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,KAAK,EAAE,EAAE,MAAM,CAAC,CAAC;QACtE,OAAO,IAAA,aAAE,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,cAAG,EAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC;IACjC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ServiceNowClient } from "../client.js";
|
|
3
|
+
import { ServiceNowConfig } from "../config.js";
|
|
4
|
+
export declare const definition: {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
inputSchema: {
|
|
8
|
+
type: "object";
|
|
9
|
+
properties: {
|
|
10
|
+
action: {
|
|
11
|
+
type: string;
|
|
12
|
+
enum: string[];
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
test_sys_id: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
suite_sys_id: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
suite_name: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
execution_id: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
query: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
fields: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
limit: {
|
|
40
|
+
type: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
wait: {
|
|
44
|
+
type: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
timeout: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
required: string[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export declare const schema: z.ZodObject<{
|
|
56
|
+
action: z.ZodEnum<["list", "suites", "run", "run-suite", "results"]>;
|
|
57
|
+
test_sys_id: z.ZodOptional<z.ZodString>;
|
|
58
|
+
suite_sys_id: z.ZodOptional<z.ZodString>;
|
|
59
|
+
suite_name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
execution_id: z.ZodOptional<z.ZodString>;
|
|
61
|
+
query: z.ZodOptional<z.ZodString>;
|
|
62
|
+
fields: z.ZodOptional<z.ZodString>;
|
|
63
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
64
|
+
wait: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
65
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
limit: number;
|
|
68
|
+
action: "list" | "suites" | "run" | "run-suite" | "results";
|
|
69
|
+
wait: boolean;
|
|
70
|
+
query?: string | undefined;
|
|
71
|
+
fields?: string | undefined;
|
|
72
|
+
test_sys_id?: string | undefined;
|
|
73
|
+
suite_sys_id?: string | undefined;
|
|
74
|
+
suite_name?: string | undefined;
|
|
75
|
+
execution_id?: string | undefined;
|
|
76
|
+
timeout?: number | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
action: "list" | "suites" | "run" | "run-suite" | "results";
|
|
79
|
+
query?: string | undefined;
|
|
80
|
+
fields?: string | undefined;
|
|
81
|
+
limit?: number | undefined;
|
|
82
|
+
test_sys_id?: string | undefined;
|
|
83
|
+
suite_sys_id?: string | undefined;
|
|
84
|
+
suite_name?: string | undefined;
|
|
85
|
+
execution_id?: string | undefined;
|
|
86
|
+
wait?: boolean | undefined;
|
|
87
|
+
timeout?: number | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export declare function handler(args: z.infer<typeof schema>, client: ServiceNowClient, _config: ServiceNowConfig): Promise<{
|
|
90
|
+
content: Array<{
|
|
91
|
+
type: "text";
|
|
92
|
+
text: string;
|
|
93
|
+
}>;
|
|
94
|
+
}>;
|
|
95
|
+
//# sourceMappingURL=atf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atf.d.ts","sourceRoot":"","sources":["../../src/tools/atf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDtB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWjB,CAAC;AAMH,wBAAsB,OAAO,CAC3B,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,EAC5B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,gBAAgB;;;;;GAsQ1B"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = exports.definition = void 0;
|
|
4
|
+
exports.handler = handler;
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const utils_js_1 = require("../utils.js");
|
|
7
|
+
exports.definition = {
|
|
8
|
+
name: "sn_atf",
|
|
9
|
+
description: "Automated Test Framework — list, run, and get results for ATF tests and test suites.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
action: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: ["list", "suites", "run", "run-suite", "results"],
|
|
16
|
+
description: "ATF operation: list tests, list suites, run a test, run a suite, or get results",
|
|
17
|
+
},
|
|
18
|
+
test_sys_id: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Test sys_id (required for run)",
|
|
21
|
+
},
|
|
22
|
+
suite_sys_id: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Suite sys_id (required for run-suite)",
|
|
25
|
+
},
|
|
26
|
+
suite_name: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Filter tests by suite name (for list action)",
|
|
29
|
+
},
|
|
30
|
+
execution_id: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Execution/result sys_id (required for results action)",
|
|
33
|
+
},
|
|
34
|
+
query: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "ServiceNow encoded query filter",
|
|
37
|
+
},
|
|
38
|
+
fields: {
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Comma-separated fields to return",
|
|
41
|
+
},
|
|
42
|
+
limit: {
|
|
43
|
+
type: "number",
|
|
44
|
+
description: "Max results (default 20)",
|
|
45
|
+
},
|
|
46
|
+
wait: {
|
|
47
|
+
type: "boolean",
|
|
48
|
+
description: "Wait for test/suite completion (default true)",
|
|
49
|
+
},
|
|
50
|
+
timeout: {
|
|
51
|
+
type: "number",
|
|
52
|
+
description: "Max wait time in seconds (default 120 for tests, 300 for suites)",
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
required: ["action"],
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
exports.schema = zod_1.z.object({
|
|
59
|
+
action: zod_1.z.enum(["list", "suites", "run", "run-suite", "results"]),
|
|
60
|
+
test_sys_id: zod_1.z.string().optional(),
|
|
61
|
+
suite_sys_id: zod_1.z.string().optional(),
|
|
62
|
+
suite_name: zod_1.z.string().optional(),
|
|
63
|
+
execution_id: zod_1.z.string().optional(),
|
|
64
|
+
query: zod_1.z.string().optional(),
|
|
65
|
+
fields: zod_1.z.string().optional(),
|
|
66
|
+
limit: zod_1.z.number().optional().default(20),
|
|
67
|
+
wait: zod_1.z.boolean().optional().default(true),
|
|
68
|
+
timeout: zod_1.z.number().optional(),
|
|
69
|
+
});
|
|
70
|
+
function sleep(ms) {
|
|
71
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
72
|
+
}
|
|
73
|
+
async function handler(args, client, _config) {
|
|
74
|
+
try {
|
|
75
|
+
switch (args.action) {
|
|
76
|
+
// ── list tests ──
|
|
77
|
+
case "list": {
|
|
78
|
+
const fields = args.fields || "sys_id,name,description,active,sys_updated_on";
|
|
79
|
+
let query = args.query || "";
|
|
80
|
+
// If suite_name given, resolve suite and filter tests
|
|
81
|
+
if (args.suite_name) {
|
|
82
|
+
const suiteResp = await client.get("/api/now/table/sys_atf_test_suite", {
|
|
83
|
+
sysparm_query: `name=${args.suite_name}`,
|
|
84
|
+
sysparm_fields: "sys_id,name",
|
|
85
|
+
sysparm_limit: "1",
|
|
86
|
+
});
|
|
87
|
+
const suiteId = suiteResp.result?.[0]?.sys_id;
|
|
88
|
+
if (!suiteId)
|
|
89
|
+
return (0, utils_js_1.err)(`Suite not found: ${args.suite_name}`);
|
|
90
|
+
// Get test IDs from M2M table
|
|
91
|
+
const m2mResp = await client.get("/api/now/table/sys_atf_test_suite_test", {
|
|
92
|
+
sysparm_query: `test_suite=${suiteId}`,
|
|
93
|
+
sysparm_fields: "test",
|
|
94
|
+
sysparm_limit: "500",
|
|
95
|
+
});
|
|
96
|
+
const testIds = (m2mResp.result || [])
|
|
97
|
+
.map((r) => r.test)
|
|
98
|
+
.filter(Boolean)
|
|
99
|
+
.join(",");
|
|
100
|
+
if (!testIds)
|
|
101
|
+
return (0, utils_js_1.ok)({ record_count: 0, results: [] });
|
|
102
|
+
const suiteFilter = `sys_idIN${testIds}`;
|
|
103
|
+
query = query ? `${suiteFilter}^${query}` : suiteFilter;
|
|
104
|
+
}
|
|
105
|
+
const resp = await client.get("/api/now/table/sys_atf_test", {
|
|
106
|
+
sysparm_limit: String(args.limit),
|
|
107
|
+
sysparm_fields: fields,
|
|
108
|
+
...(query ? { sysparm_query: query } : {}),
|
|
109
|
+
});
|
|
110
|
+
const results = resp.result || [];
|
|
111
|
+
return (0, utils_js_1.ok)({ record_count: results.length, results });
|
|
112
|
+
}
|
|
113
|
+
// ── list suites ──
|
|
114
|
+
case "suites": {
|
|
115
|
+
const fields = args.fields || "sys_id,name,description,active";
|
|
116
|
+
const resp = await client.get("/api/now/table/sys_atf_test_suite", {
|
|
117
|
+
sysparm_limit: String(args.limit),
|
|
118
|
+
sysparm_fields: fields,
|
|
119
|
+
...(args.query ? { sysparm_query: args.query } : {}),
|
|
120
|
+
});
|
|
121
|
+
const results = resp.result || [];
|
|
122
|
+
return (0, utils_js_1.ok)({ record_count: results.length, results });
|
|
123
|
+
}
|
|
124
|
+
// ── run single test ──
|
|
125
|
+
case "run": {
|
|
126
|
+
if (!args.test_sys_id)
|
|
127
|
+
return (0, utils_js_1.err)("test_sys_id is required for run");
|
|
128
|
+
const timeout = args.timeout ?? 120;
|
|
129
|
+
let runResp;
|
|
130
|
+
// Try sn_atf REST API first
|
|
131
|
+
try {
|
|
132
|
+
runResp = await client.post("/api/sn_atf/rest/test", {
|
|
133
|
+
test_id: args.test_sys_id,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
// Fallback: try /api/now/atf/test/{id}/run
|
|
138
|
+
try {
|
|
139
|
+
runResp = await client.post(`/api/now/atf/test/${args.test_sys_id}/run`);
|
|
140
|
+
}
|
|
141
|
+
catch {
|
|
142
|
+
// Last fallback: schedule via Table API
|
|
143
|
+
try {
|
|
144
|
+
runResp = await client.post("/api/now/table/sys_atf_test_result", {
|
|
145
|
+
test: args.test_sys_id,
|
|
146
|
+
status: "scheduled",
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch (e) {
|
|
150
|
+
return (0, utils_js_1.err)("All ATF execution methods failed. Ensure ATF plugin is active and user has atf_admin role.");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
const resultId = runResp?.result?.sys_id || runResp?.result?.result_id;
|
|
155
|
+
const trackerId = runResp?.result?.tracker_id || runResp?.result?.progress_id;
|
|
156
|
+
if (!args.wait) {
|
|
157
|
+
return (0, utils_js_1.ok)(runResp?.result || runResp);
|
|
158
|
+
}
|
|
159
|
+
// Poll for completion
|
|
160
|
+
return await pollTestResult(client, args.test_sys_id, resultId, trackerId, timeout);
|
|
161
|
+
}
|
|
162
|
+
// ── run suite ──
|
|
163
|
+
case "run-suite": {
|
|
164
|
+
if (!args.suite_sys_id)
|
|
165
|
+
return (0, utils_js_1.err)("suite_sys_id is required for run-suite");
|
|
166
|
+
const timeout = args.timeout ?? 300;
|
|
167
|
+
let runResp;
|
|
168
|
+
try {
|
|
169
|
+
runResp = await client.post("/api/sn_atf/rest/suite", {
|
|
170
|
+
suite_id: args.suite_sys_id,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
try {
|
|
175
|
+
runResp = await client.post(`/api/now/atf/suite/${args.suite_sys_id}/run`);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
return (0, utils_js_1.err)("Suite execution failed. Ensure ATF plugin is active and user has atf_admin role.");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (!args.wait) {
|
|
182
|
+
return (0, utils_js_1.ok)(runResp?.result || runResp);
|
|
183
|
+
}
|
|
184
|
+
// Poll tracker
|
|
185
|
+
const trackerId = runResp?.result?.tracker_id || runResp?.result?.progress_id;
|
|
186
|
+
let elapsed = 0;
|
|
187
|
+
const pollInterval = 5;
|
|
188
|
+
while (elapsed < timeout) {
|
|
189
|
+
await sleep(pollInterval * 1000);
|
|
190
|
+
elapsed += pollInterval;
|
|
191
|
+
if (trackerId) {
|
|
192
|
+
try {
|
|
193
|
+
const trackerResp = await client.get(`/api/now/table/sys_execution_tracker/${trackerId}`, {
|
|
194
|
+
sysparm_fields: "state,result,message,completion_percent",
|
|
195
|
+
sysparm_display_value: "true",
|
|
196
|
+
});
|
|
197
|
+
const state = trackerResp.result?.state;
|
|
198
|
+
if (state === "Successful" ||
|
|
199
|
+
state === "Failed" ||
|
|
200
|
+
state === "Cancelled") {
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch {
|
|
205
|
+
// continue polling
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Fetch suite results
|
|
210
|
+
const resultsResp = await client.get("/api/now/table/sys_atf_test_result", {
|
|
211
|
+
sysparm_query: `test_suite=${args.suite_sys_id}^ORDERBYDESCsys_created_on`,
|
|
212
|
+
sysparm_fields: "sys_id,test,status,output,duration,start_time,end_time",
|
|
213
|
+
sysparm_display_value: "true",
|
|
214
|
+
sysparm_limit: "200",
|
|
215
|
+
});
|
|
216
|
+
const testResults = resultsResp.result || [];
|
|
217
|
+
const passed = testResults.filter((r) => r.status === "Success" || r.status === "Pass" || r.status === "Passed").length;
|
|
218
|
+
const failed = testResults.filter((r) => r.status === "Failure" ||
|
|
219
|
+
r.status === "Fail" ||
|
|
220
|
+
r.status === "Failed" ||
|
|
221
|
+
r.status === "Error").length;
|
|
222
|
+
const skipped = testResults.filter((r) => r.status === "Skipped" || r.status === "Cancelled").length;
|
|
223
|
+
return (0, utils_js_1.ok)({
|
|
224
|
+
suite_sys_id: args.suite_sys_id,
|
|
225
|
+
summary: {
|
|
226
|
+
total: testResults.length,
|
|
227
|
+
passed,
|
|
228
|
+
failed,
|
|
229
|
+
skipped,
|
|
230
|
+
},
|
|
231
|
+
results: testResults,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
// ── results ──
|
|
235
|
+
case "results": {
|
|
236
|
+
if (!args.execution_id)
|
|
237
|
+
return (0, utils_js_1.err)("execution_id is required for results");
|
|
238
|
+
const fields = args.fields ||
|
|
239
|
+
"sys_id,test,status,output,duration,start_time,end_time";
|
|
240
|
+
// Try direct get first
|
|
241
|
+
try {
|
|
242
|
+
const resp = await client.get(`/api/now/table/sys_atf_test_result/${args.execution_id}`, {
|
|
243
|
+
sysparm_fields: fields,
|
|
244
|
+
sysparm_display_value: "true",
|
|
245
|
+
});
|
|
246
|
+
if (resp.result?.sys_id) {
|
|
247
|
+
return (0, utils_js_1.ok)(resp.result);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
// Not found by direct ID — try query
|
|
252
|
+
}
|
|
253
|
+
const query = `execution=${args.execution_id}^ORparent=${args.execution_id}^ORtest_suite=${args.execution_id}`;
|
|
254
|
+
const resp = await client.get("/api/now/table/sys_atf_test_result", {
|
|
255
|
+
sysparm_query: query,
|
|
256
|
+
sysparm_fields: fields,
|
|
257
|
+
sysparm_display_value: "true",
|
|
258
|
+
sysparm_limit: String(args.limit),
|
|
259
|
+
});
|
|
260
|
+
const results = resp.result || [];
|
|
261
|
+
return (0, utils_js_1.ok)({ record_count: results.length, results });
|
|
262
|
+
}
|
|
263
|
+
default:
|
|
264
|
+
return (0, utils_js_1.err)(`Unknown ATF action: ${args.action}`);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
catch (error) {
|
|
268
|
+
return (0, utils_js_1.err)((0, utils_js_1.formatError)(error));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
async function pollTestResult(client, testId, resultId, trackerId, timeout) {
|
|
272
|
+
let elapsed = 0;
|
|
273
|
+
const pollInterval = 5;
|
|
274
|
+
let status = "";
|
|
275
|
+
let currentResultId = resultId;
|
|
276
|
+
while (elapsed < timeout) {
|
|
277
|
+
await sleep(pollInterval * 1000);
|
|
278
|
+
elapsed += pollInterval;
|
|
279
|
+
if (currentResultId) {
|
|
280
|
+
try {
|
|
281
|
+
const resp = await client.get(`/api/now/table/sys_atf_test_result/${currentResultId}`, {
|
|
282
|
+
sysparm_fields: "sys_id,test,status,output,duration,start_time,end_time",
|
|
283
|
+
sysparm_display_value: "true",
|
|
284
|
+
});
|
|
285
|
+
status = resp.result?.status || "";
|
|
286
|
+
}
|
|
287
|
+
catch {
|
|
288
|
+
// continue
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
else if (trackerId) {
|
|
292
|
+
try {
|
|
293
|
+
const resp = await client.get(`/api/now/table/sys_execution_tracker/${trackerId}`, {
|
|
294
|
+
sysparm_fields: "state,result,message",
|
|
295
|
+
sysparm_display_value: "true",
|
|
296
|
+
});
|
|
297
|
+
const state = resp.result?.state;
|
|
298
|
+
if (state === "Successful" ||
|
|
299
|
+
state === "Failed" ||
|
|
300
|
+
state === "Cancelled") {
|
|
301
|
+
status = "complete";
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
// continue
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
// Poll by test sys_id
|
|
310
|
+
try {
|
|
311
|
+
const resp = await client.get("/api/now/table/sys_atf_test_result", {
|
|
312
|
+
sysparm_query: `test=${testId}^ORDERBYDESCsys_created_on`,
|
|
313
|
+
sysparm_fields: "sys_id,test,status,output,duration,start_time,end_time",
|
|
314
|
+
sysparm_display_value: "true",
|
|
315
|
+
sysparm_limit: "1",
|
|
316
|
+
});
|
|
317
|
+
if (resp.result?.[0]) {
|
|
318
|
+
status = resp.result[0].status || "";
|
|
319
|
+
currentResultId = resp.result[0].sys_id;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
// continue
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const sl = status.toLowerCase();
|
|
327
|
+
if ([
|
|
328
|
+
"success",
|
|
329
|
+
"pass",
|
|
330
|
+
"passed",
|
|
331
|
+
"failure",
|
|
332
|
+
"fail",
|
|
333
|
+
"failed",
|
|
334
|
+
"error",
|
|
335
|
+
"complete",
|
|
336
|
+
"skipped",
|
|
337
|
+
"cancelled",
|
|
338
|
+
].includes(sl)) {
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// Fetch final result
|
|
343
|
+
if (currentResultId) {
|
|
344
|
+
try {
|
|
345
|
+
const resp = await client.get(`/api/now/table/sys_atf_test_result/${currentResultId}`, {
|
|
346
|
+
sysparm_fields: "sys_id,test,status,output,duration,start_time,end_time",
|
|
347
|
+
sysparm_display_value: "true",
|
|
348
|
+
});
|
|
349
|
+
return (0, utils_js_1.ok)(resp.result);
|
|
350
|
+
}
|
|
351
|
+
catch {
|
|
352
|
+
return (0, utils_js_1.ok)({ status: "timeout", message: `Timed out after ${timeout}s` });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
return (0, utils_js_1.ok)({ status: "timeout", message: `Timed out after ${timeout}s` });
|
|
356
|
+
}
|
|
357
|
+
//# sourceMappingURL=atf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atf.js","sourceRoot":"","sources":["../../src/tools/atf.ts"],"names":[],"mappings":";;;AA2EA,0BAyQC;AApVD,6BAAwB;AAGxB,0CAAmD;AAEtC,QAAA,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,sFAAsF;IACxF,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC;gBACvD,WAAW,EAAE,iFAAiF;aAC/F;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAC9C;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uCAAuC;aACrD;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WA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