@babamba2/abap-mcp-adt-powerup 4.8.12 → 4.8.14
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/CHANGELOG.md +30 -1
- package/dist/handlers/gui_status/high/handleGetGuiStatus.d.ts +14 -2
- package/dist/handlers/gui_status/high/handleGetGuiStatus.d.ts.map +1 -1
- package/dist/handlers/gui_status/high/handleGetGuiStatus.js +24 -11
- package/dist/handlers/gui_status/high/handleGetGuiStatus.js.map +1 -1
- package/dist/handlers/smartform/high/handleCreateSmartForm.d.ts +71 -0
- package/dist/handlers/smartform/high/handleCreateSmartForm.d.ts.map +1 -0
- package/dist/handlers/smartform/high/handleCreateSmartForm.js +163 -0
- package/dist/handlers/smartform/high/handleCreateSmartForm.js.map +1 -0
- package/dist/handlers/smartform/high/handleDeleteSmartForm.d.ts +41 -0
- package/dist/handlers/smartform/high/handleDeleteSmartForm.d.ts.map +1 -0
- package/dist/handlers/smartform/high/handleDeleteSmartForm.js +76 -0
- package/dist/handlers/smartform/high/handleDeleteSmartForm.js.map +1 -0
- package/dist/handlers/system/readonly/handleGetSmartFormContent.d.ts +77 -0
- package/dist/handlers/system/readonly/handleGetSmartFormContent.d.ts.map +1 -0
- package/dist/handlers/system/readonly/handleGetSmartFormContent.js +98 -0
- package/dist/handlers/system/readonly/handleGetSmartFormContent.js.map +1 -0
- package/dist/handlers/system/readonly/handleGetSmartFormLayout.d.ts +47 -0
- package/dist/handlers/system/readonly/handleGetSmartFormLayout.d.ts.map +1 -0
- package/dist/handlers/system/readonly/handleGetSmartFormLayout.js +70 -0
- package/dist/handlers/system/readonly/handleGetSmartFormLayout.js.map +1 -0
- package/dist/handlers/system/readonly/handleRenderSmartForm.d.ts +65 -0
- package/dist/handlers/system/readonly/handleRenderSmartForm.d.ts.map +1 -0
- package/dist/handlers/system/readonly/handleRenderSmartForm.js +111 -0
- package/dist/handlers/system/readonly/handleRenderSmartForm.js.map +1 -0
- package/dist/handlers/system/readonly/runtimeFeedsHelper.d.ts +1 -1
- package/dist/handlers/system/readonly/runtimeFeedsHelper.d.ts.map +1 -1
- package/dist/lib/cuaFilter.d.ts +38 -0
- package/dist/lib/cuaFilter.d.ts.map +1 -0
- package/dist/lib/cuaFilter.js +132 -0
- package/dist/lib/cuaFilter.js.map +1 -0
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.d.ts.map +1 -1
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.js +11 -0
- package/dist/lib/handlers/groups/HighLevelHandlersGroup.js.map +1 -1
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.d.ts.map +1 -1
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js +15 -0
- package/dist/lib/handlers/groups/ReadOnlyHandlersGroup.js.map +1 -1
- package/dist/lib/legacyTableRead.d.ts.map +1 -1
- package/dist/lib/legacyTableRead.js +19 -9
- package/dist/lib/legacyTableRead.js.map +1 -1
- package/dist/lib/smartFormContent.d.ts +277 -0
- package/dist/lib/smartFormContent.d.ts.map +1 -0
- package/dist/lib/smartFormContent.js +1130 -0
- package/dist/lib/smartFormContent.js.map +1 -0
- package/dist/lib/smartFormLayout.d.ts +83 -0
- package/dist/lib/smartFormLayout.d.ts.map +1 -0
- package/dist/lib/smartFormLayout.js +236 -0
- package/dist/lib/smartFormLayout.js.map +1 -0
- package/dist/lib/smartFormRender.d.ts +17 -0
- package/dist/lib/smartFormRender.d.ts.map +1 -0
- package/dist/lib/smartFormRender.js +112 -0
- package/dist/lib/smartFormRender.js.map +1 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/docs/user-guide/AVAILABLE_TOOLS.md +1041 -204
- package/docs/user-guide/AVAILABLE_TOOLS_COMPACT.md +2 -1
- package/docs/user-guide/AVAILABLE_TOOLS_HIGH.md +472 -85
- package/docs/user-guide/AVAILABLE_TOOLS_LEGACY.md +957 -78
- package/docs/user-guide/AVAILABLE_TOOLS_LOW.md +271 -60
- package/docs/user-guide/AVAILABLE_TOOLS_READONLY.md +299 -60
- package/package.json +19 -19
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetSmartFormContent.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetSmartFormContent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAWvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlB,CAAC;AAEX,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;;;;;;GAsCF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GetSmartFormContent — read-only: what each window of a SmartForm prints.
|
|
4
|
+
*
|
|
5
|
+
* Source: the Form Builder XML of the active version (FB_CONVERT_FORM_TO_XML,
|
|
6
|
+
* the same XML as SMARTFORMS > Utilities > Download), parsed into pages →
|
|
7
|
+
* windows → content nodes. Styles (CSS), SE78 graphics (BMP) and include
|
|
8
|
+
* texts with a fixed key are fetched too and written as files under the MCP
|
|
9
|
+
* output directory. Program lines (code nodes, global coding) are never
|
|
10
|
+
* returned — a code node only shows up as a marker.
|
|
11
|
+
*
|
|
12
|
+
* Backend: ZMCP_ADT_DISPATCH action SSF_CONTENT through callDispatch, so it
|
|
13
|
+
* runs on the OData backend (BASIS 7.40) and on SOAP RFC (BASIS 7.31) alike.
|
|
14
|
+
*
|
|
15
|
+
* Companion ABAP sources: sc4sap/abap/zmcp_ssf_content.abap and
|
|
16
|
+
* sc4sap/abap/zmcp_adt_dispatch_ssf_content_branch.abap
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.TOOL_DEFINITION = void 0;
|
|
20
|
+
exports.handleGetSmartFormContent = handleGetSmartFormContent;
|
|
21
|
+
const smartFormContent_1 = require("../../../lib/smartFormContent");
|
|
22
|
+
const utils_1 = require("../../../lib/utils");
|
|
23
|
+
exports.TOOL_DEFINITION = {
|
|
24
|
+
name: 'GetSmartFormContent',
|
|
25
|
+
available_in: ['onprem', 'legacy'],
|
|
26
|
+
description: '[read-only] Read what a SmartForm prints, for a preview: per page and window (position in mm) the content tree — text nodes with their lines (paragraph format + text with inline tags and &symbols&), include texts, tables / templates / loops with line types and cells, graphics, addresses, conditions; code nodes appear only as markers (no program lines). Also fetches the SmartStyles as CSS, the SE78 graphics with a fixed key as BMP files (with printed size) and the include texts with a fixed key. Graphics / texts whose key holds a &symbol& are listed under dynamicReferences. Active version, texts in the logon language. Files go under the MCP output directory (smartforms/<form>/), including <form>.content.json with the full result; summary=true answers with an overview (windows, data declarations, &symbols&, files) instead of the content tree. Needs the ZMCP_SSF_CONTENT FM and the SSF_CONTENT dispatcher action.',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
form_name: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'SmartForm name (e.g. "ZMY_FORM").',
|
|
33
|
+
},
|
|
34
|
+
include_graphics: {
|
|
35
|
+
type: 'boolean',
|
|
36
|
+
description: 'Fetch SE78 graphics with a fixed key as BMP files. Default true.',
|
|
37
|
+
},
|
|
38
|
+
include_styles: {
|
|
39
|
+
type: 'boolean',
|
|
40
|
+
description: 'Fetch the SmartStyles (form default + text node styles) as CSS. Default true.',
|
|
41
|
+
},
|
|
42
|
+
include_texts: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
description: 'Fetch include texts (SO10) with a fixed key. Default true.',
|
|
45
|
+
},
|
|
46
|
+
summary: {
|
|
47
|
+
type: 'boolean',
|
|
48
|
+
description: 'Answer with an overview (windows, data declarations, &symbols&, graphics, files) instead of the full content tree; the full result is always written to files.content. Default false.',
|
|
49
|
+
},
|
|
50
|
+
values: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
description: 'Sample values for &symbols& in graphic keys (e.g. {"IM_SIGN": "ZSIGN"}): graphics named by a variable are then fetched too.',
|
|
53
|
+
},
|
|
54
|
+
device: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Output device whose printer fonts the preview should assume. Default: a device whose type has fonts for most of the families of the form.',
|
|
57
|
+
},
|
|
58
|
+
text_language: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Language for include texts whose key has no language: 1-char SAP key (e.g. "3") or 2-letter ISO code (e.g. "KO"). Default: the form language.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
required: ['form_name'],
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
async function handleGetSmartFormContent(context, args) {
|
|
67
|
+
const { connection, logger } = context;
|
|
68
|
+
try {
|
|
69
|
+
const formName = String(args?.form_name ?? '')
|
|
70
|
+
.trim()
|
|
71
|
+
.toUpperCase();
|
|
72
|
+
if (!formName) {
|
|
73
|
+
return (0, utils_1.return_error)(new Error('form_name is required'));
|
|
74
|
+
}
|
|
75
|
+
logger?.info(`GetSmartFormContent: ${formName}`);
|
|
76
|
+
const content = await (0, smartFormContent_1.getSmartFormContent)(connection, formName, {
|
|
77
|
+
includeGraphics: args?.include_graphics,
|
|
78
|
+
includeStyles: args?.include_styles,
|
|
79
|
+
includeTexts: args?.include_texts,
|
|
80
|
+
textLanguage: args?.text_language
|
|
81
|
+
? String(args.text_language).trim()
|
|
82
|
+
: undefined,
|
|
83
|
+
device: args?.device ? String(args.device).trim() : undefined,
|
|
84
|
+
values: args?.values && typeof args.values === 'object'
|
|
85
|
+
? args.values
|
|
86
|
+
: undefined,
|
|
87
|
+
});
|
|
88
|
+
return (0, utils_1.return_response)({
|
|
89
|
+
data: JSON.stringify(args?.summary ? (0, smartFormContent_1.summarizeSmartFormContent)(content) : content, null, 2),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
94
|
+
logger?.error(`GetSmartFormContent error: ${errorMessage}`);
|
|
95
|
+
return (0, utils_1.return_error)(new Error(errorMessage));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=handleGetSmartFormContent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetSmartFormContent.js","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetSmartFormContent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAiEH,8DAiDC;AA/GD,oEAGuC;AACvC,8CAI4B;AAEf,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAU;IAC3C,WAAW,EACT,25BAA25B;IAC75B,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mCAAmC;aACjD;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,kEAAkE;aACrE;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,SAAS;gBACf,WAAW,EACT,+EAA+E;aAClF;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,SAAS;gBACf,WAA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I,EAAE,CAAC,CAAC,CAAC,SAAS;YAC7D,MAAM,EACJ,IAAI,EAAE,MAAM,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;gBAC7C,CAAC,CAAC,IAAI,CAAC,MAAM;gBACb,CAAC,CAAC,SAAS;SAChB,CAAC,CAAC;QAEH,OAAO,IAAA,uBAAe,EAAC;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,IAAA,4CAAyB,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,EAC5D,IAAI,EACJ,CAAC,CACF;SACe,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,EAAE,KAAK,CAAC,8BAA8B,YAAY,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAA,oBAAY,EAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GetSmartFormLayout — read-only: pages and window positions of a SmartForm.
|
|
3
|
+
*
|
|
4
|
+
* Source: the Form Builder object model, read on the SAP side by
|
|
5
|
+
* ZMCP_SSF_LAYOUT (CL_SSF_FB_SMART_FORM->LOAD in display mode, page tree,
|
|
6
|
+
* window node output attributes). Only layout leaves SAP: no text node
|
|
7
|
+
* contents, program lines, global data or form interface.
|
|
8
|
+
*
|
|
9
|
+
* Backend: ZMCP_ADT_DISPATCH action SSF_LAYOUT through callDispatch, so it
|
|
10
|
+
* runs on the OData backend (BASIS 7.40) and on SOAP RFC (BASIS 7.31) alike.
|
|
11
|
+
* Coordinates come back raw with their unit and are converted to mm here
|
|
12
|
+
* (LN / CH through the page variant's LPI / CPI).
|
|
13
|
+
*
|
|
14
|
+
* Companion ABAP sources: sc4sap/abap/zmcp_ssf_layout.abap and
|
|
15
|
+
* sc4sap/abap/zmcp_adt_dispatch_ssf_layout_branch.abap
|
|
16
|
+
*/
|
|
17
|
+
import type { HandlerContext } from '../../../lib/handlers/interfaces';
|
|
18
|
+
export declare const TOOL_DEFINITION: {
|
|
19
|
+
readonly name: "GetSmartFormLayout";
|
|
20
|
+
readonly available_in: readonly ["onprem", "legacy"];
|
|
21
|
+
readonly description: "[read-only] Read the page and window layout of a SmartForm (active version; a never-activated form is read from its saved version, then `active` is false): per page the format, orientation, next page, CPI / LPI and style, and per window its type (MAIN / SECONDARY / ...), position and size as stored (value + unit) and converted to millimetres. Layout only: no texts, code or form interface. Needs the ZMCP_SSF_LAYOUT FM and the SSF_LAYOUT dispatcher action.";
|
|
22
|
+
readonly inputSchema: {
|
|
23
|
+
readonly type: "object";
|
|
24
|
+
readonly properties: {
|
|
25
|
+
readonly form_name: {
|
|
26
|
+
readonly type: "string";
|
|
27
|
+
readonly description: "SmartForm name (e.g. \"ZMY_FORM\").";
|
|
28
|
+
};
|
|
29
|
+
readonly language: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly description: "Form language: 1-char SAP key (e.g. \"E\", \"3\") or 2-letter ISO code (e.g. \"EN\", \"KO\"). Default: the master language of the form.";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
readonly required: readonly ["form_name"];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export declare function handleGetSmartFormLayout(context: HandlerContext, args: {
|
|
38
|
+
form_name: string;
|
|
39
|
+
language?: string;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
isError: boolean;
|
|
42
|
+
content: {
|
|
43
|
+
type: string;
|
|
44
|
+
text: any;
|
|
45
|
+
}[];
|
|
46
|
+
}>;
|
|
47
|
+
//# sourceMappingURL=handleGetSmartFormLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetSmartFormLayout.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetSmartFormLayout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAWvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAoBlB,CAAC;AAEX,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;;;;GA8B/C"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* GetSmartFormLayout — read-only: pages and window positions of a SmartForm.
|
|
4
|
+
*
|
|
5
|
+
* Source: the Form Builder object model, read on the SAP side by
|
|
6
|
+
* ZMCP_SSF_LAYOUT (CL_SSF_FB_SMART_FORM->LOAD in display mode, page tree,
|
|
7
|
+
* window node output attributes). Only layout leaves SAP: no text node
|
|
8
|
+
* contents, program lines, global data or form interface.
|
|
9
|
+
*
|
|
10
|
+
* Backend: ZMCP_ADT_DISPATCH action SSF_LAYOUT through callDispatch, so it
|
|
11
|
+
* runs on the OData backend (BASIS 7.40) and on SOAP RFC (BASIS 7.31) alike.
|
|
12
|
+
* Coordinates come back raw with their unit and are converted to mm here
|
|
13
|
+
* (LN / CH through the page variant's LPI / CPI).
|
|
14
|
+
*
|
|
15
|
+
* Companion ABAP sources: sc4sap/abap/zmcp_ssf_layout.abap and
|
|
16
|
+
* sc4sap/abap/zmcp_adt_dispatch_ssf_layout_branch.abap
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.TOOL_DEFINITION = void 0;
|
|
20
|
+
exports.handleGetSmartFormLayout = handleGetSmartFormLayout;
|
|
21
|
+
const smartFormLayout_1 = require("../../../lib/smartFormLayout");
|
|
22
|
+
const utils_1 = require("../../../lib/utils");
|
|
23
|
+
exports.TOOL_DEFINITION = {
|
|
24
|
+
name: 'GetSmartFormLayout',
|
|
25
|
+
available_in: ['onprem', 'legacy'],
|
|
26
|
+
description: '[read-only] Read the page and window layout of a SmartForm (active version; a never-activated form is read from its saved version, then `active` is false): per page the format, orientation, next page, CPI / LPI and style, and per window its type (MAIN / SECONDARY / ...), position and size as stored (value + unit) and converted to millimetres. Layout only: no texts, code or form interface. Needs the ZMCP_SSF_LAYOUT FM and the SSF_LAYOUT dispatcher action.',
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
form_name: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'SmartForm name (e.g. "ZMY_FORM").',
|
|
33
|
+
},
|
|
34
|
+
language: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Form language: 1-char SAP key (e.g. "E", "3") or 2-letter ISO code (e.g. "EN", "KO"). Default: the master language of the form.',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
required: ['form_name'],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
async function handleGetSmartFormLayout(context, args) {
|
|
43
|
+
const { connection, logger } = context;
|
|
44
|
+
try {
|
|
45
|
+
const formName = String(args?.form_name ?? '')
|
|
46
|
+
.trim()
|
|
47
|
+
.toUpperCase();
|
|
48
|
+
if (!formName) {
|
|
49
|
+
return (0, utils_1.return_error)(new Error('form_name is required'));
|
|
50
|
+
}
|
|
51
|
+
let language;
|
|
52
|
+
try {
|
|
53
|
+
language = (0, smartFormLayout_1.normalizeSmartFormLanguage)(args?.language);
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
return (0, utils_1.return_error)(e);
|
|
57
|
+
}
|
|
58
|
+
logger?.info(`GetSmartFormLayout: ${formName}, language=${language || '(master)'}`);
|
|
59
|
+
const layout = await (0, smartFormLayout_1.getSmartFormLayout)(connection, formName, language);
|
|
60
|
+
return (0, utils_1.return_response)({
|
|
61
|
+
data: JSON.stringify(layout, null, 2),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
66
|
+
logger?.error(`GetSmartFormLayout error: ${errorMessage}`);
|
|
67
|
+
return (0, utils_1.return_error)(new Error(errorMessage));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=handleGetSmartFormLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleGetSmartFormLayout.js","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleGetSmartFormLayout.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAmCH,4DAgCC;AAhED,kEAGsC;AACtC,8CAI4B;AAEf,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,oBAAoB;IAC1B,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAU;IAC3C,WAAW,EACT,4cAA4c;IAC9c,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mCAAmC;aACjD;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,iIAAiI;aACpI;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACO,CAAC;AAEJ,KAAK,UAAU,wBAAwB,CAC5C,OAAuB,EACvB,IAA8C;IAE9C,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,SAAS,IAAI,EAAE,CAAC;aAC3C,IAAI,EAAE;aACN,WAAW,EAAE,CAAC;QACjB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,IAAA,oBAAY,EAAC,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACH,QAAQ,GAAG,IAAA,4CAA0B,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,IAAA,oBAAY,EAAC,CAAC,CAAC,CAAC;QACzB,CAAC;QACD,MAAM,EAAE,IAAI,CACV,uBAAuB,QAAQ,cAAc,QAAQ,IAAI,UAAU,EAAE,CACtE,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAA,oCAAkB,EAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAExE,OAAO,IAAA,uBAAe,EAAC;YACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;SACrB,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC5E,MAAM,EAAE,KAAK,CAAC,6BAA6B,YAAY,EAAE,CAAC,CAAC;QAC3D,OAAO,IAAA,oBAAY,EAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderSmartForm — the output of a SmartForm exactly as SAP prints it
|
|
3
|
+
* (OTF + PDF), for given interface values, without printing or spooling.
|
|
4
|
+
*
|
|
5
|
+
* Runs the form's generated function module with GETOTF = 'X'. Nothing is
|
|
6
|
+
* printed, stored or sent, but the form's program lines run as in a real
|
|
7
|
+
* print (they may read the database). Use invented sample values only.
|
|
8
|
+
*
|
|
9
|
+
* Backend: ZMCP_ADT_DISPATCH action SSF_RENDER → FM ZMCP_SSF_RENDER.
|
|
10
|
+
* Companion ABAP source: sc4sap/abap/zmcp_ssf_render.abap
|
|
11
|
+
*/
|
|
12
|
+
import type { HandlerContext } from '../../../lib/handlers/interfaces';
|
|
13
|
+
export declare const TOOL_DEFINITION: {
|
|
14
|
+
readonly name: "RenderSmartForm";
|
|
15
|
+
readonly available_in: readonly ["onprem", "legacy"];
|
|
16
|
+
readonly description: "[runs the form, no output] The output of a SmartForm as SAP prints it, for given interface values: calls the generated function module with GETOTF (no dialog, no print, no spool) and writes the OTF (text: positions, fonts, strings) and the PDF under the MCP output directory (smartforms/<form>/<form>.sap.otf.txt / .sap.pdf). The form's own program lines run as in a real print and may read the database — pass invented sample values only. Needs the ZMCP_SSF_RENDER FM and the SSF_RENDER dispatcher action.";
|
|
17
|
+
readonly inputSchema: {
|
|
18
|
+
readonly type: "object";
|
|
19
|
+
readonly properties: {
|
|
20
|
+
readonly form_name: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "SmartForm name (e.g. \"ZMY_FORM\").";
|
|
23
|
+
};
|
|
24
|
+
readonly values: {
|
|
25
|
+
readonly type: "object";
|
|
26
|
+
readonly description: "Interface parameter → value, in internal format: structures as objects with the ABAP component names, TABLES parameters / table types as arrays, dates \"2026-10-16\", times \"14:00:00\", amounts and quantities as numbers. Parameters left out are passed initial.";
|
|
27
|
+
};
|
|
28
|
+
readonly values_file: {
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly description: "Path of a JSON file with the same object as `values` (for large interfaces). Ignored when `values` is given.";
|
|
31
|
+
};
|
|
32
|
+
readonly device: {
|
|
33
|
+
readonly type: "string";
|
|
34
|
+
readonly description: "Output device whose device type sets fonts and character widths (e.g. the printer the form goes to). Default: the user default device, else a SAPWIN / PDF device.";
|
|
35
|
+
};
|
|
36
|
+
readonly families: {
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly items: {
|
|
39
|
+
readonly type: "string";
|
|
40
|
+
};
|
|
41
|
+
readonly description: "Font families the form uses (from GetSmartFormContent styles). Without `device`, a device whose type has printer fonts for most of them is used, so the output shows the fonts the form was made for.";
|
|
42
|
+
};
|
|
43
|
+
readonly language: {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
readonly description: "Output language: 1-char SAP key or 2-letter ISO code. Default: logon language.";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
readonly required: readonly ["form_name"];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare function handleRenderSmartForm(context: HandlerContext, args: {
|
|
52
|
+
form_name: string;
|
|
53
|
+
values?: Record<string, unknown>;
|
|
54
|
+
values_file?: string;
|
|
55
|
+
language?: string;
|
|
56
|
+
device?: string;
|
|
57
|
+
families?: string[];
|
|
58
|
+
}): Promise<{
|
|
59
|
+
isError: boolean;
|
|
60
|
+
content: {
|
|
61
|
+
type: string;
|
|
62
|
+
text: any;
|
|
63
|
+
}[];
|
|
64
|
+
}>;
|
|
65
|
+
//# sourceMappingURL=handleRenderSmartForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleRenderSmartForm.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleRenderSmartForm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAQvE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyClB,CAAC;AAEX,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IACJ,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;;;;;;GA4BF"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* RenderSmartForm — the output of a SmartForm exactly as SAP prints it
|
|
4
|
+
* (OTF + PDF), for given interface values, without printing or spooling.
|
|
5
|
+
*
|
|
6
|
+
* Runs the form's generated function module with GETOTF = 'X'. Nothing is
|
|
7
|
+
* printed, stored or sent, but the form's program lines run as in a real
|
|
8
|
+
* print (they may read the database). Use invented sample values only.
|
|
9
|
+
*
|
|
10
|
+
* Backend: ZMCP_ADT_DISPATCH action SSF_RENDER → FM ZMCP_SSF_RENDER.
|
|
11
|
+
* Companion ABAP source: sc4sap/abap/zmcp_ssf_render.abap
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.TOOL_DEFINITION = void 0;
|
|
48
|
+
exports.handleRenderSmartForm = handleRenderSmartForm;
|
|
49
|
+
const fs = __importStar(require("node:fs"));
|
|
50
|
+
const smartFormRender_1 = require("../../../lib/smartFormRender");
|
|
51
|
+
const utils_1 = require("../../../lib/utils");
|
|
52
|
+
exports.TOOL_DEFINITION = {
|
|
53
|
+
name: 'RenderSmartForm',
|
|
54
|
+
available_in: ['onprem', 'legacy'],
|
|
55
|
+
description: "[runs the form, no output] The output of a SmartForm as SAP prints it, for given interface values: calls the generated function module with GETOTF (no dialog, no print, no spool) and writes the OTF (text: positions, fonts, strings) and the PDF under the MCP output directory (smartforms/<form>/<form>.sap.otf.txt / .sap.pdf). The form's own program lines run as in a real print and may read the database — pass invented sample values only. Needs the ZMCP_SSF_RENDER FM and the SSF_RENDER dispatcher action.",
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
form_name: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'SmartForm name (e.g. "ZMY_FORM").',
|
|
62
|
+
},
|
|
63
|
+
values: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
description: 'Interface parameter → value, in internal format: structures as objects with the ABAP component names, TABLES parameters / table types as arrays, dates "2026-10-16", times "14:00:00", amounts and quantities as numbers. Parameters left out are passed initial.',
|
|
66
|
+
},
|
|
67
|
+
values_file: {
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Path of a JSON file with the same object as `values` (for large interfaces). Ignored when `values` is given.',
|
|
70
|
+
},
|
|
71
|
+
device: {
|
|
72
|
+
type: 'string',
|
|
73
|
+
description: 'Output device whose device type sets fonts and character widths (e.g. the printer the form goes to). Default: the user default device, else a SAPWIN / PDF device.',
|
|
74
|
+
},
|
|
75
|
+
families: {
|
|
76
|
+
type: 'array',
|
|
77
|
+
items: { type: 'string' },
|
|
78
|
+
description: 'Font families the form uses (from GetSmartFormContent styles). Without `device`, a device whose type has printer fonts for most of them is used, so the output shows the fonts the form was made for.',
|
|
79
|
+
},
|
|
80
|
+
language: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'Output language: 1-char SAP key or 2-letter ISO code. Default: logon language.',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
required: ['form_name'],
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
async function handleRenderSmartForm(context, args) {
|
|
89
|
+
const { connection, logger } = context;
|
|
90
|
+
try {
|
|
91
|
+
const formName = String(args?.form_name ?? '')
|
|
92
|
+
.trim()
|
|
93
|
+
.toUpperCase();
|
|
94
|
+
if (!formName)
|
|
95
|
+
return (0, utils_1.return_error)(new Error('form_name is required'));
|
|
96
|
+
let values = args?.values;
|
|
97
|
+
if (!values && args?.values_file)
|
|
98
|
+
values = JSON.parse(fs.readFileSync(args.values_file, 'utf8'));
|
|
99
|
+
logger?.info(`RenderSmartForm: ${formName}`);
|
|
100
|
+
const result = await (0, smartFormRender_1.renderSmartForm)(connection, formName, values ?? {}, args?.language?.trim() || undefined, args?.device?.trim() || undefined, Array.isArray(args?.families) ? args.families : undefined);
|
|
101
|
+
return (0, utils_1.return_response)({
|
|
102
|
+
data: JSON.stringify(result, null, 2),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
107
|
+
logger?.error(`RenderSmartForm error: ${errorMessage}`);
|
|
108
|
+
return (0, utils_1.return_error)(new Error(errorMessage));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=handleRenderSmartForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleRenderSmartForm.js","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/handleRenderSmartForm.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDH,sDAqCC;AAzFD,4CAA8B;AAE9B,kEAA+D;AAC/D,8CAI4B;AAEf,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAU;IAC3C,WAAW,EACT,4fAA4f;IAC9f,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mCAAmC;aACjD;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,mQAAmQ;aACtQ;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,8GAA8G;aACjH;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,oKAAoK;aACvK;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,uMAAuM;aAC1M;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,gFAAgF;aACnF;SACF;QACD,QAAQ,EAAE,CAAC,WAAW,CAAC;KACxB;CACO,CAAC;AAEJ,KAAK,UAAU,qBAAqB,CACzC,OAAuB,EACvB,IAO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A0B,YAAY,EAAE,CAAC,CAAC;QACxD,OAAO,IAAA,oBAAY,EAAC,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
|
|
@@ -149,7 +149,7 @@ export declare function buildFeedQueryParams(options?: IFeedQueryOptions, userAt
|
|
|
149
149
|
/**
|
|
150
150
|
* Fetch a feed URL with optional query params. Accept header set to Atom XML.
|
|
151
151
|
*/
|
|
152
|
-
export declare function fetchFeed(connection: IAbapConnection, feedUrl: string, options?: IFeedQueryOptions, userAttribute?: string): Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
152
|
+
export declare function fetchFeed(connection: IAbapConnection, feedUrl: string, options?: IFeedQueryOptions, userAttribute?: string): Promise<import("axios").AxiosResponse<any, any, {}, any>>;
|
|
153
153
|
export declare function parseAtomFeed(xml: string): IFeedEntry[];
|
|
154
154
|
export declare function parseFeedDescriptors(xml: string): IFeedDescriptor[];
|
|
155
155
|
export declare function parseFeedVariants(xml: string): IFeedVariant[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeFeedsHelper.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/runtimeFeedsHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIzE,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,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AC,CAAC;QACpC,UAAU,EAAE,iBAAiB,EAAE,CAAC;KACjC,CAAC;IACF,UAAU,EAAE;QACV,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B;AAoED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAClB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BrB;AAcD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,iBAAiB,EAC3B,aAAa,GAAE,MAAe,GAC7B,MAAM,CAgBR;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,iBAAiB,EAC3B,aAAa,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"runtimeFeedsHelper.d.ts","sourceRoot":"","sources":["../../../../src/handlers/system/readonly/runtimeFeedsHelper.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAIzE,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;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AAE;QACV,KAAK,EAAE,eAAe,EAAE,CAAC;QACzB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;KAC5B,CAAC;IACF,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B;AAoED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,GAClB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA4BrB;AAcD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,CAAC,EAAE,iBAAiB,EAC3B,aAAa,GAAE,MAAe,GAC7B,MAAM,CAgBR;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,iBAAiB,EAC3B,aAAa,CAAC,EAAE,MAAM,6DAcvB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,EAAE,CAavD;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,EAAE,CAUnE;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE,CAS7D;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAoBtE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAoDpE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAuDlE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAmFxE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Narrowing of a fetched CUA definition (RS_CUA_INTERNAL_FETCH result) for
|
|
3
|
+
* GetGuiStatus, so a caller who asks for one status or a few function codes
|
|
4
|
+
* does not receive the whole program interface.
|
|
5
|
+
*
|
|
6
|
+
* Links between the tables (field names as serialized by /ui2/cl_json):
|
|
7
|
+
* STA.CODE ──SET.STATUS──▶ SET.FUNCTION ──▶ FUN.CODE (functions of a status)
|
|
8
|
+
* STA.PFKCODE ─▶ PFK.CODE (function keys: PFNO → FUNCODE)
|
|
9
|
+
* STA.PFKCODE ─▶ BUT.PFK_CODE, STA.BUTCODE ─▶ BUT.CODE (application toolbar: PFNO)
|
|
10
|
+
* STA.ACTCODE ─▶ ACT.CODE (menu bar) ─▶ MEN / MTX by the menu codes it names
|
|
11
|
+
*/
|
|
12
|
+
type Cua = Record<string, unknown>;
|
|
13
|
+
export interface CuaFilter {
|
|
14
|
+
statusName?: string;
|
|
15
|
+
functionCodes?: string[];
|
|
16
|
+
}
|
|
17
|
+
/** The CUA reduced to the given status (and its functions, keys, toolbar,
|
|
18
|
+
* menus) and / or the given function codes. ADM is kept; TIT, DOC and BIV are
|
|
19
|
+
* dropped when a status is given (they do not belong to a status). */
|
|
20
|
+
export declare function filterCua(cua: Cua, { statusName, functionCodes }: CuaFilter): Cua;
|
|
21
|
+
export interface CompactFunction {
|
|
22
|
+
code: string;
|
|
23
|
+
text: string;
|
|
24
|
+
icon?: string;
|
|
25
|
+
fkey?: string;
|
|
26
|
+
toolbar?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface CompactStatus {
|
|
29
|
+
code: string;
|
|
30
|
+
type: string;
|
|
31
|
+
functions: CompactFunction[];
|
|
32
|
+
}
|
|
33
|
+
/** One line per function of each status: code, text, icon, function key, on the toolbar. */
|
|
34
|
+
export declare function compactCua(cua: Cua): {
|
|
35
|
+
statuses: CompactStatus[];
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=cuaFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cuaFilter.d.ts","sourceRoot":"","sources":["../../src/lib/cuaFilter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAWnC,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;uEAEuE;AACvE,wBAAgB,SAAS,CACvB,GAAG,EAAE,GAAG,EACR,EAAE,UAAU,EAAE,aAAa,EAAE,EAAE,SAAS,GACvC,GAAG,CAoEL;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AACD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED,4FAA4F;AAC5F,wBAAgB,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE,CA4ClE"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Narrowing of a fetched CUA definition (RS_CUA_INTERNAL_FETCH result) for
|
|
4
|
+
* GetGuiStatus, so a caller who asks for one status or a few function codes
|
|
5
|
+
* does not receive the whole program interface.
|
|
6
|
+
*
|
|
7
|
+
* Links between the tables (field names as serialized by /ui2/cl_json):
|
|
8
|
+
* STA.CODE ──SET.STATUS──▶ SET.FUNCTION ──▶ FUN.CODE (functions of a status)
|
|
9
|
+
* STA.PFKCODE ─▶ PFK.CODE (function keys: PFNO → FUNCODE)
|
|
10
|
+
* STA.PFKCODE ─▶ BUT.PFK_CODE, STA.BUTCODE ─▶ BUT.CODE (application toolbar: PFNO)
|
|
11
|
+
* STA.ACTCODE ─▶ ACT.CODE (menu bar) ─▶ MEN / MTX by the menu codes it names
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.filterCua = filterCua;
|
|
15
|
+
exports.compactCua = compactCua;
|
|
16
|
+
const rows = (cua, table) => {
|
|
17
|
+
const v = cua?.[table] ?? cua?.[table.toLowerCase()];
|
|
18
|
+
return Array.isArray(v) ? v : [];
|
|
19
|
+
};
|
|
20
|
+
const str = (r, field) => String(r?.[field] ?? r?.[field.toLowerCase()] ?? '')
|
|
21
|
+
.trim()
|
|
22
|
+
.toUpperCase();
|
|
23
|
+
/** The CUA reduced to the given status (and its functions, keys, toolbar,
|
|
24
|
+
* menus) and / or the given function codes. ADM is kept; TIT, DOC and BIV are
|
|
25
|
+
* dropped when a status is given (they do not belong to a status). */
|
|
26
|
+
function filterCua(cua, { statusName, functionCodes }) {
|
|
27
|
+
if (!cua || (!statusName && !functionCodes?.length))
|
|
28
|
+
return cua;
|
|
29
|
+
const out = { ...cua };
|
|
30
|
+
const fcodes = functionCodes?.length
|
|
31
|
+
? new Set(functionCodes.map((c) => c.trim().toUpperCase()))
|
|
32
|
+
: null;
|
|
33
|
+
if (statusName) {
|
|
34
|
+
const st = statusName.toUpperCase();
|
|
35
|
+
const sta = rows(cua, 'STA').filter((r) => str(r, 'CODE') === st);
|
|
36
|
+
const pfk = new Set(sta.map((r) => str(r, 'PFKCODE')).filter(Boolean));
|
|
37
|
+
const but = new Set(sta.map((r) => str(r, 'BUTCODE')).filter(Boolean));
|
|
38
|
+
const act = new Set(sta.map((r) => str(r, 'ACTCODE')).filter(Boolean));
|
|
39
|
+
const set = rows(cua, 'SET').filter((r) => str(r, 'STATUS') === st);
|
|
40
|
+
const inStatus = new Set(set.map((r) => str(r, 'FUNCTION')));
|
|
41
|
+
const actRows = rows(cua, 'ACT').filter((r) => act.has(str(r, 'CODE')));
|
|
42
|
+
// menus named by the menu bar, and their sub-menus (one level per pass)
|
|
43
|
+
const menus = new Set();
|
|
44
|
+
const collect = (rs) => {
|
|
45
|
+
for (const r of rs)
|
|
46
|
+
for (const v of Object.values(r))
|
|
47
|
+
if (typeof v === 'string' && v.trim())
|
|
48
|
+
menus.add(v.trim().toUpperCase());
|
|
49
|
+
};
|
|
50
|
+
collect(actRows);
|
|
51
|
+
let menRows = [];
|
|
52
|
+
for (let i = 0; i < 4; i++) {
|
|
53
|
+
menRows = rows(cua, 'MEN').filter((r) => menus.has(str(r, 'CODE')));
|
|
54
|
+
const before = menus.size;
|
|
55
|
+
collect(menRows);
|
|
56
|
+
if (menus.size === before)
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
Object.assign(out, {
|
|
60
|
+
STA: sta,
|
|
61
|
+
SET: set,
|
|
62
|
+
FUN: rows(cua, 'FUN').filter((r) => inStatus.has(str(r, 'CODE'))),
|
|
63
|
+
PFK: rows(cua, 'PFK').filter((r) => pfk.has(str(r, 'CODE'))),
|
|
64
|
+
BUT: rows(cua, 'BUT').filter((r) => pfk.has(str(r, 'PFK_CODE')) && (!but.size || but.has(str(r, 'CODE')))),
|
|
65
|
+
ACT: actRows,
|
|
66
|
+
MEN: menRows,
|
|
67
|
+
MTX: rows(cua, 'MTX').filter((r) => menus.has(str(r, 'CODE'))),
|
|
68
|
+
});
|
|
69
|
+
for (const t of ['TIT', 'DOC', 'BIV', 'tit', 'doc', 'biv'])
|
|
70
|
+
delete out[t];
|
|
71
|
+
for (const t of ['sta', 'set', 'fun', 'pfk', 'but', 'act', 'men', 'mtx'])
|
|
72
|
+
delete out[t];
|
|
73
|
+
}
|
|
74
|
+
if (fcodes) {
|
|
75
|
+
const pfkRows = rows(out, 'PFK').filter((r) => fcodes.has(str(r, 'FUNCODE')));
|
|
76
|
+
const pfnos = new Set(pfkRows.map((r) => `${str(r, 'CODE')}/${str(r, 'PFNO')}`));
|
|
77
|
+
Object.assign(out, {
|
|
78
|
+
FUN: rows(out, 'FUN').filter((r) => fcodes.has(str(r, 'CODE'))),
|
|
79
|
+
SET: rows(out, 'SET').filter((r) => fcodes.has(str(r, 'FUNCTION'))),
|
|
80
|
+
PFK: pfkRows,
|
|
81
|
+
BUT: rows(out, 'BUT').filter((r) => pfnos.has(`${str(r, 'PFK_CODE')}/${str(r, 'PFNO')}`)),
|
|
82
|
+
});
|
|
83
|
+
for (const t of ['fun', 'set', 'pfk', 'but'])
|
|
84
|
+
delete out[t];
|
|
85
|
+
}
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
/** One line per function of each status: code, text, icon, function key, on the toolbar. */
|
|
89
|
+
function compactCua(cua) {
|
|
90
|
+
const fun = new Map();
|
|
91
|
+
for (const r of rows(cua, 'FUN')) {
|
|
92
|
+
const c = str(r, 'CODE');
|
|
93
|
+
if (!fun.has(c) || (!fun.get(c)?.FUN_TEXT && r.FUN_TEXT))
|
|
94
|
+
fun.set(c, r);
|
|
95
|
+
}
|
|
96
|
+
const statuses = rows(cua, 'STA').map((s) => {
|
|
97
|
+
const code = str(s, 'CODE');
|
|
98
|
+
const pfk = str(s, 'PFKCODE');
|
|
99
|
+
const butCode = str(s, 'BUTCODE');
|
|
100
|
+
const keys = new Map();
|
|
101
|
+
for (const k of rows(cua, 'PFK').filter((r) => str(r, 'CODE') === pfk))
|
|
102
|
+
if (!keys.has(str(k, 'FUNCODE')))
|
|
103
|
+
keys.set(str(k, 'FUNCODE'), str(k, 'PFNO'));
|
|
104
|
+
const onBar = new Set(rows(cua, 'BUT')
|
|
105
|
+
.filter((r) => str(r, 'PFK_CODE') === pfk &&
|
|
106
|
+
(!butCode || str(r, 'CODE') === butCode))
|
|
107
|
+
.map((r) => str(r, 'PFNO')));
|
|
108
|
+
const codes = rows(cua, 'SET')
|
|
109
|
+
.filter((r) => str(r, 'STATUS') === code)
|
|
110
|
+
.map((r) => str(r, 'FUNCTION'));
|
|
111
|
+
const functions = [...new Set(codes)].map((c) => {
|
|
112
|
+
const f = fun.get(c) ?? {};
|
|
113
|
+
const fn = {
|
|
114
|
+
code: c,
|
|
115
|
+
text: String(f.FUN_TEXT || f.TEXT_NAME || '').trim(),
|
|
116
|
+
};
|
|
117
|
+
const icon = String(f.ICON_ID || '').trim();
|
|
118
|
+
if (icon)
|
|
119
|
+
fn.icon = icon;
|
|
120
|
+
const pfno = keys.get(c);
|
|
121
|
+
if (pfno) {
|
|
122
|
+
fn.fkey = pfno;
|
|
123
|
+
if (onBar.has(pfno))
|
|
124
|
+
fn.toolbar = true;
|
|
125
|
+
}
|
|
126
|
+
return fn;
|
|
127
|
+
});
|
|
128
|
+
return { code, type: str(s, 'MODAL'), functions };
|
|
129
|
+
});
|
|
130
|
+
return { statuses };
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=cuaFilter.js.map
|