@metad/contracts 3.6.2 → 3.7.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/index.cjs.js CHANGED
@@ -1,461 +1,42 @@
1
1
  'use strict';
2
2
 
3
- function getDefaultExportFromCjs(x) {
4
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5
- }
6
-
7
- var shortUniqueId = {
8
- exports: {}
9
- };
3
+ var ShortUniqueId = require('short-unique-id');
10
4
 
11
- (function (module) {
12
- function _array_like_to_array(arr, len) {
13
- if (len == null || len > arr.length) len = arr.length;
14
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15
- return arr2;
16
- }
17
- function _array_without_holes(arr) {
18
- if (Array.isArray(arr)) return _array_like_to_array(arr);
19
- }
20
- function _assert_this_initialized(self) {
21
- if (self === void 0) {
22
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
23
- }
24
- return self;
25
- }
26
- function _class_call_check(instance, Constructor) {
27
- if (!(instance instanceof Constructor)) {
28
- throw new TypeError("Cannot call a class as a function");
29
- }
30
- }
31
- function _construct(Parent, args, Class) {
32
- if (_is_native_reflect_construct()) {
33
- _construct = Reflect.construct;
34
- } else {
35
- _construct = function construct(Parent, args, Class) {
36
- var a = [
37
- null
38
- ];
39
- a.push.apply(a, args);
40
- var Constructor = Function.bind.apply(Parent, a);
41
- var instance = new Constructor();
42
- if (Class) _set_prototype_of(instance, Class.prototype);
43
- return instance;
44
- };
45
- }
46
- return _construct.apply(null, arguments);
47
- }
48
- function _get_prototype_of(o) {
49
- _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
50
- return o.__proto__ || Object.getPrototypeOf(o);
51
- };
52
- return _get_prototype_of(o);
53
- }
54
- function _inherits(subClass, superClass) {
55
- if (typeof superClass !== "function" && superClass !== null) {
56
- throw new TypeError("Super expression must either be null or a function");
57
- }
58
- subClass.prototype = Object.create(superClass && superClass.prototype, {
59
- constructor: {
60
- value: subClass,
61
- writable: true,
62
- configurable: true
63
- }
64
- });
65
- if (superClass) _set_prototype_of(subClass, superClass);
66
- }
67
- function _is_native_function(fn) {
68
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
69
- }
70
- function _iterable_to_array(iter) {
71
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
72
- }
73
- function _non_iterable_spread() {
74
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
- }
76
- function _possible_constructor_return(self, call) {
77
- if (call && (_type_of(call) === "object" || typeof call === "function")) {
78
- return call;
79
- }
80
- return _assert_this_initialized(self);
81
- }
82
- function _set_prototype_of(o, p) {
83
- _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
84
- o.__proto__ = p;
85
- return o;
86
- };
87
- return _set_prototype_of(o, p);
88
- }
89
- function _to_consumable_array(arr) {
90
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
91
- }
92
- function _type_of(obj) {
93
- "@swc/helpers - typeof";
94
- return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
95
- }
96
- function _unsupported_iterable_to_array(o, minLen) {
97
- if (!o) return;
98
- if (typeof o === "string") return _array_like_to_array(o, minLen);
99
- var n = Object.prototype.toString.call(o).slice(8, -1);
100
- if (n === "Object" && o.constructor) n = o.constructor.name;
101
- if (n === "Map" || n === "Set") return Array.from(n);
102
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
103
- }
104
- function _wrap_native_super(Class) {
105
- var _cache = typeof Map === "function" ? new Map() : undefined;
106
- _wrap_native_super = function wrapNativeSuper(Class) {
107
- if (Class === null || !_is_native_function(Class)) return Class;
108
- if (typeof Class !== "function") {
109
- throw new TypeError("Super expression must either be null or a function");
110
- }
111
- if (typeof _cache !== "undefined") {
112
- if (_cache.has(Class)) return _cache.get(Class);
113
- _cache.set(Class, Wrapper);
114
- }
115
- function Wrapper() {
116
- return _construct(Class, arguments, _get_prototype_of(this).constructor);
117
- }
118
- Wrapper.prototype = Object.create(Class.prototype, {
119
- constructor: {
120
- value: Wrapper,
121
- enumerable: false,
122
- writable: true,
123
- configurable: true
124
- }
125
- });
126
- return _set_prototype_of(Wrapper, Class);
127
- };
128
- return _wrap_native_super(Class);
129
- }
130
- function _is_native_reflect_construct() {
131
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
132
- if (Reflect.construct.sham) return false;
133
- if (typeof Proxy === "function") return true;
134
- try {
135
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
136
- return true;
137
- } catch (e) {
138
- return false;
139
- }
140
- }
141
- function _create_super(Derived) {
142
- var hasNativeReflectConstruct = _is_native_reflect_construct();
143
- return function _createSuperInternal() {
144
- var Super = _get_prototype_of(Derived), result;
145
- if (hasNativeReflectConstruct) {
146
- var NewTarget = _get_prototype_of(this).constructor;
147
- result = Reflect.construct(Super, arguments, NewTarget);
148
- } else {
149
- result = Super.apply(this, arguments);
150
- }
151
- return _possible_constructor_return(this, result);
152
- };
153
- }
154
- var ShortUniqueId = function() {
155
- var __defProp = Object.defineProperty;
156
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
157
- var __hasOwnProp = Object.prototype.hasOwnProperty;
158
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
159
- var __defNormalProp = function(obj, key, value) {
160
- return key in obj ? __defProp(obj, key, {
161
- enumerable: true,
162
- configurable: true,
163
- writable: true,
164
- value: value
165
- }) : obj[key] = value;
166
- };
167
- var __spreadValues = function(a, b) {
168
- for(var prop in b || (b = {}))if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
169
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
170
- if (__getOwnPropSymbols) try {
171
- for(var _iterator = __getOwnPropSymbols(b)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
172
- var prop = _step.value;
173
- if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
174
- }
175
- } catch (err) {
176
- _didIteratorError = true;
177
- _iteratorError = err;
178
- } finally{
179
- try {
180
- if (!_iteratorNormalCompletion && _iterator.return != null) {
181
- _iterator.return();
182
- }
183
- } finally{
184
- if (_didIteratorError) {
185
- throw _iteratorError;
186
- }
187
- }
188
- }
189
- return a;
190
- };
191
- var __markAsModule = function(target) {
192
- return __defProp(target, "__esModule", {
193
- value: true
194
- });
195
- };
196
- var __export = function(target, all) {
197
- __markAsModule(target);
198
- for(var name in all)__defProp(target, name, {
199
- get: all[name],
200
- enumerable: true
201
- });
202
- };
203
- // src/index.ts
204
- var src_exports = {};
205
- __export(src_exports, {
206
- DEFAULT_UUID_LENGTH: function() {
207
- return DEFAULT_UUID_LENGTH;
208
- },
209
- default: function() {
210
- return ShortUniqueId;
211
- }
212
- });
213
- // package.json
214
- var version = "4.4.4";
215
- // src/index.ts
216
- var DEFAULT_UUID_LENGTH = 6;
217
- var DEFAULT_OPTIONS = {
218
- dictionary: "alphanum",
219
- shuffle: true,
220
- debug: false,
221
- length: DEFAULT_UUID_LENGTH
222
- };
223
- var _ShortUniqueId = /*#__PURE__*/ function(Function1) {
224
- _inherits(_ShortUniqueId, Function1);
225
- var _super = _create_super(_ShortUniqueId);
226
- function _ShortUniqueId() {
227
- var argOptions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
228
- _class_call_check(this, _ShortUniqueId);
229
- var _this;
230
- _this = _super.call(this);
231
- _this.dictIndex = 0;
232
- _this.dictRange = [];
233
- _this.lowerBound = 0;
234
- _this.upperBound = 0;
235
- _this.dictLength = 0;
236
- _this._digit_first_ascii = 48;
237
- _this._digit_last_ascii = 58;
238
- _this._alpha_lower_first_ascii = 97;
239
- _this._alpha_lower_last_ascii = 123;
240
- _this._hex_last_ascii = 103;
241
- _this._alpha_upper_first_ascii = 65;
242
- _this._alpha_upper_last_ascii = 91;
243
- _this._number_dict_ranges = {
244
- digits: [
245
- _this._digit_first_ascii,
246
- _this._digit_last_ascii
247
- ]
248
- };
249
- _this._alpha_dict_ranges = {
250
- lowerCase: [
251
- _this._alpha_lower_first_ascii,
252
- _this._alpha_lower_last_ascii
253
- ],
254
- upperCase: [
255
- _this._alpha_upper_first_ascii,
256
- _this._alpha_upper_last_ascii
257
- ]
258
- };
259
- _this._alpha_lower_dict_ranges = {
260
- lowerCase: [
261
- _this._alpha_lower_first_ascii,
262
- _this._alpha_lower_last_ascii
263
- ]
264
- };
265
- _this._alpha_upper_dict_ranges = {
266
- upperCase: [
267
- _this._alpha_upper_first_ascii,
268
- _this._alpha_upper_last_ascii
269
- ]
270
- };
271
- _this._alphanum_dict_ranges = {
272
- digits: [
273
- _this._digit_first_ascii,
274
- _this._digit_last_ascii
275
- ],
276
- lowerCase: [
277
- _this._alpha_lower_first_ascii,
278
- _this._alpha_lower_last_ascii
279
- ],
280
- upperCase: [
281
- _this._alpha_upper_first_ascii,
282
- _this._alpha_upper_last_ascii
283
- ]
284
- };
285
- _this._alphanum_lower_dict_ranges = {
286
- digits: [
287
- _this._digit_first_ascii,
288
- _this._digit_last_ascii
289
- ],
290
- lowerCase: [
291
- _this._alpha_lower_first_ascii,
292
- _this._alpha_lower_last_ascii
293
- ]
294
- };
295
- _this._alphanum_upper_dict_ranges = {
296
- digits: [
297
- _this._digit_first_ascii,
298
- _this._digit_last_ascii
299
- ],
300
- upperCase: [
301
- _this._alpha_upper_first_ascii,
302
- _this._alpha_upper_last_ascii
303
- ]
304
- };
305
- _this._hex_dict_ranges = {
306
- decDigits: [
307
- _this._digit_first_ascii,
308
- _this._digit_last_ascii
309
- ],
310
- alphaDigits: [
311
- _this._alpha_lower_first_ascii,
312
- _this._hex_last_ascii
313
- ]
314
- };
315
- _this.log = function() {
316
- for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
317
- args[_key] = arguments[_key];
318
- }
319
- var finalArgs = _to_consumable_array(args);
320
- finalArgs[0] = "[short-unique-id] ".concat(args[0]);
321
- if (_this.debug === true) {
322
- if (typeof console !== "undefined" && console !== null) {
323
- var _console;
324
- return (_console = console).log.apply(_console, _to_consumable_array(finalArgs));
325
- }
326
- }
327
- };
328
- _this.setDictionary = function(dictionary, shuffle) {
329
- var finalDict;
330
- if (dictionary && Array.isArray(dictionary) && dictionary.length > 1) {
331
- finalDict = dictionary;
332
- } else {
333
- finalDict = [];
334
- var i;
335
- _this.dictIndex = i = 0;
336
- var rangesName = "_".concat(dictionary, "_dict_ranges");
337
- var ranges = _this[rangesName];
338
- Object.keys(ranges).forEach(function(rangeType) {
339
- var rangeTypeKey = rangeType;
340
- _this.dictRange = ranges[rangeTypeKey];
341
- _this.lowerBound = _this.dictRange[0];
342
- _this.upperBound = _this.dictRange[1];
343
- for(_this.dictIndex = i = _this.lowerBound; _this.lowerBound <= _this.upperBound ? i < _this.upperBound : i > _this.upperBound; _this.dictIndex = _this.lowerBound <= _this.upperBound ? i += 1 : i -= 1){
344
- finalDict.push(String.fromCharCode(_this.dictIndex));
345
- }
346
- });
347
- }
348
- if (shuffle) {
349
- var PROBABILITY = 0.5;
350
- finalDict = finalDict.sort(function() {
351
- return Math.random() - PROBABILITY;
352
- });
353
- }
354
- _this.dict = finalDict;
355
- _this.dictLength = _this.dict.length;
356
- _this.counter = 0;
357
- };
358
- _this.seq = function() {
359
- return _this.sequentialUUID();
360
- };
361
- _this.sequentialUUID = function() {
362
- var counterDiv;
363
- var counterRem;
364
- var id = "";
365
- counterDiv = _this.counter;
366
- do {
367
- counterRem = counterDiv % _this.dictLength;
368
- counterDiv = Math.trunc(counterDiv / _this.dictLength);
369
- id += _this.dict[counterRem];
370
- }while (counterDiv !== 0);
371
- _this.counter += 1;
372
- return id;
373
- };
374
- _this.randomUUID = function() {
375
- var uuidLength = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.uuidLength || DEFAULT_UUID_LENGTH;
376
- var id;
377
- var randomPartIdx;
378
- var j;
379
- if (uuidLength === null || typeof uuidLength === "undefined" || uuidLength < 1) {
380
- throw new Error("Invalid UUID Length Provided");
381
- }
382
- id = "";
383
- for(j = 0; j < uuidLength; j += 1){
384
- randomPartIdx = parseInt((Math.random() * _this.dictLength).toFixed(0), 10) % _this.dictLength;
385
- id += _this.dict[randomPartIdx];
386
- }
387
- return id;
388
- };
389
- _this.availableUUIDs = function() {
390
- var uuidLength = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.uuidLength;
391
- return parseFloat(Math.pow(_to_consumable_array(new Set(_this.dict)).length, uuidLength).toFixed(0));
392
- };
393
- _this.approxMaxBeforeCollision = function() {
394
- var rounds = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.availableUUIDs(_this.uuidLength);
395
- return parseFloat(Math.sqrt(Math.PI / 2 * rounds).toFixed(20));
396
- };
397
- _this.collisionProbability = function() {
398
- var rounds = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.availableUUIDs(_this.uuidLength), uuidLength = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _this.uuidLength;
399
- return parseFloat((_this.approxMaxBeforeCollision(rounds) / _this.availableUUIDs(uuidLength)).toFixed(20));
400
- };
401
- _this.uniqueness = function() {
402
- var rounds = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _this.availableUUIDs(_this.uuidLength);
403
- var score = parseFloat((1 - _this.approxMaxBeforeCollision(rounds) / rounds).toFixed(20));
404
- return score > 1 ? 1 : score < 0 ? 0 : score;
405
- };
406
- _this.getVersion = function() {
407
- return _this.version;
408
- };
409
- _this.stamp = function(finalLength) {
410
- if (typeof finalLength !== "number" || finalLength < 10) {
411
- throw new Error("Param finalLength must be number greater than 10");
412
- }
413
- var hexStamp = Math.floor(+new Date() / 1e3).toString(16);
414
- var idLength = finalLength - 9;
415
- var rndIdx = Math.round(Math.random() * (idLength > 15 ? 15 : idLength));
416
- var id = _this.randomUUID(idLength);
417
- return "".concat(id.substr(0, rndIdx)).concat(hexStamp).concat(id.substr(rndIdx)).concat(rndIdx.toString(16));
418
- };
419
- _this.parseStamp = function(stamp) {
420
- if (stamp.length < 10) {
421
- throw new Error("Stamp length invalid");
422
- }
423
- var rndIdx = parseInt(stamp.substr(stamp.length - 1, 1), 16);
424
- return new Date(parseInt(stamp.substr(rndIdx, 8), 16) * 1e3);
425
- };
426
- var options = __spreadValues(__spreadValues({}, DEFAULT_OPTIONS), argOptions);
427
- _this.counter = 0;
428
- _this.debug = false;
429
- _this.dict = [];
430
- _this.version = version;
431
- var dictionary = options.dictionary, shuffle = options.shuffle, length = options.length;
432
- _this.uuidLength = length;
433
- _this.setDictionary(dictionary, shuffle);
434
- _this.debug = options.debug;
435
- _this.log(_this.dict);
436
- _this.log("Generator instantiated with Dictionary Size ".concat(_this.dictLength));
437
- return _possible_constructor_return(_this, new Proxy(_assert_this_initialized(_this), {
438
- apply: function(target, that, args) {
439
- return _this.randomUUID.apply(_this, _to_consumable_array(args));
440
- }
441
- }));
442
- }
443
- return _ShortUniqueId;
444
- }(_wrap_native_super(Function));
445
- var ShortUniqueId = _ShortUniqueId;
446
- ShortUniqueId.default = _ShortUniqueId;
447
- return src_exports;
448
- }();
449
-
450
- (module.exports = ShortUniqueId.default), "undefined" != typeof window && (ShortUniqueId = ShortUniqueId.default);
451
- } (shortUniqueId));
452
-
453
- var shortUniqueIdExports = shortUniqueId.exports;
454
- var ShortUniqueId = /*@__PURE__*/getDefaultExportFromCjs(shortUniqueIdExports);
455
-
456
- var uuid = new ShortUniqueId({
5
+ function _array_like_to_array$5(arr, len) {
6
+ if (len == null || len > arr.length) len = arr.length;
7
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8
+ return arr2;
9
+ }
10
+ function _array_without_holes$1(arr) {
11
+ if (Array.isArray(arr)) return _array_like_to_array$5(arr);
12
+ }
13
+ function _iterable_to_array$2(iter) {
14
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
15
+ }
16
+ function _non_iterable_spread$1() {
17
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18
+ }
19
+ function _to_consumable_array$1(arr) {
20
+ return _array_without_holes$1(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$5(arr) || _non_iterable_spread$1();
21
+ }
22
+ function _unsupported_iterable_to_array$5(o, minLen) {
23
+ if (!o) return;
24
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
25
+ var n = Object.prototype.toString.call(o).slice(8, -1);
26
+ if (n === "Object" && o.constructor) n = o.constructor.name;
27
+ if (n === "Map" || n === "Set") return Array.from(n);
28
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
29
+ }
30
+ var _uuidGenerator;
31
+ var uuidGenerator = new ShortUniqueId({
457
32
  length: 10
458
33
  });
34
+ var uuid = function() {
35
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
36
+ args[_key] = arguments[_key];
37
+ }
38
+ return (_uuidGenerator = uuidGenerator).randomUUID.apply(_uuidGenerator, _to_consumable_array$1(args));
39
+ };
459
40
  exports.ParameterTypeEnum = void 0;
460
41
  (function(ParameterTypeEnum) {
461
42
  ParameterTypeEnum["STRING"] = "string";
@@ -1368,10 +949,10 @@ var RollupPolicy;
1368
949
  })(RollupPolicy || (RollupPolicy = {}));
1369
950
 
1370
951
  var schema = /*#__PURE__*/Object.freeze({
1371
- __proto__: null,
1372
- get Access () { return Access; },
1373
- get DimensionType () { return DimensionType; },
1374
- get RollupPolicy () { return RollupPolicy; }
952
+ __proto__: null,
953
+ get Access () { return Access; },
954
+ get DimensionType () { return DimensionType; },
955
+ get RollupPolicy () { return RollupPolicy; }
1375
956
  });
1376
957
 
1377
958
  exports.ChatDashboardMessageType = void 0;
@@ -1467,6 +1048,25 @@ exports.FeedTypeEnum = void 0;
1467
1048
  FeedTypeEnum["Ranking"] = "Ranking";
1468
1049
  })(exports.FeedTypeEnum || (exports.FeedTypeEnum = {}));
1469
1050
 
1051
+ /**
1052
+ * Fields included in the draft of Indicator, please keep it in sync with TIndicator type
1053
+ */ var IndicatorDraftFields = [
1054
+ "code",
1055
+ "name",
1056
+ "type",
1057
+ "visible",
1058
+ "isApplication",
1059
+ "modelId",
1060
+ "entity",
1061
+ "unit",
1062
+ "principal",
1063
+ "authentication",
1064
+ "certificationId",
1065
+ "validity",
1066
+ "business",
1067
+ "options",
1068
+ "businessAreaId"
1069
+ ];
1470
1070
  var IndicatorOptionFields = [
1471
1071
  "dimensions",
1472
1072
  "filters",
@@ -1993,15 +1593,9 @@ exports.WorkflowNodeTypeEnum = void 0;
1993
1593
  */ WorkflowNodeTypeEnum["IF_ELSE"] = "if-else";
1994
1594
  WorkflowNodeTypeEnum["LIST_OPERATOR"] = "list-operator";
1995
1595
  WorkflowNodeTypeEnum["VARIABLE_AGGREGATOR"] = "variable-aggregator";
1996
- // SPLITTER = 'splitter',
1997
1596
  WorkflowNodeTypeEnum["ITERATING"] = "iterating";
1998
- WorkflowNodeTypeEnum["ANSWER"] = "answer";
1999
- WorkflowNodeTypeEnum["CODE"] = "code";
2000
1597
  WorkflowNodeTypeEnum["HTTP"] = "http";
2001
- WorkflowNodeTypeEnum["KNOWLEDGE"] = "knowledge";
2002
1598
  WorkflowNodeTypeEnum["SUBFLOW"] = "subflow";
2003
- WorkflowNodeTypeEnum["TEMPLATE"] = "template";
2004
- WorkflowNodeTypeEnum["CLASSIFIER"] = "classifier";
2005
1599
  WorkflowNodeTypeEnum["TOOL"] = "tool";
2006
1600
  WorkflowNodeTypeEnum["AGENT_TOOL"] = "agent-tool";
2007
1601
  WorkflowNodeTypeEnum["NOTE"] = "note";
@@ -2014,6 +1608,39 @@ exports.WorkflowNodeTypeEnum = void 0;
2014
1608
  WorkflowNodeTypeEnum["CHUNKER"] = "chunker";
2015
1609
  WorkflowNodeTypeEnum["UNDERSTANDING"] = "understanding";
2016
1610
  WorkflowNodeTypeEnum["KNOWLEDGE_BASE"] = "knowledgebase";
1611
+ // ===============================
1612
+ // 📦 Transform Nodes
1613
+ // ===============================
1614
+ WorkflowNodeTypeEnum["CLASSIFIER"] = "classifier";
1615
+ WorkflowNodeTypeEnum["KNOWLEDGE"] = "knowledge";
1616
+ WorkflowNodeTypeEnum["CODE"] = "code";
1617
+ WorkflowNodeTypeEnum["TEMPLATE"] = "template";
1618
+ WorkflowNodeTypeEnum["ANSWER"] = "answer";
1619
+ WorkflowNodeTypeEnum["JSON_STRINGIFY"] = "json-stringify";
1620
+ WorkflowNodeTypeEnum["JSON_PARSE"] = "json-parse";
1621
+ // ===============================
1622
+ // 📦 Database Operation Nodes
1623
+ // ===============================
1624
+ /**
1625
+ * Custom SQL
1626
+ */ WorkflowNodeTypeEnum["DB_SQL"] = "db-sql";
1627
+ /**
1628
+ * Insert data (INSERT)
1629
+ */ WorkflowNodeTypeEnum["DB_INSERT"] = "db-insert";
1630
+ /**
1631
+ * Update data (UPDATE)
1632
+ */ WorkflowNodeTypeEnum["DB_UPDATE"] = "db-update";
1633
+ /**
1634
+ * Delete data (DELETE)
1635
+ */ WorkflowNodeTypeEnum["DB_DELETE"] = "db-delete";
1636
+ /**
1637
+ * Query data (SELECT)
1638
+ */ WorkflowNodeTypeEnum["DB_QUERY"] = "db-query";
1639
+ // ===============================
1640
+ // 🏆 Pro Nodes
1641
+ // ===============================
1642
+ WorkflowNodeTypeEnum["MIDDLEWARE"] = "middleware";
1643
+ WorkflowNodeTypeEnum["SKILL"] = "skill";
2017
1644
  })(exports.WorkflowNodeTypeEnum || (exports.WorkflowNodeTypeEnum = {}));
2018
1645
  exports.VariableOperationEnum = void 0;
2019
1646
  (function(VariableOperationEnum) {
@@ -2059,6 +1686,12 @@ function genListOperatorKey() {
2059
1686
  function genVariableAggregatorKey() {
2060
1687
  return letterStartSUID("VariableAggregator_");
2061
1688
  }
1689
+ function genJSONStringifyKey() {
1690
+ return letterStartSUID("JSONStringify_");
1691
+ }
1692
+ function genJSONParseKey() {
1693
+ return letterStartSUID("JSONParse_");
1694
+ }
2062
1695
  function isAgentKey(key) {
2063
1696
  return key === null || key === void 0 ? void 0 : key.toLowerCase().startsWith("agent_");
2064
1697
  }
@@ -2104,7 +1737,9 @@ exports.XpertParameterTypeEnum = void 0;
2104
1737
  XpertParameterTypeEnum["NUMBER"] = "number";
2105
1738
  XpertParameterTypeEnum["OBJECT"] = "object";
2106
1739
  XpertParameterTypeEnum["SELECT"] = "select";
1740
+ XpertParameterTypeEnum["FILE"] = "file";
2107
1741
  XpertParameterTypeEnum["ARRAY_STRING"] = "array[string]";
1742
+ XpertParameterTypeEnum["ARRAY_NUMBER"] = "array[number]";
2108
1743
  XpertParameterTypeEnum["ARRAY"] = "array[object]";
2109
1744
  XpertParameterTypeEnum["ARRAY_FILE"] = "array[file]";
2110
1745
  XpertParameterTypeEnum["ARRAY_DOCUMENT"] = "array[document]";
@@ -2283,6 +1918,9 @@ var GRAPH_NODE_SUMMARIZE_CONVERSATION = "summarize_conversation";
2283
1918
  var GRAPH_NODE_TITLE_CONVERSATION = "title_conversation";
2284
1919
  var STATE_VARIABLE_FILES = "files";
2285
1920
  var STATE_VARIABLE_INPUT = "input";
1921
+ var STATE_SYS_VOLUME = "volume";
1922
+ var STATE_SYS_WORKSPACE_PATH = "workspace_path";
1923
+ var STATE_SYS_WORKSPACE_URL = "workspace_url";
2286
1924
  var STATE_VARIABLE_TITLE_CHANNEL = channelName("title");
2287
1925
  // Helpers
2288
1926
  function channelName(name) {
@@ -2611,6 +2249,45 @@ function isAudioType(type) {
2611
2249
  function classificateDocumentCategory(entity) {
2612
2250
  return isDocumentSheet(entity.type) ? "sheet" : isImageType(entity.type) ? "image" : isVideoType(entity.type) ? "video" : isAudioType(entity.type) ? "audio" : "text";
2613
2251
  }
2252
+ /**
2253
+ * System standard Metadata field definition constants
2254
+ * It can be used for rendering, validation, sorting, displaying descriptions, etc.
2255
+ */ var STANDARD_METADATA_FIELDS = [
2256
+ // Document Info
2257
+ {
2258
+ group: {
2259
+ en_US: "Document Info",
2260
+ zh_Hans: "文档信息"
2261
+ },
2262
+ fields: [
2263
+ {
2264
+ key: "title",
2265
+ label: {
2266
+ en_US: "Original File Name",
2267
+ zh_Hans: "原始文件名称"
2268
+ },
2269
+ type: "string"
2270
+ }
2271
+ ]
2272
+ },
2273
+ // Technical Parameters
2274
+ {
2275
+ group: {
2276
+ en_US: "Technical Parameters",
2277
+ zh_Hans: "技术参数"
2278
+ },
2279
+ fields: [
2280
+ {
2281
+ key: "tokens",
2282
+ label: {
2283
+ en_US: "Tokens",
2284
+ zh_Hans: "词元"
2285
+ },
2286
+ type: "number"
2287
+ }
2288
+ ]
2289
+ }
2290
+ ];
2614
2291
 
2615
2292
  exports.AIPermissionsEnum = void 0;
2616
2293
  (function(AIPermissionsEnum) {
@@ -2700,6 +2377,9 @@ function getEnabledTools(toolset) {
2700
2377
  function getToolLabel(tool) {
2701
2378
  var _tool_schema;
2702
2379
  if (!tool) return "";
2380
+ if (tool.label) {
2381
+ return tool.label;
2382
+ }
2703
2383
  var identity = (_tool_schema = tool.schema) === null || _tool_schema === void 0 ? void 0 : _tool_schema.identity;
2704
2384
  if (identity) {
2705
2385
  return identity.label || tool.name || "";
@@ -2762,6 +2442,32 @@ exports.ToolTagEnum = void 0;
2762
2442
  ToolTagEnum["OTHER"] = "other";
2763
2443
  })(exports.ToolTagEnum || (exports.ToolTagEnum = {}));
2764
2444
 
2445
+ exports.XpertTableStatus = void 0;
2446
+ (function(XpertTableStatus) {
2447
+ XpertTableStatus["DRAFT"] = "draft";
2448
+ XpertTableStatus["READY"] = "ready";
2449
+ XpertTableStatus["PENDING_ACTIVATION"] = "pendingActivation";
2450
+ XpertTableStatus["ACTIVE"] = "active";
2451
+ XpertTableStatus["NEEDS_MIGRATION"] = "needsMigration";
2452
+ XpertTableStatus["DEPRECATED"] = "deprecated";
2453
+ XpertTableStatus["ERROR"] = "error";
2454
+ })(exports.XpertTableStatus || (exports.XpertTableStatus = {}));
2455
+ function genXpertDBInsertKey() {
2456
+ return letterStartSUID("DBInsert_");
2457
+ }
2458
+ function genXpertDBUpdateKey() {
2459
+ return letterStartSUID("DBUpdate_");
2460
+ }
2461
+ function genXpertDBDeleteKey() {
2462
+ return letterStartSUID("DBDelete_");
2463
+ }
2464
+ function genXpertDBQueryKey() {
2465
+ return letterStartSUID("DBQuery_");
2466
+ }
2467
+ function genXpertDBSqlKey() {
2468
+ return letterStartSUID("DBSql_");
2469
+ }
2470
+
2765
2471
  function _array_like_to_array$3(arr, len) {
2766
2472
  if (len == null || len > arr.length) len = arr.length;
2767
2473
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
@@ -2817,13 +2523,16 @@ function _unsupported_iterable_to_array$3(o, minLen) {
2817
2523
  // Helpers
2818
2524
  function omitXpertRelations(xpert) {
2819
2525
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
2820
- var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.toolsets; _ref.managers; var rest = _object_without_properties(_ref, [
2526
+ var _ref = xpert !== null && xpert !== void 0 ? xpert : {}; _ref.draft; _ref.agent; _ref.agents; _ref.executors; _ref.leaders; _ref.knowledgebases; _ref.knowledgebase; _ref.environment; _ref.integrations; _ref.toolsets; _ref.managers; var rest = _object_without_properties(_ref, [
2821
2527
  "draft",
2822
2528
  "agent",
2823
2529
  "agents",
2824
2530
  "executors",
2825
2531
  "leaders",
2826
2532
  "knowledgebases",
2533
+ "knowledgebase",
2534
+ "environment",
2535
+ "integrations",
2827
2536
  "toolsets",
2828
2537
  "managers"
2829
2538
  ]);
@@ -3318,6 +3027,35 @@ function _object_spread_props(target, source) {
3318
3027
  return leaves;
3319
3028
  }
3320
3029
 
3030
+ // Skill types
3031
+ function genXpertSkillKey() {
3032
+ return letterStartSUID("Skill_");
3033
+ }
3034
+
3035
+ function genXpertMiddlewareKey() {
3036
+ return letterStartSUID("Middleware_");
3037
+ }
3038
+ var normalizeNodeKey = function(key) {
3039
+ var _key_split;
3040
+ return key === null || key === void 0 ? void 0 : (_key_split = key.split("/")) === null || _key_split === void 0 ? void 0 : _key_split[0];
3041
+ };
3042
+ function getAgentMiddlewareNodes(graph, agentKey) {
3043
+ var _graph_connections;
3044
+ var _graph_connections_filter_map_filter;
3045
+ var middlewares = (_graph_connections_filter_map_filter = (_graph_connections = graph.connections) === null || _graph_connections === void 0 ? void 0 : _graph_connections.filter(function(conn) {
3046
+ return conn.type === "workflow" && conn.from === agentKey;
3047
+ }).map(function(conn) {
3048
+ var _graph_nodes;
3049
+ var to = normalizeNodeKey(conn.to);
3050
+ return (_graph_nodes = graph.nodes) === null || _graph_nodes === void 0 ? void 0 : _graph_nodes.find(function(node) {
3051
+ return node.key === to;
3052
+ });
3053
+ }).filter(function(node) {
3054
+ return (node === null || node === void 0 ? void 0 : node.entity).type === exports.WorkflowNodeTypeEnum.MIDDLEWARE;
3055
+ })) !== null && _graph_connections_filter_map_filter !== void 0 ? _graph_connections_filter_map_filter : [];
3056
+ return middlewares;
3057
+ }
3058
+
3321
3059
  exports.PermissionsEnum = void 0;
3322
3060
  (function(PermissionsEnum) {
3323
3061
  PermissionsEnum["PROFILE_EDIT"] = "PROFILE_EDIT";
@@ -4019,6 +3757,48 @@ function _unsupported_iterable_to_array$1(o, minLen) {
4019
3757
  })
4020
3758
  };
4021
3759
  }
3760
+ var FILE_VARIABLES = [
3761
+ {
3762
+ name: "filePath",
3763
+ type: exports.XpertParameterTypeEnum.STRING,
3764
+ description: {
3765
+ en_US: "The path to the file",
3766
+ zh_Hans: "文件的路径"
3767
+ }
3768
+ },
3769
+ {
3770
+ name: "fileName",
3771
+ type: exports.XpertParameterTypeEnum.STRING,
3772
+ description: {
3773
+ en_US: "The name of the file",
3774
+ zh_Hans: "文件的名称"
3775
+ }
3776
+ },
3777
+ {
3778
+ name: "fileUrl",
3779
+ type: exports.XpertParameterTypeEnum.STRING,
3780
+ description: {
3781
+ en_US: "The URL of the file",
3782
+ zh_Hans: "文件的URL地址"
3783
+ }
3784
+ },
3785
+ {
3786
+ name: "fileSize",
3787
+ type: exports.XpertParameterTypeEnum.NUMBER,
3788
+ description: {
3789
+ en_US: "The size of the file in bytes",
3790
+ zh_Hans: "文件的大小,单位为字节"
3791
+ }
3792
+ },
3793
+ {
3794
+ name: "mimeType",
3795
+ type: exports.XpertParameterTypeEnum.STRING,
3796
+ description: {
3797
+ en_US: "The MIME type of the file",
3798
+ zh_Hans: "文件的MIME类型"
3799
+ }
3800
+ }
3801
+ ];
4022
3802
 
4023
3803
  function _array_like_to_array(arr, len) {
4024
3804
  if (len == null || len > arr.length) len = arr.length;
@@ -4139,9 +3919,11 @@ exports.DEFAULT_PROFIT_BASED_BONUS = DEFAULT_PROFIT_BASED_BONUS;
4139
3919
  exports.DEFAULT_REVENUE_BASED_BONUS = DEFAULT_REVENUE_BASED_BONUS;
4140
3920
  exports.DEFAULT_TENANT = DEFAULT_TENANT;
4141
3921
  exports.DEFAULT_TIME_FORMATS = DEFAULT_TIME_FORMATS;
3922
+ exports.FILE_VARIABLES = FILE_VARIABLES;
4142
3923
  exports.GRAPH_NODE_SUMMARIZE_CONVERSATION = GRAPH_NODE_SUMMARIZE_CONVERSATION;
4143
3924
  exports.GRAPH_NODE_TITLE_CONVERSATION = GRAPH_NODE_TITLE_CONVERSATION;
4144
3925
  exports.INTEGRATION_PROVIDERS = INTEGRATION_PROVIDERS;
3926
+ exports.IndicatorDraftFields = IndicatorDraftFields;
4145
3927
  exports.IndicatorOptionFields = IndicatorOptionFields;
4146
3928
  exports.IntegrationGitHubProvider = IntegrationGitHubProvider;
4147
3929
  exports.IntegrationLarkProvider = IntegrationLarkProvider;
@@ -4163,6 +3945,10 @@ exports.OllamaEmbeddingsProviders = OllamaEmbeddingsProviders;
4163
3945
  exports.OpenAIEmbeddingsProviders = OpenAIEmbeddingsProviders;
4164
3946
  exports.PermissionApprovalStatus = PermissionApprovalStatus;
4165
3947
  exports.PermissionGroups = PermissionGroups;
3948
+ exports.STANDARD_METADATA_FIELDS = STANDARD_METADATA_FIELDS;
3949
+ exports.STATE_SYS_VOLUME = STATE_SYS_VOLUME;
3950
+ exports.STATE_SYS_WORKSPACE_PATH = STATE_SYS_WORKSPACE_PATH;
3951
+ exports.STATE_SYS_WORKSPACE_URL = STATE_SYS_WORKSPACE_URL;
4166
3952
  exports.STATE_VARIABLE_FILES = STATE_VARIABLE_FILES;
4167
3953
  exports.STATE_VARIABLE_HUMAN = STATE_VARIABLE_HUMAN;
4168
3954
  exports.STATE_VARIABLE_INPUT = STATE_VARIABLE_INPUT;
@@ -4190,6 +3976,8 @@ exports.embeddingCubeCollectionName = embeddingCubeCollectionName;
4190
3976
  exports.extractSemanticModelDraft = extractSemanticModelDraft;
4191
3977
  exports.figureOutXpert = figureOutXpert;
4192
3978
  exports.findStartNodes = findStartNodes;
3979
+ exports.genJSONParseKey = genJSONParseKey;
3980
+ exports.genJSONStringifyKey = genJSONStringifyKey;
4193
3981
  exports.genListOperatorKey = genListOperatorKey;
4194
3982
  exports.genPipelineChunkerKey = genPipelineChunkerKey;
4195
3983
  exports.genPipelineKnowledgeBaseKey = genPipelineKnowledgeBaseKey;
@@ -4197,8 +3985,16 @@ exports.genPipelineProcessorKey = genPipelineProcessorKey;
4197
3985
  exports.genPipelineSourceKey = genPipelineSourceKey;
4198
3986
  exports.genPipelineUnderstandingKey = genPipelineUnderstandingKey;
4199
3987
  exports.genVariableAggregatorKey = genVariableAggregatorKey;
3988
+ exports.genXpertDBDeleteKey = genXpertDBDeleteKey;
3989
+ exports.genXpertDBInsertKey = genXpertDBInsertKey;
3990
+ exports.genXpertDBQueryKey = genXpertDBQueryKey;
3991
+ exports.genXpertDBSqlKey = genXpertDBSqlKey;
3992
+ exports.genXpertDBUpdateKey = genXpertDBUpdateKey;
3993
+ exports.genXpertMiddlewareKey = genXpertMiddlewareKey;
3994
+ exports.genXpertSkillKey = genXpertSkillKey;
4200
3995
  exports.genXpertTriggerKey = genXpertTriggerKey;
4201
3996
  exports.generateCronExpression = generateCronExpression;
3997
+ exports.getAgentMiddlewareNodes = getAgentMiddlewareNodes;
4202
3998
  exports.getAgentVarGroup = getAgentVarGroup;
4203
3999
  exports.getCurrentGraph = getCurrentGraph;
4204
4000
  exports.getEnabledTools = getEnabledTools;