@memberjunction/core-actions 2.110.1 → 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/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 -18
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"object-exists.action.js","sourceRoot":"","sources":["../../../src/custom/files/object-exists.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,gDAAqB;IAEzD;;;;;;;;;OASG;IACO,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,IAAI,CAAC;YACD,oCAAoC;YACpC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;YACjE,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;YAExB,yBAAyB;YACzB,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,OAAO,IAAI,CAAC,iBAAiB,CACzB,kCAAkC,EAClC,oBAAoB,CACvB,CAAC;YACN,CAAC;YAED,sCAAsC;YACtC,MAAM,MAAM,GAAY,MAAM,MAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YAE/D,uBAAuB;YACvB,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;YAE9C,OAAO,IAAI,CAAC,mBAAmB,CAAC;gBAC5B,SAAS,EAAE,cAAc;gBACzB,UAAU;gBACV,MAAM;aACT,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"object-exists.action.js","sourceRoot":"","sources":["../../../src/custom/files/object-exists.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,qDAAqD;AACrD,yEAAmE;AAEnE;;;;;;;;;;;;;;;;GAgBG;AAEI,IAAM,kBAAkB,GAAxB,MAAM,kBAAm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storage-files.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/search-storage-files.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"search-storage-files.action.d.ts","sourceRoot":"","sources":["../../../src/custom/files/search-storage-files.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAQhG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,qBACa,wBAAyB,SAAQ,qBAAqB;cAE/C,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAoJ1F;AAED;;GAEG;AACH,wBAAgB,4BAA4B,SAG3C"}
|
|
@@ -11,6 +11,7 @@ const global_1 = require("@memberjunction/global");
|
|
|
11
11
|
const global_2 = require("@memberjunction/global");
|
|
12
12
|
const storage_1 = require("@memberjunction/storage");
|
|
13
13
|
const base_file_storage_action_1 = require("./base-file-storage.action");
|
|
14
|
+
const actions_1 = require("@memberjunction/actions");
|
|
14
15
|
/**
|
|
15
16
|
* Action that searches for files across configured storage providers
|
|
16
17
|
* using each provider's native search capabilities.
|
|
@@ -133,28 +134,46 @@ let SearchStorageFilesAction = class SearchStorageFilesAction extends base_file_
|
|
|
133
134
|
Size: file.size,
|
|
134
135
|
ContentType: file.contentType,
|
|
135
136
|
LastModified: file.lastModified.toISOString(),
|
|
137
|
+
ObjectID: file.objectId, // Provider-specific ID for fast direct access
|
|
136
138
|
Relevance: file.relevance,
|
|
137
139
|
Excerpt: file.excerpt,
|
|
138
140
|
MatchInFilename: file.matchInFilename,
|
|
139
141
|
CustomMetadata: file.customMetadata,
|
|
140
142
|
ProviderData: file.providerData
|
|
141
143
|
}));
|
|
142
|
-
//
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
144
|
+
// Build output parameters array per ActionResultSimple spec
|
|
145
|
+
const outputParams = [
|
|
146
|
+
{
|
|
147
|
+
Name: 'SearchResults',
|
|
148
|
+
Value: formattedResults,
|
|
149
|
+
Type: 'Output'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
Name: 'ResultCount',
|
|
153
|
+
Value: searchResults.results.length,
|
|
154
|
+
Type: 'Output'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
Name: 'TotalMatches',
|
|
158
|
+
Value: searchResults.totalMatches,
|
|
159
|
+
Type: 'Output'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
Name: 'HasMore',
|
|
163
|
+
Value: searchResults.hasMore,
|
|
164
|
+
Type: 'Output'
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
Name: 'NextPageToken',
|
|
168
|
+
Value: searchResults.nextPageToken,
|
|
169
|
+
Type: 'Output'
|
|
170
|
+
}
|
|
171
|
+
];
|
|
152
172
|
return {
|
|
153
173
|
Success: true,
|
|
154
174
|
ResultCode: "SUCCESS",
|
|
155
175
|
Message: `Found ${searchResults.results.length} file(s) matching query '${query}'`,
|
|
156
|
-
|
|
157
|
-
...resultData
|
|
176
|
+
Params: outputParams
|
|
158
177
|
};
|
|
159
178
|
}
|
|
160
179
|
catch (error) {
|
|
@@ -170,7 +189,7 @@ let SearchStorageFilesAction = class SearchStorageFilesAction extends base_file_
|
|
|
170
189
|
};
|
|
171
190
|
exports.SearchStorageFilesAction = SearchStorageFilesAction;
|
|
172
191
|
exports.SearchStorageFilesAction = SearchStorageFilesAction = __decorate([
|
|
173
|
-
(0, global_1.RegisterClass)(
|
|
192
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "Search Storage Files")
|
|
174
193
|
], SearchStorageFilesAction);
|
|
175
194
|
/**
|
|
176
195
|
* Load function to ensure the class is registered and not tree-shaken
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-storage-files.action.js","sourceRoot":"","sources":["../../../src/custom/files/search-storage-files.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,mDAAkD;AAClD,qDAIiC;AACjC,yEAAmE;
|
|
1
|
+
{"version":3,"file":"search-storage-files.action.js","sourceRoot":"","sources":["../../../src/custom/files/search-storage-files.action.ts"],"names":[],"mappings":";;;;;;;;;AACA,mDAAuD;AACvD,mDAAkD;AAClD,qDAIiC;AACjC,yEAAmE;AACnE,qDAAqD;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEI,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,gDAAqB;IAErD,KAAK,CAAC,iBAAiB,CAAC,MAAuB;QACrD,sBAAsB;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC,iBAAiB,CAAC,6BAA6B,EAAE,eAAe,CAAC,CAAC;QAClF,CAAC;QAED,qEAAqE;QACrE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,KAAK,EAAE,CAAC;YACR,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,sBAAsB;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;QAC7D,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,CAAC,CAAC;QAC3E,MAAM,gBAAgB,G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iBAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,eAAe,CAAC,gDAAqB,EAAE,sBAAsB,CAAC,CAAC;AAClG,CAAC;AAHD,oEAGC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ActionResultSimple, RunActionParams } from "@memberjunction/actions-base";
|
|
2
|
+
import { BaseAction } from "@memberjunction/actions";
|
|
3
|
+
/**
|
|
4
|
+
* Action that generates SVG diagrams from Mermaid text syntax.
|
|
5
|
+
* Supports flowcharts, sequence diagrams, ER diagrams, class diagrams, state machines,
|
|
6
|
+
* Gantt charts, and more.
|
|
7
|
+
*
|
|
8
|
+
* Mermaid is a text-based diagram generation tool that converts markdown-like
|
|
9
|
+
* syntax into rich visual diagrams. This action uses the Mermaid library to
|
|
10
|
+
* render diagrams server-side as SVG, suitable for embedding in reports,
|
|
11
|
+
* artifacts, and AI-generated content.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* // Flowchart
|
|
16
|
+
* await runAction({
|
|
17
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
18
|
+
* Params: [
|
|
19
|
+
* { Name: 'Code', Value: `flowchart TD
|
|
20
|
+
* A[Start] --> B[Process]
|
|
21
|
+
* B --> C{Decision}
|
|
22
|
+
* C -->|Yes| D[End]
|
|
23
|
+
* C -->|No| A` },
|
|
24
|
+
* { Name: 'Theme', Value: 'default' }
|
|
25
|
+
* ]
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* // Sequence Diagram
|
|
29
|
+
* await runAction({
|
|
30
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
31
|
+
* Params: [
|
|
32
|
+
* { Name: 'Code', Value: `sequenceDiagram
|
|
33
|
+
* Client->>Server: Request
|
|
34
|
+
* Server->>Database: Query
|
|
35
|
+
* Database-->>Server: Results
|
|
36
|
+
* Server-->>Client: Response` },
|
|
37
|
+
* { Name: 'Theme', Value: 'dark' }
|
|
38
|
+
* ]
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* // ER Diagram
|
|
42
|
+
* await runAction({
|
|
43
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
44
|
+
* Params: [
|
|
45
|
+
* { Name: 'Code', Value: `erDiagram
|
|
46
|
+
* USER ||--o{ ORDER : places
|
|
47
|
+
* ORDER ||--|{ LINE-ITEM : contains` },
|
|
48
|
+
* { Name: 'Theme', Value: 'forest' }
|
|
49
|
+
* ]
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export declare class CreateMermaidDiagramAction extends BaseAction {
|
|
54
|
+
/**
|
|
55
|
+
* Generates an SVG diagram from Mermaid syntax.
|
|
56
|
+
*
|
|
57
|
+
* @param params - The action parameters containing:
|
|
58
|
+
* - Code: Raw Mermaid diagram syntax (required)
|
|
59
|
+
* - Theme: Visual theme ('default' | 'dark' | 'forest' | 'neutral', default: 'default')
|
|
60
|
+
* - Config: Optional Mermaid configuration JSON for advanced customization
|
|
61
|
+
*
|
|
62
|
+
* @returns A promise resolving to an ActionResultSimple with:
|
|
63
|
+
* - Success: true if diagram was generated successfully
|
|
64
|
+
* - ResultCode: "SUCCESS" or error code
|
|
65
|
+
* - Message: The sanitized SVG string or error message
|
|
66
|
+
*/
|
|
67
|
+
protected InternalRunAction(params: RunActionParams): Promise<ActionResultSimple>;
|
|
68
|
+
/**
|
|
69
|
+
* Helper to get parameter value by name (case-insensitive)
|
|
70
|
+
*/
|
|
71
|
+
private getParamValue;
|
|
72
|
+
/**
|
|
73
|
+
* Helper to get string parameter with optional default
|
|
74
|
+
*/
|
|
75
|
+
private getStringParam;
|
|
76
|
+
/**
|
|
77
|
+
* Helper to safely parse JSON that might already be an object
|
|
78
|
+
*/
|
|
79
|
+
private parseJSON;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Loader function to ensure the CreateMermaidDiagramAction class is included in the bundle.
|
|
83
|
+
* This prevents tree-shaking from removing the class during the build process.
|
|
84
|
+
*/
|
|
85
|
+
export declare function LoadCreateMermaidDiagramAction(): void;
|
|
86
|
+
//# sourceMappingURL=create-mermaid-diagram.action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-mermaid-diagram.action.d.ts","sourceRoot":"","sources":["../../../src/custom/visualization/create-mermaid-diagram.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBACa,0BAA2B,SAAQ,UAAU;IAEtD;;;;;;;;;;;;OAYG;cACa,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA0FvF;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,SAAS;CAsBpB;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,SAE7C"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LoadCreateMermaidDiagramAction = exports.CreateMermaidDiagramAction = void 0;
|
|
13
|
+
const actions_1 = require("@memberjunction/actions");
|
|
14
|
+
const global_1 = require("@memberjunction/global");
|
|
15
|
+
const mermaid_1 = __importDefault(require("mermaid"));
|
|
16
|
+
const svg_utils_1 = require("./shared/svg-utils");
|
|
17
|
+
/**
|
|
18
|
+
* Action that generates SVG diagrams from Mermaid text syntax.
|
|
19
|
+
* Supports flowcharts, sequence diagrams, ER diagrams, class diagrams, state machines,
|
|
20
|
+
* Gantt charts, and more.
|
|
21
|
+
*
|
|
22
|
+
* Mermaid is a text-based diagram generation tool that converts markdown-like
|
|
23
|
+
* syntax into rich visual diagrams. This action uses the Mermaid library to
|
|
24
|
+
* render diagrams server-side as SVG, suitable for embedding in reports,
|
|
25
|
+
* artifacts, and AI-generated content.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Flowchart
|
|
30
|
+
* await runAction({
|
|
31
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
32
|
+
* Params: [
|
|
33
|
+
* { Name: 'Code', Value: `flowchart TD
|
|
34
|
+
* A[Start] --> B[Process]
|
|
35
|
+
* B --> C{Decision}
|
|
36
|
+
* C -->|Yes| D[End]
|
|
37
|
+
* C -->|No| A` },
|
|
38
|
+
* { Name: 'Theme', Value: 'default' }
|
|
39
|
+
* ]
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* // Sequence Diagram
|
|
43
|
+
* await runAction({
|
|
44
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
45
|
+
* Params: [
|
|
46
|
+
* { Name: 'Code', Value: `sequenceDiagram
|
|
47
|
+
* Client->>Server: Request
|
|
48
|
+
* Server->>Database: Query
|
|
49
|
+
* Database-->>Server: Results
|
|
50
|
+
* Server-->>Client: Response` },
|
|
51
|
+
* { Name: 'Theme', Value: 'dark' }
|
|
52
|
+
* ]
|
|
53
|
+
* });
|
|
54
|
+
*
|
|
55
|
+
* // ER Diagram
|
|
56
|
+
* await runAction({
|
|
57
|
+
* ActionName: 'Create Mermaid Diagram',
|
|
58
|
+
* Params: [
|
|
59
|
+
* { Name: 'Code', Value: `erDiagram
|
|
60
|
+
* USER ||--o{ ORDER : places
|
|
61
|
+
* ORDER ||--|{ LINE-ITEM : contains` },
|
|
62
|
+
* { Name: 'Theme', Value: 'forest' }
|
|
63
|
+
* ]
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
let CreateMermaidDiagramAction = class CreateMermaidDiagramAction extends actions_1.BaseAction {
|
|
68
|
+
/**
|
|
69
|
+
* Generates an SVG diagram from Mermaid syntax.
|
|
70
|
+
*
|
|
71
|
+
* @param params - The action parameters containing:
|
|
72
|
+
* - Code: Raw Mermaid diagram syntax (required)
|
|
73
|
+
* - Theme: Visual theme ('default' | 'dark' | 'forest' | 'neutral', default: 'default')
|
|
74
|
+
* - Config: Optional Mermaid configuration JSON for advanced customization
|
|
75
|
+
*
|
|
76
|
+
* @returns A promise resolving to an ActionResultSimple with:
|
|
77
|
+
* - Success: true if diagram was generated successfully
|
|
78
|
+
* - ResultCode: "SUCCESS" or error code
|
|
79
|
+
* - Message: The sanitized SVG string or error message
|
|
80
|
+
*/
|
|
81
|
+
async InternalRunAction(params) {
|
|
82
|
+
try {
|
|
83
|
+
// Extract required Code parameter
|
|
84
|
+
const code = this.getStringParam(params, 'Code');
|
|
85
|
+
if (!code) {
|
|
86
|
+
return {
|
|
87
|
+
Success: false,
|
|
88
|
+
Message: "Code parameter is required",
|
|
89
|
+
ResultCode: "MISSING_PARAMETERS"
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
// Extract optional Theme parameter
|
|
93
|
+
const theme = this.getStringParam(params, 'Theme', 'default');
|
|
94
|
+
// Validate theme
|
|
95
|
+
const validThemes = ['default', 'dark', 'forest', 'neutral'];
|
|
96
|
+
if (!validThemes.includes(theme)) {
|
|
97
|
+
return {
|
|
98
|
+
Success: false,
|
|
99
|
+
Message: `Invalid theme: ${theme}. Valid themes: ${validThemes.join(', ')}`,
|
|
100
|
+
ResultCode: "INVALID_THEME"
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// Extract optional Config parameter
|
|
104
|
+
const configParam = this.getParamValue(params, 'Config');
|
|
105
|
+
const config = configParam
|
|
106
|
+
? this.parseJSON(configParam, 'Config')
|
|
107
|
+
: {};
|
|
108
|
+
// Validate code size (prevent DoS)
|
|
109
|
+
if (code.length > 100000) {
|
|
110
|
+
return {
|
|
111
|
+
Success: false,
|
|
112
|
+
Message: "Mermaid code too large (max 100KB)",
|
|
113
|
+
ResultCode: "CODE_TOO_LARGE"
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
// Check for suspicious patterns (basic XSS prevention)
|
|
117
|
+
const suspiciousPatterns = [
|
|
118
|
+
/<script/i,
|
|
119
|
+
/javascript:/i,
|
|
120
|
+
/on\w+\s*=/i // Event handlers
|
|
121
|
+
];
|
|
122
|
+
for (const pattern of suspiciousPatterns) {
|
|
123
|
+
if (pattern.test(code)) {
|
|
124
|
+
return {
|
|
125
|
+
Success: false,
|
|
126
|
+
Message: 'Invalid Mermaid code: contains suspicious content',
|
|
127
|
+
ResultCode: 'INVALID_CODE'
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Initialize Mermaid with configuration
|
|
132
|
+
mermaid_1.default.initialize({
|
|
133
|
+
theme,
|
|
134
|
+
startOnLoad: false, // Headless mode for server-side rendering
|
|
135
|
+
securityLevel: 'strict', // Enforce strict security
|
|
136
|
+
...config
|
|
137
|
+
});
|
|
138
|
+
// Generate unique ID for this render
|
|
139
|
+
const renderId = `mermaid-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
|
|
140
|
+
// Render diagram to SVG
|
|
141
|
+
const { svg } = await mermaid_1.default.render(renderId, code);
|
|
142
|
+
// Sanitize SVG (XSS prevention)
|
|
143
|
+
const sanitizedSvg = svg_utils_1.SVGUtils.sanitizeSVG(svg);
|
|
144
|
+
return {
|
|
145
|
+
Success: true,
|
|
146
|
+
ResultCode: "SUCCESS",
|
|
147
|
+
Message: sanitizedSvg
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
152
|
+
return {
|
|
153
|
+
Success: false,
|
|
154
|
+
ResultCode: "DIAGRAM_GENERATION_FAILED",
|
|
155
|
+
Message: `Failed to generate Mermaid diagram: ${errorMessage}`
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Helper to get parameter value by name (case-insensitive)
|
|
161
|
+
*/
|
|
162
|
+
getParamValue(params, paramName) {
|
|
163
|
+
const param = params.Params.find(p => p.Name.trim().toLowerCase() === paramName.toLowerCase());
|
|
164
|
+
if (param?.Value && typeof param.Value === 'string') {
|
|
165
|
+
return param?.Value?.trim() || null;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return param?.Value || null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Helper to get string parameter with optional default
|
|
173
|
+
*/
|
|
174
|
+
getStringParam(params, paramName, defaultValue) {
|
|
175
|
+
const value = this.getParamValue(params, paramName);
|
|
176
|
+
if (value === null) {
|
|
177
|
+
if (defaultValue !== undefined)
|
|
178
|
+
return defaultValue;
|
|
179
|
+
throw new Error(`Required parameter missing: ${paramName}`);
|
|
180
|
+
}
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Helper to safely parse JSON that might already be an object
|
|
185
|
+
*/
|
|
186
|
+
parseJSON(value, paramName) {
|
|
187
|
+
// If it's already an object/array, return it
|
|
188
|
+
if (typeof value === 'object' && value !== null) {
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
191
|
+
// If it's a string, parse it
|
|
192
|
+
if (typeof value === 'string') {
|
|
193
|
+
try {
|
|
194
|
+
return JSON.parse(value);
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
throw new Error(`Parameter '${paramName}' contains invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// For other types, error
|
|
201
|
+
throw new Error(`Parameter '${paramName}' must be a JSON string or object. Received ${typeof value}.`);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
exports.CreateMermaidDiagramAction = CreateMermaidDiagramAction;
|
|
205
|
+
exports.CreateMermaidDiagramAction = CreateMermaidDiagramAction = __decorate([
|
|
206
|
+
(0, global_1.RegisterClass)(actions_1.BaseAction, "__CreateMermaidDiagram")
|
|
207
|
+
], CreateMermaidDiagramAction);
|
|
208
|
+
/**
|
|
209
|
+
* Loader function to ensure the CreateMermaidDiagramAction class is included in the bundle.
|
|
210
|
+
* This prevents tree-shaking from removing the class during the build process.
|
|
211
|
+
*/
|
|
212
|
+
function LoadCreateMermaidDiagramAction() {
|
|
213
|
+
// this function is a stub that is used to force the bundler to include the above class in the final bundle and not tree shake them out
|
|
214
|
+
}
|
|
215
|
+
exports.LoadCreateMermaidDiagramAction = LoadCreateMermaidDiagramAction;
|
|
216
|
+
//# sourceMappingURL=create-mermaid-diagram.action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-mermaid-diagram.action.js","sourceRoot":"","sources":["../../../src/custom/visualization/create-mermaid-diagram.action.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAAqD;AACrD,mDAAuD;AACvD,sDAA8B;AAC9B,kDAA8C;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAEI,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,oBAAU;IAEtD;;;;;;;;;;;;OAYG;IACO,KAA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K,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC9G,CAAC;YACN,CAAC;QACL,CAAC;QAED,yBAAyB;QACzB,MAAM,IAAI,KAAK,CACX,cAAc,SAAS,+CAA+C,OAAO,KAAK,GAAG,CACxF,CAAC;IACN,CAAC;CACJ,CAAA;AA7JY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,sBAAa,EAAC,oBAAU,EAAE,wBAAwB,CAAC;GACvC,0BAA0B,CA6JtC;AAED;;;GAGG;AACH,SAAgB,8BAA8B;IAC1C,uIAAuI;AAC3I,CAAC;AAFD,wEAEC"}
|
|
@@ -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,O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,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
|