@bimatrix-aud-platform/aud_mcp_server 1.1.39 → 1.1.41
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.
|
@@ -4,10 +4,23 @@ export declare function defaultColor(): {
|
|
|
4
4
|
B: number;
|
|
5
5
|
A: number;
|
|
6
6
|
};
|
|
7
|
-
export declare function defaultBackground(): {
|
|
7
|
+
export declare function defaultBackground(): {
|
|
8
|
+
Color: {
|
|
9
|
+
R: number;
|
|
10
|
+
G: number;
|
|
11
|
+
B: number;
|
|
12
|
+
A: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
8
15
|
export declare function defaultBorder(): {
|
|
16
|
+
Color: {
|
|
17
|
+
R: number;
|
|
18
|
+
G: number;
|
|
19
|
+
B: number;
|
|
20
|
+
A: number;
|
|
21
|
+
};
|
|
9
22
|
CornerRadius: string;
|
|
10
|
-
LineType: "
|
|
23
|
+
LineType: "solid";
|
|
11
24
|
Thickness: string;
|
|
12
25
|
};
|
|
13
26
|
export declare function defaultFont(): {
|
|
@@ -56,12 +69,40 @@ export declare function defaultPosition(): {
|
|
|
56
69
|
export declare function defaultStyle(): {
|
|
57
70
|
Type: number;
|
|
58
71
|
BoxStyle: string;
|
|
59
|
-
Background: {
|
|
72
|
+
Background: {
|
|
73
|
+
Color: {
|
|
74
|
+
R: number;
|
|
75
|
+
G: number;
|
|
76
|
+
B: number;
|
|
77
|
+
A: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
60
80
|
Border: {
|
|
81
|
+
Color: {
|
|
82
|
+
R: number;
|
|
83
|
+
G: number;
|
|
84
|
+
B: number;
|
|
85
|
+
A: number;
|
|
86
|
+
};
|
|
61
87
|
CornerRadius: string;
|
|
62
|
-
LineType: "
|
|
88
|
+
LineType: "solid";
|
|
63
89
|
Thickness: string;
|
|
64
90
|
};
|
|
91
|
+
Font: {
|
|
92
|
+
Color: {
|
|
93
|
+
R: number;
|
|
94
|
+
G: number;
|
|
95
|
+
B: number;
|
|
96
|
+
A: number;
|
|
97
|
+
};
|
|
98
|
+
Size: number;
|
|
99
|
+
Family: string;
|
|
100
|
+
Bold: boolean;
|
|
101
|
+
Italic: boolean;
|
|
102
|
+
UnderLine: boolean;
|
|
103
|
+
HorizontalAlignment: "left";
|
|
104
|
+
VerticalAlignment: "middle";
|
|
105
|
+
};
|
|
65
106
|
};
|
|
66
107
|
export declare function defaultValidator(): {
|
|
67
108
|
ValidateType: number;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
// ---- Base structural defaults ----
|
|
2
2
|
export function defaultColor() {
|
|
3
|
-
return { R:
|
|
3
|
+
return { R: 48, G: 48, B: 49, A: 1 };
|
|
4
4
|
}
|
|
5
5
|
export function defaultBackground() {
|
|
6
|
-
return {
|
|
6
|
+
return {
|
|
7
|
+
Color: { R: 255, G: 255, B: 255, A: 1 },
|
|
8
|
+
};
|
|
7
9
|
}
|
|
8
10
|
export function defaultBorder() {
|
|
9
11
|
return {
|
|
12
|
+
Color: { R: 204, G: 204, B: 204, A: 1 },
|
|
10
13
|
CornerRadius: "0,0,0,0",
|
|
11
|
-
LineType: "
|
|
12
|
-
Thickness: "
|
|
14
|
+
LineType: "solid",
|
|
15
|
+
Thickness: "1,1,1,1",
|
|
13
16
|
};
|
|
14
17
|
}
|
|
15
18
|
export function defaultFont() {
|
|
16
19
|
return {
|
|
17
|
-
Color: { R:
|
|
20
|
+
Color: { R: 48, G: 48, B: 49, A: 1 },
|
|
18
21
|
Size: 12,
|
|
19
|
-
Family: "
|
|
22
|
+
Family: "inherit",
|
|
20
23
|
Bold: false,
|
|
21
24
|
Italic: false,
|
|
22
25
|
UnderLine: false,
|
|
@@ -53,6 +56,7 @@ export function defaultStyle() {
|
|
|
53
56
|
BoxStyle: "",
|
|
54
57
|
Background: defaultBackground(),
|
|
55
58
|
Border: defaultBorder(),
|
|
59
|
+
Font: defaultFont(),
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
62
|
export function defaultValidator() {
|
|
@@ -66,8 +66,8 @@ export declare class DataGridBuilder {
|
|
|
66
66
|
declare abstract class ElementContainer {
|
|
67
67
|
protected _elements: Record<string, any>[];
|
|
68
68
|
protected _gridBuilders: DataGridBuilder[];
|
|
69
|
-
addLabel(name: string,
|
|
70
|
-
addButton(name: string,
|
|
69
|
+
addLabel(name: string, textOrOpts?: string | ElementOpts, opts?: ElementOpts): this;
|
|
70
|
+
addButton(name: string, textOrOpts?: string | ElementOpts, opts?: ElementOpts): this;
|
|
71
71
|
addCalendar(name: string, opts?: ElementOpts): this;
|
|
72
72
|
addTextBox(name: string, opts?: ElementOpts): this;
|
|
73
73
|
addNumberBox(name: string, opts?: ElementOpts & {
|
|
@@ -80,7 +80,11 @@ declare abstract class ElementContainer {
|
|
|
80
80
|
labelField?: string;
|
|
81
81
|
valueField?: string;
|
|
82
82
|
}): this;
|
|
83
|
-
addCheckBox(name: string,
|
|
83
|
+
addCheckBox(name: string, textOrOpts?: string | (ElementOpts & {
|
|
84
|
+
checkedValue?: string;
|
|
85
|
+
uncheckedValue?: string;
|
|
86
|
+
checked?: boolean;
|
|
87
|
+
}), opts?: ElementOpts & {
|
|
84
88
|
checkedValue?: string;
|
|
85
89
|
uncheckedValue?: string;
|
|
86
90
|
checked?: boolean;
|
|
@@ -97,7 +101,11 @@ declare abstract class ElementContainer {
|
|
|
97
101
|
valueField?: string;
|
|
98
102
|
}): this;
|
|
99
103
|
addPickList(name: string, opts?: ElementOpts): this;
|
|
100
|
-
addRadioButton(name: string,
|
|
104
|
+
addRadioButton(name: string, textOrOpts?: string | (ElementOpts & {
|
|
105
|
+
groupName?: string;
|
|
106
|
+
checkedValue?: string;
|
|
107
|
+
checked?: boolean;
|
|
108
|
+
}), opts?: ElementOpts & {
|
|
101
109
|
groupName?: string;
|
|
102
110
|
checkedValue?: string;
|
|
103
111
|
checked?: boolean;
|
|
@@ -107,7 +115,10 @@ declare abstract class ElementContainer {
|
|
|
107
115
|
addSlider(name: string, opts?: ElementOpts): this;
|
|
108
116
|
addCalendarYear(name: string, opts?: ElementOpts): this;
|
|
109
117
|
addCalendarYM(name: string, opts?: ElementOpts): this;
|
|
110
|
-
addFileUploadButton(name: string,
|
|
118
|
+
addFileUploadButton(name: string, textOrOpts?: string | (ElementOpts & {
|
|
119
|
+
allowExt?: string;
|
|
120
|
+
saveFolderName?: string;
|
|
121
|
+
}), opts?: ElementOpts & {
|
|
111
122
|
allowExt?: string;
|
|
112
123
|
saveFolderName?: string;
|
|
113
124
|
}): this;
|
|
@@ -133,6 +144,7 @@ declare abstract class ElementContainer {
|
|
|
133
144
|
addDiagramControl(name: string, opts?: ElementOpts): this;
|
|
134
145
|
addSlicer(name: string, opts?: ElementOpts): this;
|
|
135
146
|
addGroup(name: string, opts?: ElementOpts): GroupBuilder;
|
|
147
|
+
addGroup(name: string, opts: ElementOpts, fn: (g: GroupBuilder) => void): this;
|
|
136
148
|
addDataGrid(name: string, opts?: ElementOpts): DataGridBuilder;
|
|
137
149
|
/** Generic element adder for types not covered by specific methods */
|
|
138
150
|
addElement(type: string, name: string, opts?: ElementOpts): this;
|
|
@@ -163,7 +175,7 @@ export declare class MtsdBuilder extends ElementContainer {
|
|
|
163
175
|
moduleCode?: string;
|
|
164
176
|
});
|
|
165
177
|
/** Add a DataSource */
|
|
166
|
-
addDataSource(
|
|
178
|
+
addDataSource(nameOrOpts: string | Record<string, any>, connection?: string, sql?: string, opts?: {
|
|
167
179
|
columns?: Array<{
|
|
168
180
|
name: string;
|
|
169
181
|
type?: string;
|
|
@@ -14,40 +14,36 @@ import { ELEMENT_DEFAULTS_MAP } from "./defaults.js";
|
|
|
14
14
|
// ============================================================
|
|
15
15
|
function emptyBg() {
|
|
16
16
|
return {
|
|
17
|
-
Color: { R:
|
|
18
|
-
ColorR: 0, ColorG: 0, ColorB: 0, ColorA: 0,
|
|
17
|
+
Color: { R: 255, G: 255, B: 255, A: 1 },
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
20
|
function fullBg(hex) {
|
|
22
21
|
const c = parseHexColor(hex);
|
|
23
22
|
return {
|
|
24
|
-
Color: { R: c.R, G: c.G, B: c.B, A: 1 },
|
|
25
|
-
ColorR: c.R, ColorG: c.G, ColorB: c.B, ColorA: 1,
|
|
23
|
+
Color: { R: c.R, G: c.G, B: c.B, A: c.A > 0 ? 1 : 0 },
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
26
|
function emptyBorder() {
|
|
29
27
|
return {
|
|
30
|
-
Color: { R:
|
|
31
|
-
ColorR: 0, ColorG: 0, ColorB: 0, ColorA: 0,
|
|
28
|
+
Color: { R: 204, G: 204, B: 204, A: 1 },
|
|
32
29
|
CornerRadius: "0,0,0,0",
|
|
33
|
-
LineType: "
|
|
34
|
-
Thickness: "
|
|
30
|
+
LineType: "solid",
|
|
31
|
+
Thickness: "1,1,1,1",
|
|
35
32
|
};
|
|
36
33
|
}
|
|
37
34
|
function fullBorder(opts = {}) {
|
|
38
|
-
const c = opts.color ? parseHexColor(opts.color) : { R:
|
|
35
|
+
const c = opts.color ? parseHexColor(opts.color) : { R: 204, G: 204, B: 204, A: 1 };
|
|
39
36
|
return {
|
|
40
|
-
Color: { R: c.R, G: c.G, B: c.B, A: 1 },
|
|
41
|
-
ColorR: c.R, ColorG: c.G, ColorB: c.B, ColorA: 1,
|
|
37
|
+
Color: { R: c.R, G: c.G, B: c.B, A: c.A > 1 ? 1 : c.A },
|
|
42
38
|
CornerRadius: opts.radius || "0,0,0,0",
|
|
43
39
|
LineType: opts.lineType || "solid",
|
|
44
40
|
Thickness: opts.thickness || "1,1,1,1",
|
|
45
41
|
};
|
|
46
42
|
}
|
|
47
43
|
function fullFont(opts = {}) {
|
|
48
|
-
const c = opts.color ? parseHexColor(opts.color) : { R:
|
|
44
|
+
const c = opts.color ? parseHexColor(opts.color) : { R: 48, G: 48, B: 49, A: 1 };
|
|
49
45
|
return {
|
|
50
|
-
Color: { R: c.R, G: c.G, B: c.B, A: 1 },
|
|
46
|
+
Color: { R: c.R, G: c.G, B: c.B, A: c.A > 1 ? 1 : c.A },
|
|
51
47
|
Size: opts.size ?? 12,
|
|
52
48
|
Family: opts.family ?? "inherit",
|
|
53
49
|
Bold: opts.bold ?? false,
|
|
@@ -190,7 +186,15 @@ class ElementContainer {
|
|
|
190
186
|
_elements = [];
|
|
191
187
|
_gridBuilders = [];
|
|
192
188
|
// ---- Element factories ----
|
|
193
|
-
addLabel(name,
|
|
189
|
+
addLabel(name, textOrOpts = "", opts = {}) {
|
|
190
|
+
let text;
|
|
191
|
+
if (typeof textOrOpts === "object" && textOrOpts !== null) {
|
|
192
|
+
opts = textOrOpts;
|
|
193
|
+
text = opts.text ?? "";
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
text = textOrOpts;
|
|
197
|
+
}
|
|
194
198
|
const id = generateId("Label");
|
|
195
199
|
const element = {
|
|
196
200
|
Type: "Label", Id: id, Name: name,
|
|
@@ -203,7 +207,15 @@ class ElementContainer {
|
|
|
203
207
|
this._addElement(element);
|
|
204
208
|
return this;
|
|
205
209
|
}
|
|
206
|
-
addButton(name,
|
|
210
|
+
addButton(name, textOrOpts = "", opts = {}) {
|
|
211
|
+
let text;
|
|
212
|
+
if (typeof textOrOpts === "object" && textOrOpts !== null) {
|
|
213
|
+
opts = textOrOpts;
|
|
214
|
+
text = opts.value ?? opts.text ?? "";
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
text = textOrOpts;
|
|
218
|
+
}
|
|
207
219
|
const id = generateId("Button");
|
|
208
220
|
const element = {
|
|
209
221
|
Type: "Button", Id: id, Name: name,
|
|
@@ -273,7 +285,15 @@ class ElementContainer {
|
|
|
273
285
|
this._addElement(element);
|
|
274
286
|
return this;
|
|
275
287
|
}
|
|
276
|
-
addCheckBox(name,
|
|
288
|
+
addCheckBox(name, textOrOpts = "", opts = {}) {
|
|
289
|
+
let text;
|
|
290
|
+
if (typeof textOrOpts === "object" && textOrOpts !== null) {
|
|
291
|
+
opts = textOrOpts;
|
|
292
|
+
text = opts.text ?? "";
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
text = textOrOpts;
|
|
296
|
+
}
|
|
277
297
|
const id = generateId("CheckBox");
|
|
278
298
|
const element = {
|
|
279
299
|
Type: "CheckBox", Id: id, Name: name,
|
|
@@ -382,7 +402,15 @@ class ElementContainer {
|
|
|
382
402
|
this._addElement(element);
|
|
383
403
|
return this;
|
|
384
404
|
}
|
|
385
|
-
addRadioButton(name,
|
|
405
|
+
addRadioButton(name, textOrOpts = "", opts = {}) {
|
|
406
|
+
let text;
|
|
407
|
+
if (typeof textOrOpts === "object" && textOrOpts !== null) {
|
|
408
|
+
opts = textOrOpts;
|
|
409
|
+
text = opts.text ?? "";
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
text = textOrOpts;
|
|
413
|
+
}
|
|
386
414
|
const id = generateId("RadioButton");
|
|
387
415
|
const element = {
|
|
388
416
|
Type: "RadioButton", Id: id, Name: name,
|
|
@@ -462,7 +490,15 @@ class ElementContainer {
|
|
|
462
490
|
return this;
|
|
463
491
|
}
|
|
464
492
|
// ---- Upload ----
|
|
465
|
-
addFileUploadButton(name,
|
|
493
|
+
addFileUploadButton(name, textOrOpts = "Upload", opts = {}) {
|
|
494
|
+
let text;
|
|
495
|
+
if (typeof textOrOpts === "object" && textOrOpts !== null) {
|
|
496
|
+
opts = textOrOpts;
|
|
497
|
+
text = opts.value ?? opts.text ?? "Upload";
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
text = textOrOpts;
|
|
501
|
+
}
|
|
466
502
|
const id = generateId("FileUploadButton");
|
|
467
503
|
const element = {
|
|
468
504
|
Type: "FileUploadButton", Id: id, Name: name,
|
|
@@ -665,7 +701,7 @@ class ElementContainer {
|
|
|
665
701
|
this._addElement(element);
|
|
666
702
|
return this;
|
|
667
703
|
}
|
|
668
|
-
addGroup(name, opts = {}) {
|
|
704
|
+
addGroup(name, opts = {}, fn) {
|
|
669
705
|
const id = generateId("Group");
|
|
670
706
|
const element = {
|
|
671
707
|
Type: "Group", Id: id, Name: name,
|
|
@@ -675,7 +711,13 @@ class ElementContainer {
|
|
|
675
711
|
};
|
|
676
712
|
this._applyPassThrough(element, opts);
|
|
677
713
|
this._addElement(element);
|
|
678
|
-
|
|
714
|
+
const builder = new GroupBuilder(this, element);
|
|
715
|
+
if (fn) {
|
|
716
|
+
fn(builder);
|
|
717
|
+
builder._finalize();
|
|
718
|
+
return this;
|
|
719
|
+
}
|
|
720
|
+
return builder;
|
|
679
721
|
}
|
|
680
722
|
addDataGrid(name, opts = {}) {
|
|
681
723
|
const id = generateId("DataGrid");
|
|
@@ -716,7 +758,7 @@ class ElementContainer {
|
|
|
716
758
|
for (const [key, value] of Object.entries(opts)) {
|
|
717
759
|
if (!COMMON_OPTS.has(key) && value !== undefined) {
|
|
718
760
|
// Skip element-specific keys already handled
|
|
719
|
-
if (["format", "value", "min", "max", "labelField", "valueField",
|
|
761
|
+
if (["text", "format", "value", "min", "max", "labelField", "valueField",
|
|
720
762
|
"checkedValue", "uncheckedValue", "checked", "groupName",
|
|
721
763
|
"url", "serverScript", "templateCode", "reportCode",
|
|
722
764
|
"allowExt", "saveFolderName"].includes(key))
|
|
@@ -785,13 +827,33 @@ export class MtsdBuilder extends ElementContainer {
|
|
|
785
827
|
this._moduleCode = opts.moduleCode;
|
|
786
828
|
}
|
|
787
829
|
/** Add a DataSource */
|
|
788
|
-
addDataSource(
|
|
789
|
-
|
|
830
|
+
addDataSource(nameOrOpts, connection, sql, opts) {
|
|
831
|
+
// Support single-object argument: addDataSource({ name, connection, sql, ... })
|
|
832
|
+
let dsName;
|
|
833
|
+
let dsConnection;
|
|
834
|
+
let dsSql;
|
|
835
|
+
if (typeof nameOrOpts === "object" && nameOrOpts !== null) {
|
|
836
|
+
dsName = nameOrOpts.name ?? "";
|
|
837
|
+
dsConnection = nameOrOpts.connection ?? "";
|
|
838
|
+
dsSql = nameOrOpts.sql ?? "";
|
|
839
|
+
opts = {
|
|
840
|
+
columns: nameOrOpts.columns,
|
|
841
|
+
useMeta: nameOrOpts.useMeta,
|
|
842
|
+
useCache: nameOrOpts.useCache,
|
|
843
|
+
encrypted: nameOrOpts.encrypted,
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
dsName = nameOrOpts;
|
|
848
|
+
dsConnection = connection ?? "";
|
|
849
|
+
dsSql = sql ?? "";
|
|
850
|
+
}
|
|
851
|
+
const paramNames = extractParamsFromSQL(dsSql);
|
|
790
852
|
this._dataSources.push({
|
|
791
853
|
id: generateId("DS"),
|
|
792
|
-
name,
|
|
793
|
-
connection,
|
|
794
|
-
sql,
|
|
854
|
+
name: dsName,
|
|
855
|
+
connection: dsConnection,
|
|
856
|
+
sql: dsSql,
|
|
795
857
|
columns: opts?.columns || [],
|
|
796
858
|
params: paramNames.map(n => ({
|
|
797
859
|
Name: n.startsWith(":") ? n : `:${n}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bimatrix-aud-platform/aud_mcp_server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.41",
|
|
4
4
|
"description": "MCP Server for i-AUD MTSD document validation, generation, schema querying, control info extraction, and database operations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|