@ldsg/form 0.3.8 → 0.3.10
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 +68 -68
- package/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -9
- package/dist/handler.d.ts +5 -7
- package/dist/handler.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/instantiate-resource.d.ts +4 -4
- package/dist/instantiate-resource.js +1 -1
- package/dist/resource.d.ts +3 -3
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts +1 -1
- package/package.json +22 -17
package/dist/__tests__/unit.js
CHANGED
|
@@ -6,107 +6,107 @@ const object_1 = require("@ldsg/object");
|
|
|
6
6
|
const object_field_1 = require("@ldsg/object-field");
|
|
7
7
|
const workflow_1 = require("@ldsg/workflow");
|
|
8
8
|
const resource_1 = require("../resource");
|
|
9
|
-
test(
|
|
9
|
+
test('unit', () => {
|
|
10
10
|
new handler_1.HandlerResource(field_type_1.stringFieldTypeHandlerResourceRecord);
|
|
11
11
|
new field_type_1.FieldTypeResource(field_type_1.stringFieldTypeResourceRecord);
|
|
12
12
|
new object_1.ObjectResource({
|
|
13
|
-
id:
|
|
14
|
-
kind:
|
|
15
|
-
parentId:
|
|
13
|
+
id: 'test-object-1',
|
|
14
|
+
kind: 'object',
|
|
15
|
+
parentId: 'root',
|
|
16
16
|
settings: {
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
19
|
-
name:
|
|
20
|
-
}
|
|
17
|
+
title: '测试对象1',
|
|
18
|
+
description: '',
|
|
19
|
+
name: 'test-object-1'
|
|
20
|
+
}
|
|
21
21
|
});
|
|
22
22
|
new object_field_1.ObjectFieldResource({
|
|
23
|
-
id:
|
|
24
|
-
kind:
|
|
25
|
-
parentId:
|
|
23
|
+
id: 'test-object-1-field-1',
|
|
24
|
+
kind: 'object_field',
|
|
25
|
+
parentId: 'test-object-1',
|
|
26
26
|
settings: {
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
29
|
-
name:
|
|
27
|
+
title: '测试对象1测试字段1',
|
|
28
|
+
description: '',
|
|
29
|
+
name: 'test-1',
|
|
30
30
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
31
31
|
properties: {
|
|
32
|
-
max:
|
|
33
|
-
}
|
|
34
|
-
}
|
|
32
|
+
max: '10'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
35
|
});
|
|
36
36
|
new object_field_1.ObjectFieldResource({
|
|
37
|
-
id:
|
|
38
|
-
kind:
|
|
39
|
-
parentId:
|
|
37
|
+
id: 'test-object-1-field-2',
|
|
38
|
+
kind: 'object_field',
|
|
39
|
+
parentId: 'test-object-1',
|
|
40
40
|
settings: {
|
|
41
|
-
title:
|
|
42
|
-
description:
|
|
43
|
-
name:
|
|
41
|
+
title: '测试对象1测试字段2',
|
|
42
|
+
description: '',
|
|
43
|
+
name: 'test-2',
|
|
44
44
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
45
45
|
properties: {
|
|
46
|
-
max:
|
|
47
|
-
}
|
|
48
|
-
}
|
|
46
|
+
max: '10'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
49
|
});
|
|
50
50
|
new object_field_1.ObjectFieldResource({
|
|
51
|
-
id:
|
|
52
|
-
kind:
|
|
53
|
-
parentId:
|
|
51
|
+
id: 'test-object-1-field-3',
|
|
52
|
+
kind: 'object_field',
|
|
53
|
+
parentId: 'test-object-1',
|
|
54
54
|
settings: {
|
|
55
|
-
title:
|
|
56
|
-
description:
|
|
57
|
-
name:
|
|
55
|
+
title: '测试对象1测试字段3',
|
|
56
|
+
description: '',
|
|
57
|
+
name: 'test-3',
|
|
58
58
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
59
59
|
properties: {
|
|
60
|
-
max:
|
|
61
|
-
}
|
|
62
|
-
}
|
|
60
|
+
max: '10'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
63
|
});
|
|
64
64
|
new object_1.ObjectResource({
|
|
65
|
-
id:
|
|
66
|
-
kind:
|
|
67
|
-
parentId:
|
|
65
|
+
id: 'test-object-2',
|
|
66
|
+
kind: 'object',
|
|
67
|
+
parentId: 'root',
|
|
68
68
|
settings: {
|
|
69
|
-
title:
|
|
70
|
-
description:
|
|
71
|
-
name:
|
|
72
|
-
}
|
|
69
|
+
title: '测试对象2',
|
|
70
|
+
description: '',
|
|
71
|
+
name: 'test-object-2'
|
|
72
|
+
}
|
|
73
73
|
});
|
|
74
74
|
new object_field_1.ObjectFieldResource({
|
|
75
|
-
id:
|
|
76
|
-
kind:
|
|
77
|
-
parentId:
|
|
75
|
+
id: 'test-object-2-field-1',
|
|
76
|
+
kind: 'object_field',
|
|
77
|
+
parentId: 'test-object-2',
|
|
78
78
|
settings: {
|
|
79
|
-
title:
|
|
80
|
-
description:
|
|
81
|
-
name:
|
|
79
|
+
title: '测试对象2测试字段1',
|
|
80
|
+
description: '',
|
|
81
|
+
name: 'test-1',
|
|
82
82
|
fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
|
|
83
83
|
properties: {
|
|
84
|
-
max:
|
|
85
|
-
}
|
|
86
|
-
}
|
|
84
|
+
max: '10'
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
87
|
});
|
|
88
88
|
new workflow_1.WorkflowResource({
|
|
89
|
-
id:
|
|
90
|
-
kind:
|
|
91
|
-
parentId:
|
|
89
|
+
id: 'test-workflow',
|
|
90
|
+
kind: 'workflow',
|
|
91
|
+
parentId: 'root',
|
|
92
92
|
settings: {
|
|
93
|
-
title:
|
|
94
|
-
description:
|
|
95
|
-
startWorkflowNodeResourceId:
|
|
96
|
-
endWorkflowNodeResourceId:
|
|
97
|
-
}
|
|
93
|
+
title: '测试工作流',
|
|
94
|
+
description: '',
|
|
95
|
+
startWorkflowNodeResourceId: '',
|
|
96
|
+
endWorkflowNodeResourceId: ''
|
|
97
|
+
}
|
|
98
98
|
});
|
|
99
99
|
const formResource = new resource_1.FormResource({
|
|
100
|
-
id:
|
|
101
|
-
kind:
|
|
102
|
-
parentId:
|
|
100
|
+
id: 'test-form',
|
|
101
|
+
kind: 'form',
|
|
102
|
+
parentId: 'forms',
|
|
103
103
|
settings: {
|
|
104
|
-
title:
|
|
105
|
-
description:
|
|
106
|
-
name:
|
|
107
|
-
inputObjectResourceId:
|
|
108
|
-
outputObjectResourceId:
|
|
109
|
-
}
|
|
104
|
+
title: '测试表单',
|
|
105
|
+
description: '',
|
|
106
|
+
name: 'test-form',
|
|
107
|
+
inputObjectResourceId: 'test-object-1',
|
|
108
|
+
outputObjectResourceId: 'test-object-2'
|
|
109
|
+
}
|
|
110
110
|
});
|
|
111
111
|
const getFormInfoRes = formResource.getFormInfo();
|
|
112
112
|
expect(getFormInfoRes).toMatchSnapshot();
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerSpecificResourceSettings } from
|
|
2
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
3
|
-
import { GeneralResourceSettings } from
|
|
1
|
+
import { HandlerSpecificResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition';
|
|
3
|
+
import { GeneralResourceSettings } from '@ldsg/types';
|
|
4
4
|
/**
|
|
5
5
|
* Instantiate Resource Handler General Resource Settings
|
|
6
6
|
* 实例化资源处理程序普通资源配置
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAGpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAOrE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAE5D,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
|
|
4
|
-
const forms_1 = require("@ldsg/forms");
|
|
5
4
|
/**
|
|
6
5
|
* Instantiate Resource Handler General Resource Settings
|
|
7
6
|
* 实例化资源处理程序普通资源配置
|
|
8
7
|
*/
|
|
9
8
|
exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
|
|
10
|
-
title:
|
|
11
|
-
description:
|
|
9
|
+
title: '表单资源处理程序',
|
|
10
|
+
description: ''
|
|
12
11
|
};
|
|
13
12
|
/**
|
|
14
13
|
* Instantiate Resource Handler Specific Resource Settings
|
|
@@ -19,12 +18,14 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
|
|
|
19
18
|
code: `export * from "@ldsg/form";`,
|
|
20
19
|
dependencies: [
|
|
21
20
|
{
|
|
22
|
-
name:
|
|
23
|
-
}
|
|
24
|
-
]
|
|
21
|
+
name: '@ldsg/form'
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
|
|
26
|
+
title: '表单资源定义',
|
|
27
|
+
description: ''
|
|
25
28
|
};
|
|
26
|
-
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "表单资源定义", description: "" };
|
|
27
29
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
|
|
28
|
-
kind:
|
|
29
|
-
parentKind: forms_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
|
|
30
|
+
kind: 'form'
|
|
30
31
|
};
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Handler, HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResourceParams, InstantiateResourceRes } from
|
|
3
|
-
import { FormResource } from
|
|
4
|
-
import { FormSpecificResourceSettings } from
|
|
5
|
-
export declare const handler: Handler<
|
|
6
|
-
InstantiateResourceParams<HandlerExtendedResourceSettings<FormSpecificResourceSettings>>
|
|
7
|
-
], InstantiateResourceRes<FormResource>>;
|
|
1
|
+
import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
|
|
3
|
+
import { FormResource } from './resource';
|
|
4
|
+
import { FormSpecificResourceSettings } from './types';
|
|
5
|
+
export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<FormSpecificResourceSettings>>, InstantiateResourceRes<FormResource>>;
|
|
8
6
|
//# sourceMappingURL=handler.d.ts.map
|
package/dist/handler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,4BAA4B,CAAC,CAAC,EACxF,sBAAsB,CAAC,YAAY,CAAC,CACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './handler';
|
|
3
|
+
export * from './instantiate-resource';
|
|
4
|
+
export * from './resource';
|
|
5
|
+
export * from './types';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResource } from
|
|
3
|
-
import { FormResource } from
|
|
4
|
-
import { FormSpecificResourceSettings } from
|
|
1
|
+
import { HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResource } from '@ldsg/resource';
|
|
3
|
+
import { FormResource } from './resource';
|
|
4
|
+
import { FormSpecificResourceSettings } from './types';
|
|
5
5
|
export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<FormSpecificResourceSettings>, FormResource>;
|
|
6
6
|
//# sourceMappingURL=instantiate-resource.d.ts.map
|
package/dist/resource.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { GetFormInfo } from
|
|
2
|
-
import { Resource } from
|
|
3
|
-
import { FormSpecificResourceSettings } from
|
|
1
|
+
import { GetFormInfo } from '@ldsg/forms';
|
|
2
|
+
import { Resource } from '@ldsg/resource';
|
|
3
|
+
import { FormSpecificResourceSettings } from './types';
|
|
4
4
|
export declare class FormResource extends Resource<FormSpecificResourceSettings> {
|
|
5
5
|
getFormInfo: GetFormInfo;
|
|
6
6
|
}
|
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;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,YAAa,SAAQ,QAAQ,CAAC,4BAA4B,CAAC;IACtE,WAAW,EAAE,WAAW,
|
|
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;AAC1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,qBAAa,YAAa,SAAQ,QAAQ,CAAC,4BAA4B,CAAC;IACtE,WAAW,EAAE,WAAW,CAuBtB;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -6,7 +6,7 @@ class FormResource extends resource_1.Resource {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
this.getFormInfo = (params) => {
|
|
9
|
-
const { id, settings: { title, description, name }, getResourcesFromSettings
|
|
9
|
+
const { id, settings: { title, description, name }, getResourcesFromSettings } = this;
|
|
10
10
|
const { inputObjectResource, outputObjectResource } = getResourcesFromSettings();
|
|
11
11
|
const { objectInfo: inputObjectInfo } = inputObjectResource.getObjectInfo(params);
|
|
12
12
|
const { objectInfo: outputObjectInfo } = outputObjectResource.getObjectInfo(params);
|
|
@@ -16,7 +16,7 @@ class FormResource extends resource_1.Resource {
|
|
|
16
16
|
description,
|
|
17
17
|
name,
|
|
18
18
|
inputObjectInfo,
|
|
19
|
-
outputObjectInfo
|
|
19
|
+
outputObjectInfo
|
|
20
20
|
};
|
|
21
21
|
return res;
|
|
22
22
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './specific-resource-settings';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/form",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.10",
|
|
4
4
|
"description": "",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "wanxger",
|
|
5
8
|
"main": "dist/index.js",
|
|
9
|
+
"types": "dist",
|
|
6
10
|
"files": [
|
|
7
11
|
"dist/"
|
|
8
12
|
],
|
|
9
|
-
"types": "dist",
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "wanxger",
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
15
|
-
},
|
|
16
13
|
"dependencies": {
|
|
17
|
-
"@ldsg/handler": "0.3.
|
|
18
|
-
"@ldsg/resource": "0.3.
|
|
19
|
-
"@ldsg/resource
|
|
14
|
+
"@ldsg/handler": "0.3.10",
|
|
15
|
+
"@ldsg/resource-definition": "0.3.10",
|
|
16
|
+
"@ldsg/resource": "0.3.10"
|
|
20
17
|
},
|
|
21
18
|
"devDependencies": {
|
|
19
|
+
"@types/jest": "^29.5.2",
|
|
22
20
|
"@types/supertest": "^6.0.0",
|
|
21
|
+
"jest": "^29.5.0",
|
|
23
22
|
"supertest": "^6.3.4",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"@ldsg/
|
|
28
|
-
"@ldsg/
|
|
29
|
-
"@ldsg/
|
|
23
|
+
"ts-jest": "^29.1.5",
|
|
24
|
+
"ts-node": "^10.9.2",
|
|
25
|
+
"typescript": "^5.8.3",
|
|
26
|
+
"@ldsg/field-type": "0.3.10",
|
|
27
|
+
"@ldsg/forms": "0.3.10",
|
|
28
|
+
"@ldsg/object-field": "0.3.10",
|
|
29
|
+
"@ldsg/types": "0.3.10",
|
|
30
|
+
"@ldsg/workflow": "0.3.10",
|
|
31
|
+
"@ldsg/object": "0.3.10"
|
|
32
|
+
},
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
30
35
|
},
|
|
31
36
|
"scripts": {
|
|
32
37
|
"build": "tsc --project tsconfig.build.json",
|