@bimatrix-aud-platform/aud_mcp_server 1.1.40 → 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.
|
@@ -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;
|
|
@@ -186,7 +186,15 @@ class ElementContainer {
|
|
|
186
186
|
_elements = [];
|
|
187
187
|
_gridBuilders = [];
|
|
188
188
|
// ---- Element factories ----
|
|
189
|
-
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
|
+
}
|
|
190
198
|
const id = generateId("Label");
|
|
191
199
|
const element = {
|
|
192
200
|
Type: "Label", Id: id, Name: name,
|
|
@@ -199,7 +207,15 @@ class ElementContainer {
|
|
|
199
207
|
this._addElement(element);
|
|
200
208
|
return this;
|
|
201
209
|
}
|
|
202
|
-
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
|
+
}
|
|
203
219
|
const id = generateId("Button");
|
|
204
220
|
const element = {
|
|
205
221
|
Type: "Button", Id: id, Name: name,
|
|
@@ -269,7 +285,15 @@ class ElementContainer {
|
|
|
269
285
|
this._addElement(element);
|
|
270
286
|
return this;
|
|
271
287
|
}
|
|
272
|
-
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
|
+
}
|
|
273
297
|
const id = generateId("CheckBox");
|
|
274
298
|
const element = {
|
|
275
299
|
Type: "CheckBox", Id: id, Name: name,
|
|
@@ -378,7 +402,15 @@ class ElementContainer {
|
|
|
378
402
|
this._addElement(element);
|
|
379
403
|
return this;
|
|
380
404
|
}
|
|
381
|
-
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
|
+
}
|
|
382
414
|
const id = generateId("RadioButton");
|
|
383
415
|
const element = {
|
|
384
416
|
Type: "RadioButton", Id: id, Name: name,
|
|
@@ -458,7 +490,15 @@ class ElementContainer {
|
|
|
458
490
|
return this;
|
|
459
491
|
}
|
|
460
492
|
// ---- Upload ----
|
|
461
|
-
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
|
+
}
|
|
462
502
|
const id = generateId("FileUploadButton");
|
|
463
503
|
const element = {
|
|
464
504
|
Type: "FileUploadButton", Id: id, Name: name,
|
|
@@ -661,7 +701,7 @@ class ElementContainer {
|
|
|
661
701
|
this._addElement(element);
|
|
662
702
|
return this;
|
|
663
703
|
}
|
|
664
|
-
addGroup(name, opts = {}) {
|
|
704
|
+
addGroup(name, opts = {}, fn) {
|
|
665
705
|
const id = generateId("Group");
|
|
666
706
|
const element = {
|
|
667
707
|
Type: "Group", Id: id, Name: name,
|
|
@@ -671,7 +711,13 @@ class ElementContainer {
|
|
|
671
711
|
};
|
|
672
712
|
this._applyPassThrough(element, opts);
|
|
673
713
|
this._addElement(element);
|
|
674
|
-
|
|
714
|
+
const builder = new GroupBuilder(this, element);
|
|
715
|
+
if (fn) {
|
|
716
|
+
fn(builder);
|
|
717
|
+
builder._finalize();
|
|
718
|
+
return this;
|
|
719
|
+
}
|
|
720
|
+
return builder;
|
|
675
721
|
}
|
|
676
722
|
addDataGrid(name, opts = {}) {
|
|
677
723
|
const id = generateId("DataGrid");
|
|
@@ -712,7 +758,7 @@ class ElementContainer {
|
|
|
712
758
|
for (const [key, value] of Object.entries(opts)) {
|
|
713
759
|
if (!COMMON_OPTS.has(key) && value !== undefined) {
|
|
714
760
|
// Skip element-specific keys already handled
|
|
715
|
-
if (["format", "value", "min", "max", "labelField", "valueField",
|
|
761
|
+
if (["text", "format", "value", "min", "max", "labelField", "valueField",
|
|
716
762
|
"checkedValue", "uncheckedValue", "checked", "groupName",
|
|
717
763
|
"url", "serverScript", "templateCode", "reportCode",
|
|
718
764
|
"allowExt", "saveFolderName"].includes(key))
|
|
@@ -781,13 +827,33 @@ export class MtsdBuilder extends ElementContainer {
|
|
|
781
827
|
this._moduleCode = opts.moduleCode;
|
|
782
828
|
}
|
|
783
829
|
/** Add a DataSource */
|
|
784
|
-
addDataSource(
|
|
785
|
-
|
|
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);
|
|
786
852
|
this._dataSources.push({
|
|
787
853
|
id: generateId("DS"),
|
|
788
|
-
name,
|
|
789
|
-
connection,
|
|
790
|
-
sql,
|
|
854
|
+
name: dsName,
|
|
855
|
+
connection: dsConnection,
|
|
856
|
+
sql: dsSql,
|
|
791
857
|
columns: opts?.columns || [],
|
|
792
858
|
params: paramNames.map(n => ({
|
|
793
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",
|