@memberjunction/core-actions 2.110.0 → 2.111.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/custom/ai/{find-best-action.action.d.ts → find-candidate-actions.action.d.ts} +3 -3
- package/dist/custom/ai/find-candidate-actions.action.d.ts.map +1 -0
- package/dist/custom/ai/{find-best-action.action.js → find-candidate-actions.action.js} +5 -5
- package/dist/custom/ai/find-candidate-actions.action.js.map +1 -0
- package/dist/custom/ai/{find-best-agent.action.d.ts → find-candidate-agents.action.d.ts} +4 -3
- package/dist/custom/ai/find-candidate-agents.action.d.ts.map +1 -0
- package/dist/custom/ai/{find-best-agent.action.js → find-candidate-agents.action.js} +40 -10
- package/dist/custom/ai/find-candidate-agents.action.js.map +1 -0
- package/dist/custom/files/base-file-storage.action.d.ts +1 -1
- package/dist/custom/files/base-file-storage.action.d.ts.map +1 -1
- package/dist/custom/files/base-file-storage.action.js +3 -2
- package/dist/custom/files/base-file-storage.action.js.map +1 -1
- package/dist/custom/files/copy-object.action.js +1 -1
- package/dist/custom/files/copy-object.action.js.map +1 -1
- package/dist/custom/files/create-directory.action.js +1 -1
- package/dist/custom/files/create-directory.action.js.map +1 -1
- package/dist/custom/files/delete-directory.action.js +1 -1
- package/dist/custom/files/delete-directory.action.js.map +1 -1
- package/dist/custom/files/delete-object.action.js +1 -1
- package/dist/custom/files/delete-object.action.js.map +1 -1
- package/dist/custom/files/directory-exists.action.js +1 -1
- package/dist/custom/files/directory-exists.action.js.map +1 -1
- package/dist/custom/files/get-download-url.action.js +1 -1
- package/dist/custom/files/get-download-url.action.js.map +1 -1
- package/dist/custom/files/get-file-content.action.d.ts +84 -0
- package/dist/custom/files/get-file-content.action.d.ts.map +1 -0
- package/dist/custom/files/get-file-content.action.js +249 -0
- package/dist/custom/files/get-file-content.action.js.map +1 -0
- package/dist/custom/files/get-metadata.action.d.ts +2 -1
- package/dist/custom/files/get-metadata.action.d.ts.map +1 -1
- package/dist/custom/files/get-metadata.action.js +12 -7
- package/dist/custom/files/get-metadata.action.js.map +1 -1
- package/dist/custom/files/get-object.action.d.ts +2 -1
- package/dist/custom/files/get-object.action.d.ts.map +1 -1
- package/dist/custom/files/get-object.action.js +12 -7
- package/dist/custom/files/get-object.action.js.map +1 -1
- package/dist/custom/files/get-upload-url.action.js +1 -1
- package/dist/custom/files/get-upload-url.action.js.map +1 -1
- package/dist/custom/files/list-objects.action.js +1 -1
- package/dist/custom/files/list-objects.action.js.map +1 -1
- package/dist/custom/files/list-storage-providers.action.d.ts +0 -5
- package/dist/custom/files/list-storage-providers.action.d.ts.map +1 -1
- package/dist/custom/files/list-storage-providers.action.js +46 -18
- package/dist/custom/files/list-storage-providers.action.js.map +1 -1
- package/dist/custom/files/move-object.action.js +1 -1
- package/dist/custom/files/move-object.action.js.map +1 -1
- package/dist/custom/files/object-exists.action.js +1 -1
- package/dist/custom/files/object-exists.action.js.map +1 -1
- package/dist/custom/files/search-storage-files.action.d.ts.map +1 -1
- package/dist/custom/files/search-storage-files.action.js +32 -13
- package/dist/custom/files/search-storage-files.action.js.map +1 -1
- package/dist/custom/visualization/create-mermaid-diagram.action.d.ts +86 -0
- package/dist/custom/visualization/create-mermaid-diagram.action.d.ts.map +1 -0
- package/dist/custom/visualization/create-mermaid-diagram.action.js +216 -0
- package/dist/custom/visualization/create-mermaid-diagram.action.js.map +1 -0
- package/dist/custom/visualization/create-svg-chart.action.d.ts +0 -24
- package/dist/custom/visualization/create-svg-chart.action.d.ts.map +1 -1
- package/dist/custom/visualization/create-svg-chart.action.js +57 -236
- package/dist/custom/visualization/create-svg-chart.action.js.map +1 -1
- package/dist/custom/visualization/shared/mermaid-types.d.ts +103 -0
- package/dist/custom/visualization/shared/mermaid-types.d.ts.map +1 -0
- package/dist/custom/visualization/shared/mermaid-types.js +89 -0
- package/dist/custom/visualization/shared/mermaid-types.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/package.json +23 -20
- package/dist/custom/ai/find-best-action.action.d.ts.map +0 -1
- package/dist/custom/ai/find-best-action.action.js.map +0 -1
- package/dist/custom/ai/find-best-agent.action.d.ts.map +0 -1
- package/dist/custom/ai/find-best-agent.action.js.map +0 -1
|
@@ -1,39 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
7
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
9
|
exports.LoadCreateSVGChartAction = exports.CreateSVGChartAction = void 0;
|
|
33
10
|
const actions_1 = require("@memberjunction/actions");
|
|
34
11
|
const global_1 = require("@memberjunction/global");
|
|
35
|
-
|
|
36
|
-
|
|
12
|
+
// import * as vega from 'vega';
|
|
13
|
+
// import * as vegaLite from 'vega-lite';
|
|
14
|
+
// import { TopLevelSpec as VegaLiteSpec } from 'vega-lite';
|
|
37
15
|
/**
|
|
38
16
|
* Action that generates SVG charts from data using Vega-Lite.
|
|
39
17
|
* Supports various chart types including bar, line, pie, scatter, area, and more.
|
|
@@ -98,217 +76,60 @@ let CreateSVGChartAction = class CreateSVGChartAction extends actions_1.BaseActi
|
|
|
98
76
|
* - Message: The SVG string or error message
|
|
99
77
|
*/
|
|
100
78
|
async InternalRunAction(params) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Builds a Vega-Lite specification from action parameters
|
|
159
|
-
*/
|
|
160
|
-
buildVegaLiteSpec(params, chartType, data) {
|
|
161
|
-
const title = this.getParamValue(params, 'Title');
|
|
162
|
-
const width = parseInt(this.getParamValue(params, 'Width') || '400');
|
|
163
|
-
const height = parseInt(this.getParamValue(params, 'Height') || '300');
|
|
164
|
-
const baseSpec = {
|
|
165
|
-
$schema: "https://vega.github.io/schema/vega-lite/v5.json",
|
|
166
|
-
width,
|
|
167
|
-
height,
|
|
168
|
-
data: { values: data },
|
|
169
|
-
padding: 20,
|
|
170
|
-
autosize: {
|
|
171
|
-
type: 'fit',
|
|
172
|
-
contains: 'padding'
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
if (title) {
|
|
176
|
-
baseSpec.title = {
|
|
177
|
-
text: title,
|
|
178
|
-
anchor: 'middle',
|
|
179
|
-
offset: 20,
|
|
180
|
-
fontSize: 16,
|
|
181
|
-
fontWeight: 'bold'
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
// Add config for better spacing and readability
|
|
185
|
-
baseSpec.config = {
|
|
186
|
-
axis: {
|
|
187
|
-
labelFontSize: 11,
|
|
188
|
-
titleFontSize: 12,
|
|
189
|
-
titlePadding: 10,
|
|
190
|
-
labelPadding: 5
|
|
191
|
-
},
|
|
192
|
-
legend: {
|
|
193
|
-
labelFontSize: 11,
|
|
194
|
-
titleFontSize: 12,
|
|
195
|
-
padding: 10
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
// Build encoding based on chart type
|
|
199
|
-
switch (chartType) {
|
|
200
|
-
case 'bar':
|
|
201
|
-
case 'line':
|
|
202
|
-
case 'area':
|
|
203
|
-
case 'point':
|
|
204
|
-
case 'scatter':
|
|
205
|
-
// For line and area charts, handle missing data points properly
|
|
206
|
-
if (chartType === 'line' || chartType === 'area') {
|
|
207
|
-
baseSpec.mark = {
|
|
208
|
-
type: chartType,
|
|
209
|
-
point: chartType === 'line', // Show points on line charts
|
|
210
|
-
interpolate: 'monotone', // Smooth curves
|
|
211
|
-
tooltip: true
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
baseSpec.mark = chartType === 'scatter' ? 'point' : chartType;
|
|
216
|
-
}
|
|
217
|
-
baseSpec.encoding = this.buildCartesianEncoding(params);
|
|
218
|
-
break;
|
|
219
|
-
case 'pie':
|
|
220
|
-
case 'arc':
|
|
221
|
-
baseSpec.mark = 'arc';
|
|
222
|
-
baseSpec.encoding = this.buildPieEncoding(params);
|
|
223
|
-
break;
|
|
224
|
-
default:
|
|
225
|
-
throw new Error(`Unsupported chart type: ${chartType}. Supported types: bar, line, area, point, scatter, pie`);
|
|
226
|
-
}
|
|
227
|
-
return baseSpec;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Builds encoding for Cartesian charts (bar, line, scatter, area)
|
|
231
|
-
*/
|
|
232
|
-
buildCartesianEncoding(params) {
|
|
233
|
-
const xField = this.getParamValue(params, 'XField');
|
|
234
|
-
const yField = this.getParamValue(params, 'YField');
|
|
235
|
-
const colorField = this.getParamValue(params, 'ColorField');
|
|
236
|
-
if (!xField || !yField) {
|
|
237
|
-
throw new Error("XField and YField are required for this chart type");
|
|
238
|
-
}
|
|
239
|
-
const encoding = {
|
|
240
|
-
x: { field: xField, type: this.inferFieldType(xField) },
|
|
241
|
-
y: { field: yField, type: 'quantitative' }
|
|
242
|
-
};
|
|
243
|
-
if (colorField) {
|
|
244
|
-
encoding.color = { field: colorField, type: 'nominal' };
|
|
245
|
-
}
|
|
246
|
-
return encoding;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Builds encoding for pie/arc charts
|
|
250
|
-
*/
|
|
251
|
-
buildPieEncoding(params) {
|
|
252
|
-
const thetaField = this.getParamValue(params, 'ThetaField');
|
|
253
|
-
const colorField = this.getParamValue(params, 'ColorField');
|
|
254
|
-
if (!thetaField) {
|
|
255
|
-
throw new Error("ThetaField is required for pie charts");
|
|
256
|
-
}
|
|
257
|
-
const encoding = {
|
|
258
|
-
theta: { field: thetaField, type: 'quantitative' }
|
|
259
|
-
};
|
|
260
|
-
if (colorField) {
|
|
261
|
-
encoding.color = { field: colorField, type: 'nominal' };
|
|
262
|
-
}
|
|
263
|
-
return encoding;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Infers the Vega-Lite field type from field name
|
|
267
|
-
*/
|
|
268
|
-
inferFieldType(fieldName) {
|
|
269
|
-
const lowerName = fieldName.toLowerCase();
|
|
270
|
-
// Temporal hints
|
|
271
|
-
if (lowerName.includes('date') || lowerName.includes('time') || lowerName.includes('year') || lowerName.includes('month')) {
|
|
272
|
-
return 'temporal';
|
|
273
|
-
}
|
|
274
|
-
// Quantitative hints
|
|
275
|
-
if (lowerName.includes('count') || lowerName.includes('value') || lowerName.includes('amount') || lowerName.includes('total')) {
|
|
276
|
-
return 'quantitative';
|
|
277
|
-
}
|
|
278
|
-
// Default to nominal for categorical data
|
|
279
|
-
return 'nominal';
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Helper to safely parse JSON that might already be an object
|
|
283
|
-
*/
|
|
284
|
-
parseJSON(value, paramName) {
|
|
285
|
-
// If it's already an object/array, return it
|
|
286
|
-
if (typeof value === 'object' && value !== null) {
|
|
287
|
-
return value;
|
|
288
|
-
}
|
|
289
|
-
// If it's a string, parse it
|
|
290
|
-
if (typeof value === 'string') {
|
|
291
|
-
try {
|
|
292
|
-
return JSON.parse(value);
|
|
293
|
-
}
|
|
294
|
-
catch (error) {
|
|
295
|
-
throw new Error(`Parameter '${paramName}' contains invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
// For other types, error
|
|
299
|
-
throw new Error(`Parameter '${paramName}' must be a JSON string or object. Received ${typeof value}.`);
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Helper to get parameter value by name (case-insensitive)
|
|
303
|
-
*/
|
|
304
|
-
getParamValue(params, paramName) {
|
|
305
|
-
const param = params.Params.find(p => p.Name.trim().toLowerCase() === paramName.toLowerCase());
|
|
306
|
-
if (param?.Value && typeof param.Value === 'string') {
|
|
307
|
-
return param?.Value?.trim() || null;
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
return param?.Value || null;
|
|
311
|
-
}
|
|
79
|
+
throw new Error("Not yet implemented");
|
|
80
|
+
// try {
|
|
81
|
+
// // Check if a full Vega-Lite spec was provided
|
|
82
|
+
// const specParam = this.getParamValue(params, 'VegaLiteSpec');
|
|
83
|
+
// let vlSpec: VegaLiteSpec;
|
|
84
|
+
// if (specParam) {
|
|
85
|
+
// // Use the provided spec directly
|
|
86
|
+
// vlSpec = this.parseJSON<VegaLiteSpec>(specParam, 'VegaLiteSpec');
|
|
87
|
+
// } else {
|
|
88
|
+
// // Build spec from individual parameters
|
|
89
|
+
// const chartType = this.getParamValue(params, 'ChartType');
|
|
90
|
+
// const dataParam = this.getParamValue(params, 'Data');
|
|
91
|
+
// if (!chartType) {
|
|
92
|
+
// return {
|
|
93
|
+
// Success: false,
|
|
94
|
+
// Message: "ChartType parameter is required (or provide VegaLiteSpec)",
|
|
95
|
+
// ResultCode: "MISSING_PARAMETERS"
|
|
96
|
+
// };
|
|
97
|
+
// }
|
|
98
|
+
// if (!dataParam) {
|
|
99
|
+
// return {
|
|
100
|
+
// Success: false,
|
|
101
|
+
// Message: "Data parameter is required (or provide VegaLiteSpec)",
|
|
102
|
+
// ResultCode: "MISSING_PARAMETERS"
|
|
103
|
+
// };
|
|
104
|
+
// }
|
|
105
|
+
// const data = this.parseJSON<any[]>(dataParam, 'Data');
|
|
106
|
+
// if (!Array.isArray(data)) {
|
|
107
|
+
// return {
|
|
108
|
+
// Success: false,
|
|
109
|
+
// Message: "Data parameter must be a JSON array",
|
|
110
|
+
// ResultCode: "INVALID_DATA"
|
|
111
|
+
// };
|
|
112
|
+
// }
|
|
113
|
+
// // Build the Vega-Lite spec
|
|
114
|
+
// vlSpec = this.buildVegaLiteSpec(params, chartType.toLowerCase(), data);
|
|
115
|
+
// }
|
|
116
|
+
// // Compile Vega-Lite to Vega
|
|
117
|
+
// const vegaSpec = vegaLite.compile(vlSpec).spec;
|
|
118
|
+
// // Create a headless view and render to SVG
|
|
119
|
+
// const view = new vega.View(vega.parse(vegaSpec), { renderer: 'none' });
|
|
120
|
+
// const svg = await view.toSVG();
|
|
121
|
+
// return {
|
|
122
|
+
// Success: true,
|
|
123
|
+
// ResultCode: "SUCCESS",
|
|
124
|
+
// Message: svg
|
|
125
|
+
// };
|
|
126
|
+
// } catch (error) {
|
|
127
|
+
// return {
|
|
128
|
+
// Success: false,
|
|
129
|
+
// Message: `Failed to generate chart: ${error instanceof Error ? error.message : String(error)}`,
|
|
130
|
+
// ResultCode: "CHART_GENERATION_FAILED"
|
|
131
|
+
// };
|
|
132
|
+
// }
|
|
312
133
|
}
|
|
313
134
|
};
|
|
314
135
|
exports.CreateSVGChartAction = CreateSVGChartAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-svg-chart.action.js","sourceRoot":"","sources":["../../../src/custom/visualization/create-svg-chart.action.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-svg-chart.action.js","sourceRoot":"","sources":["../../../src/custom/visualization/create-svg-chart.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,qDAAqD;AACrD,mDAAuD;AACvD,gCAAgC;AAChC,yCAAyC;AACzC,4DAA4D;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,oBAAU;IAChD;;;;;;;;;;;;;;;;;;;OAmBG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACvC,QAAQ;QACR,qDAAqD;QACrD,oEAAoE;QAEpE,gCAAgC;QAEhC,uBAAuB;QACvB,4CAA4C;QAC5C,4EAA4E;QAC5E,eAAe;QACf,mDAAmD;QACnD,qEAAqE;QACrE,gEAAgE;QAEhE,4BAA4B;QAC5B,uBAAuB;QACvB,kCAAkC;QAClC,wFAAwF;QACxF,mDAAmD;QACnD,iBAAiB;QACjB,YAAY;QAEZ,4BAA4B;QAC5B,uBAAuB;QACvB,kCAAkC;QAClC,mFAAmF;QACnF,mDAAmD;QACnD,iBAAiB;QACjB,YAAY;QAEZ,iEAAiE;QAEjE,sCAAsC;QACtC,uBAAuB;QACvB,kCAAkC;QAClC,kEAAkE;QAClE,6CAA6C;QAC7C,iBAAiB;QACjB,YAAY;QAEZ,sCAAsC;QACtC,kFAAkF;QAClF,QAAQ;QAER,mCAAmC;QACnC,sDAAsD;QAEtD,kDAAkD;QAClD,8EAA8E;QAC9E,sCAAsC;QAEtC,eAAe;QACf,yBAAyB;QACzB,iCAAiC;QACjC,uBAAuB;QACvB,SAAS;QAET,oBAAoB;QACpB,eAAe;QACf,0BAA0B;QAC1B,0GAA0G;QAC1G,gDAAgD;QAChD,SAAS;QACT,IAAI;IACR,CAAC;CAyLJ,CAAA;AAhRY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,sBAAa,EAAC,oBAAU,EAAE,kBAAkB,CAAC;GACjC,oBAAoB,CAgRhC;AAED;;;GAGG;AACH,SAAgB,wBAAwB;IACpC,uIAAuI;AAC3I,CAAC;AAFD,4DAEC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Type definitions for Mermaid diagram generation.
|
|
3
|
+
* Mermaid is a text-based diagram tool that converts markdown-like syntax into rich visualizations.
|
|
4
|
+
*
|
|
5
|
+
* @module @memberjunction/actions-core/visualization
|
|
6
|
+
* @since 2.109.0
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Mermaid diagram themes
|
|
10
|
+
*/
|
|
11
|
+
export type MermaidTheme = 'default' | 'dark' | 'forest' | 'neutral';
|
|
12
|
+
/**
|
|
13
|
+
* Supported Mermaid diagram types (documentation only - detected from syntax)
|
|
14
|
+
*/
|
|
15
|
+
export type MermaidDiagramType = 'flowchart' | 'sequenceDiagram' | 'classDiagram' | 'stateDiagram' | 'erDiagram' | 'gantt' | 'pie' | 'gitGraph' | 'journey' | 'requirementDiagram' | 'mindmap' | 'timeline' | 'quadrantChart' | 'c4' | 'sankey';
|
|
16
|
+
/**
|
|
17
|
+
* Mermaid configuration options
|
|
18
|
+
* See: https://mermaid.js.org/config/schema-docs/config.html
|
|
19
|
+
*/
|
|
20
|
+
export interface MermaidConfig {
|
|
21
|
+
/**
|
|
22
|
+
* Flowchart-specific configuration
|
|
23
|
+
*/
|
|
24
|
+
flowchart?: {
|
|
25
|
+
curve?: 'basis' | 'linear' | 'step' | 'stepBefore' | 'stepAfter';
|
|
26
|
+
padding?: number;
|
|
27
|
+
useMaxWidth?: boolean;
|
|
28
|
+
defaultRenderer?: 'dagre-d3' | 'dagre-wrapper' | 'elk';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Sequence diagram configuration
|
|
32
|
+
*/
|
|
33
|
+
sequence?: {
|
|
34
|
+
diagramMarginX?: number;
|
|
35
|
+
diagramMarginY?: number;
|
|
36
|
+
boxMargin?: number;
|
|
37
|
+
boxTextMargin?: number;
|
|
38
|
+
noteMargin?: number;
|
|
39
|
+
messageMargin?: number;
|
|
40
|
+
mirrorActors?: boolean;
|
|
41
|
+
showSequenceNumbers?: boolean;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* ER diagram configuration
|
|
45
|
+
*/
|
|
46
|
+
er?: {
|
|
47
|
+
layoutDirection?: 'TB' | 'BT' | 'LR' | 'RL';
|
|
48
|
+
minEntityWidth?: number;
|
|
49
|
+
minEntityHeight?: number;
|
|
50
|
+
entityPadding?: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Class diagram configuration
|
|
54
|
+
*/
|
|
55
|
+
class?: {
|
|
56
|
+
arrowMarkerAbsolute?: boolean;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* State diagram configuration
|
|
60
|
+
*/
|
|
61
|
+
state?: {
|
|
62
|
+
dividerMargin?: number;
|
|
63
|
+
sizeUnit?: number;
|
|
64
|
+
padding?: number;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Gantt chart configuration
|
|
68
|
+
*/
|
|
69
|
+
gantt?: {
|
|
70
|
+
titleTopMargin?: number;
|
|
71
|
+
barHeight?: number;
|
|
72
|
+
barGap?: number;
|
|
73
|
+
topPadding?: number;
|
|
74
|
+
leftPadding?: number;
|
|
75
|
+
gridLineStartPadding?: number;
|
|
76
|
+
fontSize?: number;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Font configuration (applies to all diagrams)
|
|
80
|
+
*/
|
|
81
|
+
fontFamily?: string;
|
|
82
|
+
fontSize?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Security level
|
|
85
|
+
*/
|
|
86
|
+
securityLevel?: 'strict' | 'loose' | 'sandbox';
|
|
87
|
+
/**
|
|
88
|
+
* Log level for debugging
|
|
89
|
+
*/
|
|
90
|
+
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'fatal';
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Common Mermaid syntax examples for documentation
|
|
94
|
+
*/
|
|
95
|
+
export declare const MERMAID_EXAMPLES: {
|
|
96
|
+
flowchart: string;
|
|
97
|
+
sequence: string;
|
|
98
|
+
erDiagram: string;
|
|
99
|
+
classDiagram: string;
|
|
100
|
+
stateDiagram: string;
|
|
101
|
+
gantt: string;
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=mermaid-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-types.d.ts","sourceRoot":"","sources":["../../../../src/custom/visualization/shared/mermaid-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GACxB,WAAW,GACX,iBAAiB,GACjB,cAAc,GACd,cAAc,GACd,WAAW,GACX,OAAO,GACP,KAAK,GACL,UAAU,GACV,SAAS,GACT,oBAAoB,GACpB,SAAS,GACT,UAAU,GACV,eAAe,GACf,IAAI,GACJ,QAAQ,CAAC;AAEf;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,CAAC;QACjE,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,eAAe,CAAC,EAAE,UAAU,GAAG,eAAe,GAAG,KAAK,CAAC;KAC1D,CAAC;IAEF;;OAEG;IACH,QAAQ,CAAC,EAAE;QACP,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;KACjC,CAAC;IAEF;;OAEG;IACH,EAAE,CAAC,EAAE;QACD,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;QAC5C,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,aAAa,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE;QACJ,mBAAmB,CAAC,EAAE,OAAO,CAAC;KACjC,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE;QACJ,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;OAEG;IACH,KAAK,CAAC,EAAE;QACJ,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAEF;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAE/C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;CAC5D;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;CA+E5B,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Type definitions for Mermaid diagram generation.
|
|
4
|
+
* Mermaid is a text-based diagram tool that converts markdown-like syntax into rich visualizations.
|
|
5
|
+
*
|
|
6
|
+
* @module @memberjunction/actions-core/visualization
|
|
7
|
+
* @since 2.109.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MERMAID_EXAMPLES = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* Common Mermaid syntax examples for documentation
|
|
13
|
+
*/
|
|
14
|
+
exports.MERMAID_EXAMPLES = {
|
|
15
|
+
flowchart: `flowchart TD
|
|
16
|
+
Start[Start] --> Process[Process Data]
|
|
17
|
+
Process --> Decision{Is Valid?}
|
|
18
|
+
Decision -->|Yes| Success[Success]
|
|
19
|
+
Decision -->|No| Error[Error]
|
|
20
|
+
Success --> End[End]
|
|
21
|
+
Error --> End`,
|
|
22
|
+
sequence: `sequenceDiagram
|
|
23
|
+
participant Client
|
|
24
|
+
participant Server
|
|
25
|
+
participant Database
|
|
26
|
+
Client->>Server: Request Data
|
|
27
|
+
Server->>Database: Query
|
|
28
|
+
Database-->>Server: Results
|
|
29
|
+
Server-->>Client: Response`,
|
|
30
|
+
erDiagram: `erDiagram
|
|
31
|
+
USER ||--o{ ORDER : places
|
|
32
|
+
USER {
|
|
33
|
+
string id PK
|
|
34
|
+
string name
|
|
35
|
+
string email
|
|
36
|
+
}
|
|
37
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
38
|
+
ORDER {
|
|
39
|
+
string id PK
|
|
40
|
+
date orderDate
|
|
41
|
+
string userId FK
|
|
42
|
+
}
|
|
43
|
+
PRODUCT ||--o{ LINE_ITEM : "ordered in"
|
|
44
|
+
PRODUCT {
|
|
45
|
+
string id PK
|
|
46
|
+
string name
|
|
47
|
+
decimal price
|
|
48
|
+
}
|
|
49
|
+
LINE_ITEM {
|
|
50
|
+
string orderId FK
|
|
51
|
+
string productId FK
|
|
52
|
+
int quantity
|
|
53
|
+
}`,
|
|
54
|
+
classDiagram: `classDiagram
|
|
55
|
+
class Animal {
|
|
56
|
+
+String name
|
|
57
|
+
+int age
|
|
58
|
+
+makeSound()
|
|
59
|
+
}
|
|
60
|
+
class Dog {
|
|
61
|
+
+String breed
|
|
62
|
+
+bark()
|
|
63
|
+
}
|
|
64
|
+
class Cat {
|
|
65
|
+
+String color
|
|
66
|
+
+meow()
|
|
67
|
+
}
|
|
68
|
+
Animal <|-- Dog
|
|
69
|
+
Animal <|-- Cat`,
|
|
70
|
+
stateDiagram: `stateDiagram-v2
|
|
71
|
+
[*] --> Idle
|
|
72
|
+
Idle --> Processing : Start
|
|
73
|
+
Processing --> Success : Complete
|
|
74
|
+
Processing --> Error : Fail
|
|
75
|
+
Success --> [*]
|
|
76
|
+
Error --> Idle : Retry`,
|
|
77
|
+
gantt: `gantt
|
|
78
|
+
title Project Timeline
|
|
79
|
+
dateFormat YYYY-MM-DD
|
|
80
|
+
section Planning
|
|
81
|
+
Research :done, des1, 2024-01-01, 2024-01-15
|
|
82
|
+
Design :active, des2, 2024-01-16, 2024-02-01
|
|
83
|
+
section Development
|
|
84
|
+
Backend :des3, 2024-02-01, 2024-03-01
|
|
85
|
+
Frontend :des4, 2024-02-15, 2024-03-15
|
|
86
|
+
section Testing
|
|
87
|
+
QA :des5, 2024-03-01, 2024-03-20`
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=mermaid-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-types.js","sourceRoot":"","sources":["../../../../src/custom/visualization/shared/mermaid-types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAgHH;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC5B,SAAS,EAAE;;;;;;kBAMG;IAEd,QAAQ,EAAE;;;;;;;+BAOiB;IAE3B,SAAS,EAAE;;;;;;;;;;;;;;;;;;;;;;;MAuBT;IAEF,YAAY,EAAE;;;;;;;;;;;;;;;oBAeE;IAEhB,YAAY,EAAE;;;;;;2BAMS;IAEvB,KAAK,EAAE;;;;;;;;;;qDAU0C;CACpD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export * from './custom/files/excel-reader.action';
|
|
|
38
38
|
export * from './custom/files/excel-writer.action';
|
|
39
39
|
export * from './custom/files/file-compress.action';
|
|
40
40
|
export * from './custom/files';
|
|
41
|
+
export * from './custom/files/get-file-content.action';
|
|
41
42
|
export * from './custom/integration/http-request.action';
|
|
42
43
|
export * from './custom/integration/graphql-query.action';
|
|
43
44
|
export * from './custom/integration/oauth-flow.action';
|
|
@@ -51,8 +52,8 @@ export * from './custom/workflow/retry.action';
|
|
|
51
52
|
export * from './custom/workflow/delay.action';
|
|
52
53
|
export * from './custom/ai/execute-ai-prompt.action';
|
|
53
54
|
export * from './custom/ai/summarize-content.action';
|
|
54
|
-
export * from './custom/ai/find-
|
|
55
|
-
export * from './custom/ai/find-
|
|
55
|
+
export * from './custom/ai/find-candidate-agents.action';
|
|
56
|
+
export * from './custom/ai/find-candidate-actions.action';
|
|
56
57
|
export * from './custom/ai/load-agent-spec.action';
|
|
57
58
|
export * from './custom/user-management/check-user-permission.action';
|
|
58
59
|
export * from './custom/user-management/create-user.action';
|
|
@@ -65,8 +66,10 @@ export * from './custom/visualization/create-svg-word-cloud.action';
|
|
|
65
66
|
export * from './custom/visualization/create-svg-network.action';
|
|
66
67
|
export * from './custom/visualization/create-svg-infographic.action';
|
|
67
68
|
export * from './custom/visualization/create-svg-sketch-diagram.action';
|
|
69
|
+
export * from './custom/visualization/create-mermaid-diagram.action';
|
|
68
70
|
export * from './custom/visualization/shared/svg-types';
|
|
69
71
|
export * from './custom/visualization/shared/svg-utils';
|
|
70
72
|
export * from './custom/visualization/shared/svg-theming';
|
|
73
|
+
export * from './custom/visualization/shared/mermaid-types';
|
|
71
74
|
export declare function LoadAllCoreActions(): void;
|
|
72
75
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAG9C,cAAc,mD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