@xuda.io/runtime-bundle 1.0.1216 → 1.0.1217
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/js/modules/xuda-project-loader-module.esm.js +3 -2
- package/js/modules/xuda-project-loader-module.esm.min.js +1 -1
- package/js/modules/xuda-studio-checker.min.mjs +2 -2
- package/js/modules/xuda-studio-checker.mjs +142 -22
- package/js/xuda-runtime-bundle.js +3 -0
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-mini-bundle.js +3 -0
- package/js/xuda-runtime-mini-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +3 -0
- package/js/xuda-runtime-slim.min.es.js +3 -0
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +3 -0
- package/js/xuda-worker-bundle.js +3 -0
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -235,6 +235,19 @@ export const check_structure = function (doc) {
|
|
|
235
235
|
return ret;
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
if (z) {
|
|
239
|
+
const schema = get_zod_schema(doc.properties.menuType);
|
|
240
|
+
const result = schema.safeParse(doc);
|
|
241
|
+
if (!result.success) {
|
|
242
|
+
result.error.errors.forEach((error) => {
|
|
243
|
+
const msg = `${error.message}: ${error.path}(${error.expected})`;
|
|
244
|
+
addValidationError('CHK_MSG_OBJ_GEN_000', msg);
|
|
245
|
+
});
|
|
246
|
+
critical_error = true;
|
|
247
|
+
return ret;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
238
251
|
// Continue validation even with errors
|
|
239
252
|
if (!doc._id) {
|
|
240
253
|
addValidationError('CHK_MSG_OBJ_GEN_050', 'missing _id value');
|
|
@@ -3733,7 +3746,57 @@ export const get_zod_schema = function (type) {
|
|
|
3733
3746
|
|
|
3734
3747
|
let XudaComponentSchema = z.object(main_obj);
|
|
3735
3748
|
|
|
3749
|
+
main_obj.properties = properties;
|
|
3750
|
+
|
|
3736
3751
|
switch (type) {
|
|
3752
|
+
case `globals`:
|
|
3753
|
+
XudaComponentSchema.describe(
|
|
3754
|
+
`The globals object in the Xuda platform defines a universal logic layer shared across all programs, components, and workflows. It provides a centralized and consistent structure for declaring global fields, utility functions, and event-driven logic, ensuring logic reusability and reducing redundancy across the application.`,
|
|
3755
|
+
);
|
|
3756
|
+
main_obj.progFields = progFields;
|
|
3757
|
+
main_obj.progEvents = progEvents;
|
|
3758
|
+
break;
|
|
3759
|
+
|
|
3760
|
+
case `table`:
|
|
3761
|
+
XudaComponentSchema.describe(
|
|
3762
|
+
`The Table Object represents a data entity and serves as the structural definition for interacting with external databases. It supports integration via pluggable connectors, allowing seamless connection to various database engines such as MySQL, CouchDB, and others (see available database plugins for the full list).`,
|
|
3763
|
+
);
|
|
3764
|
+
properties_obj.databaseSocket = z.string().default('@xuda.io/xuda-dbs-plugin-xuda').describe('Database driver to use for the table');
|
|
3765
|
+
|
|
3766
|
+
const XudaFieldType = z.enum(['string', 'number', 'boolean', 'array', 'object', 'date']).describe('Data type for table fields');
|
|
3767
|
+
const IndexDataSchema = z.object({
|
|
3768
|
+
name: z.string().describe('Name of the index'),
|
|
3769
|
+
unique: z.boolean().describe('If true, ensures no duplicates for indexed fields'),
|
|
3770
|
+
keys: z.array(z.string()).describe('List of field names used in this index'),
|
|
3771
|
+
});
|
|
3772
|
+
|
|
3773
|
+
const TableIndexSchema = z.object({
|
|
3774
|
+
id: z.string().describe('Unique identifier for the index'),
|
|
3775
|
+
data: IndexDataSchema.describe('Contains keys, uniqueness setting, and index name'),
|
|
3776
|
+
});
|
|
3777
|
+
|
|
3778
|
+
const FieldPropsSchema = z.object({
|
|
3779
|
+
fieldType: XudaFieldType.describe('Data type: "string", "number", "boolean", "array", "object", or "date"'),
|
|
3780
|
+
});
|
|
3781
|
+
const FieldDataSchema = z.object({
|
|
3782
|
+
field_id: z.string().describe('Field identifier used in logic or database operations'),
|
|
3783
|
+
});
|
|
3784
|
+
const TableFieldSchema = z.object({
|
|
3785
|
+
id: z.string().describe('Unique ID of the field object'),
|
|
3786
|
+
data: FieldDataSchema.describe('Contains the logical field ID'),
|
|
3787
|
+
props: FieldPropsSchema.describe('Properties of the field including data type'),
|
|
3788
|
+
});
|
|
3789
|
+
main_obj.tableIndexes = z.array(TableIndexSchema).describe('Defines indexing rules for efficient lookups and uniqueness constraints');
|
|
3790
|
+
main_obj.tableFields = z.array(TableFieldSchema).describe('Defines each field used in the table and its data type');
|
|
3791
|
+
break;
|
|
3792
|
+
|
|
3793
|
+
case `folder`:
|
|
3794
|
+
XudaComponentSchema.describe(
|
|
3795
|
+
`The Folder is a non-executable, project-level container represented as a structured JSON object. It is used to define a hierarchical structure for organizing application assets within the Xuda environment. Although it does not execute any logic at runtime, the folder object plays an essential role in shaping the overall architecture of a project by logically grouping related objects such as components, APIs, tables, datasets, and other program entities.`,
|
|
3796
|
+
);
|
|
3797
|
+
|
|
3798
|
+
break;
|
|
3799
|
+
|
|
3737
3800
|
case `component`:
|
|
3738
3801
|
XudaComponentSchema.describe(
|
|
3739
3802
|
`The component object in the Xuda platform defines a modular, self-contained program unit that encapsulates both front-end presentation and back-end logic. It serves as a reusable UI component that supports a full execution lifecycle, making it ideal for constructing low-code applications that are maintainable, scalable, and highly interactive. A component is engineered to allow seamless integration of logic, data, and rendering, enabling developers to build sophisticated interactive views without redundant code. Each component instance supports input/output parameters, can communicate with other components or programs, and can be dynamically rendered as a page, modal, or embedded panel.`,
|
|
@@ -3745,7 +3808,7 @@ export const get_zod_schema = function (type) {
|
|
|
3745
3808
|
properties_obj.menuTitle = z.string().optional().describe(`Display title for Studio UI or routing usage`);
|
|
3746
3809
|
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3747
3810
|
|
|
3748
|
-
main_obj.properties = properties;
|
|
3811
|
+
// main_obj.properties = properties;
|
|
3749
3812
|
main_obj.progDataSource = progDataSource;
|
|
3750
3813
|
main_obj.progFields = progFields;
|
|
3751
3814
|
main_obj.progEvents = progEvents;
|
|
@@ -3753,30 +3816,87 @@ export const get_zod_schema = function (type) {
|
|
|
3753
3816
|
|
|
3754
3817
|
break;
|
|
3755
3818
|
|
|
3756
|
-
|
|
3819
|
+
case `get_data`:
|
|
3820
|
+
XudaComponentSchema.describe(
|
|
3821
|
+
`The Get Data Object defines a lightweight, read-only program unit designed to retrieve data from a structured source such as a table, array, or remote dataset. It is used to extract specific values, perform indexed lookups, and support transformations through reduce or conditional logic. This object is typically used when a logic program requires only data retrieval without the need to iterate or mutate records. It supports output parameter mapping and can be embedded into workflows and alerts for dynamic value extraction.`,
|
|
3822
|
+
);
|
|
3823
|
+
properties_obj.frameworkProperties = z.object({}).optional().describe(`Framework-specific rendering extensions and configuration`);
|
|
3824
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3825
|
+
// main_obj.properties = properties;
|
|
3826
|
+
main_obj.progDataSource = progDataSource;
|
|
3827
|
+
main_obj.progFields = progFields;
|
|
3828
|
+
main_obj.progEvents = progEvents;
|
|
3757
3829
|
break;
|
|
3758
|
-
}
|
|
3759
3830
|
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
data: XudaComponentSchema.parse(data),
|
|
3766
|
-
errors: null,
|
|
3767
|
-
};
|
|
3768
|
-
} catch (error) {
|
|
3769
|
-
return {
|
|
3770
|
-
success: false,
|
|
3771
|
-
data: null,
|
|
3772
|
-
errors: error.errors,
|
|
3773
|
-
};
|
|
3774
|
-
}
|
|
3775
|
-
};
|
|
3831
|
+
case `set_data`:
|
|
3832
|
+
XudaComponentSchema.describe(
|
|
3833
|
+
`The set_data object defines a program-level functional unit responsible for writing data to a specified table. It can be invoked from any program and is designed to handle create, update, and delete operations in a structured and reusable way. The object includes properties to determine the type of operation being performed and supports an optional flag to create a new record if one does not already exist. In addition to its core structure, the set_data object includes a parameter interface property that defines input and output parameters. This allows values to be passed into the function and returned to the calling context, enabling flexible, context-aware data handling.`,
|
|
3834
|
+
);
|
|
3835
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3776
3836
|
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3837
|
+
properties_obj.crudMode = z.enum(['C', 'U', 'D']).describe('Operation mode: C = Create, U = Update, D = Delete');
|
|
3838
|
+
properties_obj.crudMode = z.boolean().describe('If true, allows record creation if not found');
|
|
3839
|
+
|
|
3840
|
+
main_obj.progDataSource = progDataSource;
|
|
3841
|
+
main_obj.progFields = progFields;
|
|
3842
|
+
main_obj.progEvents = progEvents;
|
|
3843
|
+
break;
|
|
3844
|
+
|
|
3845
|
+
case `batch`:
|
|
3846
|
+
XudaComponentSchema.describe(
|
|
3847
|
+
`The Batch Object defines a program-level execution unit tailored for iterative, record-by-record operations across datasets. It enables controlled loops over structured data sources or arrays, making it a foundational element for multi-record processing, automation flows, and background job orchestration. The batch object can be invoked from within any Xuda logic program and serves as a reusable execution block for bulk workflows, such as saving multiple records, transforming arrays, or triggering chained program logic. It accepts dynamic input and output parameters, which allow context-aware execution and return values that can be consumed downstream.The batch unit also includes lifecycle hooks and event workflow, enabling custom logic at specific points within the loop (e.g., before/after each record or on error conditions). This supports advanced control, transformation, and external interactions during iterative processing.`,
|
|
3848
|
+
);
|
|
3849
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3850
|
+
main_obj.progDataSource = progDataSource;
|
|
3851
|
+
main_obj.progFields = progFields;
|
|
3852
|
+
main_obj.progEvents = progEvents;
|
|
3853
|
+
break;
|
|
3854
|
+
|
|
3855
|
+
case `api`:
|
|
3856
|
+
XudaComponentSchema.describe(
|
|
3857
|
+
`The API Program-Level Logic Unit is a program-level logic unit represented as a structured JSON object that exposes backend functionality through internal or external interfaces. It can be invoked internally via the call_project_api method or externally through the api/mcp endpoint, enabling controlled access to application-level logic and data services. Acting as an orchestration layer, the API unit enables coordination of multiple subordinate logic units such as get_data, set_data, and batch, allowing compound workflows, transactional operations, and conditional executions to be encapsulated within a single, callable endpoint. This design abstracts complexity and promotes composability of business logic across the application. The API unit includes an interface definition for parameter binding, specifying dynamic input and output mappings. This supports stateless, context-aware executions where external values can be passed into the API call, and structured results returned to the calling layer. Response format configuration is also supported, with output types including json, text, html, and others—allowing precise control over the serialization and consumption of API responses.`,
|
|
3858
|
+
);
|
|
3859
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3860
|
+
const ApiOutputFormat = z.enum(['json', 'html', 'text', 'xml', 'csv', 'pdf']).describe('Format of the API response: json, html, text, xml, csv, pdf, etc.');
|
|
3861
|
+
properties_obj.apiOutput = ApiOutputFormat.describe('Format of the API response: json, html, text, etc.');
|
|
3862
|
+
|
|
3863
|
+
main_obj.progDataSource = progDataSource;
|
|
3864
|
+
main_obj.progFields = progFields;
|
|
3865
|
+
main_obj.progEvents = progEvents;
|
|
3866
|
+
main_obj.scriptData = z.object({
|
|
3867
|
+
value: z.string().describe('The return payload template as a stringified object. Placeholder bindings (e.g., @CS_Id) are replaced at runtime'),
|
|
3868
|
+
});
|
|
3869
|
+
|
|
3870
|
+
break;
|
|
3871
|
+
|
|
3872
|
+
case `alert`:
|
|
3873
|
+
XudaComponentSchema.describe(
|
|
3874
|
+
`The Alert Object is a program-level UI unit in the Xuda platform used to deliver contextual messages and notifications to users or developers at runtime. These alerts can be triggered from within logic flows and offer various display formats (such as toast, modal, browser alert, or console message) based on the use case. The alert object is defined using a structured JSON format and can be embedded in broader program logic. It supports both static and dynamic content, and can optionally create log entries to support audit trails and debugging workflows.`,
|
|
3875
|
+
);
|
|
3876
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3877
|
+
main_obj.alertData = z.object({
|
|
3878
|
+
alertDisplay: AlertDisplay.describe('Mode of display: "toast", "modal", "browser", or "console"'),
|
|
3879
|
+
alertType: AlertType.describe('Type of message: "warning", "error", "info", or "success"'),
|
|
3880
|
+
alertTitle: z.string().describe('Main content of the alert shown to the user'),
|
|
3881
|
+
alertTitleFx: z.string().optional().describe('Optional dynamic override (e.g., @msg_v) for alert content'),
|
|
3882
|
+
createLog: z.boolean().describe('Whether to generate a system log entry associated with the alert'),
|
|
3883
|
+
});
|
|
3884
|
+
break;
|
|
3885
|
+
|
|
3886
|
+
case `javascript`:
|
|
3887
|
+
XudaComponentSchema.describe(
|
|
3888
|
+
`The javascript object is a functional unit designed to execute JavaScript code within the application context. It can be called from any program using methods such as call_native_javascript, call_evaluate_javascript, execute_native_javascript, or execute_evaluate_javascript. This object includes the following key property: Script – Contains the JavaScript code to be executed, along with any declared dependencies required for execution. The javascript object is ideal for performing advanced logic, custom client-side behavior, or dynamic scripting that extends the capabilities of low-code flows. Xuda also exposes a set of built-in API methods that can be easily called from JavaScript units. These include actions like reading from or writing to Drive, interacting with the Studio API, or performing database operations such as create, update, and delete. These ready-to-use APIs simplify common tasks and allow you to focus on building functionality instead of writing boilerplate code. By centralizing script execution in a modular and reusable way, the JavaScript unit enhances flexibility, promotes clean architecture, and empowers developers to go beyond standard configuration with native scripting power.`,
|
|
3889
|
+
);
|
|
3890
|
+
properties_obj.progParams = z.array(ProgParamSchema).optional().describe(`Array of input/output parameter definitions for ${type} interface`);
|
|
3891
|
+
main_obj.scriptData = z.object({
|
|
3892
|
+
value: z.string().describe('JavaScript code to be executed'),
|
|
3893
|
+
dependencies: z.record(z.string()).optional().describe('Optional. Key-value map of external packages required'),
|
|
3894
|
+
});
|
|
3895
|
+
break;
|
|
3896
|
+
|
|
3897
|
+
default:
|
|
3898
|
+
break;
|
|
3899
|
+
}
|
|
3780
3900
|
|
|
3781
3901
|
return XudaComponentSchema;
|
|
3782
3902
|
};
|
|
@@ -26808,6 +26808,9 @@ func.utils.remove_cached_objects = async function (SESSION_ID) {
|
|
|
26808
26808
|
{
|
|
26809
26809
|
docType: 'cache_app',
|
|
26810
26810
|
},
|
|
26811
|
+
{
|
|
26812
|
+
docType: 'cache_build_info',
|
|
26813
|
+
},
|
|
26811
26814
|
],
|
|
26812
26815
|
};
|
|
26813
26816
|
|