@lcap/nasl 3.8.2-alpha.2 → 3.8.2-alpha.4
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/out/common/ComponentAPI.d.ts +9 -0
- package/out/concepts/AuthLogicForCallInterface__.js +21 -6
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +11 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BusinessComponent__.js +24 -8
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +21 -6
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallInterface__.js +2 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +1 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Logic__.js +43 -16
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +19 -13
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +21 -6
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +5 -4
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/ViewElement__.js +0 -5
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +50 -19
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.processV2.js +78 -0
- package/out/concepts/basics/stdlib/nasl.processV2.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +10 -5
- package/out/natural/genNaturalTS.js +34 -25
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/getUILib.js +6 -3
- package/out/natural/getContext/getUILib.js.map +1 -1
- package/out/natural/getContext/index.d.ts +5 -2
- package/out/natural/getContext/index.js +105 -12
- package/out/natural/getContext/index.js.map +1 -1
- package/out/natural/getContext/naslStdlibMap.js +8 -8
- package/out/natural/getContext/naslStdlibMap.js.map +1 -1
- package/out/natural/tools.d.ts +16 -0
- package/out/natural/tools.js +103 -1
- package/out/natural/tools.js.map +1 -1
- package/out/server/getMemberIdentifier.js +11 -17
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.js +1 -1
- package/out/server/naslServer.js.map +1 -1
- package/out/translator/types.d.ts +2 -0
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.processV2.ts +19 -0
- package/sandbox-natural/stdlib/nasl.core.d.ts +54 -0
- package/sandbox-natural/stdlib/nasl.oql.d.ts +22 -0
- package/sandbox-natural/stdlib/{nasl.ui.pre.d.ts → nasl.ui.d.ts} +20 -44
- package/sandbox-natural/stdlib/nasl.ui.h5.d.ts +1684 -1643
- package/sandbox-natural/stdlib/nasl.ui.h5.json +15746 -15045
- package/sandbox-natural/stdlib/nasl.ui.pc.d.ts +5341 -5154
- package/sandbox-natural/stdlib/nasl.ui.pc.json +31176 -30681
- package/sandbox-natural/stdlib/{nasl.util.ts → nasl.util.d.ts} +43 -37
- package/src/common/ComponentAPI.ts +7 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +23 -6
- package/src/concepts/BindAttribute__.ts +17 -12
- package/src/concepts/BusinessComponent__.ts +26 -8
- package/src/concepts/BusinessLogic__.ts +23 -6
- package/src/concepts/CallInterface__.ts +2 -2
- package/src/concepts/CallLogic__.ts +1 -1
- package/src/concepts/Logic__.ts +58 -32
- package/src/concepts/MemberExpression__.ts +20 -13
- package/src/concepts/OverriddenLogic__.ts +23 -6
- package/src/concepts/Param__.ts +5 -4
- package/src/concepts/Structure__.ts +4 -4
- package/src/concepts/ViewElement__.ts +1 -7
- package/src/concepts/View__.ts +55 -21
- package/src/concepts/basics/stdlib/nasl.processV2.ts +79 -0
- package/src/generator/genBundleFiles.ts +1 -1
- package/src/natural/genNaturalTS.ts +43 -27
- package/src/natural/getContext/getUILib.ts +6 -3
- package/src/natural/getContext/index.ts +85 -10
- package/src/natural/getContext/naslStdlibMap.ts +8 -8
- package/src/natural/tools.ts +100 -1
- package/src/server/getMemberIdentifier.ts +14 -14
- package/src/server/naslServer.ts +1 -1
- package/src/translator/types.ts +2 -0
- package/test/concepts/member-expression/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toVue.spec.ts.snap +1 -1
- package/sandbox-natural/stdlib/nasl.core.ts +0 -47
- package/sandbox-natural/stdlib/nasl.oql.ts +0 -14
- package/sandbox-natural/stdlib/nasl.ui.ts +0 -63
|
@@ -87,6 +87,8 @@ export interface TranslatorState {
|
|
|
87
87
|
isVariableHost?: boolean;
|
|
88
88
|
/** DataSource 声明 */
|
|
89
89
|
isDataSource?: boolean;
|
|
90
|
+
/** 推导类型集合,toNaturalTS 使用 */
|
|
91
|
+
typeMap?: any;
|
|
90
92
|
}
|
|
91
93
|
export declare type SourceMapItem = Range;
|
|
92
94
|
export declare type SourceMap = Map<BaseNode, SourceMapItem>;
|
package/package.json
CHANGED
|
@@ -90,6 +90,9 @@ declare namespace nasl.processV2 {
|
|
|
90
90
|
// 加签
|
|
91
91
|
export function addSignTask(taskId: nasl.core.String, userForAddSign: nasl.core.String): void;
|
|
92
92
|
|
|
93
|
+
// 查询可加签用户列表
|
|
94
|
+
export function getUsersForAddSign(taskId: nasl.core.String): nasl.collection.List<LCAPUser>;
|
|
95
|
+
|
|
93
96
|
//终止
|
|
94
97
|
export function terminateProcess(procInstId: nasl.core.String): void;
|
|
95
98
|
|
|
@@ -102,6 +105,9 @@ declare namespace nasl.processV2 {
|
|
|
102
105
|
//查询转派目标用户列表
|
|
103
106
|
export function getUsersForReassign(taskId: nasl.core.String): nasl.collection.List<LCAPUser>;
|
|
104
107
|
|
|
108
|
+
//查询流程任务信息
|
|
109
|
+
export function getTaskInfo(taskId: nasl.core.String): TaskInst;
|
|
110
|
+
|
|
105
111
|
|
|
106
112
|
/* *********************************** 数据结构定义 ******************************* */
|
|
107
113
|
export class CurrNode {
|
|
@@ -209,6 +215,19 @@ declare namespace nasl.processV2 {
|
|
|
209
215
|
nodeOperationComment: nasl.core.String;
|
|
210
216
|
}
|
|
211
217
|
|
|
218
|
+
export class TaskInst {
|
|
219
|
+
processDefUniqueKey: nasl.core.String;
|
|
220
|
+
processDefinitionId: nasl.core.String;
|
|
221
|
+
processInstanceId: nasl.core.String;
|
|
222
|
+
taskDefName: nasl.core.String;
|
|
223
|
+
taskTitle: nasl.core.String;
|
|
224
|
+
taskId: nasl.core.String;
|
|
225
|
+
completeBy: nasl.core.String;
|
|
226
|
+
finished: nasl.core.Boolean;
|
|
227
|
+
createTime: nasl.core.String;
|
|
228
|
+
completeTime: nasl.core.String;
|
|
229
|
+
}
|
|
230
|
+
|
|
212
231
|
// 流程变量类型定义
|
|
213
232
|
export interface ProcessVariable {
|
|
214
233
|
// 流程实例发起人
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/* 基本类型定义 */
|
|
2
|
+
type Any = any;
|
|
3
|
+
type Long = number;
|
|
4
|
+
type Integer = number;
|
|
5
|
+
type Decimal = number;
|
|
6
|
+
type Boolean = boolean;
|
|
7
|
+
type String = string;
|
|
8
|
+
type List<T> = Array<T>;
|
|
9
|
+
|
|
10
|
+
type Date = globalThis.Date;
|
|
11
|
+
class Time {
|
|
12
|
+
accept: 'Time';
|
|
13
|
+
}
|
|
14
|
+
/* 日期时间类型 */
|
|
15
|
+
class DateTime {
|
|
16
|
+
accept: 'DateTime';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 数据实体接口
|
|
21
|
+
* 作用:创建、更新和删除数据表中的数据
|
|
22
|
+
*/
|
|
23
|
+
interface Entity<T> {
|
|
24
|
+
/* 根据主键ID获取一条数据 */
|
|
25
|
+
get(id: Integer): T;
|
|
26
|
+
/**
|
|
27
|
+
* 将传入的数据实体插入到数据表中
|
|
28
|
+
* @param entity 数据实体,T类型。不包含id, createTime, updateTime, createdBy, updatedBy字段
|
|
29
|
+
* @returns 返回插入的数据实体,T类型。已自动生成id, createTime, updateTime, createdBy, updatedBy字段, 可以通过返回值获取插入数据在数据库中的id
|
|
30
|
+
* @example const person = nasl.util.NewEntity<app.dataSources.defaultDS.entities.Person>({name: 'test', age: 18}; insertPerson = app.dataSources.defaultDS.entities.PersonEntity.create(person); // 可以根据insertPerson.id获取插入数据在数据库中的id
|
|
31
|
+
*/
|
|
32
|
+
create(entity: T): T;
|
|
33
|
+
/* 根据传入的数据对象更新数据表中的数据 */
|
|
34
|
+
update(entity: T): T;
|
|
35
|
+
/* 根据主键ID删除数据表中的数据 */
|
|
36
|
+
delete(id: Integer): void;
|
|
37
|
+
/* 根据传入的数据对象创建或更新数据表中的数据 */
|
|
38
|
+
createOrUpdate(body: T): T;
|
|
39
|
+
/* 根据主键ID列表批量删除数据表中的数据 */
|
|
40
|
+
batchCreate(list: List<T>): List<T>;
|
|
41
|
+
/* 根据传入的数据对象列表批量更新数据表中的数据 */
|
|
42
|
+
batchUpdate(list: List<T>): List<T>;
|
|
43
|
+
/* 根据主键ID列表批量删除数据表中的数据 */
|
|
44
|
+
batchDelete(list: List<Integer>): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/*
|
|
48
|
+
* createEntity函数:根据数据表类型创建一个数据实体接口,然后通过该接口调用数据表中的数据。
|
|
49
|
+
* @example const LCAPUserEntity = createEntity<app.dataSources.defaultDS.entities.LCAPUser>(); app.dataSources.defaultDS.entities.LCAPUserEntity.delete(id);
|
|
50
|
+
* 注意:对应接口已经在下面的实体列表中定义好了,不需要重新定义。
|
|
51
|
+
*/
|
|
52
|
+
declare const createEntity: <T>() => Entity<T>;
|
|
53
|
+
/* EntityRelation函数:用于定义数据表内的外键关联关系。*/
|
|
54
|
+
declare function EntityRelation(property: any): any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare namespace nasl.oql {
|
|
2
|
+
/**
|
|
3
|
+
* SQL数据查询
|
|
4
|
+
* @param sql 数据查询需要的 SQL
|
|
5
|
+
* @returns 返回查询结果列表
|
|
6
|
+
* 关于T的类型说明:
|
|
7
|
+
* 1. 如果查询字段均来自一个数据表,T为该数据表的类型
|
|
8
|
+
* 2. 如果查询字段来自多个数据表,那么T为匿名类型,包含所有查询字段, 如:{name: string, age: number}
|
|
9
|
+
* 在调用时,T可以不指定,平台会自动进行推断
|
|
10
|
+
*
|
|
11
|
+
* 优先使用数据库的查询和数据操纵能力,例如 JOIN、SUM、GROUP_BY 等
|
|
12
|
+
* 所有变量格式为:${variable},不能用''包裹,不能用函数处理。
|
|
13
|
+
* @example nasl.oql.query(`SELECT * FROM Student WHERE id = ${id}`)
|
|
14
|
+
* @example nasl.oql.query(`SELECT OrderProduct.*, Product.price as price FROM OrderProduct JOIN Product WHERE orderId = ${orderId}`)
|
|
15
|
+
* 可直接使用list查询,无需拼接成字符串
|
|
16
|
+
* @example nasl.oql.query(`SELECT * FROM Student WHERE id IN ${idList}`)
|
|
17
|
+
*/
|
|
18
|
+
export function query<T>(sql: string): List<T>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* 分页组件函数,用于分页 */
|
|
22
|
+
declare function PAGINATE<T>(list: List<T>, page: Integer, size: Integer): { list: List<T>, total: Integer; };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
declare namespace nasl.ui {
|
|
2
|
-
|
|
2
|
+
/* 校验类型 */
|
|
3
|
+
export interface ValidateResult { valid: Boolean; }
|
|
4
|
+
/* current: 推导类型 */
|
|
5
|
+
export class Current<T> {
|
|
6
|
+
item: T;
|
|
7
|
+
constructor(obj: Partial<Current<T>>);
|
|
8
|
+
}
|
|
3
9
|
|
|
4
10
|
export class ViewComponentOptions {
|
|
5
11
|
@Prop({
|
|
@@ -39,52 +45,22 @@ declare namespace nasl.ui {
|
|
|
39
45
|
_backgroundImage: String;
|
|
40
46
|
}
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
altKey: Boolean;
|
|
44
|
-
button: Integer;
|
|
45
|
-
clientX: Integer;
|
|
46
|
-
clientY: Integer;
|
|
47
|
-
ctrlKey: Boolean;
|
|
48
|
-
metaKey: Boolean;
|
|
49
|
-
movementX: Integer;
|
|
50
|
-
movementY: Integer;
|
|
51
|
-
offsetX: Integer;
|
|
52
|
-
offsetY: Integer;
|
|
53
|
-
pageX: Integer;
|
|
54
|
-
pageY: Integer;
|
|
55
|
-
screenX: Integer;
|
|
56
|
-
screenY: Integer;
|
|
57
|
-
which: Integer;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface FocusEvent {
|
|
61
|
-
cancelBubble: Boolean;
|
|
62
|
-
detail: String;
|
|
63
|
-
layerX: Integer;
|
|
64
|
-
layerY: Integer;
|
|
65
|
-
pageX: Integer;
|
|
66
|
-
pageY: Integer;
|
|
67
|
-
which: Integer;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface ValidateResult {
|
|
71
|
-
rawValue: String;
|
|
72
|
-
value: String;
|
|
73
|
-
trigger: String;
|
|
74
|
-
muted: String;
|
|
75
|
-
valid: Boolean;
|
|
76
|
-
touched: Boolean;
|
|
77
|
-
dirty: Boolean;
|
|
78
|
-
firstError: String;
|
|
79
|
-
triggerValid: Boolean;
|
|
80
|
-
}
|
|
81
|
-
|
|
48
|
+
// 在页面上弹出消息
|
|
82
49
|
export function showMessage(text: Any): void;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* 跳转到指定页面
|
|
50
|
+
/** 跳转到指定页面
|
|
86
51
|
* @example nasl.ui.destination('pageType.some_view.sub1_view', param1, param2);
|
|
87
52
|
* pageType 为 namespace,如 pc 或者 m,必填
|
|
88
53
|
*/
|
|
89
54
|
export function destination(path: String, ...args: Any[]): void;
|
|
90
55
|
}
|
|
56
|
+
|
|
57
|
+
declare namespace nasl.auth {
|
|
58
|
+
// 检查当前用户是否有当前资源的权限
|
|
59
|
+
export function hasAuth(authPath: String): Boolean;
|
|
60
|
+
// 退出当前登录状态
|
|
61
|
+
export function logout(): Promise<void>;
|
|
62
|
+
// 对字符串 实现aes解密,返回解密后的字符串
|
|
63
|
+
export function encryptByAES(authPath: String): String;
|
|
64
|
+
// 对字符串 实现aes加密,返回加密后的字符串
|
|
65
|
+
export function decryptByAES(authPath: String): String;
|
|
66
|
+
}
|