@sonisoft/now-sdk-ext-core 2.0.0-alpha.3 → 2.2.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/dist/comm/http/TableAPIRequest.js +1 -1
- package/dist/comm/http/TableAPIRequest.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/sn/BackgroundScriptExecutor.js +2 -2
- package/dist/sn/BackgroundScriptExecutor.js.map +1 -1
- package/dist/sn/atf/ATFTestExecutor.d.ts +11 -6
- package/dist/sn/codesearch/CodeSearch.d.ts +112 -0
- package/dist/sn/codesearch/CodeSearch.js +300 -0
- package/dist/sn/codesearch/CodeSearch.js.map +1 -0
- package/dist/sn/codesearch/CodeSearchModels.d.ts +231 -0
- package/dist/sn/codesearch/CodeSearchModels.js +5 -0
- package/dist/sn/codesearch/CodeSearchModels.js.map +1 -0
- package/dist/util/Logger.d.ts +2 -1
- package/dist/util/Logger.js +4 -2
- package/dist/util/Logger.js.map +1 -1
- package/package.json +11 -10
|
@@ -35,7 +35,7 @@ export class TableAPIRequest {
|
|
|
35
35
|
let resp = null;
|
|
36
36
|
try {
|
|
37
37
|
const req = new ServiceNowRequest(this.snInstance);
|
|
38
|
-
const request = { path: uri, method: httpMethod, headers: this._headers, query: query, body: bodyData };
|
|
38
|
+
const request = { path: uri, method: httpMethod, headers: this._headers, query: query, body: null, json: bodyData };
|
|
39
39
|
resp = await req.executeRequest(request);
|
|
40
40
|
}
|
|
41
41
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableAPIRequest.js","sourceRoot":"","sources":["../../../src/comm/http/TableAPIRequest.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,OAAO,eAAe;IAEhB,QAAQ,GAAU;QACtB,cAAc,EAAC,kBAAkB;QACjC,QAAQ,EAAE,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;QAEjC,IAAG,CAAC;YACA,MAAM,GAAG,GAAqB,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAgC,CAAC,CAAC;YAE3F,MAAM,OAAO,GAAe,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;YAC/H,IAAI,GAAG,MAAM,GAAG,CAAC,cAAc,CAAI,OAAO,CAAC,CAAC;QAChD,CAAC;QAAA,OAAM,GAAG,EAAC,CAAC;YACR,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAGO,UAAU,CAAC,aAAoB,EAAE,SAAgB;QACtD,IAAI,YAAY,GAAU,aAAa,CAAC;QACvC,KAAI,MAAM,IAAI,IAAI,SAAS,EAAC,CAAC;YACzB,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,GAAC,IAAI,GAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAW,CAAC,CAAC;QACjF,CAAC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export * from './sn/application/CompanyApplications.js';
|
|
|
39
39
|
export * from './sn/atf/ATFTest.js';
|
|
40
40
|
export * from './sn/atf/ATFTestExecutor.js';
|
|
41
41
|
export * from './sn/atf/TestFactory.js';
|
|
42
|
+
export * from './sn/codesearch/CodeSearch.js';
|
|
43
|
+
export * from './sn/codesearch/CodeSearchModels.js';
|
|
42
44
|
export * from './sn/syslog/SyslogReader.js';
|
|
43
45
|
export * from './sn/syslog/SyslogRecord.js';
|
|
44
46
|
export * from './sn/user/UserRequest.js';
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,8 @@ export * from './sn/application/CompanyApplications.js';
|
|
|
39
39
|
export * from './sn/atf/ATFTest.js';
|
|
40
40
|
export * from './sn/atf/ATFTestExecutor.js';
|
|
41
41
|
export * from './sn/atf/TestFactory.js';
|
|
42
|
+
export * from './sn/codesearch/CodeSearch.js';
|
|
43
|
+
export * from './sn/codesearch/CodeSearchModels.js';
|
|
42
44
|
export * from './sn/syslog/SyslogReader.js';
|
|
43
45
|
export * from './sn/syslog/SyslogRecord.js';
|
|
44
46
|
export * from './sn/user/UserRequest.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAg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AAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
|
|
@@ -176,11 +176,11 @@ export class ScriptExecutionOutputLine {
|
|
|
176
176
|
return this;
|
|
177
177
|
}
|
|
178
178
|
asSystemLine(isSystemLine = true) {
|
|
179
|
-
this.
|
|
179
|
+
this._isSystem = isSystemLine;
|
|
180
180
|
return this;
|
|
181
181
|
}
|
|
182
182
|
asScriptLine(isScriptLine = true) {
|
|
183
|
-
this.
|
|
183
|
+
this._isScript = isScriptLine;
|
|
184
184
|
return this;
|
|
185
185
|
}
|
|
186
186
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundScriptExecutor.js","sourceRoot":"","sources":["../../src/sn/BackgroundScriptExecutor.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,4DAA4D;AAC5D,6DAA6D;AAC7D,uDAAuD;AACvD,wDAAwD;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,uCAAuC;A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,CAAC,GAAG,IAAI,CAAC;YACtB,CAAC;QAEL,CAAC,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAEtD,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAC,aAAa,EAAmC,CAAC;IAC1H,CAAC;IACO,qBAAqB,CAAC,YAAsC;QAChE,OAAO,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAA;IACxC,CAAC;CACJ;AA4BD,MAAM,OAAO,yBAAyB;IAC1B,KAAK,CAAQ;IACb,QAAQ,GAAW,KAAK,CAAC;IACzB,SAAS,GAAW,KAAK,CAAC;IAC1B,SAAS,GAAW,KAAK,CAAC;IAElC,YAAmB,IAAW;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,GAAU;QACtB,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;IACrB,CAAC;IAEM,WAAW,CAAC,cAAsB,IAAI;QACzC,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;QAE5B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,YAAY,CAAC,eAAuB,IAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC;QAE9B,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,YAAY,CAAC,eAAuB,IAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC;QAE9B,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -102,14 +102,19 @@ export interface TestSuiteExecutionResponse {
|
|
|
102
102
|
}
|
|
103
103
|
export interface TestSuiteExecutionResult {
|
|
104
104
|
sys_id: string;
|
|
105
|
+
number: string;
|
|
105
106
|
test_suite: ReferenceLink;
|
|
106
107
|
status: string;
|
|
108
|
+
success: string;
|
|
107
109
|
start_time: string;
|
|
108
110
|
end_time: string;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
run_time: string;
|
|
112
|
+
success_count: string;
|
|
113
|
+
failure_count: string;
|
|
114
|
+
skip_count: string;
|
|
115
|
+
error_count: string;
|
|
116
|
+
parent: string;
|
|
117
|
+
base_suite_result: ReferenceLink;
|
|
118
|
+
execution_tracker: ReferenceLink;
|
|
119
|
+
schedule_run: ReferenceLink;
|
|
115
120
|
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ServiceNowInstance } from "../ServiceNowInstance.js";
|
|
2
|
+
import { CodeSearchOptions, CodeSearchResult, CodeSearchRecordTypeResult, CodeSearchTable, CodeSearchGroup, CodeSearchGroupQueryOptions, AddCodeSearchTableOptions, CodeSearchTableRecord } from './CodeSearchModels.js';
|
|
3
|
+
/**
|
|
4
|
+
* CodeSearch class for querying ServiceNow's code search REST API.
|
|
5
|
+
* Supports searching across the platform, within specific applications or tables,
|
|
6
|
+
* listing search groups, and listing tables within a search group.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CodeSearch {
|
|
9
|
+
private static readonly SEARCH_API_PATH;
|
|
10
|
+
private static readonly TABLES_API_PATH;
|
|
11
|
+
private static readonly SEARCH_GROUP_TABLE;
|
|
12
|
+
private static readonly SEARCH_TABLE_TABLE;
|
|
13
|
+
private _logger;
|
|
14
|
+
private _req;
|
|
15
|
+
private _tableAPI;
|
|
16
|
+
private _instance;
|
|
17
|
+
constructor(instance: ServiceNowInstance);
|
|
18
|
+
/**
|
|
19
|
+
* Search across the ServiceNow platform for code matching the given term.
|
|
20
|
+
* Returns flattened results for easy consumption by CLI and MCP consumers.
|
|
21
|
+
* Uses GET /api/sn_codesearch/code_search/search
|
|
22
|
+
*
|
|
23
|
+
* @param options Search options including the required search term
|
|
24
|
+
* @returns Array of flattened CodeSearchResult items
|
|
25
|
+
* @throws Error if term is empty or if table is specified without search_group
|
|
26
|
+
*/
|
|
27
|
+
search(options: CodeSearchOptions): Promise<CodeSearchResult[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Search and return the raw hierarchical response from the API.
|
|
30
|
+
* Results are grouped by record type, then by hit, then by field match.
|
|
31
|
+
* Use this when you need the full response structure.
|
|
32
|
+
*
|
|
33
|
+
* @param options Search options including the required search term
|
|
34
|
+
* @returns Array of CodeSearchRecordTypeResult groups
|
|
35
|
+
* @throws Error if term is empty or if table is specified without search_group
|
|
36
|
+
*/
|
|
37
|
+
searchRaw(options: CodeSearchOptions): Promise<CodeSearchRecordTypeResult[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Search for code within a specific application scope.
|
|
40
|
+
* Convenience method that sets current_app and search_all_scopes=false.
|
|
41
|
+
*
|
|
42
|
+
* @param term The search term
|
|
43
|
+
* @param appScope The application scope to search within (e.g., "x_myapp")
|
|
44
|
+
* @param additionalOptions Optional additional search options
|
|
45
|
+
* @returns Array of flattened CodeSearchResult items
|
|
46
|
+
*/
|
|
47
|
+
searchInApp(term: string, appScope: string, additionalOptions?: Omit<CodeSearchOptions, 'term' | 'current_app' | 'search_all_scopes'>): Promise<CodeSearchResult[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Search for code within a specific table.
|
|
50
|
+
* Convenience method that sets table and search_group.
|
|
51
|
+
*
|
|
52
|
+
* @param term The search term
|
|
53
|
+
* @param tableName The table to search in
|
|
54
|
+
* @param searchGroup The search group name (required when searching by table)
|
|
55
|
+
* @param additionalOptions Optional additional search options
|
|
56
|
+
* @returns Array of flattened CodeSearchResult items
|
|
57
|
+
*/
|
|
58
|
+
searchInTable(term: string, tableName: string, searchGroup: string, additionalOptions?: Omit<CodeSearchOptions, 'term' | 'table' | 'search_group'>): Promise<CodeSearchResult[]>;
|
|
59
|
+
/**
|
|
60
|
+
* List the tables that would be searched for a given search group.
|
|
61
|
+
* Uses GET /api/sn_codesearch/code_search/tables
|
|
62
|
+
*
|
|
63
|
+
* @param searchGroup The search group NAME
|
|
64
|
+
* @returns Array of CodeSearchTable items
|
|
65
|
+
* @throws Error if searchGroup is empty
|
|
66
|
+
*/
|
|
67
|
+
getTablesForSearchGroup(searchGroup: string): Promise<CodeSearchTable[]>;
|
|
68
|
+
/**
|
|
69
|
+
* List all available code search groups.
|
|
70
|
+
* Queries the sn_codesearch_search_group table via Table API.
|
|
71
|
+
*
|
|
72
|
+
* @param options Optional query/limit options
|
|
73
|
+
* @returns Array of CodeSearchGroup records
|
|
74
|
+
*/
|
|
75
|
+
getSearchGroups(options?: CodeSearchGroupQueryOptions): Promise<CodeSearchGroup[]>;
|
|
76
|
+
/**
|
|
77
|
+
* Add a new table to an existing code search group.
|
|
78
|
+
* Inserts a record into the sn_codesearch_table table via Table API POST.
|
|
79
|
+
*
|
|
80
|
+
* @param options The table name, search fields, and search group sys_id
|
|
81
|
+
* @returns The created CodeSearchTableRecord including its sys_id
|
|
82
|
+
* @throws Error if any required field is empty or if the API call fails
|
|
83
|
+
*/
|
|
84
|
+
addTableToSearchGroup(options: AddCodeSearchTableOptions): Promise<CodeSearchTableRecord>;
|
|
85
|
+
/**
|
|
86
|
+
* List table records for a search group from the sn_codesearch_table table.
|
|
87
|
+
* Unlike getTablesForSearchGroup() which uses the REST API and returns {name, label},
|
|
88
|
+
* this method uses the Table API and returns full records including sys_id.
|
|
89
|
+
*
|
|
90
|
+
* @param searchGroupSysId The sys_id of the search group
|
|
91
|
+
* @param options Optional query/limit options
|
|
92
|
+
* @returns Array of CodeSearchTableRecord records
|
|
93
|
+
* @throws Error if searchGroupSysId is empty or if the API call fails
|
|
94
|
+
*/
|
|
95
|
+
getTableRecordsForSearchGroup(searchGroupSysId: string, options?: CodeSearchGroupQueryOptions): Promise<CodeSearchTableRecord[]>;
|
|
96
|
+
/**
|
|
97
|
+
* Flatten the hierarchical search API response into a simple array of results.
|
|
98
|
+
* Each entry represents one field match in one record — ideal for CLI display or MCP output.
|
|
99
|
+
*
|
|
100
|
+
* @param rawResults The raw record type results from searchRaw()
|
|
101
|
+
* @returns Flattened array of CodeSearchResult
|
|
102
|
+
*/
|
|
103
|
+
static flattenResults(rawResults: CodeSearchRecordTypeResult[]): CodeSearchResult[];
|
|
104
|
+
/**
|
|
105
|
+
* Format flattened search results as a simple text summary.
|
|
106
|
+
* Useful for CLI output.
|
|
107
|
+
*
|
|
108
|
+
* @param results Flattened search results from search()
|
|
109
|
+
* @returns Formatted string
|
|
110
|
+
*/
|
|
111
|
+
static formatResultsAsText(results: CodeSearchResult[]): string;
|
|
112
|
+
}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { Logger } from "../../util/Logger.js";
|
|
2
|
+
import { ServiceNowRequest } from "../../comm/http/ServiceNowRequest.js";
|
|
3
|
+
import { TableAPIRequest } from "../../comm/http/TableAPIRequest.js";
|
|
4
|
+
/**
|
|
5
|
+
* CodeSearch class for querying ServiceNow's code search REST API.
|
|
6
|
+
* Supports searching across the platform, within specific applications or tables,
|
|
7
|
+
* listing search groups, and listing tables within a search group.
|
|
8
|
+
*/
|
|
9
|
+
export class CodeSearch {
|
|
10
|
+
static SEARCH_API_PATH = '/api/sn_codesearch/code_search/search';
|
|
11
|
+
static TABLES_API_PATH = '/api/sn_codesearch/code_search/tables';
|
|
12
|
+
static SEARCH_GROUP_TABLE = 'sn_codesearch_search_group';
|
|
13
|
+
static SEARCH_TABLE_TABLE = 'sn_codesearch_table';
|
|
14
|
+
_logger = new Logger("CodeSearch");
|
|
15
|
+
_req;
|
|
16
|
+
_tableAPI;
|
|
17
|
+
_instance;
|
|
18
|
+
constructor(instance) {
|
|
19
|
+
this._instance = instance;
|
|
20
|
+
this._req = new ServiceNowRequest(instance);
|
|
21
|
+
this._tableAPI = new TableAPIRequest(instance);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Search across the ServiceNow platform for code matching the given term.
|
|
25
|
+
* Returns flattened results for easy consumption by CLI and MCP consumers.
|
|
26
|
+
* Uses GET /api/sn_codesearch/code_search/search
|
|
27
|
+
*
|
|
28
|
+
* @param options Search options including the required search term
|
|
29
|
+
* @returns Array of flattened CodeSearchResult items
|
|
30
|
+
* @throws Error if term is empty or if table is specified without search_group
|
|
31
|
+
*/
|
|
32
|
+
async search(options) {
|
|
33
|
+
const raw = await this.searchRaw(options);
|
|
34
|
+
return CodeSearch.flattenResults(raw);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Search and return the raw hierarchical response from the API.
|
|
38
|
+
* Results are grouped by record type, then by hit, then by field match.
|
|
39
|
+
* Use this when you need the full response structure.
|
|
40
|
+
*
|
|
41
|
+
* @param options Search options including the required search term
|
|
42
|
+
* @returns Array of CodeSearchRecordTypeResult groups
|
|
43
|
+
* @throws Error if term is empty or if table is specified without search_group
|
|
44
|
+
*/
|
|
45
|
+
async searchRaw(options) {
|
|
46
|
+
if (!options.term || options.term.trim().length === 0) {
|
|
47
|
+
throw new Error('Search term is required');
|
|
48
|
+
}
|
|
49
|
+
if (options.table && !options.search_group) {
|
|
50
|
+
throw new Error('search_group is required when searching a specific table');
|
|
51
|
+
}
|
|
52
|
+
this._logger.info(`Performing code search for term: ${options.term}`);
|
|
53
|
+
const query = {
|
|
54
|
+
term: options.term
|
|
55
|
+
};
|
|
56
|
+
if (options.search_group) {
|
|
57
|
+
query.search_group = options.search_group;
|
|
58
|
+
}
|
|
59
|
+
if (options.table) {
|
|
60
|
+
query.table = options.table;
|
|
61
|
+
}
|
|
62
|
+
if (options.current_app) {
|
|
63
|
+
query.current_app = options.current_app;
|
|
64
|
+
}
|
|
65
|
+
if (options.search_all_scopes !== undefined) {
|
|
66
|
+
query.search_all_scopes = String(options.search_all_scopes);
|
|
67
|
+
}
|
|
68
|
+
if (options.extended_matching !== undefined) {
|
|
69
|
+
query.extended_matching = String(options.extended_matching);
|
|
70
|
+
}
|
|
71
|
+
if (options.limit !== undefined) {
|
|
72
|
+
query.limit = String(options.limit);
|
|
73
|
+
}
|
|
74
|
+
const request = {
|
|
75
|
+
method: 'GET',
|
|
76
|
+
path: CodeSearch.SEARCH_API_PATH,
|
|
77
|
+
headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' },
|
|
78
|
+
query: query,
|
|
79
|
+
body: null
|
|
80
|
+
};
|
|
81
|
+
const resp = await this._req.get(request);
|
|
82
|
+
if (resp.status === 200 && resp.bodyObject?.result) {
|
|
83
|
+
const results = resp.bodyObject.result;
|
|
84
|
+
// The API normally returns an array of record type groups.
|
|
85
|
+
// When filtering by table, it may return a single object — normalize to array.
|
|
86
|
+
const normalized = Array.isArray(results) ? results : [results];
|
|
87
|
+
this._logger.info(`Code search returned ${normalized.length} record type groups`);
|
|
88
|
+
return normalized;
|
|
89
|
+
}
|
|
90
|
+
throw new Error(`Code search failed. Status: ${resp.status}`);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Search for code within a specific application scope.
|
|
94
|
+
* Convenience method that sets current_app and search_all_scopes=false.
|
|
95
|
+
*
|
|
96
|
+
* @param term The search term
|
|
97
|
+
* @param appScope The application scope to search within (e.g., "x_myapp")
|
|
98
|
+
* @param additionalOptions Optional additional search options
|
|
99
|
+
* @returns Array of flattened CodeSearchResult items
|
|
100
|
+
*/
|
|
101
|
+
async searchInApp(term, appScope, additionalOptions) {
|
|
102
|
+
return this.search({
|
|
103
|
+
...additionalOptions,
|
|
104
|
+
term,
|
|
105
|
+
current_app: appScope,
|
|
106
|
+
search_all_scopes: false
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Search for code within a specific table.
|
|
111
|
+
* Convenience method that sets table and search_group.
|
|
112
|
+
*
|
|
113
|
+
* @param term The search term
|
|
114
|
+
* @param tableName The table to search in
|
|
115
|
+
* @param searchGroup The search group name (required when searching by table)
|
|
116
|
+
* @param additionalOptions Optional additional search options
|
|
117
|
+
* @returns Array of flattened CodeSearchResult items
|
|
118
|
+
*/
|
|
119
|
+
async searchInTable(term, tableName, searchGroup, additionalOptions) {
|
|
120
|
+
return this.search({
|
|
121
|
+
...additionalOptions,
|
|
122
|
+
term,
|
|
123
|
+
table: tableName,
|
|
124
|
+
search_group: searchGroup
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* List the tables that would be searched for a given search group.
|
|
129
|
+
* Uses GET /api/sn_codesearch/code_search/tables
|
|
130
|
+
*
|
|
131
|
+
* @param searchGroup The search group NAME
|
|
132
|
+
* @returns Array of CodeSearchTable items
|
|
133
|
+
* @throws Error if searchGroup is empty
|
|
134
|
+
*/
|
|
135
|
+
async getTablesForSearchGroup(searchGroup) {
|
|
136
|
+
if (!searchGroup || searchGroup.trim().length === 0) {
|
|
137
|
+
throw new Error('Search group name is required');
|
|
138
|
+
}
|
|
139
|
+
this._logger.info(`Listing tables for search group: ${searchGroup}`);
|
|
140
|
+
const request = {
|
|
141
|
+
method: 'GET',
|
|
142
|
+
path: CodeSearch.TABLES_API_PATH,
|
|
143
|
+
headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' },
|
|
144
|
+
query: { search_group: searchGroup },
|
|
145
|
+
body: null
|
|
146
|
+
};
|
|
147
|
+
const resp = await this._req.get(request);
|
|
148
|
+
if (resp.status === 200 && resp.bodyObject?.result) {
|
|
149
|
+
const tables = resp.bodyObject.result;
|
|
150
|
+
this._logger.info(`Found ${tables.length} tables in search group: ${searchGroup}`);
|
|
151
|
+
return tables;
|
|
152
|
+
}
|
|
153
|
+
throw new Error(`Failed to list tables for search group '${searchGroup}'. Status: ${resp.status}`);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* List all available code search groups.
|
|
157
|
+
* Queries the sn_codesearch_search_group table via Table API.
|
|
158
|
+
*
|
|
159
|
+
* @param options Optional query/limit options
|
|
160
|
+
* @returns Array of CodeSearchGroup records
|
|
161
|
+
*/
|
|
162
|
+
async getSearchGroups(options = {}) {
|
|
163
|
+
const { encodedQuery, limit = 100 } = options;
|
|
164
|
+
this._logger.info(`Querying code search groups with query: ${encodedQuery || 'none'}`);
|
|
165
|
+
const query = {
|
|
166
|
+
sysparm_limit: limit,
|
|
167
|
+
sysparm_display_value: 'false'
|
|
168
|
+
};
|
|
169
|
+
if (encodedQuery) {
|
|
170
|
+
query.sysparm_query = encodedQuery;
|
|
171
|
+
}
|
|
172
|
+
const response = await this._tableAPI.get(CodeSearch.SEARCH_GROUP_TABLE, query);
|
|
173
|
+
if (response.status === 200 && response.bodyObject?.result) {
|
|
174
|
+
this._logger.info(`Retrieved ${response.bodyObject.result.length} code search groups`);
|
|
175
|
+
return response.bodyObject.result;
|
|
176
|
+
}
|
|
177
|
+
throw new Error(`Failed to query code search groups. Status: ${response.status}`);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Add a new table to an existing code search group.
|
|
181
|
+
* Inserts a record into the sn_codesearch_table table via Table API POST.
|
|
182
|
+
*
|
|
183
|
+
* @param options The table name, search fields, and search group sys_id
|
|
184
|
+
* @returns The created CodeSearchTableRecord including its sys_id
|
|
185
|
+
* @throws Error if any required field is empty or if the API call fails
|
|
186
|
+
*/
|
|
187
|
+
async addTableToSearchGroup(options) {
|
|
188
|
+
if (!options.table || options.table.trim().length === 0) {
|
|
189
|
+
throw new Error('Table name is required');
|
|
190
|
+
}
|
|
191
|
+
if (!options.search_fields || options.search_fields.trim().length === 0) {
|
|
192
|
+
throw new Error('Search fields are required');
|
|
193
|
+
}
|
|
194
|
+
if (!options.search_group || options.search_group.trim().length === 0) {
|
|
195
|
+
throw new Error('Search group sys_id is required');
|
|
196
|
+
}
|
|
197
|
+
this._logger.info(`Adding table '${options.table}' to search group '${options.search_group}'`);
|
|
198
|
+
const body = {
|
|
199
|
+
table: options.table,
|
|
200
|
+
search_fields: options.search_fields,
|
|
201
|
+
search_group: options.search_group
|
|
202
|
+
};
|
|
203
|
+
const response = await this._tableAPI.post(CodeSearch.SEARCH_TABLE_TABLE, {}, body);
|
|
204
|
+
if (response && (response.status === 200 || response.status === 201) && response.bodyObject?.result) {
|
|
205
|
+
this._logger.info(`Successfully added table '${options.table}' with sys_id: ${response.bodyObject.result.sys_id}`);
|
|
206
|
+
return response.bodyObject.result;
|
|
207
|
+
}
|
|
208
|
+
throw new Error(`Failed to add table '${options.table}' to search group '${options.search_group}'. Status: ${response?.status ?? 'unknown'}`);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* List table records for a search group from the sn_codesearch_table table.
|
|
212
|
+
* Unlike getTablesForSearchGroup() which uses the REST API and returns {name, label},
|
|
213
|
+
* this method uses the Table API and returns full records including sys_id.
|
|
214
|
+
*
|
|
215
|
+
* @param searchGroupSysId The sys_id of the search group
|
|
216
|
+
* @param options Optional query/limit options
|
|
217
|
+
* @returns Array of CodeSearchTableRecord records
|
|
218
|
+
* @throws Error if searchGroupSysId is empty or if the API call fails
|
|
219
|
+
*/
|
|
220
|
+
async getTableRecordsForSearchGroup(searchGroupSysId, options = {}) {
|
|
221
|
+
if (!searchGroupSysId || searchGroupSysId.trim().length === 0) {
|
|
222
|
+
throw new Error('Search group sys_id is required');
|
|
223
|
+
}
|
|
224
|
+
this._logger.info(`Querying table records for search group: ${searchGroupSysId}`);
|
|
225
|
+
const query = {
|
|
226
|
+
sysparm_query: `search_group=${searchGroupSysId}`,
|
|
227
|
+
sysparm_limit: options.limit ?? 100,
|
|
228
|
+
sysparm_display_value: 'false'
|
|
229
|
+
};
|
|
230
|
+
const response = await this._tableAPI.get(CodeSearch.SEARCH_TABLE_TABLE, query);
|
|
231
|
+
if (response && response.status === 200 && response.bodyObject?.result) {
|
|
232
|
+
this._logger.info(`Retrieved ${response.bodyObject.result.length} table records`);
|
|
233
|
+
return response.bodyObject.result;
|
|
234
|
+
}
|
|
235
|
+
throw new Error(`Failed to query table records for search group '${searchGroupSysId}'. Status: ${response?.status ?? 'unknown'}`);
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Flatten the hierarchical search API response into a simple array of results.
|
|
239
|
+
* Each entry represents one field match in one record — ideal for CLI display or MCP output.
|
|
240
|
+
*
|
|
241
|
+
* @param rawResults The raw record type results from searchRaw()
|
|
242
|
+
* @returns Flattened array of CodeSearchResult
|
|
243
|
+
*/
|
|
244
|
+
static flattenResults(rawResults) {
|
|
245
|
+
const flattened = [];
|
|
246
|
+
if (!rawResults || !Array.isArray(rawResults))
|
|
247
|
+
return flattened;
|
|
248
|
+
for (const group of rawResults) {
|
|
249
|
+
if (!group.hits || group.hits.length === 0)
|
|
250
|
+
continue;
|
|
251
|
+
for (const hit of group.hits) {
|
|
252
|
+
if (!hit.matches || hit.matches.length === 0)
|
|
253
|
+
continue;
|
|
254
|
+
for (const match of hit.matches) {
|
|
255
|
+
const lineMatches = match.lineMatches || [];
|
|
256
|
+
flattened.push({
|
|
257
|
+
table: hit.className || group.recordType,
|
|
258
|
+
tableLabel: hit.tableLabel || group.tableLabel,
|
|
259
|
+
name: hit.name,
|
|
260
|
+
field: match.field,
|
|
261
|
+
fieldLabel: match.fieldLabel,
|
|
262
|
+
lineMatches: lineMatches,
|
|
263
|
+
matchCount: lineMatches.length,
|
|
264
|
+
firstMatchContext: lineMatches.length > 0 ? lineMatches[0].context : '',
|
|
265
|
+
firstMatchLine: lineMatches.length > 0 ? lineMatches[0].line : 0
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return flattened;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Format flattened search results as a simple text summary.
|
|
274
|
+
* Useful for CLI output.
|
|
275
|
+
*
|
|
276
|
+
* @param results Flattened search results from search()
|
|
277
|
+
* @returns Formatted string
|
|
278
|
+
*/
|
|
279
|
+
static formatResultsAsText(results) {
|
|
280
|
+
if (results.length === 0) {
|
|
281
|
+
return 'No results found.';
|
|
282
|
+
}
|
|
283
|
+
const lines = [];
|
|
284
|
+
lines.push(`Found ${results.length} matches:\n`);
|
|
285
|
+
for (const result of results) {
|
|
286
|
+
lines.push(` ${result.tableLabel} > ${result.name} > ${result.fieldLabel}`);
|
|
287
|
+
lines.push(` Table: ${result.table}, Field: ${result.field}, Matches: ${result.matchCount}`);
|
|
288
|
+
for (const lm of result.lineMatches.slice(0, 3)) {
|
|
289
|
+
const lineStr = lm.line > 0 ? `L${lm.line}: ` : '';
|
|
290
|
+
lines.push(` ${lineStr}${lm.context}`);
|
|
291
|
+
}
|
|
292
|
+
if (result.lineMatches.length > 3) {
|
|
293
|
+
lines.push(` ... and ${result.lineMatches.length - 3} more matches`);
|
|
294
|
+
}
|
|
295
|
+
lines.push('');
|
|
296
|
+
}
|
|
297
|
+
return lines.join('\n');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=CodeSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeSearch.js","sourceRoot":"","sources":["../../../src/sn/codesearch/CodeSearch.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAmBlE;;;;GAIG;AACH,MAAM,OAAO,UAAU;IACX,MAAM,CAAU,eAAe,GAAG,uCAAuC,CAAC;IAC1E,MAAM,CAAU,eAAe,GAAG,uCAAuC,CAAC;IAC1E,MAAM,CAAU,kBAAkB,GAAG,4BAA4B,CAAC;IAClE,MAAM,CAAU,kBAAkB,GAAG,qBAAqB,CAAC;IAE3D,OAAO,GAAW,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;IAC3C,IAAI,CAAoB;IACxB,SAAS,CAAkB;IAC3B,SAAS,CAAqB;IAEtC,YAAmB,QAA4B;QAC3C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,iBAAiB,CAAC,QAAQ,CAAC,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M,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,aAAa,CAAC,CAAC;QAEjD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,UAAU,MAAM,MAAM,CAAC,IAAI,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAC7E,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,KAAK,YAAY,MAAM,CAAC,KAAK,cAAc,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YAEhG,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC9C,MAAM,OAAO,GAAG,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnD,KAAK,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YAChD,CAAC;YACD,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAChC,KAAK,CAAC,IAAI,CAAC,iBAAiB,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,eAAe,CAAC,CAAC;YAC9E,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for performing a code search.
|
|
3
|
+
* Maps to query parameters for GET /api/sn_codesearch/code_search/search
|
|
4
|
+
*/
|
|
5
|
+
export interface CodeSearchOptions {
|
|
6
|
+
/** The term to search for (required) */
|
|
7
|
+
term: string;
|
|
8
|
+
/**
|
|
9
|
+
* The Search Group NAME to search within (optional).
|
|
10
|
+
* Note: This is the NAME of the code search group, not the sys_id.
|
|
11
|
+
*/
|
|
12
|
+
search_group?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The specific table to search in.
|
|
15
|
+
* Requires search_group to also be provided.
|
|
16
|
+
*/
|
|
17
|
+
table?: string;
|
|
18
|
+
/**
|
|
19
|
+
* When false, limits results to files within the scope specified by current_app.
|
|
20
|
+
* Defaults to true (search all scopes).
|
|
21
|
+
*/
|
|
22
|
+
search_all_scopes?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Limits results to the specified application scope.
|
|
25
|
+
* Only effective when search_all_scopes is false.
|
|
26
|
+
*/
|
|
27
|
+
current_app?: string;
|
|
28
|
+
/** When true, returns additional fields with match context */
|
|
29
|
+
extended_matching?: boolean;
|
|
30
|
+
/** Maximum number of results to return */
|
|
31
|
+
limit?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Options for querying search groups from the table API.
|
|
35
|
+
*/
|
|
36
|
+
export interface CodeSearchGroupQueryOptions {
|
|
37
|
+
/** Encoded query string for filtering search groups */
|
|
38
|
+
encodedQuery?: string;
|
|
39
|
+
/** Maximum number of records to return (default: 100) */
|
|
40
|
+
limit?: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A single line match within a field.
|
|
44
|
+
*/
|
|
45
|
+
export interface CodeSearchLineMatch {
|
|
46
|
+
/** Line number of the match */
|
|
47
|
+
line: number;
|
|
48
|
+
/** The matching line content / context snippet */
|
|
49
|
+
context: string;
|
|
50
|
+
/** HTML-escaped version of the context */
|
|
51
|
+
escaped?: string;
|
|
52
|
+
/** Additional fields */
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A matching field within a record hit.
|
|
57
|
+
*/
|
|
58
|
+
export interface CodeSearchFieldMatch {
|
|
59
|
+
/** The field name where the match was found (e.g., "script") */
|
|
60
|
+
field: string;
|
|
61
|
+
/** Display label of the field (e.g., "Script") */
|
|
62
|
+
fieldLabel: string;
|
|
63
|
+
/** Array of individual line matches within this field */
|
|
64
|
+
lineMatches: CodeSearchLineMatch[];
|
|
65
|
+
/** Additional fields */
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A record that contains matches — a "hit" within a record type group.
|
|
70
|
+
*/
|
|
71
|
+
export interface CodeSearchHit {
|
|
72
|
+
/** The name/label of the record */
|
|
73
|
+
name: string;
|
|
74
|
+
/** The table name (className) of the record */
|
|
75
|
+
className: string;
|
|
76
|
+
/** Display label of the table */
|
|
77
|
+
tableLabel: string;
|
|
78
|
+
/** Array of field matches within this record */
|
|
79
|
+
matches: CodeSearchFieldMatch[];
|
|
80
|
+
/** Additional fields */
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A record type group in the search results.
|
|
85
|
+
* The search API groups results by table/record type.
|
|
86
|
+
*/
|
|
87
|
+
export interface CodeSearchRecordTypeResult {
|
|
88
|
+
/** The table name / record type (e.g., "sys_script_include") */
|
|
89
|
+
recordType: string;
|
|
90
|
+
/** Display label of the table (e.g., "Script Includes") */
|
|
91
|
+
tableLabel: string;
|
|
92
|
+
/** Array of record hits within this record type */
|
|
93
|
+
hits: CodeSearchHit[];
|
|
94
|
+
/** Additional fields */
|
|
95
|
+
[key: string]: unknown;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Top-level response from the code search API.
|
|
99
|
+
* GET /api/sn_codesearch/code_search/search
|
|
100
|
+
*
|
|
101
|
+
* The result is an array of record type groups, each containing hits.
|
|
102
|
+
*/
|
|
103
|
+
export interface CodeSearchResponse {
|
|
104
|
+
result: CodeSearchRecordTypeResult[];
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A flattened, easy-to-consume search result.
|
|
108
|
+
* Each entry represents a single field match in a single record.
|
|
109
|
+
* Ideal for CLI table output or MCP server responses.
|
|
110
|
+
*/
|
|
111
|
+
export interface CodeSearchResult {
|
|
112
|
+
/** The table name where the match was found */
|
|
113
|
+
table: string;
|
|
114
|
+
/** Display label of the table */
|
|
115
|
+
tableLabel: string;
|
|
116
|
+
/** The name of the record containing the match */
|
|
117
|
+
name: string;
|
|
118
|
+
/** The field name where the match was found */
|
|
119
|
+
field: string;
|
|
120
|
+
/** Display label of the field */
|
|
121
|
+
fieldLabel: string;
|
|
122
|
+
/** Array of line matches within this field */
|
|
123
|
+
lineMatches: CodeSearchLineMatch[];
|
|
124
|
+
/** Total number of line matches in this field */
|
|
125
|
+
matchCount: number;
|
|
126
|
+
/** First matching line's context (convenience for display) */
|
|
127
|
+
firstMatchContext: string;
|
|
128
|
+
/** First matching line number */
|
|
129
|
+
firstMatchLine: number;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* A table entry returned by the tables endpoint.
|
|
133
|
+
*/
|
|
134
|
+
export interface CodeSearchTable {
|
|
135
|
+
/** Table name (e.g., "sys_script_include") */
|
|
136
|
+
name: string;
|
|
137
|
+
/** Display label of the table */
|
|
138
|
+
label?: string;
|
|
139
|
+
/** Additional fields */
|
|
140
|
+
[key: string]: unknown;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Response from the tables endpoint.
|
|
144
|
+
* GET /api/sn_codesearch/code_search/tables
|
|
145
|
+
*
|
|
146
|
+
* The result is a flat array of table objects.
|
|
147
|
+
*/
|
|
148
|
+
export interface CodeSearchTablesResponse {
|
|
149
|
+
result: CodeSearchTable[];
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* A search group record from the sn_codesearch_search_group table.
|
|
153
|
+
* Retrieved via Table API.
|
|
154
|
+
*/
|
|
155
|
+
export interface CodeSearchGroup {
|
|
156
|
+
/** System ID */
|
|
157
|
+
sys_id: string;
|
|
158
|
+
/** Search group name — this is the value used in the search_group parameter */
|
|
159
|
+
name: string;
|
|
160
|
+
/** Description of the search group */
|
|
161
|
+
description?: string;
|
|
162
|
+
/** Whether extended matching is enabled */
|
|
163
|
+
extended_matching?: string;
|
|
164
|
+
/** Sys scope */
|
|
165
|
+
sys_scope?: string | {
|
|
166
|
+
link: string;
|
|
167
|
+
value: string;
|
|
168
|
+
};
|
|
169
|
+
/** Created timestamp */
|
|
170
|
+
sys_created_on?: string;
|
|
171
|
+
/** Updated timestamp */
|
|
172
|
+
sys_updated_on?: string;
|
|
173
|
+
/** Additional fields */
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Response from the search groups table query (Table API).
|
|
178
|
+
*/
|
|
179
|
+
export interface CodeSearchGroupResponse {
|
|
180
|
+
result: CodeSearchGroup[];
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Options for adding a table to a code search group.
|
|
184
|
+
* Maps to fields on the sn_codesearch_table table.
|
|
185
|
+
*/
|
|
186
|
+
export interface AddCodeSearchTableOptions {
|
|
187
|
+
/** Table name to add (e.g., "sys_script_include") */
|
|
188
|
+
table: string;
|
|
189
|
+
/** Comma-separated fields to search (e.g., "script,name") */
|
|
190
|
+
search_fields: string;
|
|
191
|
+
/** sys_id of the target code search group */
|
|
192
|
+
search_group: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* A record from the sn_codesearch_table Table API.
|
|
196
|
+
* This is the full record shape including sys_id, unlike CodeSearchTable
|
|
197
|
+
* which only has name/label from the REST endpoint.
|
|
198
|
+
*/
|
|
199
|
+
export interface CodeSearchTableRecord {
|
|
200
|
+
/** System ID of this table record */
|
|
201
|
+
sys_id: string;
|
|
202
|
+
/** The table name (e.g., "sys_script_include") */
|
|
203
|
+
table: string;
|
|
204
|
+
/** Comma-separated search fields (e.g., "script,name") */
|
|
205
|
+
search_fields: string;
|
|
206
|
+
/** Reference (sys_id) to the search group */
|
|
207
|
+
search_group: string | {
|
|
208
|
+
link: string;
|
|
209
|
+
value: string;
|
|
210
|
+
};
|
|
211
|
+
/** Created timestamp */
|
|
212
|
+
sys_created_on?: string;
|
|
213
|
+
/** Updated timestamp */
|
|
214
|
+
sys_updated_on?: string;
|
|
215
|
+
/** Additional fields */
|
|
216
|
+
[key: string]: unknown;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Response from inserting into sn_codesearch_table (Table API POST).
|
|
220
|
+
* POST returns a single record under result.
|
|
221
|
+
*/
|
|
222
|
+
export interface CodeSearchTableRecordResponse {
|
|
223
|
+
result: CodeSearchTableRecord;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Response from querying sn_codesearch_table (Table API GET).
|
|
227
|
+
* GET returns an array of records under result.
|
|
228
|
+
*/
|
|
229
|
+
export interface CodeSearchTableRecordsResponse {
|
|
230
|
+
result: CodeSearchTableRecord[];
|
|
231
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeSearchModels.js","sourceRoot":"","sources":["../../../src/sn/codesearch/CodeSearchModels.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wBAAwB;AACxB,+DAA+D"}
|
package/dist/util/Logger.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ export declare class Logger {
|
|
|
5
5
|
static debugFilter: winston.Logform.FormatWrap;
|
|
6
6
|
_labelName: string;
|
|
7
7
|
_localLogger: winston.Logger;
|
|
8
|
-
|
|
8
|
+
_logLevel: string;
|
|
9
|
+
constructor(labelName: string, level?: string);
|
|
9
10
|
setLogger(logger: winston.Logger): void;
|
|
10
11
|
getLabel(): string;
|
|
11
12
|
private initLogger;
|
package/dist/util/Logger.js
CHANGED
|
@@ -13,8 +13,10 @@ export class Logger {
|
|
|
13
13
|
});
|
|
14
14
|
_labelName;
|
|
15
15
|
_localLogger;
|
|
16
|
-
|
|
16
|
+
_logLevel;
|
|
17
|
+
constructor(labelName, level = "info") {
|
|
17
18
|
this._labelName = labelName;
|
|
19
|
+
this._logLevel = level;
|
|
18
20
|
this.initLogger();
|
|
19
21
|
}
|
|
20
22
|
setLogger(logger) {
|
|
@@ -25,7 +27,7 @@ export class Logger {
|
|
|
25
27
|
}
|
|
26
28
|
initLogger() {
|
|
27
29
|
this._localLogger = winston.createLogger({
|
|
28
|
-
level:
|
|
30
|
+
level: this._logLevel,
|
|
29
31
|
format: combine(label({ label: this._labelName }), timestamp({ format: "YYYY-MM-DD HH:mm:ss" }),
|
|
30
32
|
// Format the metadata object
|
|
31
33
|
metadata({ fillExcept: ["message", "level", "timestamp", "label"] })),
|
package/dist/util/Logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/util/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AACnC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAC,GAAG,OAAO,CAAC,MAAM,CAAC;AACpE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;AAGvC,MAAM,OAAO,MAAM;IAElB,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5C,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC7C,OAAO,IAAI,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/C,OAAO,IAAI,CAAC,KAAK,KAAK,OAAO,CA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AC,CAAC;IAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sonisoft/now-sdk-ext-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Comprehensive TypeScript library extending ServiceNow SDK with application management, ATF testing, real-time log monitoring, AMB event subscriptions, and automation tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"servicenow",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": ""
|
|
19
|
+
"url": "https://git.sonisoft.io/sonisoft/now-sdk-ext-core.git"
|
|
20
20
|
},
|
|
21
21
|
"type": "module",
|
|
22
22
|
"author": "",
|
|
@@ -44,10 +44,11 @@
|
|
|
44
44
|
"watch-test": "npm run test:unit -- --watchAll",
|
|
45
45
|
"watch-test:integration": "npm run test:integration -- --watchAll",
|
|
46
46
|
"watch-ts": "tsc -w",
|
|
47
|
-
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run watch-node\""
|
|
47
|
+
"watch": "concurrently -k -p \"[{name}]\" -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run watch-node\"",
|
|
48
|
+
"prepare": "git config core.hooksPath .githooks"
|
|
48
49
|
},
|
|
49
50
|
"publishConfig": {
|
|
50
|
-
"access": "
|
|
51
|
+
"access": "public"
|
|
51
52
|
},
|
|
52
53
|
"files": [
|
|
53
54
|
"dist"
|
|
@@ -56,11 +57,11 @@
|
|
|
56
57
|
"types": "./dist/index.d.ts",
|
|
57
58
|
"dependencies": {
|
|
58
59
|
"@servicenow/glide": "^26.0.1",
|
|
59
|
-
"@servicenow/sdk": "
|
|
60
|
-
"@servicenow/sdk-build-core": "
|
|
61
|
-
"@servicenow/sdk-cli": "
|
|
60
|
+
"@servicenow/sdk": "3.0.2",
|
|
61
|
+
"@servicenow/sdk-build-core": "3.0.2",
|
|
62
|
+
"@servicenow/sdk-cli": "3.0.2",
|
|
62
63
|
"@servicenow/sdk-cli-core": "3.0.2",
|
|
63
|
-
"@servicenow/sdk-core": "
|
|
64
|
+
"@servicenow/sdk-core": "3.0.2",
|
|
64
65
|
"@ts-morph/common": "^0.24.0",
|
|
65
66
|
"@types/mock-fs": "^4.13.4",
|
|
66
67
|
"@types/node-gzip": "^1.1.3",
|
|
@@ -149,6 +150,6 @@
|
|
|
149
150
|
"typescript-transform-paths": "^3.5.0"
|
|
150
151
|
},
|
|
151
152
|
"engines": {
|
|
152
|
-
"node": ">=
|
|
153
|
+
"node": ">=18.0.0"
|
|
153
154
|
}
|
|
154
|
-
}
|
|
155
|
+
}
|