bruce-models 7.1.33 → 7.1.34
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/bruce-models.es5.js +108 -2
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +103 -1
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/bruce-models.js +2 -1
- package/dist/lib/bruce-models.js.map +1 -1
- package/dist/lib/data-transform/data-transform.js +120 -0
- package/dist/lib/data-transform/data-transform.js.map +1 -0
- package/dist/types/bruce-models.d.ts +2 -1
- package/dist/types/data-transform/data-transform.d.ts +133 -0
- package/package.json +1 -1
package/dist/lib/bruce-models.js
CHANGED
|
@@ -98,6 +98,7 @@ __exportStar(require("./util/object-utils"), exports);
|
|
|
98
98
|
__exportStar(require("./util/path-utils"), exports);
|
|
99
99
|
__exportStar(require("./util/url-utils"), exports);
|
|
100
100
|
__exportStar(require("./data-lab/data-lab"), exports);
|
|
101
|
+
__exportStar(require("./data-transform/data-transform"), exports);
|
|
101
102
|
__exportStar(require("./data-lab/data-lab-group"), exports);
|
|
102
103
|
__exportStar(require("./data-feed/data-feed"), exports);
|
|
103
104
|
__exportStar(require("./import/import-assembly"), exports);
|
|
@@ -121,5 +122,5 @@ __exportStar(require("./mcp/navigator-chat"), exports);
|
|
|
121
122
|
__exportStar(require("./mcp/navigator-mcp-websocket"), exports);
|
|
122
123
|
__exportStar(require("./change-set/change-set"), exports);
|
|
123
124
|
// This is updated with the package.json version on build.
|
|
124
|
-
exports.VERSION = "7.1.
|
|
125
|
+
exports.VERSION = "7.1.34";
|
|
125
126
|
//# sourceMappingURL=bruce-models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bruce-models.js","sourceRoot":"","sources":["../../src/bruce-models.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,8DAA4C;AAE5C,4DAA0C;AAC1C,oEAAkD;AAElD,qDAAmC;AACnC,4CAA0B;AAC1B,kDAAgC;AAChC,mDAAiC;AACjC,qDAAmC;AACnC,oDAAkC;AAElC,0DAAwC;AAExC,kDAAgC;AAChC,uDAAqC;AACrC,iDAA+B;AAC/B,kDAAgC;AAChC,kDAAgC;AAChC,iDAA+B;AAC/B,iDAA+B;AAC/B,uDAAqC;AACrC,sDAAoC;AACpC,oDAAkC;AAClC,qDAAmC;AACnC,+CAA6B;AAC7B,0DAAwC;AACxC,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AAEjC,kEAAgD;AAChD,6DAA2C;AAC3C,0DAAwC;AACxC,uDAAqC;AACrC,sDAAoC;AACpC,+DAA6C;AAC7C,gEAA8C;AAC9C,2DAAyC;AACzC,yDAAuC;AACvC,sDAAoC;AACpC,+DAA6C;AAC7C,uDAAqC;AACrC,kDAAgC;AAChC,yDAAuC;AACvC,4DAA0C;AAC1C,gEAA8C;AAC9C,6DAA2C;AAC3C,6DAA2C;AAE3C,8DAA4C;AAE5C,4DAA0C;AAE1C,4DAA0C;AAE1C,yDAAuC;AACvC,sDAAoC;AACpC,kEAAgD;AAChD,yDAAuC;AACvC,qEAAmD;AACnD,8DAA4C;AAC5C,mEAAiD;AACjD,gEAA8C;AAC9C,yEAAuD;AACvD,wEAAsD;AAEtD,0DAAwC;AACxC,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,+DAA6C;AAE7C,gDAA8B;AAE9B,oDAAkC;AAElC,oDAAkC;AAClC,iDAA+B;AAC/B,oDAAkC;AAClC,8CAA4B;AAC5B,yDAAuC;AAEvC,oDAAkC;AAClC,6DAA2C;AAC3C,2DAAyC;AACzC,6DAA2C;AAC3C,2DAAyC;AACzC,6DAA2C;AAC3C,yDAAuC;AAEvC,uDAAqC;AACrC,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,mDAAiC;
|
|
1
|
+
{"version":3,"file":"bruce-models.js","sourceRoot":"","sources":["../../src/bruce-models.ts"],"names":[],"mappings":";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,mDAAiC;AACjC,sDAAoC;AACpC,kEAAgD;AAChD,4DAA0C;AAC1C,wDAAsC;AACtC,2DAAyC;AACzC,sDAAoC;AACpC,sDAAoC;AACpC,uDAAqC;AACrC,0DAAwC;AACxC,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AAEvC,sDAAoC;AACpC,sDAAoC;AAEpC,kDAAgC;AAChC,sDAAoC;AACpC,kDAAgC;AAChC,gDAA8B;AAC9B,4DAA0C;AAC1C,sDAAoC;AACpC,sDAAoC;AACpC,uDAAqC;AACrC,gEAA8C;AAE9C,0DAAwC;AAExC,0DAA0D;AAC7C,QAAA,OAAO,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DataTransform = void 0;
|
|
13
|
+
const api_1 = require("../api/api");
|
|
14
|
+
const environment_1 = require("../environment");
|
|
15
|
+
/**
|
|
16
|
+
* Describes the "Data Transform" concept within Nextspace.
|
|
17
|
+
*/
|
|
18
|
+
var DataTransform;
|
|
19
|
+
(function (DataTransform) {
|
|
20
|
+
/**
|
|
21
|
+
* Supported Logic Flow diagram item types.
|
|
22
|
+
*/
|
|
23
|
+
let ELogicFlowDiagramItemType;
|
|
24
|
+
(function (ELogicFlowDiagramItemType) {
|
|
25
|
+
ELogicFlowDiagramItemType["InputValue"] = "input-value";
|
|
26
|
+
ELogicFlowDiagramItemType["OutputValue"] = "output-value";
|
|
27
|
+
ELogicFlowDiagramItemType["If"] = "if";
|
|
28
|
+
ELogicFlowDiagramItemType["Formula"] = "formula";
|
|
29
|
+
ELogicFlowDiagramItemType["Switch"] = "switch";
|
|
30
|
+
})(ELogicFlowDiagramItemType = DataTransform.ELogicFlowDiagramItemType || (DataTransform.ELogicFlowDiagramItemType = {}));
|
|
31
|
+
/**
|
|
32
|
+
* Supported Logic Flow connection point types.
|
|
33
|
+
*/
|
|
34
|
+
let ELogicFlowConnectionPointType;
|
|
35
|
+
(function (ELogicFlowConnectionPointType) {
|
|
36
|
+
ELogicFlowConnectionPointType["Input"] = "input";
|
|
37
|
+
ELogicFlowConnectionPointType["Output"] = "output";
|
|
38
|
+
})(ELogicFlowConnectionPointType = DataTransform.ELogicFlowConnectionPointType || (DataTransform.ELogicFlowConnectionPointType = {}));
|
|
39
|
+
/**
|
|
40
|
+
* Supported Logic Flow connection end roles.
|
|
41
|
+
*/
|
|
42
|
+
let ELogicFlowConnectionEndRole;
|
|
43
|
+
(function (ELogicFlowConnectionEndRole) {
|
|
44
|
+
ELogicFlowConnectionEndRole["From"] = "from";
|
|
45
|
+
ELogicFlowConnectionEndRole["To"] = "to";
|
|
46
|
+
})(ELogicFlowConnectionEndRole = DataTransform.ELogicFlowConnectionEndRole || (DataTransform.ELogicFlowConnectionEndRole = {}));
|
|
47
|
+
/**
|
|
48
|
+
* Requests a suggested Logic Flow diagram from a natural-language prompt.
|
|
49
|
+
* Route: POST v1/entityType/{entityType_id}/DataTransform/SuggestLogicFlowDiagram
|
|
50
|
+
*/
|
|
51
|
+
function SuggestLogicFlowDiagramByPrompt(params) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
let { api, entityTypeId, prompt, model, maxNodes, dataTransformId, dataTransform, dataTransformContext, sourceDataSchema, destinationDataSchema, inputAttributes, outputAttributes, req: reqParams } = params;
|
|
54
|
+
if (!entityTypeId) {
|
|
55
|
+
throw ("Entity Type ID is required.");
|
|
56
|
+
}
|
|
57
|
+
prompt = prompt === null || prompt === void 0 ? void 0 : prompt.trim();
|
|
58
|
+
if (!prompt) {
|
|
59
|
+
throw ("Prompt is required.");
|
|
60
|
+
}
|
|
61
|
+
if (!api) {
|
|
62
|
+
api = environment_1.ENVIRONMENT.Api().GetBruceApi();
|
|
63
|
+
}
|
|
64
|
+
const body = {
|
|
65
|
+
Prompt: prompt
|
|
66
|
+
};
|
|
67
|
+
if (model) {
|
|
68
|
+
body.Model = model;
|
|
69
|
+
}
|
|
70
|
+
if (typeof maxNodes == "number" && !isNaN(maxNodes)) {
|
|
71
|
+
body.MaxNodes = maxNodes;
|
|
72
|
+
}
|
|
73
|
+
if (typeof dataTransformId == "number" && dataTransformId > 0) {
|
|
74
|
+
body["DataTransform.ID"] = dataTransformId;
|
|
75
|
+
}
|
|
76
|
+
if (dataTransform != null) {
|
|
77
|
+
body.DataTransform = dataTransform;
|
|
78
|
+
}
|
|
79
|
+
if (dataTransformContext != null) {
|
|
80
|
+
body.DataTransformContext = dataTransformContext;
|
|
81
|
+
}
|
|
82
|
+
if (sourceDataSchema != null) {
|
|
83
|
+
body.SourceDataSchema = sourceDataSchema;
|
|
84
|
+
}
|
|
85
|
+
if (destinationDataSchema != null) {
|
|
86
|
+
body.DestinationDataSchema = destinationDataSchema;
|
|
87
|
+
}
|
|
88
|
+
if (inputAttributes === null || inputAttributes === void 0 ? void 0 : inputAttributes.length) {
|
|
89
|
+
body.InputAttributes = inputAttributes;
|
|
90
|
+
}
|
|
91
|
+
if (outputAttributes === null || outputAttributes === void 0 ? void 0 : outputAttributes.length) {
|
|
92
|
+
body.OutputAttributes = outputAttributes;
|
|
93
|
+
}
|
|
94
|
+
const route = `v1/entityType/${api_1.Api.Encode(entityTypeId)}/DataTransform/SuggestLogicFlowDiagram`;
|
|
95
|
+
const response = yield api.POST(route, body, api_1.Api.PrepReqParams(reqParams));
|
|
96
|
+
let diagram = (response === null || response === void 0 ? void 0 : response.diagram)
|
|
97
|
+
|| (response === null || response === void 0 ? void 0 : response.Diagram)
|
|
98
|
+
|| (response === null || response === void 0 ? void 0 : response.LogicFlowDiagram)
|
|
99
|
+
|| (response === null || response === void 0 ? void 0 : response.result)
|
|
100
|
+
|| (response === null || response === void 0 ? void 0 : response.Result)
|
|
101
|
+
|| response;
|
|
102
|
+
if (typeof diagram == "string") {
|
|
103
|
+
try {
|
|
104
|
+
diagram = JSON.parse(diagram);
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
// Keep original shape if parse fails.
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!diagram || typeof diagram != "object") {
|
|
111
|
+
throw ("No Logic Flow Diagram was returned by the suggestion API.");
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
diagram: diagram
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
DataTransform.SuggestLogicFlowDiagramByPrompt = SuggestLogicFlowDiagramByPrompt;
|
|
119
|
+
})(DataTransform = exports.DataTransform || (exports.DataTransform = {}));
|
|
120
|
+
//# sourceMappingURL=data-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-transform.js","sourceRoot":"","sources":["../../../src/data-transform/data-transform.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oCAAiC;AAEjC,gDAA6C;AAE7C;;GAEG;AACH,IAAiB,aAAa,CA2O7B;AA3OD,WAAiB,aAAa;IAC1B;;OAEG;IACH,IAAY,yBAMX;IAND,WAAY,yBAAyB;QACjC,uDAA0B,CAAA;QAC1B,yDAA4B,CAAA;QAC5B,sCAAS,CAAA;QACT,gDAAmB,CAAA;QACnB,8CAAiB,CAAA;IACrB,CAAC,EANW,yBAAyB,GAAzB,uCAAyB,KAAzB,uCAAyB,QAMpC;IAGD;;OAE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gBAC5B,IAAI;oBACA,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;iBACjC;gBACD,OAAO,CAAC,EAAE;oBACN,sCAAsC;iBACzC;aACJ;YACD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,IAAI,QAAQ,EAAE;gBACxC,MAAK,CAAC,2DAA2D,CAAC,CAAC;aACtE;YAED,OAAO;gBACH,OAAO,EAAE,OAA4B;aACxC,CAAC;QACN,CAAC;KAAA;IAjHqB,6CAA+B,kCAiHpD,CAAA;AACL,CAAC,EA3OgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QA2O7B"}
|
|
@@ -81,6 +81,7 @@ export * from "./util/object-utils";
|
|
|
81
81
|
export * from "./util/path-utils";
|
|
82
82
|
export * from "./util/url-utils";
|
|
83
83
|
export * from "./data-lab/data-lab";
|
|
84
|
+
export * from "./data-transform/data-transform";
|
|
84
85
|
export * from "./data-lab/data-lab-group";
|
|
85
86
|
export * from "./data-feed/data-feed";
|
|
86
87
|
export * from "./import/import-assembly";
|
|
@@ -103,4 +104,4 @@ export * from "./tracking/tracking";
|
|
|
103
104
|
export * from "./mcp/navigator-chat";
|
|
104
105
|
export * from "./mcp/navigator-mcp-websocket";
|
|
105
106
|
export * from "./change-set/change-set";
|
|
106
|
-
export declare const VERSION = "7.1.
|
|
107
|
+
export declare const VERSION = "7.1.34";
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Api } from "../api/api";
|
|
2
|
+
import { BruceApi } from "../api/bruce-api";
|
|
3
|
+
/**
|
|
4
|
+
* Describes the "Data Transform" concept within Nextspace.
|
|
5
|
+
*/
|
|
6
|
+
export declare namespace DataTransform {
|
|
7
|
+
/**
|
|
8
|
+
* Supported Logic Flow diagram item types.
|
|
9
|
+
*/
|
|
10
|
+
enum ELogicFlowDiagramItemType {
|
|
11
|
+
InputValue = "input-value",
|
|
12
|
+
OutputValue = "output-value",
|
|
13
|
+
If = "if",
|
|
14
|
+
Formula = "formula",
|
|
15
|
+
Switch = "switch"
|
|
16
|
+
}
|
|
17
|
+
type LogicFlowDiagramItemType = ELogicFlowDiagramItemType | string;
|
|
18
|
+
/**
|
|
19
|
+
* Supported Logic Flow connection point types.
|
|
20
|
+
*/
|
|
21
|
+
enum ELogicFlowConnectionPointType {
|
|
22
|
+
Input = "input",
|
|
23
|
+
Output = "output"
|
|
24
|
+
}
|
|
25
|
+
type LogicFlowConnectionPointType = ELogicFlowConnectionPointType | string;
|
|
26
|
+
/**
|
|
27
|
+
* Supported Logic Flow connection end roles.
|
|
28
|
+
*/
|
|
29
|
+
enum ELogicFlowConnectionEndRole {
|
|
30
|
+
From = "from",
|
|
31
|
+
To = "to"
|
|
32
|
+
}
|
|
33
|
+
type LogicFlowConnectionEndRole = ELogicFlowConnectionEndRole | string;
|
|
34
|
+
/**
|
|
35
|
+
* Describes an attribute reference used by the Logic Flow suggestion endpoint.
|
|
36
|
+
*/
|
|
37
|
+
interface IAttributeRef {
|
|
38
|
+
Key?: string;
|
|
39
|
+
Path?: string;
|
|
40
|
+
Name?: string;
|
|
41
|
+
Type?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Describes 2D coordinates on a Logic Flow diagram canvas.
|
|
45
|
+
*/
|
|
46
|
+
interface IDiagramPoint {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Describes a diagram connection point.
|
|
52
|
+
*/
|
|
53
|
+
interface IDiagramConnectionPoint {
|
|
54
|
+
key: string;
|
|
55
|
+
type: LogicFlowConnectionPointType;
|
|
56
|
+
payload?: any;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Describes a node within a Logic Flow diagram.
|
|
60
|
+
*/
|
|
61
|
+
interface ILogicFlowDiagramItem {
|
|
62
|
+
key: string;
|
|
63
|
+
type: LogicFlowDiagramItemType;
|
|
64
|
+
position: IDiagramPoint;
|
|
65
|
+
payload?: any;
|
|
66
|
+
Settings?: any;
|
|
67
|
+
connectionPoints?: IDiagramConnectionPoint[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Describes one end of a diagram connection.
|
|
71
|
+
*/
|
|
72
|
+
interface IDiagramConnectionEnd {
|
|
73
|
+
role: LogicFlowConnectionEndRole;
|
|
74
|
+
itemKey: string;
|
|
75
|
+
pointKey: string;
|
|
76
|
+
pointType: LogicFlowConnectionPointType;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Describes a connection between two diagram items.
|
|
80
|
+
*/
|
|
81
|
+
interface ILogicFlowDiagramConnection {
|
|
82
|
+
key: string;
|
|
83
|
+
type: string;
|
|
84
|
+
payload?: any;
|
|
85
|
+
from: IDiagramConnectionEnd;
|
|
86
|
+
to: IDiagramConnectionEnd;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Describes counters for generated diagram keys.
|
|
90
|
+
*/
|
|
91
|
+
interface ILogicFlowDiagramCounters {
|
|
92
|
+
input?: number;
|
|
93
|
+
output?: number;
|
|
94
|
+
if?: number;
|
|
95
|
+
formula?: number;
|
|
96
|
+
switch?: number;
|
|
97
|
+
connection?: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Describes the logic flow diagram payload returned by the API.
|
|
101
|
+
*/
|
|
102
|
+
interface ILogicFlowDiagram {
|
|
103
|
+
version?: number;
|
|
104
|
+
exportedAt?: string;
|
|
105
|
+
viewport?: any;
|
|
106
|
+
transform?: any;
|
|
107
|
+
toolMode?: string;
|
|
108
|
+
counters?: ILogicFlowDiagramCounters;
|
|
109
|
+
diagramItems?: ILogicFlowDiagramItem[];
|
|
110
|
+
diagramConnections?: ILogicFlowDiagramConnection[];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Requests a suggested Logic Flow diagram from a natural-language prompt.
|
|
114
|
+
* Route: POST v1/entityType/{entityType_id}/DataTransform/SuggestLogicFlowDiagram
|
|
115
|
+
*/
|
|
116
|
+
function SuggestLogicFlowDiagramByPrompt(params: {
|
|
117
|
+
api?: BruceApi.Api;
|
|
118
|
+
entityTypeId: string;
|
|
119
|
+
prompt: string;
|
|
120
|
+
model?: string;
|
|
121
|
+
maxNodes?: number;
|
|
122
|
+
dataTransformId?: number;
|
|
123
|
+
dataTransform?: any;
|
|
124
|
+
dataTransformContext?: any;
|
|
125
|
+
sourceDataSchema?: any;
|
|
126
|
+
destinationDataSchema?: any;
|
|
127
|
+
inputAttributes?: IAttributeRef[];
|
|
128
|
+
outputAttributes?: IAttributeRef[];
|
|
129
|
+
req?: Api.IReqParams;
|
|
130
|
+
}): Promise<{
|
|
131
|
+
diagram: ILogicFlowDiagram;
|
|
132
|
+
}>;
|
|
133
|
+
}
|