@ldsg/form 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/__tests__/unit.js
CHANGED
|
@@ -16,7 +16,7 @@ test("unit", () => {
|
|
|
16
16
|
settings: {
|
|
17
17
|
title: "测试对象1",
|
|
18
18
|
description: "",
|
|
19
|
-
|
|
19
|
+
slug: "test-object-1",
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
new object_field_1.ObjectFieldResource({
|
|
@@ -26,7 +26,7 @@ test("unit", () => {
|
|
|
26
26
|
settings: {
|
|
27
27
|
title: "测试对象1测试字段1",
|
|
28
28
|
description: "",
|
|
29
|
-
|
|
29
|
+
slug: "test-1",
|
|
30
30
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
31
31
|
properties: {
|
|
32
32
|
max: "10",
|
|
@@ -40,7 +40,7 @@ test("unit", () => {
|
|
|
40
40
|
settings: {
|
|
41
41
|
title: "测试对象1测试字段2",
|
|
42
42
|
description: "",
|
|
43
|
-
|
|
43
|
+
slug: "test-2",
|
|
44
44
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
45
45
|
properties: {
|
|
46
46
|
max: "10",
|
|
@@ -54,7 +54,7 @@ test("unit", () => {
|
|
|
54
54
|
settings: {
|
|
55
55
|
title: "测试对象1测试字段3",
|
|
56
56
|
description: "",
|
|
57
|
-
|
|
57
|
+
slug: "test-3",
|
|
58
58
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
59
59
|
properties: {
|
|
60
60
|
max: "10",
|
|
@@ -68,7 +68,7 @@ test("unit", () => {
|
|
|
68
68
|
settings: {
|
|
69
69
|
title: "测试对象2",
|
|
70
70
|
description: "",
|
|
71
|
-
|
|
71
|
+
slug: "test-object-2",
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
74
|
new object_field_1.ObjectFieldResource({
|
|
@@ -78,7 +78,7 @@ test("unit", () => {
|
|
|
78
78
|
settings: {
|
|
79
79
|
title: "测试对象2测试字段1",
|
|
80
80
|
description: "",
|
|
81
|
-
|
|
81
|
+
slug: "test-1",
|
|
82
82
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
83
83
|
properties: {
|
|
84
84
|
max: "10",
|
|
@@ -103,7 +103,7 @@ test("unit", () => {
|
|
|
103
103
|
settings: {
|
|
104
104
|
title: "测试表单",
|
|
105
105
|
description: "",
|
|
106
|
-
|
|
106
|
+
slug: "test-form",
|
|
107
107
|
inputObjectResourceId: "test-object-1",
|
|
108
108
|
outputObjectResourceId: "test-object-2",
|
|
109
109
|
},
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,YAAa,SAAQ,QAAQ,CAAC,4BAA4B,CAAC;IACtE,WAAW,EAAE,WAAW,CA6BtB;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.FormResource = void 0;
|
|
4
7
|
const resource_1 = require("@ldsg/resource");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
5
9
|
class FormResource extends resource_1.Resource {
|
|
6
10
|
constructor() {
|
|
7
11
|
super(...arguments);
|
|
8
12
|
this.getFormInfo = (params) => {
|
|
9
|
-
const { id, settings: { title, description,
|
|
13
|
+
const { id, settings: { title, description, slug }, getResourcesFromSettings, } = this;
|
|
14
|
+
const name = lodash_1.default.camelCase(slug);
|
|
10
15
|
const { inputObjectResource, outputObjectResource } = getResourcesFromSettings();
|
|
11
16
|
const { objectInfo: inputObjectInfo } = inputObjectResource.getObjectInfo(params);
|
|
12
17
|
const { objectInfo: outputObjectInfo } = outputObjectResource.getObjectInfo(params);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const FormSpecificResourceSettingsSchema: z.ZodObject<{
|
|
3
|
-
|
|
3
|
+
slug: z.ZodString;
|
|
4
4
|
inputObjectResourceId: z.ZodString;
|
|
5
5
|
outputObjectResourceId: z.ZodString;
|
|
6
6
|
}, z.core.$catchall<z.ZodAny>>;
|
|
7
7
|
export declare const SpecificResourceSettingsSchema: z.ZodObject<{
|
|
8
|
-
|
|
8
|
+
slug: z.ZodString;
|
|
9
9
|
inputObjectResourceId: z.ZodString;
|
|
10
10
|
outputObjectResourceId: z.ZodString;
|
|
11
11
|
}, z.core.$catchall<z.ZodAny>>;
|
package/package.json
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/form",
|
|
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": {
|
|
17
|
+
"lodash": "^4.17.21",
|
|
14
18
|
"zod": "^4.1.11",
|
|
15
|
-
"@ldsg/handler": "0.3.
|
|
16
|
-
"@ldsg/resource": "0.3.
|
|
17
|
-
"@ldsg/resource-definition": "0.3.
|
|
19
|
+
"@ldsg/handler": "0.3.33",
|
|
20
|
+
"@ldsg/resource": "0.3.33",
|
|
21
|
+
"@ldsg/resource-definition": "0.3.33"
|
|
18
22
|
},
|
|
19
23
|
"devDependencies": {
|
|
20
24
|
"@types/jest": "^29.5.2",
|
|
25
|
+
"@types/lodash": "^4.17.0",
|
|
21
26
|
"@types/supertest": "^6.0.0",
|
|
22
27
|
"jest": "^29.5.0",
|
|
23
28
|
"oxfmt": "latest",
|
|
@@ -26,15 +31,12 @@
|
|
|
26
31
|
"ts-jest": "^29.1.5",
|
|
27
32
|
"ts-node": "^10.9.2",
|
|
28
33
|
"typescript": "^5.8.3",
|
|
29
|
-
"@ldsg/field-type": "0.3.
|
|
30
|
-
"@ldsg/forms": "0.3.
|
|
31
|
-
"@ldsg/object": "0.3.
|
|
32
|
-
"@ldsg/object-field": "0.3.
|
|
33
|
-
"@ldsg/
|
|
34
|
-
"@ldsg/
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
34
|
+
"@ldsg/field-type": "0.3.33",
|
|
35
|
+
"@ldsg/forms": "0.3.33",
|
|
36
|
+
"@ldsg/object": "0.3.33",
|
|
37
|
+
"@ldsg/object-field": "0.3.33",
|
|
38
|
+
"@ldsg/workflow": "0.3.33",
|
|
39
|
+
"@ldsg/types": "0.3.33"
|
|
38
40
|
},
|
|
39
41
|
"scripts": {
|
|
40
42
|
"build": "tsc --project tsconfig.build.json",
|