@xuda.io/runtime-bundle 1.0.1274 → 1.0.1276
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
const new_node_id=(type,app_id)=>{const abbreviate=word=>{if(word.length<=3){return word}let abbreviation=word[0];const vowels="aeiou";for(let i=1;i<word.length&&abbreviation.length<3;i++){if(!vowels.includes(word[i].toLowerCase())){abbreviation+=word[i]}}if(abbreviation.length<3){abbreviation=word.substring(0,3)}return abbreviation};var last12uuid=crypto.randomUUID().split("-")[4];if(type){var menuAbbreviated=abbreviate(type.replaceAll("_",""));return`${app_id.substr(app_id.length-3)}_${menuAbbreviated}_${last12uuid}`}return app_id.substr(app_id.length-3)+"_"+last12uuid};export const createDoc=function({_id,uid,menuType,checkedInUserName,app_id,parentId,properties,studio_meta={},minimal=false}={}){if(!_id){_id=new_node_id(menuType,app_id)}var doc={_id:_id,stat:3,docType:"studio",docDate:Date.now(),ts:Date.now(),order_ts:Date.now(),studio_meta:{...{created:Date.now(),createdByUid:uid,checkedInUserId:uid,checkedInUserName:checkedInUserName,parentId:parentId||menuType==="globals"?"globals":menuType==="table"?"database":menuType==="route"?"routes":"programs"},...studio_meta},properties:properties||{}};if(minimal)return doc;if(menuType){switch(menuType){case"table":if(!doc.tableIndexes)doc.tableIndexes=[];if(!doc.tableFields)doc.tableFields=[];break;case"alert":if(!doc.alertData)doc.alertData={};break;case"javascript":if(!doc.scriptData)doc.scriptData={};break;case"folder":break;case"route":if(!doc.routeMenu)doc.routeMenu={};break;case"api":if(!doc.scriptData)doc.scriptData={};case"component":if(!doc.progUi)doc.progUi=[{id:"root",type:"element",tagName:doc?.properties?.renderType!=="form"?"xu-multi-view":"xu-single-view",attributes:{},children:[]}];default:if(!doc.progDataSource)doc.progDataSource={dataSourceType:""};if(!doc.progFields)doc.progFields=[];if(!doc.progEvents)doc.progEvents=[];break}}return doc};export const valid_menuType=["globals","table","get_data","set_data","batch","alert","javascript","folder","route","api","component"];
|
|
1
|
+
const new_node_id=(type,app_id)=>{const abbreviate=word=>{if(word.length<=3){return word}let abbreviation=word[0];const vowels="aeiou";for(let i=1;i<word.length&&abbreviation.length<3;i++){if(!vowels.includes(word[i].toLowerCase())){abbreviation+=word[i]}}if(abbreviation.length<3){abbreviation=word.substring(0,3)}return abbreviation};var last12uuid=crypto.randomUUID().split("-")[4];if(type){var menuAbbreviated=abbreviate(type.replaceAll("_",""));return`${app_id.substr(app_id.length-3)}_${menuAbbreviated}_${last12uuid}`}return app_id.substr(app_id.length-3)+"_"+last12uuid};export const createDoc=function({_id,uid,menuType,checkedInUserName,app_id,parentId,properties,studio_meta={},minimal=false}={}){if(!_id){_id=new_node_id(properties.menuType,app_id)}var doc={_id:_id,stat:3,app_id:app_id,docType:"studio",docDate:Date.now(),ts:Date.now(),order_ts:Date.now(),studio_meta:{...{created:Date.now(),createdByUid:uid,checkedInUserId:uid,checkedInUserName:checkedInUserName,parentId:parentId||properties.menuType==="globals"?"globals":properties.menuType==="table"?"database":properties.menuType==="route"?"routes":"programs"},...studio_meta},properties:properties||{}};if(minimal)return doc;if(properties.menuType){switch(properties.menuType){case"table":if(!doc.tableIndexes)doc.tableIndexes=[];if(!doc.tableFields)doc.tableFields=[];break;case"alert":if(!doc.alertData)doc.alertData={};break;case"javascript":if(!doc.scriptData)doc.scriptData={};break;case"ai_agent":if(!doc.agentConfig)doc.agentConfig={};break;case"folder":break;case"route":if(!doc.routeMenu)doc.routeMenu={};break;case"api":if(!doc.scriptData)doc.scriptData={};case"component":if(!doc.progUi)doc.progUi=[{id:"root",type:"element",tagName:doc?.properties?.renderType!=="form"?"xu-multi-view":"xu-single-view",attributes:{},children:[]}];default:if(!doc.progDataSource)doc.progDataSource={dataSourceType:""};if(!doc.progFields)doc.progFields=[];if(!doc.progEvents)doc.progEvents=[];break}}return doc};export const valid_menuType=["globals","table","get_data","set_data","batch","alert","javascript","folder","route","api","component","ai_agent"];
|
|
@@ -34,12 +34,13 @@ const new_node_id = (type, app_id) => {
|
|
|
34
34
|
|
|
35
35
|
export const createDoc = function ({ _id, uid, menuType, checkedInUserName, app_id, parentId, properties, studio_meta = {}, minimal = false } = {}) {
|
|
36
36
|
if (!_id) {
|
|
37
|
-
_id = new_node_id(menuType, app_id);
|
|
37
|
+
_id = new_node_id(properties.menuType, app_id);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
var doc = {
|
|
41
41
|
_id,
|
|
42
42
|
stat: 3,
|
|
43
|
+
app_id,
|
|
43
44
|
docType: 'studio',
|
|
44
45
|
docDate: Date.now(),
|
|
45
46
|
ts: Date.now(),
|
|
@@ -50,7 +51,7 @@ export const createDoc = function ({ _id, uid, menuType, checkedInUserName, app_
|
|
|
50
51
|
createdByUid: uid,
|
|
51
52
|
checkedInUserId: uid,
|
|
52
53
|
checkedInUserName,
|
|
53
|
-
parentId: parentId || menuType === 'globals' ? 'globals' : menuType === 'table' ? 'database' : menuType === 'route' ? 'routes' : 'programs',
|
|
54
|
+
parentId: parentId || properties.menuType === 'globals' ? 'globals' : properties.menuType === 'table' ? 'database' : properties.menuType === 'route' ? 'routes' : 'programs',
|
|
54
55
|
},
|
|
55
56
|
...studio_meta,
|
|
56
57
|
},
|
|
@@ -59,8 +60,8 @@ export const createDoc = function ({ _id, uid, menuType, checkedInUserName, app_
|
|
|
59
60
|
|
|
60
61
|
if (minimal) return doc;
|
|
61
62
|
|
|
62
|
-
if (menuType) {
|
|
63
|
-
switch (menuType) {
|
|
63
|
+
if (properties.menuType) {
|
|
64
|
+
switch (properties.menuType) {
|
|
64
65
|
case 'table':
|
|
65
66
|
if (!doc.tableIndexes) doc.tableIndexes = [];
|
|
66
67
|
if (!doc.tableFields) doc.tableFields = [];
|
|
@@ -74,6 +75,10 @@ export const createDoc = function ({ _id, uid, menuType, checkedInUserName, app_
|
|
|
74
75
|
if (!doc.scriptData) doc.scriptData = {};
|
|
75
76
|
break;
|
|
76
77
|
|
|
78
|
+
case 'ai_agent':
|
|
79
|
+
if (!doc.agentConfig) doc.agentConfig = {};
|
|
80
|
+
break;
|
|
81
|
+
|
|
77
82
|
case 'folder':
|
|
78
83
|
break;
|
|
79
84
|
|
|
@@ -102,4 +107,4 @@ export const createDoc = function ({ _id, uid, menuType, checkedInUserName, app_
|
|
|
102
107
|
return doc;
|
|
103
108
|
};
|
|
104
109
|
|
|
105
|
-
export const valid_menuType = ['globals', 'table', 'get_data', 'set_data', 'batch', 'alert', 'javascript', 'folder', 'route', 'api', 'component'];
|
|
110
|
+
export const valid_menuType = ['globals', 'table', 'get_data', 'set_data', 'batch', 'alert', 'javascript', 'folder', 'route', 'api', 'component', 'ai_agent'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xuda.io/runtime-bundle",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1276",
|
|
4
4
|
"description": "The Xuda Runtime Bundle refers to a collection of scripts and libraries packaged together to provide the necessary runtime environment for executing plugins or components in the Xuda platform. ",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"pub": "npm version patch --force && npm publish --access public"
|