automl-util
v0.0.41-feat.3
Published
* 基于 typescript 的常用函数库。 * Flowengine组件开发SDK。
Downloads
3
Readme
FlowEngine工具库
- 基于 typescript 的常用函数库。
- Flowengine组件开发SDK。
安装
npm set registry http://npm.4paradigm.com
npm i automl-util --save
使用FlowEngineSDK
1、组件配置态本地开发说明
基本说明
SDK方法执行依赖运行时URL携带参数,本地开发时需在URL携带必要参数。
例如:localhost:8080/?type=running&templateId=1&workspaceId=1&componentId=113&engineKey=bug-verify-1&rootPath=/automl-engine/93/automl/v1
| 属性 | 说明 | 示例值 | | ------------- | ------------------------------------------ | --------------------------- | | type | 组件配置态运行环境 (FlowEngine、Developer) | running/editing | | templateId | 模板ID | 1 | | componentId | 组件ID | 1 | | workspaceId | 工作区ID | 1 | | rootPath | API地址 | /automl-engine/93/automl/v1 |
获取组件数据
import { FlowEngineSDK } from 'automl-util';
const component = await FlowEngineSDK.Component();
const data = component.get();
console.log(data)
// data => 获取组件配置信息(组件yaml中的solution)
保存组件数据
import { FlowEngineSDK } from 'automl-util';
const component = await FlowEngineSDK.Component();
const resp = await component.save({}) =>
// 保存组件配置信息(组件yaml中的solution)参数传入Object对象(非字符串)
2、组件运行态本地开发说明
基本说明
SDK方法执行依赖运行时URL携带参数,本地开发时需在URL携带必要参数。
例如:localhost:8080/?type=running&instanceId=1&workspaceId=1
| 属性 | 说明 | 示例值 | | ------------- | ------------------------------------------ | ----------------------------| | instanceId | FlowEngine实例ID | 1 | | workspaceId | 工作区ID | 1 |
获取FlowEngine系统参数
import { FlowEngineSDK } from 'automl-util';
const engine = await FlowEngineSDK.Engine();
const systemParam = engine.getSystemParam();
console.log(systemParam);
// systemParam => 组件内获取FlowEngine系统参数
// 系统参数示例结构
interface ISystemParamDto {
instanceId: number; // 实例ID
selfLearnerUrl: string; // 自学习服务路径
batchPredictorUrl: string; // 批量预估服务路径
engineId: number; // 引擎ID
engineTemplateId: number; // 模板ID
engineDataInfo: IEngineDataInfo; // 引擎使用数据组信息
template: ITemplate; // 引擎模板详细信息
engineKey: string; // EngineKey
engineName: string; // Engine名称
isTemplateDebug: boolean; // 是否开启模板查看权限
workspaceId: number; // WorkspaceId
versionName: string; // 引擎版本名称
isTemplateComplex: boolean; // 是否单表模式
runningENV: "aio"; // 运行环境
systemTime: number; // 系统当前时间
}
组件跳转FlowEngine页面
import { FlowEngineSDK } from 'automl-util';
const message = await FlowEngineSDK.EngineMessage();
message.redirectToRoot();
// => 跳转到FlowEngine首页
message.redirectTo({
url:"/template"
});
// => 跳转到FlowEngine指定路径