@ldsg/forms 0.3.32 → 0.3.33
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/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAe,MAAM,SAAS,CAAC;AAG/E,UAAU,kBAAkB;IAC1B;;OAEG;IACH,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,KAAK,eAAe,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,kBAAkB,CAAC;AAExE,qBAAa,aAAc,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAE1B,eAAe,EAAE,eAAe,CA6B9B;IAEF,mBAAmB,EAAE,mBAAmB,CAStC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FormsResource = void 0;
|
|
7
|
+
const apaas_constants_1 = require("@ldsg/apaas-constants");
|
|
7
8
|
const resource_1 = require("@ldsg/resource");
|
|
8
9
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
10
|
const handle_form_info_list_1 = require("./utils/handle-form-info-list");
|
|
@@ -14,12 +15,13 @@ class FormsResource extends resource_1.Resource {
|
|
|
14
15
|
const { id, formInfoList: thisFormInfoList, getFilteredResources } = this;
|
|
15
16
|
let formInfoList = thisFormInfoList;
|
|
16
17
|
if (!formInfoList) {
|
|
17
|
-
const { resources } = getFilteredResources({
|
|
18
|
+
const { resources: formResources } = getFilteredResources({
|
|
19
|
+
kind: apaas_constants_1.ApaasResourceKind.FORM,
|
|
18
20
|
parentId: id,
|
|
19
21
|
});
|
|
20
|
-
const mapRes =
|
|
22
|
+
const mapRes = formResources.map((formResource) => {
|
|
21
23
|
var _a;
|
|
22
|
-
return (_a =
|
|
24
|
+
return (_a = formResource.getFormInfo) === null || _a === void 0 ? void 0 : _a.call(formResource, params);
|
|
23
25
|
});
|
|
24
26
|
const filterRes = lodash_1.default.filter(mapRes, (value) => !lodash_1.default.isUndefined(value));
|
|
25
27
|
formInfoList = filterRes;
|
|
@@ -50,7 +50,7 @@ test("forms", () => {
|
|
|
50
50
|
settings: {
|
|
51
51
|
title: "测试对象1测试字段1",
|
|
52
52
|
description: "",
|
|
53
|
-
|
|
53
|
+
slug: "test-1",
|
|
54
54
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
55
55
|
properties: {
|
|
56
56
|
max: "10",
|
|
@@ -64,7 +64,7 @@ test("forms", () => {
|
|
|
64
64
|
settings: {
|
|
65
65
|
title: "测试对象1测试字段2",
|
|
66
66
|
description: "",
|
|
67
|
-
|
|
67
|
+
slug: "test-2",
|
|
68
68
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
69
69
|
properties: {
|
|
70
70
|
max: "10",
|
|
@@ -78,7 +78,7 @@ test("forms", () => {
|
|
|
78
78
|
settings: {
|
|
79
79
|
title: "测试对象1测试字段3",
|
|
80
80
|
description: "",
|
|
81
|
-
|
|
81
|
+
slug: "test-3",
|
|
82
82
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
83
83
|
properties: {
|
|
84
84
|
max: "10",
|
|
@@ -92,7 +92,7 @@ test("forms", () => {
|
|
|
92
92
|
settings: {
|
|
93
93
|
title: "测试对象1",
|
|
94
94
|
description: "",
|
|
95
|
-
|
|
95
|
+
slug: "test-object-1",
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
98
|
new object_field_1.ObjectFieldResource({
|
|
@@ -102,7 +102,7 @@ test("forms", () => {
|
|
|
102
102
|
settings: {
|
|
103
103
|
title: "测试对象2测试字段1",
|
|
104
104
|
description: "",
|
|
105
|
-
|
|
105
|
+
slug: "test-1",
|
|
106
106
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
107
107
|
properties: {
|
|
108
108
|
max: "10",
|
|
@@ -116,7 +116,7 @@ test("forms", () => {
|
|
|
116
116
|
settings: {
|
|
117
117
|
title: "测试对象2",
|
|
118
118
|
description: "",
|
|
119
|
-
|
|
119
|
+
slug: "test-object-2",
|
|
120
120
|
},
|
|
121
121
|
});
|
|
122
122
|
const formsResource = new resource_2.FormsResource({
|
|
@@ -201,7 +201,7 @@ test("form and forms query fields", () => {
|
|
|
201
201
|
settings: {
|
|
202
202
|
title: "测试对象字段",
|
|
203
203
|
description: "",
|
|
204
|
-
|
|
204
|
+
slug: "test_field_1",
|
|
205
205
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
206
206
|
properties: {
|
|
207
207
|
max: "10",
|
|
@@ -215,7 +215,7 @@ test("form and forms query fields", () => {
|
|
|
215
215
|
settings: {
|
|
216
216
|
title: "测试对象1",
|
|
217
217
|
description: "",
|
|
218
|
-
|
|
218
|
+
slug: "test_object_1",
|
|
219
219
|
fields: ["test-object-1-field-1"],
|
|
220
220
|
},
|
|
221
221
|
});
|
|
@@ -226,7 +226,7 @@ test("form and forms query fields", () => {
|
|
|
226
226
|
settings: {
|
|
227
227
|
title: "测试对象2",
|
|
228
228
|
description: "",
|
|
229
|
-
|
|
229
|
+
slug: "test_object_2",
|
|
230
230
|
fields: [],
|
|
231
231
|
},
|
|
232
232
|
});
|
|
@@ -4,12 +4,12 @@ exports.getInputITC = void 0;
|
|
|
4
4
|
const get_field_config_map_definition_1 = require("./get-field-config-map-definition");
|
|
5
5
|
const getInputITC = (params) => {
|
|
6
6
|
const { schemaComposer, inputObjectInfo } = params;
|
|
7
|
-
const { title, description,
|
|
7
|
+
const { title, description, objectTypeName, fieldInfoList } = inputObjectInfo;
|
|
8
8
|
const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
|
|
9
9
|
fieldInfoList,
|
|
10
10
|
});
|
|
11
11
|
const definition = {
|
|
12
|
-
name,
|
|
12
|
+
name: objectTypeName,
|
|
13
13
|
fields: fieldConfigMapDefinition,
|
|
14
14
|
};
|
|
15
15
|
const inputITC = schemaComposer.createInputTC(definition);
|
|
@@ -4,12 +4,12 @@ exports.getOutputOTC = void 0;
|
|
|
4
4
|
const get_field_config_map_definition_1 = require("./get-field-config-map-definition");
|
|
5
5
|
const getOutputOTC = (params) => {
|
|
6
6
|
const { schemaComposer, outputObjectInfo } = params;
|
|
7
|
-
const { title, description,
|
|
7
|
+
const { title, description, objectTypeName, fieldInfoList } = outputObjectInfo;
|
|
8
8
|
const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
|
|
9
9
|
fieldInfoList,
|
|
10
10
|
});
|
|
11
11
|
const definition = {
|
|
12
|
-
name,
|
|
12
|
+
name: objectTypeName,
|
|
13
13
|
fields: fieldConfigMapDefinition,
|
|
14
14
|
};
|
|
15
15
|
const outputOTC = schemaComposer.createObjectTC(definition);
|
package/package.json
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/forms",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "wanxger",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"types": "dist",
|
|
10
8
|
"files": [
|
|
11
9
|
"dist/"
|
|
12
10
|
],
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
13
16
|
"dependencies": {
|
|
14
17
|
"@formily/json-schema": "^2.3.1",
|
|
15
18
|
"json-schema": "^0.4.0",
|
|
16
19
|
"lodash": "^4.17.21",
|
|
17
20
|
"zod": "^4.1.11",
|
|
18
|
-
"@ldsg/
|
|
19
|
-
"@ldsg/
|
|
20
|
-
"@ldsg/
|
|
21
|
-
"@ldsg/resource-definition": "0.3.
|
|
21
|
+
"@ldsg/handler": "0.3.33",
|
|
22
|
+
"@ldsg/resource": "0.3.33",
|
|
23
|
+
"@ldsg/field-type": "0.3.33",
|
|
24
|
+
"@ldsg/resource-definition": "0.3.33"
|
|
22
25
|
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@types/jest": "^29.5.2",
|
|
@@ -34,14 +37,12 @@
|
|
|
34
37
|
"ts-jest": "^29.1.5",
|
|
35
38
|
"ts-node": "^10.9.2",
|
|
36
39
|
"typescript": "^5.8.3",
|
|
37
|
-
"@ldsg/
|
|
38
|
-
"@ldsg/
|
|
39
|
-
"@ldsg/object
|
|
40
|
-
"@ldsg/
|
|
41
|
-
"@ldsg/
|
|
42
|
-
|
|
43
|
-
"publishConfig": {
|
|
44
|
-
"access": "public"
|
|
40
|
+
"@ldsg/apaas-constants": "0.3.33",
|
|
41
|
+
"@ldsg/graphql": "0.3.33",
|
|
42
|
+
"@ldsg/object": "0.3.33",
|
|
43
|
+
"@ldsg/object-field": "0.3.33",
|
|
44
|
+
"@ldsg/types": "0.3.33",
|
|
45
|
+
"@ldsg/workflow": "0.3.33"
|
|
45
46
|
},
|
|
46
47
|
"scripts": {
|
|
47
48
|
"build": "tsc --project tsconfig.build.json",
|