@metad/contracts 3.6.0 → 3.6.2
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 +306 -69
- package/index.esm.js +296 -67
- package/package.json +8 -1
- package/src/ai/ai-model.model.d.ts +12 -9
- package/src/ai/index.d.ts +1 -0
- package/src/ai/knowledge-doc-chunk.model.d.ts +60 -0
- package/src/ai/knowledge-doc.model.d.ts +46 -31
- package/src/ai/knowledge-pipeline.d.ts +9 -2
- package/src/ai/knowledgebase-task.model.d.ts +3 -0
- package/src/ai/knowledgebase.model.d.ts +6 -4
- package/src/ai/xpert-workflow.model.d.ts +1 -0
- package/src/ai/xpert.model.d.ts +33 -1
- package/src/analytics/data-source.d.ts +1 -1
- package/src/integration.model.d.ts +6 -2
- package/src/password-reset.model.d.ts +3 -3
- package/src/plugin.d.ts +1 -1
- package/src/types.d.ts +1 -0
- package/src/user.model.d.ts +3 -0
- package/src/integration/ragflow.d.ts +0 -0
package/index.cjs.js
CHANGED
|
@@ -1744,6 +1744,8 @@ exports.ModelFeature = void 0;
|
|
|
1744
1744
|
ModelFeature["AGENT_THOUGHT"] = "agent-thought";
|
|
1745
1745
|
ModelFeature["VISION"] = "vision";
|
|
1746
1746
|
ModelFeature["STREAM_TOOL_CALL"] = "stream-tool-call";
|
|
1747
|
+
ModelFeature["VIDEO"] = "video";
|
|
1748
|
+
ModelFeature["STRUCTURED_OUTPUT"] = "structured-output";
|
|
1747
1749
|
})(exports.ModelFeature || (exports.ModelFeature = {}));
|
|
1748
1750
|
exports.ModelPropertyKey = void 0;
|
|
1749
1751
|
(function(ModelPropertyKey) {
|
|
@@ -2048,6 +2050,9 @@ exports.WorkflowComparisonOperator = void 0;
|
|
|
2048
2050
|
WorkflowComparisonOperator["LIKE"] = "like";
|
|
2049
2051
|
WorkflowComparisonOperator["NOT_LIKE"] = "not-like";
|
|
2050
2052
|
})(exports.WorkflowComparisonOperator || (exports.WorkflowComparisonOperator = {}));
|
|
2053
|
+
function genXpertTriggerKey() {
|
|
2054
|
+
return letterStartSUID("Trigger_");
|
|
2055
|
+
}
|
|
2051
2056
|
function genListOperatorKey() {
|
|
2052
2057
|
return letterStartSUID("ListOperator_");
|
|
2053
2058
|
}
|
|
@@ -2184,7 +2189,7 @@ function _array_like_to_array$4(arr, len) {
|
|
|
2184
2189
|
function _array_with_holes$3(arr) {
|
|
2185
2190
|
if (Array.isArray(arr)) return arr;
|
|
2186
2191
|
}
|
|
2187
|
-
function _define_property$
|
|
2192
|
+
function _define_property$3(obj, key, value) {
|
|
2188
2193
|
if (key in obj) {
|
|
2189
2194
|
Object.defineProperty(obj, key, {
|
|
2190
2195
|
value: value,
|
|
@@ -2224,7 +2229,7 @@ function _iterable_to_array_limit$2(arr, i) {
|
|
|
2224
2229
|
function _non_iterable_rest$3() {
|
|
2225
2230
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2226
2231
|
}
|
|
2227
|
-
function _object_spread(target) {
|
|
2232
|
+
function _object_spread$2(target) {
|
|
2228
2233
|
for(var i = 1; i < arguments.length; i++){
|
|
2229
2234
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2230
2235
|
var ownKeys = Object.keys(source);
|
|
@@ -2234,12 +2239,12 @@ function _object_spread(target) {
|
|
|
2234
2239
|
}));
|
|
2235
2240
|
}
|
|
2236
2241
|
ownKeys.forEach(function(key) {
|
|
2237
|
-
_define_property$
|
|
2242
|
+
_define_property$3(target, key, source[key]);
|
|
2238
2243
|
});
|
|
2239
2244
|
}
|
|
2240
2245
|
return target;
|
|
2241
2246
|
}
|
|
2242
|
-
function ownKeys(object, enumerableOnly) {
|
|
2247
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
2243
2248
|
var keys = Object.keys(object);
|
|
2244
2249
|
if (Object.getOwnPropertySymbols) {
|
|
2245
2250
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2247,12 +2252,12 @@ function ownKeys(object, enumerableOnly) {
|
|
|
2247
2252
|
}
|
|
2248
2253
|
return keys;
|
|
2249
2254
|
}
|
|
2250
|
-
function _object_spread_props(target, source) {
|
|
2255
|
+
function _object_spread_props$1(target, source) {
|
|
2251
2256
|
source = source != null ? source : {};
|
|
2252
2257
|
if (Object.getOwnPropertyDescriptors) {
|
|
2253
2258
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2254
2259
|
} else {
|
|
2255
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
2260
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
2256
2261
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2257
2262
|
});
|
|
2258
2263
|
}
|
|
@@ -2333,7 +2338,7 @@ function configurableStoreNamespace(configurable) {
|
|
|
2333
2338
|
var _varName_split = _sliced_to_array$2(varName.split("."), 2), agentChannelName = _varName_split[0], variableName = _varName_split[1];
|
|
2334
2339
|
if (variableName) {
|
|
2335
2340
|
var _state_agentChannelName;
|
|
2336
|
-
state[agentChannelName] = _object_spread_props(_object_spread({}, (_state_agentChannelName = state[agentChannelName]) !== null && _state_agentChannelName !== void 0 ? _state_agentChannelName : {}), _define_property$
|
|
2341
|
+
state[agentChannelName] = _object_spread_props$1(_object_spread$2({}, (_state_agentChannelName = state[agentChannelName]) !== null && _state_agentChannelName !== void 0 ? _state_agentChannelName : {}), _define_property$3({}, variableName, value));
|
|
2337
2342
|
} else {
|
|
2338
2343
|
state[agentChannelName] = value;
|
|
2339
2344
|
}
|
|
@@ -2460,26 +2465,85 @@ exports.KnowledgebasePermission = void 0;
|
|
|
2460
2465
|
*/ var KnowledgeTask = "task_id";
|
|
2461
2466
|
/**
|
|
2462
2467
|
* Specify the data source to run
|
|
2463
|
-
*/ var
|
|
2464
|
-
var
|
|
2465
|
-
var
|
|
2468
|
+
*/ var KNOWLEDGE_SOURCES_NAME = "sources";
|
|
2469
|
+
var KNOWLEDGE_DOCUMENTS_NAME = "documents";
|
|
2470
|
+
var KNOWLEDGE_FOLDER_ID_NAME = "folder_id";
|
|
2466
2471
|
var KNOWLEDGE_STAGE_NAME = "stage";
|
|
2467
2472
|
|
|
2468
|
-
exports.
|
|
2469
|
-
(function(
|
|
2473
|
+
exports.DocumentSourceProviderCategoryEnum = void 0;
|
|
2474
|
+
(function(DocumentSourceProviderCategoryEnum) {
|
|
2470
2475
|
/**
|
|
2471
|
-
* Local files
|
|
2472
|
-
*/
|
|
2476
|
+
* Local files uploaded directly to the system
|
|
2477
|
+
*/ DocumentSourceProviderCategoryEnum["LocalFile"] = "local-file";
|
|
2478
|
+
/**
|
|
2479
|
+
* Remote file systems, e.g. S3, FTP, etc.
|
|
2480
|
+
*/ DocumentSourceProviderCategoryEnum["FileSystem"] = "file-system";
|
|
2473
2481
|
/**
|
|
2474
|
-
*
|
|
2475
|
-
*/
|
|
2482
|
+
* Online documents, e.g. public URLs, Google Docs, etc.
|
|
2483
|
+
*/ DocumentSourceProviderCategoryEnum["OnlineDocument"] = "online-document";
|
|
2476
2484
|
/**
|
|
2477
|
-
* Web
|
|
2478
|
-
*/
|
|
2485
|
+
* Web crawling from public websites
|
|
2486
|
+
*/ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
|
|
2487
|
+
/**
|
|
2488
|
+
* Database connections, e.g. MySQL, PostgreSQL, etc.
|
|
2489
|
+
* @deprecated Planning
|
|
2490
|
+
*/ DocumentSourceProviderCategoryEnum["Database"] = "database";
|
|
2491
|
+
})(exports.DocumentSourceProviderCategoryEnum || (exports.DocumentSourceProviderCategoryEnum = {}));
|
|
2492
|
+
function genPipelineSourceKey() {
|
|
2493
|
+
return letterStartSUID("Source_");
|
|
2494
|
+
}
|
|
2495
|
+
function genPipelineProcessorKey() {
|
|
2496
|
+
return letterStartSUID("Processor_");
|
|
2497
|
+
}
|
|
2498
|
+
function genPipelineChunkerKey() {
|
|
2499
|
+
return letterStartSUID("Chunker_");
|
|
2500
|
+
}
|
|
2501
|
+
function genPipelineUnderstandingKey() {
|
|
2502
|
+
return letterStartSUID("Understanding_");
|
|
2503
|
+
}
|
|
2504
|
+
function genPipelineKnowledgeBaseKey() {
|
|
2505
|
+
return letterStartSUID("KnowledgeBase_");
|
|
2506
|
+
}
|
|
2507
|
+
|
|
2508
|
+
function _define_property$2(obj, key, value) {
|
|
2509
|
+
if (key in obj) {
|
|
2510
|
+
Object.defineProperty(obj, key, {
|
|
2511
|
+
value: value,
|
|
2512
|
+
enumerable: true,
|
|
2513
|
+
configurable: true,
|
|
2514
|
+
writable: true
|
|
2515
|
+
});
|
|
2516
|
+
} else {
|
|
2517
|
+
obj[key] = value;
|
|
2518
|
+
}
|
|
2519
|
+
return obj;
|
|
2520
|
+
}
|
|
2521
|
+
function _object_spread$1(target) {
|
|
2522
|
+
for(var i = 1; i < arguments.length; i++){
|
|
2523
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
2524
|
+
var ownKeys = Object.keys(source);
|
|
2525
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
2526
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
2527
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
2528
|
+
}));
|
|
2529
|
+
}
|
|
2530
|
+
ownKeys.forEach(function(key) {
|
|
2531
|
+
_define_property$2(target, key, source[key]);
|
|
2532
|
+
});
|
|
2533
|
+
}
|
|
2534
|
+
return target;
|
|
2535
|
+
}
|
|
2536
|
+
exports.DocumentTypeEnum = void 0;
|
|
2537
|
+
(function(DocumentTypeEnum) {
|
|
2479
2538
|
/**
|
|
2480
2539
|
* Folder, parent of other documents
|
|
2481
|
-
*/
|
|
2482
|
-
|
|
2540
|
+
*/ DocumentTypeEnum["FOLDER"] = "folder";
|
|
2541
|
+
/**
|
|
2542
|
+
* Local files
|
|
2543
|
+
* @deprecated use DocumentSourceProviderCategoryEnum local file type instead
|
|
2544
|
+
*/ DocumentTypeEnum["FILE"] = "file";
|
|
2545
|
+
})(exports.DocumentTypeEnum || (exports.DocumentTypeEnum = {}));
|
|
2546
|
+
var KDocumentSourceType = _object_spread$1({}, exports.DocumentSourceProviderCategoryEnum, exports.DocumentTypeEnum);
|
|
2483
2547
|
exports.KBDocumentCategoryEnum = void 0;
|
|
2484
2548
|
(function(KBDocumentCategoryEnum) {
|
|
2485
2549
|
KBDocumentCategoryEnum["Text"] = "text";
|
|
@@ -2494,6 +2558,10 @@ exports.KBDocumentStatusEnum = void 0;
|
|
|
2494
2558
|
KBDocumentStatusEnum["WAITING"] = "waiting";
|
|
2495
2559
|
KBDocumentStatusEnum["VALIDATE"] = "validate";
|
|
2496
2560
|
KBDocumentStatusEnum["RUNNING"] = "running";
|
|
2561
|
+
KBDocumentStatusEnum["TRANSFORMED"] = "transformed";
|
|
2562
|
+
KBDocumentStatusEnum["SPLITTED"] = "splitted";
|
|
2563
|
+
KBDocumentStatusEnum["UNDERSTOOD"] = "understood";
|
|
2564
|
+
KBDocumentStatusEnum["EMBEDDING"] = "embedding";
|
|
2497
2565
|
KBDocumentStatusEnum["CANCEL"] = "cancel";
|
|
2498
2566
|
KBDocumentStatusEnum["FINISH"] = "finish";
|
|
2499
2567
|
KBDocumentStatusEnum["ERROR"] = "error";
|
|
@@ -2503,9 +2571,46 @@ function isDocumentSheet(type) {
|
|
|
2503
2571
|
"csv",
|
|
2504
2572
|
"xls",
|
|
2505
2573
|
"xlsx",
|
|
2506
|
-
"ods"
|
|
2574
|
+
"ods",
|
|
2575
|
+
"vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
2576
|
+
].includes(type);
|
|
2577
|
+
}
|
|
2578
|
+
function isImageType(type) {
|
|
2579
|
+
return [
|
|
2580
|
+
"jpg",
|
|
2581
|
+
"jpeg",
|
|
2582
|
+
"png",
|
|
2583
|
+
"gif",
|
|
2584
|
+
"bmp",
|
|
2585
|
+
"tiff",
|
|
2586
|
+
"svg",
|
|
2587
|
+
"webp"
|
|
2588
|
+
].includes(type);
|
|
2589
|
+
}
|
|
2590
|
+
function isVideoType(type) {
|
|
2591
|
+
return [
|
|
2592
|
+
"mp4",
|
|
2593
|
+
"avi",
|
|
2594
|
+
"mov",
|
|
2595
|
+
"wmv",
|
|
2596
|
+
"flv",
|
|
2597
|
+
"mkv",
|
|
2598
|
+
"webm"
|
|
2599
|
+
].includes(type);
|
|
2600
|
+
}
|
|
2601
|
+
function isAudioType(type) {
|
|
2602
|
+
return [
|
|
2603
|
+
"mp3",
|
|
2604
|
+
"wav",
|
|
2605
|
+
"aac",
|
|
2606
|
+
"flac",
|
|
2607
|
+
"ogg",
|
|
2608
|
+
"m4a"
|
|
2507
2609
|
].includes(type);
|
|
2508
2610
|
}
|
|
2611
|
+
function classificateDocumentCategory(entity) {
|
|
2612
|
+
return isDocumentSheet(entity.type) ? "sheet" : isImageType(entity.type) ? "image" : isVideoType(entity.type) ? "video" : isAudioType(entity.type) ? "audio" : "text";
|
|
2613
|
+
}
|
|
2509
2614
|
|
|
2510
2615
|
exports.AIPermissionsEnum = void 0;
|
|
2511
2616
|
(function(AIPermissionsEnum) {
|
|
@@ -3040,39 +3145,177 @@ exports.MCPServerType = void 0;
|
|
|
3040
3145
|
MCPServerType["CODE"] = "code";
|
|
3041
3146
|
})(exports.MCPServerType || (exports.MCPServerType = {}));
|
|
3042
3147
|
|
|
3043
|
-
|
|
3044
|
-
(
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
* Web crawling from public websites
|
|
3056
|
-
*/ DocumentSourceProviderCategoryEnum["WebCrawl"] = "web-crawl";
|
|
3057
|
-
/**
|
|
3058
|
-
* Database connections, e.g. MySQL, PostgreSQL, etc.
|
|
3059
|
-
* @deprecated Planning
|
|
3060
|
-
*/ DocumentSourceProviderCategoryEnum["Database"] = "database";
|
|
3061
|
-
})(exports.DocumentSourceProviderCategoryEnum || (exports.DocumentSourceProviderCategoryEnum = {}));
|
|
3062
|
-
function genPipelineSourceKey() {
|
|
3063
|
-
return letterStartSUID("Source_");
|
|
3148
|
+
function _define_property$1(obj, key, value) {
|
|
3149
|
+
if (key in obj) {
|
|
3150
|
+
Object.defineProperty(obj, key, {
|
|
3151
|
+
value: value,
|
|
3152
|
+
enumerable: true,
|
|
3153
|
+
configurable: true,
|
|
3154
|
+
writable: true
|
|
3155
|
+
});
|
|
3156
|
+
} else {
|
|
3157
|
+
obj[key] = value;
|
|
3158
|
+
}
|
|
3159
|
+
return obj;
|
|
3064
3160
|
}
|
|
3065
|
-
function
|
|
3066
|
-
|
|
3161
|
+
function _object_spread(target) {
|
|
3162
|
+
for(var i = 1; i < arguments.length; i++){
|
|
3163
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3164
|
+
var ownKeys = Object.keys(source);
|
|
3165
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
3166
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
3167
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
3168
|
+
}));
|
|
3169
|
+
}
|
|
3170
|
+
ownKeys.forEach(function(key) {
|
|
3171
|
+
_define_property$1(target, key, source[key]);
|
|
3172
|
+
});
|
|
3173
|
+
}
|
|
3174
|
+
return target;
|
|
3067
3175
|
}
|
|
3068
|
-
function
|
|
3069
|
-
|
|
3176
|
+
function ownKeys(object, enumerableOnly) {
|
|
3177
|
+
var keys = Object.keys(object);
|
|
3178
|
+
if (Object.getOwnPropertySymbols) {
|
|
3179
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3180
|
+
keys.push.apply(keys, symbols);
|
|
3181
|
+
}
|
|
3182
|
+
return keys;
|
|
3070
3183
|
}
|
|
3071
|
-
function
|
|
3072
|
-
|
|
3184
|
+
function _object_spread_props(target, source) {
|
|
3185
|
+
source = source != null ? source : {};
|
|
3186
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
3187
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3188
|
+
} else {
|
|
3189
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
3190
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3191
|
+
});
|
|
3192
|
+
}
|
|
3193
|
+
return target;
|
|
3073
3194
|
}
|
|
3074
|
-
|
|
3075
|
-
|
|
3195
|
+
/**
|
|
3196
|
+
* Build a hierarchical tree structure from a flat list of DocumentInterface objects,
|
|
3197
|
+
* and
|
|
3198
|
+
*
|
|
3199
|
+
* @template Metadata - Type of metadata, defaults to IDocChunkMetadata
|
|
3200
|
+
* @param documents - A flat array of DocumentInterface objects
|
|
3201
|
+
* @returns the hierarchical tree (root-level DocumentInterface[])
|
|
3202
|
+
*/ function buildChunkTree(documents) {
|
|
3203
|
+
if (!documents || documents.length === 0) return [];
|
|
3204
|
+
// Step 1. Build a lookup map for quick access by chunkId
|
|
3205
|
+
var map = new Map();
|
|
3206
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3207
|
+
try {
|
|
3208
|
+
for(var _iterator = documents[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3209
|
+
var doc = _step.value;
|
|
3210
|
+
var _doc_metadata;
|
|
3211
|
+
if ((_doc_metadata = doc.metadata) === null || _doc_metadata === void 0 ? void 0 : _doc_metadata.chunkId) {
|
|
3212
|
+
map.set(doc.metadata.chunkId, _object_spread_props(_object_spread({}, doc), {
|
|
3213
|
+
metadata: _object_spread_props(_object_spread({}, doc.metadata), {
|
|
3214
|
+
children: []
|
|
3215
|
+
})
|
|
3216
|
+
}));
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
} catch (err) {
|
|
3220
|
+
_didIteratorError = true;
|
|
3221
|
+
_iteratorError = err;
|
|
3222
|
+
} finally{
|
|
3223
|
+
try {
|
|
3224
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3225
|
+
_iterator.return();
|
|
3226
|
+
}
|
|
3227
|
+
} finally{
|
|
3228
|
+
if (_didIteratorError) {
|
|
3229
|
+
throw _iteratorError;
|
|
3230
|
+
}
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
// Step 2. Organize nodes into tree
|
|
3234
|
+
var roots = [];
|
|
3235
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
3236
|
+
try {
|
|
3237
|
+
for(var _iterator1 = map.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
3238
|
+
var doc1 = _step1.value;
|
|
3239
|
+
var parentId = doc1.metadata.parentId;
|
|
3240
|
+
if (parentId && map.has(parentId)) {
|
|
3241
|
+
var parent = map.get(parentId);
|
|
3242
|
+
parent.metadata.children = parent.metadata.children || [];
|
|
3243
|
+
parent.metadata.children.push(doc1);
|
|
3244
|
+
} else {
|
|
3245
|
+
roots.push(doc1);
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
} catch (err) {
|
|
3249
|
+
_didIteratorError1 = true;
|
|
3250
|
+
_iteratorError1 = err;
|
|
3251
|
+
} finally{
|
|
3252
|
+
try {
|
|
3253
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
3254
|
+
_iterator1.return();
|
|
3255
|
+
}
|
|
3256
|
+
} finally{
|
|
3257
|
+
if (_didIteratorError1) {
|
|
3258
|
+
throw _iteratorError1;
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
return roots;
|
|
3263
|
+
}
|
|
3264
|
+
/**
|
|
3265
|
+
* Find all leaf nodes (nodes without children).
|
|
3266
|
+
*
|
|
3267
|
+
* @param roots
|
|
3268
|
+
* @returns
|
|
3269
|
+
*/ function collectTreeLeaves(roots) {
|
|
3270
|
+
var leaves = [];
|
|
3271
|
+
var collectLeaves = function(node) {
|
|
3272
|
+
var children = node.metadata.children;
|
|
3273
|
+
if (!children || children.length === 0) {
|
|
3274
|
+
leaves.push(node);
|
|
3275
|
+
} else {
|
|
3276
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3277
|
+
try {
|
|
3278
|
+
for(var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3279
|
+
var child = _step.value;
|
|
3280
|
+
collectLeaves(child);
|
|
3281
|
+
}
|
|
3282
|
+
} catch (err) {
|
|
3283
|
+
_didIteratorError = true;
|
|
3284
|
+
_iteratorError = err;
|
|
3285
|
+
} finally{
|
|
3286
|
+
try {
|
|
3287
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3288
|
+
_iterator.return();
|
|
3289
|
+
}
|
|
3290
|
+
} finally{
|
|
3291
|
+
if (_didIteratorError) {
|
|
3292
|
+
throw _iteratorError;
|
|
3293
|
+
}
|
|
3294
|
+
}
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
};
|
|
3298
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
3299
|
+
try {
|
|
3300
|
+
for(var _iterator = roots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
3301
|
+
var root = _step.value;
|
|
3302
|
+
collectLeaves(root);
|
|
3303
|
+
}
|
|
3304
|
+
} catch (err) {
|
|
3305
|
+
_didIteratorError = true;
|
|
3306
|
+
_iteratorError = err;
|
|
3307
|
+
} finally{
|
|
3308
|
+
try {
|
|
3309
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
3310
|
+
_iterator.return();
|
|
3311
|
+
}
|
|
3312
|
+
} finally{
|
|
3313
|
+
if (_didIteratorError) {
|
|
3314
|
+
throw _iteratorError;
|
|
3315
|
+
}
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
return leaves;
|
|
3076
3319
|
}
|
|
3077
3320
|
|
|
3078
3321
|
exports.PermissionsEnum = void 0;
|
|
@@ -3471,21 +3714,6 @@ var IntegrationLarkProvider = {
|
|
|
3471
3714
|
}
|
|
3472
3715
|
};
|
|
3473
3716
|
|
|
3474
|
-
var IntegrationWeComProvider = {
|
|
3475
|
-
name: exports.IntegrationEnum.WECOM,
|
|
3476
|
-
label: {
|
|
3477
|
-
en_US: "WeCom",
|
|
3478
|
-
zh_Hans: "企业微信"
|
|
3479
|
-
},
|
|
3480
|
-
avatar: "wecom.webp",
|
|
3481
|
-
webhook: true,
|
|
3482
|
-
schema: {
|
|
3483
|
-
type: "object",
|
|
3484
|
-
properties: {}
|
|
3485
|
-
},
|
|
3486
|
-
pro: true
|
|
3487
|
-
};
|
|
3488
|
-
|
|
3489
3717
|
function _define_property(obj, key, value) {
|
|
3490
3718
|
if (key in obj) {
|
|
3491
3719
|
Object.defineProperty(obj, key, {
|
|
@@ -3500,7 +3728,8 @@ function _define_property(obj, key, value) {
|
|
|
3500
3728
|
return obj;
|
|
3501
3729
|
}
|
|
3502
3730
|
var _obj;
|
|
3503
|
-
var INTEGRATION_PROVIDERS = (_obj = {},
|
|
3731
|
+
var INTEGRATION_PROVIDERS = (_obj = {}, // [IntegrationEnum.LARK]: IntegrationLarkProvider,
|
|
3732
|
+
_define_property(_obj, exports.IntegrationEnum.DINGTALK, IntegrationDingTalkProvider), // [IntegrationEnum.WECOM]: IntegrationWeComProvider,
|
|
3504
3733
|
_define_property(_obj, exports.IntegrationEnum.GITHUB, IntegrationGitHubProvider), _obj);
|
|
3505
3734
|
|
|
3506
3735
|
exports.AiModelTypeEnum = void 0;
|
|
@@ -3918,11 +4147,12 @@ exports.IntegrationGitHubProvider = IntegrationGitHubProvider;
|
|
|
3918
4147
|
exports.IntegrationLarkProvider = IntegrationLarkProvider;
|
|
3919
4148
|
exports.IteratingIndexParameterName = IteratingIndexParameterName;
|
|
3920
4149
|
exports.IteratingItemParameterName = IteratingItemParameterName;
|
|
4150
|
+
exports.KDocumentSourceType = KDocumentSourceType;
|
|
3921
4151
|
exports.KDocumentWebTypeOptions = KDocumentWebTypeOptions;
|
|
4152
|
+
exports.KNOWLEDGE_DOCUMENTS_NAME = KNOWLEDGE_DOCUMENTS_NAME;
|
|
4153
|
+
exports.KNOWLEDGE_FOLDER_ID_NAME = KNOWLEDGE_FOLDER_ID_NAME;
|
|
4154
|
+
exports.KNOWLEDGE_SOURCES_NAME = KNOWLEDGE_SOURCES_NAME;
|
|
3922
4155
|
exports.KNOWLEDGE_STAGE_NAME = KNOWLEDGE_STAGE_NAME;
|
|
3923
|
-
exports.KnowledgeDocuments = KnowledgeDocuments;
|
|
3924
|
-
exports.KnowledgeFolderId = KnowledgeFolderId;
|
|
3925
|
-
exports.KnowledgeSources = KnowledgeSources;
|
|
3926
4156
|
exports.KnowledgeTask = KnowledgeTask;
|
|
3927
4157
|
exports.KnowledgebaseChannel = KnowledgebaseChannel;
|
|
3928
4158
|
exports.LanguagesMap = LanguagesMap;
|
|
@@ -3947,7 +4177,10 @@ exports.VariableOperations = VariableOperations;
|
|
|
3947
4177
|
exports.agentLabel = agentLabel;
|
|
3948
4178
|
exports.agentUniqueName = agentUniqueName;
|
|
3949
4179
|
exports.allChannels = allChannels;
|
|
4180
|
+
exports.buildChunkTree = buildChunkTree;
|
|
3950
4181
|
exports.channelName = channelName;
|
|
4182
|
+
exports.classificateDocumentCategory = classificateDocumentCategory;
|
|
4183
|
+
exports.collectTreeLeaves = collectTreeLeaves;
|
|
3951
4184
|
exports.configurableStoreNamespace = configurableStoreNamespace;
|
|
3952
4185
|
exports.convertToUrlPath = convertToUrlPath;
|
|
3953
4186
|
exports.createAgentConnections = createAgentConnections;
|
|
@@ -3964,6 +4197,7 @@ exports.genPipelineProcessorKey = genPipelineProcessorKey;
|
|
|
3964
4197
|
exports.genPipelineSourceKey = genPipelineSourceKey;
|
|
3965
4198
|
exports.genPipelineUnderstandingKey = genPipelineUnderstandingKey;
|
|
3966
4199
|
exports.genVariableAggregatorKey = genVariableAggregatorKey;
|
|
4200
|
+
exports.genXpertTriggerKey = genXpertTriggerKey;
|
|
3967
4201
|
exports.generateCronExpression = generateCronExpression;
|
|
3968
4202
|
exports.getAgentVarGroup = getAgentVarGroup;
|
|
3969
4203
|
exports.getCurrentGraph = getCurrentGraph;
|
|
@@ -3977,12 +4211,15 @@ exports.getVariableSchema = getVariableSchema;
|
|
|
3977
4211
|
exports.getWorkflowTriggers = getWorkflowTriggers;
|
|
3978
4212
|
exports.getWorkspaceFromRunnable = getWorkspaceFromRunnable;
|
|
3979
4213
|
exports.isAgentKey = isAgentKey;
|
|
4214
|
+
exports.isAudioType = isAudioType;
|
|
3980
4215
|
exports.isDocumentSheet = isDocumentSheet;
|
|
3981
4216
|
exports.isEnableTool = isEnableTool;
|
|
4217
|
+
exports.isImageType = isImageType;
|
|
3982
4218
|
exports.isIteratingKey = isIteratingKey;
|
|
3983
4219
|
exports.isMessageGroup = isMessageGroup;
|
|
3984
4220
|
exports.isRouterKey = isRouterKey;
|
|
3985
4221
|
exports.isToolEnabled = isToolEnabled;
|
|
4222
|
+
exports.isVideoType = isVideoType;
|
|
3986
4223
|
exports.isWorkflowKey = isWorkflowKey;
|
|
3987
4224
|
exports.letterStartSUID = letterStartSUID;
|
|
3988
4225
|
exports.locateNodes = locateNodes;
|