@cloudbase/cals 0.3.18 → 0.3.22-alpha.0

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.
Files changed (31) hide show
  1. package/README.md +17 -10
  2. package/lib/parser/cals/index.d.ts +22 -68
  3. package/lib/parser/cals/index.d.ts.map +1 -1
  4. package/lib/parser/cals/index.js +134 -96
  5. package/lib/parser/cals/utils/block/index.js +2 -2
  6. package/lib/parser/cals/utils/common.d.ts +5 -0
  7. package/lib/parser/cals/utils/common.d.ts.map +1 -1
  8. package/lib/parser/cals/utils/common.js +125 -1
  9. package/lib/parser/cals/utils/runtime.d.ts +4 -1
  10. package/lib/parser/cals/utils/runtime.d.ts.map +1 -1
  11. package/lib/parser/cals/utils/runtime.js +7 -0
  12. package/lib/parser/cals/utils/spinoff/index.d.ts.map +1 -1
  13. package/lib/parser/expression/index.d.ts +8 -1
  14. package/lib/parser/expression/index.d.ts.map +1 -1
  15. package/lib/parser/expression/index.js +6 -1
  16. package/lib/tsconfig.tsbuildinfo +1 -1
  17. package/lib/types/platform/app.d.ts +15 -1
  18. package/lib/types/platform/app.d.ts.map +1 -1
  19. package/lib/types/platform/common.d.ts +7 -7
  20. package/lib/types/platform/common.d.ts.map +1 -1
  21. package/lib/types/platform/common.js +4 -5
  22. package/lib/types/platform/component.d.ts +17 -30
  23. package/lib/types/platform/component.d.ts.map +1 -1
  24. package/lib/types/platform/component.js +5 -6
  25. package/lib/types/platform/datasource.d.ts +11 -7
  26. package/lib/types/platform/datasource.d.ts.map +1 -1
  27. package/package.json +6 -2
  28. package/lib/schema/platform_application.json +0 -2177
  29. package/lib/tests/common-application-specs.test.d.ts +0 -2
  30. package/lib/tests/common-application-specs.test.d.ts.map +0 -1
  31. package/lib/tests/common-application-specs.test.js +0 -45
@@ -1,2177 +0,0 @@
1
- {
2
- "description": "云开发低码平台应用",
3
- "type": "object",
4
- "properties": {
5
- "items": {
6
- "description": "必填, 应用的组件集合",
7
- "type": "array",
8
- "items": {
9
- "$ref": "#/definitions/IPageComponent"
10
- }
11
- },
12
- "dataSources": {
13
- "description": "可选, 数据源集合",
14
- "type": "array",
15
- "items": {
16
- "anyOf": [
17
- {
18
- "$ref": "#/definitions/IDatabaseDataSource"
19
- },
20
- {
21
- "$ref": "#/definitions/ICloudIntegrationDataSource"
22
- }
23
- ]
24
- }
25
- },
26
- "dataset": {
27
- "description": "可选, 变量集合",
28
- "$ref": "#/definitions/IDataset"
29
- },
30
- "dataVariables": {
31
- "description": "可选, 数据源变量集合",
32
- "type": "array",
33
- "items": {
34
- "$ref": "#/definitions/IDataSourceVariable"
35
- }
36
- },
37
- "extra": {
38
- "description": "可选,平台特有数据",
39
- "$ref": "#/definitions/IPlatformAppExtra"
40
- },
41
- "resources": {
42
- "description": "可选, 应用的资源集合\n\n应用级别挂载了 code 资源",
43
- "type": "array",
44
- "items": {
45
- "$ref": "#/definitions/ICodeResource"
46
- }
47
- },
48
- "dependencies": {
49
- "description": "应用依赖和依赖对应版本信息,包含组件库,数据源sdk,应用运行时\nIDependencies",
50
- "type": "object",
51
- "additionalProperties": {
52
- "type": "string"
53
- }
54
- },
55
- "label": {
56
- "description": "选填, 应用别名",
57
- "type": "string"
58
- },
59
- "main": {
60
- "description": "选填, 应用的入口组件",
61
- "default": "home",
62
- "type": "string"
63
- },
64
- "name": {
65
- "description": "必填, 应用名称, 标识",
66
- "maxLength": 214,
67
- "minLength": 1,
68
- "pattern": "^(?:\\x40[a-z0-9-*~][a-z0-9-*._~]*\\x47)?[a-z0-9-~][a-z0-9-._~]*$",
69
- "type": "string"
70
- },
71
- "version": {
72
- "description": "选填, 应用版本\nversion 值应该能够被 node-semver 解析",
73
- "default": "0.1.0",
74
- "type": "string"
75
- },
76
- "description": {
77
- "description": "选填, 应用简介",
78
- "type": "string"
79
- },
80
- "author": {
81
- "description": "选填, 应用的作者",
82
- "type": "string"
83
- }
84
- },
85
- "required": [
86
- "dependencies",
87
- "items"
88
- ],
89
- "definitions": {
90
- "IPageComponent": {
91
- "description": "页面组件, 描述整个页面的组件",
92
- "type": "object",
93
- "properties": {
94
- "type": {
95
- "description": "选填, 组件类型",
96
- "type": "string",
97
- "enum": [
98
- "PAGE"
99
- ]
100
- },
101
- "id": {
102
- "description": "页面 id,对应页面 path",
103
- "type": "string"
104
- },
105
- "items": {
106
- "description": "可选, 可递归结构, 子级对应",
107
- "type": "array",
108
- "items": {
109
- "anyOf": [
110
- {
111
- "$ref": "#/definitions/IBasicComponent"
112
- },
113
- {
114
- "$ref": "#/definitions/IComplexComponent"
115
- }
116
- ]
117
- }
118
- },
119
- "dataset": {
120
- "description": "可选, 变量集合",
121
- "$ref": "#/definitions/IDataset"
122
- },
123
- "dataVariables": {
124
- "description": "可选, 数据源变量集合",
125
- "type": "array",
126
- "items": {
127
- "$ref": "#/definitions/IDataSourceVariable"
128
- }
129
- },
130
- "resources": {
131
- "description": "可选, 页面的资源集合\n\n页面级别只挂载了 code 资源",
132
- "type": "array",
133
- "items": {
134
- "$ref": "#/definitions/ICodeResource"
135
- }
136
- },
137
- "label": {
138
- "description": "可选, 对用户可读的名称, 如 \"用户名\"",
139
- "type": "string"
140
- },
141
- "attributes": {
142
- "description": "可选, 组件控制属性",
143
- "$ref": "#/definitions/IPlatformAttributes"
144
- },
145
- "name": {
146
- "description": "可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"",
147
- "type": "string"
148
- },
149
- "component": {
150
- "description": "必填, 组件名, 一般首字母大写的大驼峰形式, 如Image",
151
- "type": "string"
152
- },
153
- "valueFilterName": {
154
- "description": "可选, 前端对value加工处理的函数名, 会做局部范围的广播, 需要做对应捕获并实现",
155
- "type": "string"
156
- },
157
- "extra": {
158
- "description": "可选,平台实现有关字段",
159
- "$ref": "#/definitions/IPlatformComponentExtra"
160
- },
161
- "listeners": {
162
- "description": "可选, 组件绑定的监听器",
163
- "type": "array",
164
- "items": {
165
- "$ref": "#/definitions/IPlatformListener"
166
- }
167
- },
168
- "directives": {
169
- "description": "选填,指令属性",
170
- "type": "object",
171
- "properties": {
172
- ":if": {
173
- "description": "选填,动态 if 指令\nboolean 或 字符串表达式",
174
- "default": true,
175
- "type": [
176
- "string",
177
- "boolean"
178
- ]
179
- },
180
- ":for": {
181
- "description": "选填,动态 for 指令\n字符串表达式 (item, index) in list",
182
- "type": "string"
183
- }
184
- }
185
- },
186
- ":class": {
187
- "description": "可选,动态绑定 class,字符串表达式\n'[\"1\", \"2\"]'",
188
- "type": "string"
189
- },
190
- ":style": {
191
- "description": "可选,动态绑定 style, 与静态合并,字符表达式\n'{width: 17}'",
192
- "type": "string"
193
- }
194
- },
195
- "required": [
196
- "id",
197
- "type"
198
- ]
199
- },
200
- "IBasicComponent": {
201
- "description": "默认组件, 由平台提供的组件",
202
- "type": "object",
203
- "properties": {
204
- "type": {
205
- "description": "选填, 组件类型",
206
- "enum": [
207
- "BASIC"
208
- ],
209
- "type": "string"
210
- },
211
- "items": {
212
- "description": "可选, 可递归结构, 子级对应",
213
- "type": "array",
214
- "items": {
215
- "anyOf": [
216
- {
217
- "$ref": "#/definitions/IBasicComponent"
218
- },
219
- {
220
- "$ref": "#/definitions/IComplexComponent"
221
- }
222
- ]
223
- }
224
- },
225
- "module": {
226
- "description": "可选, 组件所属的组件库",
227
- "type": "string"
228
- },
229
- "attributes": {
230
- "description": "可选, 组件控制属性",
231
- "$ref": "#/definitions/IPlatformAttributes"
232
- },
233
- "listeners": {
234
- "description": "可选, 组件绑定的监听器",
235
- "type": "array",
236
- "items": {
237
- "$ref": "#/definitions/IPlatformListener"
238
- }
239
- },
240
- "directives": {
241
- "description": "选填,指令属性",
242
- "type": "object",
243
- "properties": {
244
- ":if": {
245
- "description": "选填,动态 if 指令\nboolean 或 字符串表达式",
246
- "default": true,
247
- "type": [
248
- "string",
249
- "boolean"
250
- ]
251
- },
252
- ":for": {
253
- "description": "选填,动态 for 指令\n字符串表达式 (item, index) in list",
254
- "type": "string"
255
- }
256
- }
257
- },
258
- ":class": {
259
- "description": "可选,动态绑定 class,字符串表达式\n'[\"1\", \"2\"]'",
260
- "type": "string"
261
- },
262
- ":style": {
263
- "description": "可选,动态绑定 style, 与静态合并,字符表达式\n'{width: 17}'",
264
- "type": "string"
265
- },
266
- "extra": {
267
- "description": "可选,平台实现有关字段",
268
- "$ref": "#/definitions/IPlatformComponentExtra"
269
- },
270
- "label": {
271
- "description": "可选, 对用户可读的名称, 如 \"用户名\"",
272
- "type": "string"
273
- },
274
- "id": {
275
- "description": "选填, 当前页面内的唯一ID",
276
- "type": "string"
277
- },
278
- "name": {
279
- "description": "可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"",
280
- "type": "string"
281
- },
282
- "component": {
283
- "description": "必填, 组件名, 一般首字母大写的大驼峰形式, 如Image",
284
- "type": "string"
285
- },
286
- "valueFilterName": {
287
- "description": "可选, 前端对value加工处理的函数名, 会做局部范围的广播, 需要做对应捕获并实现",
288
- "type": "string"
289
- },
290
- "resources": {
291
- "description": "可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源",
292
- "type": "array",
293
- "items": {
294
- "$ref": "#/definitions/IResource"
295
- }
296
- }
297
- }
298
- },
299
- "IComplexComponent": {
300
- "description": "自定义组件, 开发者组合已有的默认组件, 得到的新组件",
301
- "type": "object",
302
- "properties": {
303
- "type": {
304
- "description": "选填, 组件类型",
305
- "enum": [
306
- "COMPLEX"
307
- ],
308
- "type": "string"
309
- },
310
- "items": {
311
- "description": "可选, 可递归结构, 子级对应",
312
- "type": "array",
313
- "items": {
314
- "anyOf": [
315
- {
316
- "$ref": "#/definitions/IBasicComponent"
317
- },
318
- {
319
- "$ref": "#/definitions/IComplexComponent"
320
- }
321
- ]
322
- }
323
- },
324
- "module": {
325
- "description": "可选, 组件所属的组件库",
326
- "type": "string"
327
- },
328
- "attributes": {
329
- "description": "可选, 组件控制属性",
330
- "$ref": "#/definitions/IPlatformAttributes"
331
- },
332
- "listeners": {
333
- "description": "可选, 组件绑定的监听器",
334
- "type": "array",
335
- "items": {
336
- "$ref": "#/definitions/IPlatformListener"
337
- }
338
- },
339
- "directives": {
340
- "description": "选填,指令属性",
341
- "type": "object",
342
- "properties": {
343
- ":if": {
344
- "description": "选填,动态 if 指令\nboolean 或 字符串表达式",
345
- "default": true,
346
- "type": [
347
- "string",
348
- "boolean"
349
- ]
350
- },
351
- ":for": {
352
- "description": "选填,动态 for 指令\n字符串表达式 (item, index) in list",
353
- "type": "string"
354
- }
355
- }
356
- },
357
- ":class": {
358
- "description": "可选,动态绑定 class,字符串表达式\n'[\"1\", \"2\"]'",
359
- "type": "string"
360
- },
361
- ":style": {
362
- "description": "可选,动态绑定 style, 与静态合并,字符表达式\n'{width: 17}'",
363
- "type": "string"
364
- },
365
- "extra": {
366
- "description": "可选,平台实现有关字段",
367
- "$ref": "#/definitions/IPlatformComponentExtra"
368
- },
369
- "label": {
370
- "description": "可选, 对用户可读的名称, 如 \"用户名\"",
371
- "type": "string"
372
- },
373
- "id": {
374
- "description": "选填, 当前页面内的唯一ID",
375
- "type": "string"
376
- },
377
- "name": {
378
- "description": "可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"",
379
- "type": "string"
380
- },
381
- "component": {
382
- "description": "必填, 组件名, 一般首字母大写的大驼峰形式, 如Image",
383
- "type": "string"
384
- },
385
- "valueFilterName": {
386
- "description": "可选, 前端对value加工处理的函数名, 会做局部范围的广播, 需要做对应捕获并实现",
387
- "type": "string"
388
- },
389
- "resources": {
390
- "description": "可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源",
391
- "type": "array",
392
- "items": {
393
- "$ref": "#/definitions/IResource"
394
- }
395
- }
396
- }
397
- },
398
- "IPlatformAttributes": {
399
- "type": "object",
400
- "additionalProperties": {},
401
- "properties": {
402
- "class": {
403
- "type": "string"
404
- },
405
- "style": {
406
- "type": "object",
407
- "properties": {},
408
- "additionalProperties": true
409
- }
410
- }
411
- },
412
- "IPlatformListener": {
413
- "description": "组件绑定的监听器",
414
- "type": "object",
415
- "properties": {
416
- "isCapturePhase": {
417
- "description": "可选,是否在捕获阶段响应",
418
- "default": false,
419
- "type": "boolean"
420
- },
421
- "id": {
422
- "description": "可选,监听器唯一标识",
423
- "type": "string"
424
- },
425
- "type": {
426
- "description": "可选, 监听器类型",
427
- "type": "string"
428
- },
429
- "handler": {
430
- "description": "可选, 绑定的处理器",
431
- "$ref": "#/definitions/IHandler"
432
- },
433
- "eventName": {
434
- "description": "必填, 监听的事件名, 来源于 IEvents 定义的事件",
435
- "type": "string"
436
- }
437
- },
438
- "required": [
439
- "eventName",
440
- "id"
441
- ]
442
- },
443
- "IHandler": {
444
- "description": "监听器触发的处理器",
445
- "type": "object",
446
- "properties": {
447
- "name": {
448
- "description": "必填, 处理器的名称",
449
- "type": "string"
450
- },
451
- "module": {
452
- "description": "可选, 处理器所属的模块",
453
- "type": "string"
454
- },
455
- "params": {
456
- "description": "可选, 处理器的入参",
457
- "type": "object",
458
- "properties": {},
459
- "additionalProperties": true
460
- }
461
- },
462
- "required": [
463
- "name"
464
- ]
465
- },
466
- "IPlatformComponentExtra": {
467
- "type": "object",
468
- "properties": {
469
- "commonStyle": {
470
- "description": "可选,样式分组配置\n{selt: {}, margin: {}, text: {}, custom: []}",
471
- "type": "object",
472
- "properties": {},
473
- "additionalProperties": true
474
- },
475
- "xIndex": {
476
- "description": "可选,组件顺序 formily x-index\nhttps://github.com/alibaba/formily/blob/master/packages/react-schema-renderer/README.md",
477
- "type": "number"
478
- },
479
- "staticResourceAttribute": {
480
- "type": "array",
481
- "items": {
482
- "type": "string"
483
- }
484
- },
485
- "pluginInstances": {
486
- "description": "可选,页面插件",
487
- "type": "object",
488
- "properties": {
489
- "data": {
490
- "type": "object",
491
- "additionalProperties": {}
492
- },
493
- "dataBinds": {
494
- "type": "array",
495
- "items": {
496
- "type": "object",
497
- "properties": {
498
- "propertyPath": {
499
- "type": "string"
500
- },
501
- "bindDataPath": {
502
- "type": "string"
503
- },
504
- "type": {}
505
- },
506
- "required": [
507
- "bindDataPath",
508
- "propertyPath"
509
- ]
510
- }
511
- },
512
- "dataTypes": {
513
- "type": "array",
514
- "items": {
515
- "type": "object",
516
- "properties": {
517
- "propertyPath": {
518
- "type": "string"
519
- },
520
- "type": {
521
- "enum": [
522
- "bind",
523
- "slot",
524
- "static"
525
- ],
526
- "type": "string"
527
- }
528
- },
529
- "required": [
530
- "propertyPath"
531
- ]
532
- }
533
- },
534
- "key": {
535
- "description": "Make all properties in T readonly",
536
- "type": "string"
537
- },
538
- "sourceKey": {
539
- "type": "string"
540
- },
541
- "instanceFunction": {
542
- "type": "string"
543
- }
544
- },
545
- "required": [
546
- "data",
547
- "key",
548
- "sourceKey"
549
- ]
550
- },
551
- "styleBindPath": {
552
- "description": "style bind path",
553
- "type": "string"
554
- },
555
- "children": {
556
- "description": "未知用处 children",
557
- "type": "array",
558
- "items": {
559
- "$ref": "#/definitions/IPlatformComponent"
560
- }
561
- },
562
- "hideAdminPortalMenu": {
563
- "description": "是否再门户网站中的菜单中隐藏页面对应的菜单项",
564
- "type": "boolean"
565
- }
566
- }
567
- },
568
- "IPlatformComponent": {
569
- "description": "云开发低码平台组件",
570
- "type": "object",
571
- "properties": {
572
- "attributes": {
573
- "description": "可选, 组件控制属性",
574
- "$ref": "#/definitions/IPlatformAttributes"
575
- },
576
- "type": {
577
- "description": "选填, 组件类型",
578
- "enum": [
579
- "BASIC",
580
- "COMPLEX",
581
- "PAGE"
582
- ],
583
- "type": "string"
584
- },
585
- "listeners": {
586
- "description": "可选, 组件绑定的监听器",
587
- "type": "array",
588
- "items": {
589
- "$ref": "#/definitions/IPlatformListener"
590
- }
591
- },
592
- "directives": {
593
- "description": "选填,指令属性",
594
- "type": "object",
595
- "properties": {
596
- ":if": {
597
- "description": "选填,动态 if 指令\nboolean 或 字符串表达式",
598
- "default": true,
599
- "type": [
600
- "string",
601
- "boolean"
602
- ]
603
- },
604
- ":for": {
605
- "description": "选填,动态 for 指令\n字符串表达式 (item, index) in list",
606
- "type": "string"
607
- }
608
- }
609
- },
610
- ":class": {
611
- "description": "可选,动态绑定 class,字符串表达式\n'[\"1\", \"2\"]'",
612
- "type": "string"
613
- },
614
- ":style": {
615
- "description": "可选,动态绑定 style, 与静态合并,字符表达式\n'{width: 17}'",
616
- "type": "string"
617
- },
618
- "extra": {
619
- "description": "可选,平台实现有关字段",
620
- "$ref": "#/definitions/IPlatformComponentExtra"
621
- },
622
- "label": {
623
- "description": "可选, 对用户可读的名称, 如 \"用户名\"",
624
- "type": "string"
625
- },
626
- "id": {
627
- "description": "选填, 当前页面内的唯一ID",
628
- "type": "string"
629
- },
630
- "name": {
631
- "description": "可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"",
632
- "type": "string"
633
- },
634
- "component": {
635
- "description": "必填, 组件名, 一般首字母大写的大驼峰形式, 如Image",
636
- "type": "string"
637
- },
638
- "valueFilterName": {
639
- "description": "可选, 前端对value加工处理的函数名, 会做局部范围的广播, 需要做对应捕获并实现",
640
- "type": "string"
641
- },
642
- "items": {
643
- "description": "可选, 可递归结构, 子级对应",
644
- "type": "array",
645
- "items": {
646
- "$ref": "#/definitions/IComponent"
647
- }
648
- },
649
- "resources": {
650
- "description": "可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源",
651
- "type": "array",
652
- "items": {
653
- "$ref": "#/definitions/IResource"
654
- }
655
- }
656
- }
657
- },
658
- "IComponent": {
659
- "type": "object",
660
- "properties": {
661
- "id": {
662
- "description": "选填, 当前页面内的唯一ID",
663
- "type": "string"
664
- },
665
- "name": {
666
- "description": "可选, 数据字段名, 作为向后台传值的名称约定, 如 \"user_name\"",
667
- "type": "string"
668
- },
669
- "label": {
670
- "description": "可选, 对用户可读的名称, 如 \"用户名\"",
671
- "type": "string"
672
- },
673
- "component": {
674
- "description": "必填, 组件名, 一般首字母大写的大驼峰形式, 如Image",
675
- "type": "string"
676
- },
677
- "type": {
678
- "description": "选填, 组件类型",
679
- "type": "string"
680
- },
681
- "value": {
682
- "description": "可选, 组件取值, 具体类型依赖 validity.format 决定"
683
- },
684
- "valueFilterName": {
685
- "description": "可选, 前端对value加工处理的函数名, 会做局部范围的广播, 需要做对应捕获并实现",
686
- "type": "string"
687
- },
688
- "attributes": {
689
- "description": "可选, 组件控制属性",
690
- "$ref": "#/definitions/IAttributes"
691
- },
692
- "events": {
693
- "description": "可选, 组件事件信息",
694
- "$ref": "#/definitions/IEvents"
695
- },
696
- "validity": {
697
- "description": "可选, 组件的数据有效性校验",
698
- "$ref": "#/definitions/IValidity"
699
- },
700
- "extra": {
701
- "description": "可选, 扩展字段, 尽量避免用"
702
- },
703
- "items": {
704
- "description": "可选, 可递归结构, 子级对应",
705
- "type": "array",
706
- "items": {
707
- "$ref": "#/definitions/IComponent"
708
- }
709
- },
710
- "resources": {
711
- "description": "可选, 应用的资源集合\n\n例如, 代码片段、组件库、静态资源",
712
- "type": "array",
713
- "items": {
714
- "$ref": "#/definitions/IResource"
715
- }
716
- },
717
- "listeners": {
718
- "description": "可选, 组件绑定的监听器",
719
- "type": "array",
720
- "items": {
721
- "$ref": "#/definitions/IListener"
722
- }
723
- }
724
- }
725
- },
726
- "IAttributes": {
727
- "type": "object",
728
- "properties": {
729
- "class": {
730
- "description": "可选, 样式名",
731
- "type": "string"
732
- },
733
- "style": {
734
- "description": "可选, 标准CSS属性, 由于过多不宜下钻定义",
735
- "type": "object",
736
- "properties": {},
737
- "additionalProperties": true
738
- },
739
- "width": {
740
- "description": "可选, 宽, 绝对值或相对值, 如\"100px\"或“100%”",
741
- "type": [
742
- "string",
743
- "number"
744
- ]
745
- },
746
- "height": {
747
- "description": "可选, 高, 绝对值或相对值, 如\"100px\"或“100%”",
748
- "type": [
749
- "string",
750
- "number"
751
- ]
752
- },
753
- "layout": {
754
- "description": "可选, 布局, 如\"column\"、\"row\"",
755
- "type": "string"
756
- },
757
- "placeholder": {
758
- "description": "可选, 无内容时的占位信息",
759
- "type": "string"
760
- },
761
- "string": {
762
- "description": "可选, 提示语",
763
- "type": "string"
764
- },
765
- "defaults": {
766
- "description": "可选, 默认选项",
767
- "type": "object",
768
- "properties": {},
769
- "additionalProperties": true
770
- },
771
- "hide": {
772
- "description": "可选, 是否隐藏",
773
- "type": "boolean"
774
- },
775
- "multiple": {
776
- "description": "可选, 是否多选",
777
- "type": "boolean"
778
- },
779
- "disabled": {
780
- "description": "可选, 是否禁用",
781
- "type": "boolean"
782
- },
783
- "readonly": {
784
- "description": "可选, 是否只读",
785
- "type": "boolean"
786
- },
787
- "repeated": {
788
- "description": "可选, 是否可重复",
789
- "type": "boolean"
790
- },
791
- "sortable": {
792
- "description": "可选, 是否可排序",
793
- "type": "boolean"
794
- },
795
- "searchable": {
796
- "description": "可选, 是否可搜索",
797
- "type": "boolean"
798
- },
799
- "resetable": {
800
- "description": "可选, 是否可重置",
801
- "type": "boolean"
802
- },
803
- "dataset": {
804
- "description": "可选, 类似HTMLElement.dataset, 需要传递的其他数据",
805
- "type": "object",
806
- "properties": {},
807
- "additionalProperties": true
808
- },
809
- "theme": {
810
- "description": "可选, 皮肤",
811
- "type": "string"
812
- }
813
- }
814
- },
815
- "IEvents": {
816
- "type": "object",
817
- "properties": {
818
- "clickEventName": {
819
- "description": "可选, 点击事件名",
820
- "default": "'click'",
821
- "type": "string"
822
- },
823
- "dblClickEventName": {
824
- "description": "可选, 双击事件名",
825
- "default": "'dbClick'",
826
- "type": "string"
827
- },
828
- "mouseEnterEventName": {
829
- "description": "可选, 鼠标移入事件名",
830
- "default": "'mouseEnter'",
831
- "type": "string"
832
- },
833
- "mouseLeaveEventName": {
834
- "description": "可选, 鼠标移出事件名",
835
- "default": "'mouseLeave'",
836
- "type": "string"
837
- },
838
- "changeEventName": {
839
- "description": "可选, 值变化事件名",
840
- "default": "'change'",
841
- "type": "string"
842
- },
843
- "dragStartEventName": {
844
- "description": "可选, 开始拖拽事件名",
845
- "default": "'dragStart'",
846
- "type": "string"
847
- },
848
- "dragEventName": {
849
- "description": "可选, 拖拽事件名",
850
- "default": "'drag'",
851
- "type": "string"
852
- },
853
- "dragEndEventName": {
854
- "description": "可选, 结束拖拽事件名",
855
- "default": "'dragEnd'",
856
- "type": "string"
857
- },
858
- "customEventName": {
859
- "description": "可选, 自定义事件名",
860
- "type": "string"
861
- },
862
- "lifecycleConnectedEventName": {
863
- "description": "可选, 生命周期-connected事件名",
864
- "type": "string"
865
- },
866
- "lifecycleDisconnectedEventName": {
867
- "description": "可选, 生命周期-disconnected事件名",
868
- "type": "string"
869
- },
870
- "lifecycleAdoptedEventName": {
871
- "description": "可选, 生命周期-adopted事件名",
872
- "type": "string"
873
- },
874
- "lifecycleAttributeChangedEventName": {
875
- "description": "可选, 生命周期-attributeChanged事件名",
876
- "type": "string"
877
- }
878
- }
879
- },
880
- "IValidity": {
881
- "type": "object",
882
- "properties": {
883
- "required": {
884
- "description": "可选, 组件值是否必填",
885
- "type": "boolean"
886
- },
887
- "format": {
888
- "description": "可选, 组件值的数据类型",
889
- "type": "string"
890
- },
891
- "min": {
892
- "description": "可选, 最小值/最小长度",
893
- "type": "number"
894
- },
895
- "max": {
896
- "description": "可选, 最大值/最大长度",
897
- "type": "number"
898
- },
899
- "pattern": {
900
- "description": "可选, 需要符合的正则表达式",
901
- "type": "string"
902
- }
903
- }
904
- },
905
- "IResource": {
906
- "type": "object",
907
- "properties": {
908
- "name": {
909
- "description": "必填,资源名",
910
- "type": "string"
911
- },
912
- "type": {
913
- "description": "必填,资源类型",
914
- "type": "string"
915
- }
916
- },
917
- "required": [
918
- "name",
919
- "type"
920
- ]
921
- },
922
- "IListener": {
923
- "description": "应用/组件 绑定的监听器",
924
- "type": "object",
925
- "properties": {
926
- "type": {
927
- "description": "可选, 监听器类型",
928
- "type": "string"
929
- },
930
- "handler": {
931
- "description": "可选, 绑定的处理器",
932
- "$ref": "#/definitions/IHandler"
933
- },
934
- "eventName": {
935
- "description": "必填, 监听的事件名, 来源于 IEvents 定义的事件",
936
- "type": "string"
937
- }
938
- },
939
- "required": [
940
- "eventName"
941
- ]
942
- },
943
- "IDataset": {
944
- "description": "变量",
945
- "type": "object",
946
- "properties": {
947
- "state": {
948
- "description": "状态",
949
- "$ref": "#/definitions/Record<string,IDataSourceVariable|IStateVariable>"
950
- },
951
- "params": {
952
- "description": "页面/应用 参数",
953
- "$ref": "#/definitions/Record<string,IParamsVariable>"
954
- }
955
- }
956
- },
957
- "Record<string,IDataSourceVariable|IStateVariable>": {
958
- "type": "object"
959
- },
960
- "Record<string,IParamsVariable>": {
961
- "type": "object"
962
- },
963
- "IDataSourceVariable": {
964
- "description": "数据源变量的描述",
965
- "type": "object",
966
- "properties": {
967
- "name": {
968
- "description": "必填, 数据源变量的英文标识",
969
- "type": "string"
970
- },
971
- "label": {
972
- "description": "选填, 数据源变量的中文标识",
973
- "type": "string"
974
- },
975
- "varType": {
976
- "description": "变量类型",
977
- "type": "string",
978
- "enum": [
979
- "datasource"
980
- ]
981
- },
982
- "dataType": {
983
- "description": "选填, 数据源变量的类型\n record-collection 集合类型, 对应数据源 get-list 类型的方法\n new-record 新纪录类型, 用于表单, 对应数据源 create 类型的方法\n single-record 单条记录类型, 对应数据源 get-item 类型的方法\n single-record-edit 单条记录·编辑类型, 对应数据源 get-item/update 类型的方法\n若数据源无对应方法, 则不能选择相应类型变量",
984
- "enum": [
985
- "new-record",
986
- "record-collection",
987
- "single-record",
988
- "single-record-edit"
989
- ],
990
- "type": "string"
991
- },
992
- "dataSourceName": {
993
- "description": "必填, 绑定的数据源名称",
994
- "type": "string"
995
- },
996
- "initMethod": {
997
- "description": "变量初始化的方法, 集合/单条记录类型变量需有该方法",
998
- "$ref": "#/definitions/IDataVarMethod"
999
- },
1000
- "updateMethod": {
1001
- "description": "变量更新时候的方法, 新纪录/单条记录·编辑类型需有该方法",
1002
- "$ref": "#/definitions/IDataVarMethod"
1003
- }
1004
- },
1005
- "required": [
1006
- "dataSourceName",
1007
- "name",
1008
- "varType"
1009
- ]
1010
- },
1011
- "IDataVarMethod": {
1012
- "description": "数据源变量关联的方法",
1013
- "type": "object",
1014
- "properties": {
1015
- "name": {
1016
- "description": "数据源的方法名称",
1017
- "type": "string"
1018
- },
1019
- "params": {
1020
- "description": "方法入参",
1021
- "type": "object",
1022
- "properties": {},
1023
- "additionalProperties": true
1024
- }
1025
- },
1026
- "required": [
1027
- "name"
1028
- ]
1029
- },
1030
- "ICodeResource": {
1031
- "type": "object",
1032
- "properties": {
1033
- "type": {
1034
- "description": "资源类型",
1035
- "type": "string",
1036
- "enum": [
1037
- "CODE"
1038
- ]
1039
- },
1040
- "code": {
1041
- "description": "必填, 代码片段",
1042
- "type": "string"
1043
- },
1044
- "description": {
1045
- "description": "选填, 代码片段的简介",
1046
- "type": "string"
1047
- },
1048
- "path": {
1049
- "description": "选填, 代码片段的路径, 可用于组建代码树",
1050
- "type": "string"
1051
- },
1052
- "codeType": {
1053
- "description": "选填, 代码类型",
1054
- "type": "string"
1055
- },
1056
- "name": {
1057
- "description": "必填,资源名",
1058
- "type": "string"
1059
- }
1060
- },
1061
- "required": [
1062
- "code",
1063
- "name",
1064
- "type"
1065
- ]
1066
- },
1067
- "IDatabaseDataSource": {
1068
- "description": "内建数据源",
1069
- "type": "object",
1070
- "properties": {
1071
- "type": {
1072
- "description": "数据源类型",
1073
- "type": "string",
1074
- "enum": [
1075
- "database"
1076
- ]
1077
- },
1078
- "configuration": {
1079
- "$ref": "#/definitions/IConfigurationBase",
1080
- "description": "数据源的公共配置"
1081
- },
1082
- "schema": {
1083
- "$ref": "#/definitions/IDatabaseSchema",
1084
- "description": "数据源模型信息"
1085
- },
1086
- "methods": {
1087
- "description": "数据源自定义方法, 数据库类型数据源设计上也可支持 http",
1088
- "type": "array",
1089
- "items": {
1090
- "anyOf": [
1091
- {
1092
- "$ref": "#/definitions/IHttpMethod"
1093
- },
1094
- {
1095
- "$ref": "#/definitions/ICloudMethod"
1096
- }
1097
- ]
1098
- }
1099
- },
1100
- "id": {
1101
- "description": "数据源ID",
1102
- "type": "string"
1103
- },
1104
- "title": {
1105
- "description": "数据源描述名称",
1106
- "type": "string"
1107
- },
1108
- "name": {
1109
- "description": "数据源标识",
1110
- "type": "string"
1111
- },
1112
- "description": {
1113
- "description": "数据源描述信息",
1114
- "type": "string"
1115
- },
1116
- "version": {
1117
- "description": "数据源描述信息的版本号",
1118
- "type": "string"
1119
- },
1120
- "schemaVersion": {
1121
- "description": "数据源描述使用的schema版本",
1122
- "type": "string"
1123
- }
1124
- },
1125
- "required": [
1126
- "configuration",
1127
- "description",
1128
- "id",
1129
- "methods",
1130
- "name",
1131
- "schema",
1132
- "schemaVersion",
1133
- "title",
1134
- "type",
1135
- "version"
1136
- ]
1137
- },
1138
- "IConfigurationBase": {
1139
- "type": "object",
1140
- "properties": {
1141
- "vars": {
1142
- "description": "公共变量",
1143
- "$ref": "#/definitions/IHttpField"
1144
- }
1145
- }
1146
- },
1147
- "IHttpField": {
1148
- "description": "http 配置的字段",
1149
- "type": "object",
1150
- "properties": {
1151
- "key": {
1152
- "description": "字段名称\n 仅根节点可选, 其他节点必填",
1153
- "type": [
1154
- "string",
1155
- "number"
1156
- ]
1157
- },
1158
- "type": {
1159
- "description": "字段数据类型\n 在 http body 中, 字段数据类型可以是 string, number, null, boolean, array, object\n 在 header 和 query中, 字段数据类型则只能是 string",
1160
- "type": "string"
1161
- },
1162
- "value": {
1163
- "description": "字段值, 若使用入参中的值, 则使用 {{xxx}} 形式\n 非 array 和 object 类型应必须有 value\n array 和 object 类型的, 若有绑定入参, 则有该值"
1164
- },
1165
- "items": {
1166
- "description": "字段类型若为 array 或 object 且无入参绑定, 则有该字段\n 若type为 array, IHttpField 的key为 number, 即数组索引\n 若type为 array, IHttpField 的key为 string, 即对象的key",
1167
- "type": "array",
1168
- "items": {
1169
- "$ref": "#/definitions/IHttpField"
1170
- }
1171
- }
1172
- },
1173
- "required": [
1174
- "type"
1175
- ]
1176
- },
1177
- "IDatabaseSchema": {
1178
- "description": "自建数据源模型信息",
1179
- "type": "object",
1180
- "properties": {
1181
- "x-kind": {
1182
- "description": "数据库类型, 默认 tcb",
1183
- "type": "string"
1184
- },
1185
- "x-defaultMethods": {
1186
- "description": "启用的内置方法: create, delete, update, getItem, getList, getRecords",
1187
- "type": "array",
1188
- "items": {
1189
- "type": "string"
1190
- }
1191
- },
1192
- "x-relatedType": {
1193
- "description": "新建/编辑 数据源不需要该字段\n后续优化,用于告诉服务端是否创建表格。 create 标识创建表格, exist 表示搜索确定表格",
1194
- "enum": [
1195
- "create",
1196
- "exist"
1197
- ],
1198
- "type": "string"
1199
- },
1200
- "x-viewId": {
1201
- "description": "新建/编辑数据源时不需要该字段, 运行态需要使用 viewId\n 当x-relatedType为exist时有效,对应模型的视图id",
1202
- "type": "string"
1203
- },
1204
- "type": {
1205
- "description": "字段类型: object",
1206
- "type": "string",
1207
- "enum": [
1208
- "object"
1209
- ]
1210
- },
1211
- "properties": {
1212
- "description": "对象的属性",
1213
- "type": "object",
1214
- "additionalProperties": {
1215
- "anyOf": [
1216
- {
1217
- "$ref": "#/definitions/IJsonSchemaObject"
1218
- },
1219
- {
1220
- "$ref": "#/definitions/IJsonSchemaString"
1221
- },
1222
- {
1223
- "$ref": "#/definitions/IJsonSchemaNumber"
1224
- },
1225
- {
1226
- "$ref": "#/definitions/IJsonSchemaBool"
1227
- },
1228
- {
1229
- "$ref": "#/definitions/IJsonSchemaArray"
1230
- }
1231
- ]
1232
- }
1233
- },
1234
- "additionalProperties": {
1235
- "description": "是否允许 properties 中未声明的字段, 可不传, 默认 true\n https://json-schema.org/understanding-json-schema/reference/object.html#id5",
1236
- "enum": [
1237
- true
1238
- ],
1239
- "type": "boolean"
1240
- },
1241
- "required": {
1242
- "description": "必填属性列表",
1243
- "type": "array",
1244
- "items": {
1245
- "type": "string"
1246
- }
1247
- },
1248
- "title": {
1249
- "description": "字段中文名称",
1250
- "type": "string"
1251
- },
1252
- "description": {
1253
- "description": "字段描述",
1254
- "type": "string"
1255
- },
1256
- "default": {
1257
- "description": "默认值, 与当前字段类型结构应当保持一致"
1258
- },
1259
- "x-required": {
1260
- "type": "boolean"
1261
- },
1262
- "x-id": {
1263
- "description": "前端UI冗余字段",
1264
- "type": "string"
1265
- },
1266
- "x-keyPath": {
1267
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1268
- "type": "string"
1269
- },
1270
- "x-index": {
1271
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1272
- "type": "number"
1273
- },
1274
- "x-unique": {
1275
- "description": "是否唯一",
1276
- "type": "boolean"
1277
- },
1278
- "enum": {
1279
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1280
- "type": "array",
1281
- "items": {}
1282
- },
1283
- "x-enumObj": {
1284
- "description": "枚举值, 详细描述对象, 供前端使用",
1285
- "type": "array",
1286
- "items": {
1287
- "$ref": "#/definitions/IEnumOption"
1288
- }
1289
- }
1290
- },
1291
- "required": [
1292
- "properties",
1293
- "type",
1294
- "x-defaultMethods",
1295
- "x-relatedType",
1296
- "x-viewId"
1297
- ]
1298
- },
1299
- "IJsonSchemaObject": {
1300
- "description": "对象",
1301
- "type": "object",
1302
- "properties": {
1303
- "type": {
1304
- "description": "字段类型: object",
1305
- "type": "string",
1306
- "enum": [
1307
- "object"
1308
- ]
1309
- },
1310
- "properties": {
1311
- "description": "对象的属性",
1312
- "type": "object",
1313
- "additionalProperties": {
1314
- "anyOf": [
1315
- {
1316
- "$ref": "#/definitions/IJsonSchemaObject"
1317
- },
1318
- {
1319
- "$ref": "#/definitions/IJsonSchemaString"
1320
- },
1321
- {
1322
- "$ref": "#/definitions/IJsonSchemaNumber"
1323
- },
1324
- {
1325
- "$ref": "#/definitions/IJsonSchemaBool"
1326
- },
1327
- {
1328
- "$ref": "#/definitions/IJsonSchemaArray"
1329
- }
1330
- ]
1331
- }
1332
- },
1333
- "additionalProperties": {
1334
- "description": "是否允许 properties 中未声明的字段, 可不传, 默认 true\n https://json-schema.org/understanding-json-schema/reference/object.html#id5",
1335
- "enum": [
1336
- true
1337
- ],
1338
- "type": "boolean"
1339
- },
1340
- "required": {
1341
- "description": "必填属性列表",
1342
- "type": "array",
1343
- "items": {
1344
- "type": "string"
1345
- }
1346
- },
1347
- "title": {
1348
- "description": "字段中文名称",
1349
- "type": "string"
1350
- },
1351
- "description": {
1352
- "description": "字段描述",
1353
- "type": "string"
1354
- },
1355
- "default": {
1356
- "description": "默认值, 与当前字段类型结构应当保持一致"
1357
- },
1358
- "x-required": {
1359
- "type": "boolean"
1360
- },
1361
- "x-id": {
1362
- "description": "前端UI冗余字段",
1363
- "type": "string"
1364
- },
1365
- "x-keyPath": {
1366
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1367
- "type": "string"
1368
- },
1369
- "x-index": {
1370
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1371
- "type": "number"
1372
- },
1373
- "x-unique": {
1374
- "description": "是否唯一",
1375
- "type": "boolean"
1376
- },
1377
- "enum": {
1378
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1379
- "type": "array",
1380
- "items": {}
1381
- },
1382
- "x-enumObj": {
1383
- "description": "枚举值, 详细描述对象, 供前端使用",
1384
- "type": "array",
1385
- "items": {
1386
- "$ref": "#/definitions/IEnumOption"
1387
- }
1388
- }
1389
- },
1390
- "required": [
1391
- "properties",
1392
- "type"
1393
- ]
1394
- },
1395
- "IJsonSchemaString": {
1396
- "description": "字符串",
1397
- "type": "object",
1398
- "properties": {
1399
- "type": {
1400
- "description": "字段类型: object",
1401
- "type": "string",
1402
- "enum": [
1403
- "string"
1404
- ]
1405
- },
1406
- "format": {
1407
- "description": "字段格式\n 目前支持的有\n email, tel, phone, cnName, url",
1408
- "type": "string"
1409
- },
1410
- "pattern": {
1411
- "type": "string"
1412
- },
1413
- "minLength": {
1414
- "type": "number"
1415
- },
1416
- "maxLength": {
1417
- "type": "number"
1418
- },
1419
- "title": {
1420
- "description": "字段中文名称",
1421
- "type": "string"
1422
- },
1423
- "description": {
1424
- "description": "字段描述",
1425
- "type": "string"
1426
- },
1427
- "default": {
1428
- "description": "默认值, 与当前字段类型结构应当保持一致"
1429
- },
1430
- "x-required": {
1431
- "type": "boolean"
1432
- },
1433
- "x-id": {
1434
- "description": "前端UI冗余字段",
1435
- "type": "string"
1436
- },
1437
- "x-keyPath": {
1438
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1439
- "type": "string"
1440
- },
1441
- "x-index": {
1442
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1443
- "type": "number"
1444
- },
1445
- "x-unique": {
1446
- "description": "是否唯一",
1447
- "type": "boolean"
1448
- },
1449
- "enum": {
1450
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1451
- "type": "array",
1452
- "items": {}
1453
- },
1454
- "x-enumObj": {
1455
- "description": "枚举值, 详细描述对象, 供前端使用",
1456
- "type": "array",
1457
- "items": {
1458
- "$ref": "#/definitions/IEnumOption"
1459
- }
1460
- },
1461
- "x-parent": {
1462
- "description": "关联父数据源内容\n必须string,number。(当前消息 id 是 string,_id: mongo string)\n需求相关:https://qxhe1g.axshare.com/#g=1&p=%E4%B8%BB%E5%AD%90%E6%98%8E%E7%BB%86%E5%AD%97%E6%AE%B5",
1463
- "type": "object",
1464
- "properties": {
1465
- "type": {
1466
- "description": "关联父数据源关系 related | father-son",
1467
- "enum": [
1468
- "father-son",
1469
- "related"
1470
- ],
1471
- "type": "string"
1472
- },
1473
- "parentViewId": {
1474
- "description": "关联的数据源viewID, 设计态不使用, 运行态使用",
1475
- "type": "string"
1476
- },
1477
- "parentDataSourceName": {
1478
- "type": "string"
1479
- },
1480
- "fatherAction": {
1481
- "description": "father-son 关系下有效\n prompt-not-delete(提示不允许删除)\n judge()",
1482
- "enum": [
1483
- "judge",
1484
- "prompt-not-delete"
1485
- ],
1486
- "type": "string"
1487
- }
1488
- },
1489
- "required": [
1490
- "parentDataSourceName",
1491
- "parentViewId",
1492
- "type"
1493
- ]
1494
- }
1495
- },
1496
- "required": [
1497
- "type"
1498
- ]
1499
- },
1500
- "IEnumOption": {
1501
- "description": "单个枚举成员",
1502
- "type": "object",
1503
- "properties": {
1504
- "label": {
1505
- "description": "枚举显示的文字",
1506
- "type": "string"
1507
- },
1508
- "value": {
1509
- "description": "内部存储的值"
1510
- },
1511
- "description": {
1512
- "description": "详细描述",
1513
- "type": "string"
1514
- }
1515
- },
1516
- "required": [
1517
- "label",
1518
- "value"
1519
- ]
1520
- },
1521
- "IJsonSchemaNumber": {
1522
- "description": "数字",
1523
- "type": "object",
1524
- "properties": {
1525
- "type": {
1526
- "description": "字段类型: object",
1527
- "type": "string",
1528
- "enum": [
1529
- "number"
1530
- ]
1531
- },
1532
- "format": {
1533
- "description": "字段格式\ndate, time, age",
1534
- "type": "string"
1535
- },
1536
- "minimum": {
1537
- "type": "number"
1538
- },
1539
- "maximum": {
1540
- "type": "number"
1541
- },
1542
- "title": {
1543
- "description": "字段中文名称",
1544
- "type": "string"
1545
- },
1546
- "description": {
1547
- "description": "字段描述",
1548
- "type": "string"
1549
- },
1550
- "default": {
1551
- "description": "默认值, 与当前字段类型结构应当保持一致"
1552
- },
1553
- "x-required": {
1554
- "type": "boolean"
1555
- },
1556
- "x-id": {
1557
- "description": "前端UI冗余字段",
1558
- "type": "string"
1559
- },
1560
- "x-keyPath": {
1561
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1562
- "type": "string"
1563
- },
1564
- "x-index": {
1565
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1566
- "type": "number"
1567
- },
1568
- "x-unique": {
1569
- "description": "是否唯一",
1570
- "type": "boolean"
1571
- },
1572
- "enum": {
1573
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1574
- "type": "array",
1575
- "items": {}
1576
- },
1577
- "x-enumObj": {
1578
- "description": "枚举值, 详细描述对象, 供前端使用",
1579
- "type": "array",
1580
- "items": {
1581
- "$ref": "#/definitions/IEnumOption"
1582
- }
1583
- },
1584
- "x-parent": {
1585
- "description": "关联父数据源内容\n必须string,number。(当前消息 id 是 string,_id: mongo string)\n需求相关:https://qxhe1g.axshare.com/#g=1&p=%E4%B8%BB%E5%AD%90%E6%98%8E%E7%BB%86%E5%AD%97%E6%AE%B5",
1586
- "type": "object",
1587
- "properties": {
1588
- "type": {
1589
- "description": "关联父数据源关系 related | father-son",
1590
- "enum": [
1591
- "father-son",
1592
- "related"
1593
- ],
1594
- "type": "string"
1595
- },
1596
- "parentViewId": {
1597
- "description": "关联的数据源viewID, 设计态不使用, 运行态使用",
1598
- "type": "string"
1599
- },
1600
- "parentDataSourceName": {
1601
- "type": "string"
1602
- },
1603
- "fatherAction": {
1604
- "description": "father-son 关系下有效\n prompt-not-delete(提示不允许删除)\n judge()",
1605
- "enum": [
1606
- "judge",
1607
- "prompt-not-delete"
1608
- ],
1609
- "type": "string"
1610
- }
1611
- },
1612
- "required": [
1613
- "parentDataSourceName",
1614
- "parentViewId",
1615
- "type"
1616
- ]
1617
- }
1618
- },
1619
- "required": [
1620
- "type"
1621
- ]
1622
- },
1623
- "IJsonSchemaBool": {
1624
- "description": "布尔",
1625
- "type": "object",
1626
- "properties": {
1627
- "type": {
1628
- "description": "字段类型: object",
1629
- "type": "string",
1630
- "enum": [
1631
- "boolean"
1632
- ]
1633
- },
1634
- "title": {
1635
- "description": "字段中文名称",
1636
- "type": "string"
1637
- },
1638
- "description": {
1639
- "description": "字段描述",
1640
- "type": "string"
1641
- },
1642
- "default": {
1643
- "description": "默认值, 与当前字段类型结构应当保持一致"
1644
- },
1645
- "x-required": {
1646
- "type": "boolean"
1647
- },
1648
- "x-id": {
1649
- "description": "前端UI冗余字段",
1650
- "type": "string"
1651
- },
1652
- "x-keyPath": {
1653
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1654
- "type": "string"
1655
- },
1656
- "x-index": {
1657
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1658
- "type": "number"
1659
- },
1660
- "x-unique": {
1661
- "description": "是否唯一",
1662
- "type": "boolean"
1663
- },
1664
- "enum": {
1665
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1666
- "type": "array",
1667
- "items": {}
1668
- },
1669
- "x-enumObj": {
1670
- "description": "枚举值, 详细描述对象, 供前端使用",
1671
- "type": "array",
1672
- "items": {
1673
- "$ref": "#/definitions/IEnumOption"
1674
- }
1675
- }
1676
- },
1677
- "required": [
1678
- "type"
1679
- ]
1680
- },
1681
- "IJsonSchemaArray": {
1682
- "description": "数组",
1683
- "type": "object",
1684
- "properties": {
1685
- "type": {
1686
- "description": "字段类型: object",
1687
- "type": "string",
1688
- "enum": [
1689
- "array"
1690
- ]
1691
- },
1692
- "items": {
1693
- "description": "数组成员",
1694
- "anyOf": [
1695
- {
1696
- "$ref": "#/definitions/IJsonSchemaObject"
1697
- },
1698
- {
1699
- "$ref": "#/definitions/IJsonSchemaString"
1700
- },
1701
- {
1702
- "$ref": "#/definitions/IJsonSchemaNumber"
1703
- },
1704
- {
1705
- "$ref": "#/definitions/IJsonSchemaBool"
1706
- },
1707
- {
1708
- "$ref": "#/definitions/IJsonSchemaArray"
1709
- }
1710
- ]
1711
- },
1712
- "title": {
1713
- "description": "字段中文名称",
1714
- "type": "string"
1715
- },
1716
- "description": {
1717
- "description": "字段描述",
1718
- "type": "string"
1719
- },
1720
- "default": {
1721
- "description": "默认值, 与当前字段类型结构应当保持一致"
1722
- },
1723
- "x-required": {
1724
- "type": "boolean"
1725
- },
1726
- "x-id": {
1727
- "description": "前端UI冗余字段",
1728
- "type": "string"
1729
- },
1730
- "x-keyPath": {
1731
- "description": "http 方法的出参中, 用于描述原始响应结果与出参的字段映射关系",
1732
- "type": "string"
1733
- },
1734
- "x-index": {
1735
- "description": "属性排序,用于前端展示字段的顺序,或者其他字段顺序相关操作,从1开始",
1736
- "type": "number"
1737
- },
1738
- "x-unique": {
1739
- "description": "是否唯一",
1740
- "type": "boolean"
1741
- },
1742
- "enum": {
1743
- "description": "枚举值, 只列出值, 方便利用 json schema 特性校验\n 这里需要注意, enum 需要与 x-enumObj 的信息对应:\n 若有枚举, 两个字段的内容应当匹配\n 若无枚举, 则无这两字段",
1744
- "type": "array",
1745
- "items": {}
1746
- },
1747
- "x-enumObj": {
1748
- "description": "枚举值, 详细描述对象, 供前端使用",
1749
- "type": "array",
1750
- "items": {
1751
- "$ref": "#/definitions/IEnumOption"
1752
- }
1753
- }
1754
- },
1755
- "required": [
1756
- "items",
1757
- "type"
1758
- ]
1759
- },
1760
- "IHttpMethod": {
1761
- "description": "http类型的数据源方法",
1762
- "type": "object",
1763
- "properties": {
1764
- "type": {
1765
- "description": "方法实现类型",
1766
- "type": "string",
1767
- "enum": [
1768
- "http"
1769
- ]
1770
- },
1771
- "calleeBody": {
1772
- "description": "请求核心信息",
1773
- "type": "object",
1774
- "properties": {
1775
- "url": {
1776
- "description": "请求地址",
1777
- "type": "string"
1778
- },
1779
- "method": {
1780
- "description": "请求方法",
1781
- "type": "string"
1782
- },
1783
- "header": {
1784
- "description": "自定义头",
1785
- "type": "object",
1786
- "properties": {
1787
- "values": {
1788
- "$ref": "#/definitions/IHttpField"
1789
- }
1790
- },
1791
- "required": [
1792
- "values"
1793
- ]
1794
- },
1795
- "query": {
1796
- "description": "query 查询参数",
1797
- "type": "object",
1798
- "properties": {
1799
- "values": {
1800
- "$ref": "#/definitions/IHttpField"
1801
- }
1802
- },
1803
- "required": [
1804
- "values"
1805
- ]
1806
- },
1807
- "body": {
1808
- "description": "请求body, 仅 post 和 get 方法有",
1809
- "type": "object",
1810
- "properties": {
1811
- "contentType": {
1812
- "enum": [
1813
- "form",
1814
- "json",
1815
- "none",
1816
- "xml"
1817
- ],
1818
- "type": "string"
1819
- },
1820
- "values": {
1821
- "$ref": "#/definitions/IHttpField"
1822
- }
1823
- },
1824
- "required": [
1825
- "contentType",
1826
- "values"
1827
- ]
1828
- }
1829
- },
1830
- "required": [
1831
- "method",
1832
- "url"
1833
- ]
1834
- },
1835
- "name": {
1836
- "description": "必填, 操作方法名, 在数据源中唯一\n\n以下为默认预置的方法名, 作为默认方法\n getList \n getRecords\n getItem\n update\n create\n delete",
1837
- "type": "string"
1838
- },
1839
- "title": {
1840
- "description": "选填, 数据源方法别名",
1841
- "type": "string"
1842
- },
1843
- "intent": {
1844
- "description": "必填, 方法分类\n get-list\n get-item\n update\n create\n delete",
1845
- "enum": [
1846
- "create",
1847
- "delete",
1848
- "get-item",
1849
- "get-list",
1850
- "update"
1851
- ],
1852
- "type": "string"
1853
- },
1854
- "description": {
1855
- "description": "选填, 数据源方法的描述",
1856
- "type": "string"
1857
- },
1858
- "disabled": {
1859
- "description": "方法是否禁用, 留空则默认启用\n 为true则方法定义后不实际使用",
1860
- "type": "boolean"
1861
- },
1862
- "inParams": {
1863
- "description": "选填, 入参结构",
1864
- "$ref": "#/definitions/IJsonSchemaObject"
1865
- },
1866
- "outParams": {
1867
- "$ref": "#/definitions/IJsonSchemaObject",
1868
- "description": "出参"
1869
- }
1870
- },
1871
- "required": [
1872
- "calleeBody",
1873
- "intent",
1874
- "name",
1875
- "outParams",
1876
- "title",
1877
- "type"
1878
- ]
1879
- },
1880
- "ICloudMethod": {
1881
- "description": "云函数类型的数据源方法",
1882
- "type": "object",
1883
- "properties": {
1884
- "type": {
1885
- "description": "必填, 方法的实现类型\n cloud-function 云函数",
1886
- "type": "string",
1887
- "enum": [
1888
- "cloud-function"
1889
- ]
1890
- },
1891
- "calleeBody": {
1892
- "description": "必填, 数据源方法的实现",
1893
- "type": "object",
1894
- "properties": {
1895
- "callee": {
1896
- "description": "即函数源码",
1897
- "type": "string"
1898
- },
1899
- "config": {
1900
- "description": "其他配置项, 如云函数执行环境配置, 函数依赖的包信息(需注意: 同一数据源同一类型 云函数/本地函数 的数据源实现方法中的依赖版本需兼容匹配)\n config: {deps: {'lodash': '*', 'request': '2.88'}}",
1901
- "type": "object",
1902
- "properties": {},
1903
- "additionalProperties": true
1904
- }
1905
- },
1906
- "required": [
1907
- "callee"
1908
- ]
1909
- },
1910
- "name": {
1911
- "description": "必填, 操作方法名, 在数据源中唯一\n\n以下为默认预置的方法名, 作为默认方法\n getList \n getRecords\n getItem\n update\n create\n delete",
1912
- "type": "string"
1913
- },
1914
- "title": {
1915
- "description": "选填, 数据源方法别名",
1916
- "type": "string"
1917
- },
1918
- "intent": {
1919
- "description": "必填, 方法分类\n get-list\n get-item\n update\n create\n delete",
1920
- "enum": [
1921
- "create",
1922
- "delete",
1923
- "get-item",
1924
- "get-list",
1925
- "update"
1926
- ],
1927
- "type": "string"
1928
- },
1929
- "description": {
1930
- "description": "选填, 数据源方法的描述",
1931
- "type": "string"
1932
- },
1933
- "disabled": {
1934
- "description": "方法是否禁用, 留空则默认启用\n 为true则方法定义后不实际使用",
1935
- "type": "boolean"
1936
- },
1937
- "inParams": {
1938
- "description": "选填, 入参结构",
1939
- "$ref": "#/definitions/IJsonSchemaObject"
1940
- },
1941
- "outParams": {
1942
- "$ref": "#/definitions/IJsonSchemaObject",
1943
- "description": "出参"
1944
- }
1945
- },
1946
- "required": [
1947
- "calleeBody",
1948
- "intent",
1949
- "name",
1950
- "outParams",
1951
- "title",
1952
- "type"
1953
- ]
1954
- },
1955
- "ICloudIntegrationDataSource": {
1956
- "description": "云端集成数据源",
1957
- "type": "object",
1958
- "properties": {
1959
- "type": {
1960
- "description": "数据源类型",
1961
- "type": "string",
1962
- "enum": [
1963
- "cloud-integration"
1964
- ]
1965
- },
1966
- "configuration": {
1967
- "$ref": "#/definitions/ICloudIntegrationConfig",
1968
- "description": "第三方数据源基础配置"
1969
- },
1970
- "methods": {
1971
- "description": "数据源自定义方法",
1972
- "type": "array",
1973
- "items": {
1974
- "anyOf": [
1975
- {
1976
- "$ref": "#/definitions/IHttpMethod"
1977
- },
1978
- {
1979
- "$ref": "#/definitions/ICloudMethod"
1980
- }
1981
- ]
1982
- }
1983
- },
1984
- "id": {
1985
- "description": "数据源ID",
1986
- "type": "string"
1987
- },
1988
- "title": {
1989
- "description": "数据源描述名称",
1990
- "type": "string"
1991
- },
1992
- "name": {
1993
- "description": "数据源标识",
1994
- "type": "string"
1995
- },
1996
- "description": {
1997
- "description": "数据源描述信息",
1998
- "type": "string"
1999
- },
2000
- "schema": {
2001
- "description": "数据源模型信息"
2002
- },
2003
- "version": {
2004
- "description": "数据源描述信息的版本号",
2005
- "type": "string"
2006
- },
2007
- "schemaVersion": {
2008
- "description": "数据源描述使用的schema版本",
2009
- "type": "string"
2010
- }
2011
- },
2012
- "required": [
2013
- "configuration",
2014
- "description",
2015
- "id",
2016
- "methods",
2017
- "name",
2018
- "schema",
2019
- "schemaVersion",
2020
- "title",
2021
- "type",
2022
- "version"
2023
- ]
2024
- },
2025
- "ICloudIntegrationConfig": {
2026
- "description": "云端集成类型的数据源配置",
2027
- "type": "object",
2028
- "properties": {
2029
- "provider": {
2030
- "description": "第三方数据源提供者\n tencent-meeting 腾讯会议\n tencent-docs 腾讯文档",
2031
- "type": "string"
2032
- },
2033
- "baseUrl": {
2034
- "description": "基准URL",
2035
- "type": "string"
2036
- },
2037
- "header": {
2038
- "description": "公共请求头",
2039
- "type": "object",
2040
- "properties": {
2041
- "values": {
2042
- "$ref": "#/definitions/IHttpField"
2043
- }
2044
- },
2045
- "required": [
2046
- "values"
2047
- ]
2048
- },
2049
- "vars": {
2050
- "description": "公共变量",
2051
- "$ref": "#/definitions/IHttpField"
2052
- }
2053
- }
2054
- },
2055
- "IPlatformAppExtra": {
2056
- "type": "object",
2057
- "properties": {
2058
- "historyType": {
2059
- "enum": [
2060
- "BROWSER",
2061
- "HASH"
2062
- ],
2063
- "type": "string"
2064
- },
2065
- "npmDependencies": {
2066
- "type": "object",
2067
- "additionalProperties": {
2068
- "type": "string"
2069
- }
2070
- },
2071
- "presetColors": {
2072
- "type": "array",
2073
- "items": {
2074
- "type": "string"
2075
- }
2076
- },
2077
- "maxID": {
2078
- "type": "number"
2079
- },
2080
- "plugins": {
2081
- "type": "array",
2082
- "items": {
2083
- "type": "object",
2084
- "properties": {
2085
- "title": {
2086
- "type": "string"
2087
- },
2088
- "name": {
2089
- "type": "string"
2090
- },
2091
- "module": {
2092
- "type": "string"
2093
- },
2094
- "type": {
2095
- "enum": [
2096
- "kbone",
2097
- "mp"
2098
- ],
2099
- "type": "string"
2100
- },
2101
- "version": {
2102
- "type": "string"
2103
- }
2104
- },
2105
- "required": [
2106
- "module",
2107
- "name",
2108
- "title",
2109
- "version"
2110
- ]
2111
- }
2112
- },
2113
- "rootPath": {
2114
- "type": [
2115
- "null",
2116
- "string"
2117
- ]
2118
- },
2119
- "themeVars": {
2120
- "type": "object",
2121
- "additionalProperties": {
2122
- "type": "string"
2123
- }
2124
- },
2125
- "appConfig": {
2126
- "type": "object",
2127
- "properties": {}
2128
- },
2129
- "miniprogramPlugins": {
2130
- "description": "小程序插件描述",
2131
- "type": "array",
2132
- "items": {
2133
- "type": "object",
2134
- "properties": {
2135
- "name": {
2136
- "type": "string"
2137
- },
2138
- "version": {
2139
- "type": "string"
2140
- },
2141
- "pluginAppId": {
2142
- "type": "string"
2143
- },
2144
- "componentConfigs": {
2145
- "type": "array",
2146
- "items": {
2147
- "allOf": [
2148
- {
2149
- "type": "object",
2150
- "properties": {},
2151
- "additionalProperties": true
2152
- },
2153
- {
2154
- "type": "object",
2155
- "properties": {
2156
- "isMiniProgramPlugins": {
2157
- "type": "boolean"
2158
- }
2159
- }
2160
- }
2161
- ]
2162
- }
2163
- }
2164
- },
2165
- "required": [
2166
- "componentConfigs",
2167
- "name",
2168
- "pluginAppId",
2169
- "version"
2170
- ]
2171
- }
2172
- }
2173
- }
2174
- }
2175
- },
2176
- "$schema": "http://json-schema.org/draft-07/schema#"
2177
- }