@ldsg/workflow-node-type 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.
Files changed (44) hide show
  1. package/dist/__tests__/unit.js +27 -26
  2. package/dist/constants.d.ts +3 -3
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +16 -16
  5. package/dist/handler.d.ts +5 -7
  6. package/dist/handler.d.ts.map +1 -1
  7. package/dist/index.d.ts +6 -6
  8. package/dist/instantiate-resource.d.ts +4 -4
  9. package/dist/instantiate-resource.js +1 -1
  10. package/dist/resource-records/end/handler/index.d.ts +2 -2
  11. package/dist/resource-records/end/handler/index.d.ts.map +1 -1
  12. package/dist/resource-records/end/handler/index.js +4 -5
  13. package/dist/resource-records/end/handler/utils/handler.d.ts +2 -2
  14. package/dist/resource-records/end/handler/utils/handler.d.ts.map +1 -1
  15. package/dist/resource-records/end/handler/utils/handler.js +1 -1
  16. package/dist/resource-records/end/index.d.ts +3 -3
  17. package/dist/resource-records/end/index.d.ts.map +1 -1
  18. package/dist/resource-records/end/index.js +3 -4
  19. package/dist/resource-records/index.d.ts +2 -2
  20. package/dist/resource-records/index.d.ts.map +1 -1
  21. package/dist/resource-records/index.js +1 -1
  22. package/dist/resource-records/start/handler/index.d.ts +2 -2
  23. package/dist/resource-records/start/handler/index.d.ts.map +1 -1
  24. package/dist/resource-records/start/handler/index.js +4 -5
  25. package/dist/resource-records/start/handler/utils/handler.d.ts +2 -2
  26. package/dist/resource-records/start/handler/utils/handler.d.ts.map +1 -1
  27. package/dist/resource-records/start/handler/utils/handler.js +1 -1
  28. package/dist/resource-records/start/index.d.ts +3 -3
  29. package/dist/resource-records/start/index.d.ts.map +1 -1
  30. package/dist/resource-records/start/index.js +3 -4
  31. package/dist/resource.d.ts +2 -2
  32. package/dist/resource.d.ts.map +1 -1
  33. package/dist/resource.js +3 -4
  34. package/dist/types/index.d.ts +3 -2
  35. package/dist/types/index.d.ts.map +1 -1
  36. package/dist/types/index.js +1 -0
  37. package/dist/types/resource-extended-handler.d.ts +4 -0
  38. package/dist/types/resource-extended-handler.d.ts.map +1 -0
  39. package/dist/types/resource-extended-handler.js +2 -0
  40. package/dist/types/specific-resource-settings.d.ts +1 -1
  41. package/dist/types/specific-resource-settings.d.ts.map +1 -1
  42. package/dist/types/workflow-node-type.d.ts +4 -5
  43. package/dist/types/workflow-node-type.d.ts.map +1 -1
  44. package/package.json +20 -13
@@ -5,46 +5,47 @@ const resource_1 = require("../resource");
5
5
  const handler = async (params) => {
6
6
  const { variables } = params;
7
7
  const res = {
8
- variables,
8
+ variables
9
9
  };
10
10
  return res;
11
11
  };
12
- test("field type", async () => {
12
+ test('field type', async () => {
13
13
  new handler_1.HandlerResource({
14
- id: "test-handler",
15
- kind: "handler",
16
- parentId: "root",
14
+ id: 'test-handler',
15
+ kind: 'handler',
16
+ parentId: 'root',
17
17
  settings: {
18
- title: "测试处理程序",
19
- description: "",
20
- code: "",
18
+ title: '测试处理程序',
19
+ description: '',
20
+ code: '',
21
21
  dependencies: [],
22
- handler,
23
- },
22
+ handler
23
+ }
24
24
  });
25
25
  const workflowNodeTypeResource = new resource_1.WorkflowNodeTypeResource({
26
- id: "test-workflow-node-type",
27
- kind: "workflow_node_type",
28
- parentId: "root",
26
+ id: 'test-workflow-node-type',
27
+ kind: 'workflow_node_type',
28
+ parentId: 'root',
29
29
  settings: {
30
- title: "文本",
31
- description: "可用来存储各种文本",
32
- handlerResourceId: "test-handler",
33
- },
30
+ title: '文本',
31
+ description: '可用来存储各种文本',
32
+ handlerResourceId: 'test-handler'
33
+ }
34
34
  });
35
- const { workflowNodeTypeInfo: { execute: workflowNodeTypeExecute }, } = workflowNodeTypeResource.getWorkflowNodeTypeInfo();
35
+ const { workflowNodeTypeInfo: { execute: workflowNodeTypeExecute } } = workflowNodeTypeResource.getWorkflowNodeTypeInfo();
36
+ const context = {};
36
37
  const { variables: variables1 } = await workflowNodeTypeExecute({
38
+ context,
37
39
  variables: {
38
- hello: "world",
39
- },
40
- context: {},
40
+ hello: 'world'
41
+ }
41
42
  });
42
- expect(variables1).toEqual({ hello: "world" });
43
+ expect(variables1).toEqual({ hello: 'world' });
43
44
  const { variables: variables2 } = await workflowNodeTypeExecute({
45
+ context,
44
46
  variables: {
45
- name: "test",
46
- },
47
- context: {},
47
+ name: 'test'
48
+ }
48
49
  });
49
- expect(variables2).toEqual({ name: "test" });
50
+ expect(variables2).toEqual({ name: 'test' });
50
51
  });
@@ -1,6 +1,6 @@
1
- import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
- import { GeneralResourceSettings } from "@ldsg/types";
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
  * 实例化资源处理程序普通资源配置
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,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,uBAIlE,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAIzD,CAAC;AAEJ,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,kDAAkD,EAAE,uBAI9D,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,mDAAmD,EAAE,+BAmB/D,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,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,0CAG5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kDAAkD,EAAE,uBAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mDAAmD,EAAE,+BAkBjE,CAAC"}
package/dist/constants.js CHANGED
@@ -7,8 +7,8 @@ const constants_1 = require("@ldsg/constants");
7
7
  * 实例化资源处理程序普通资源配置
8
8
  */
9
9
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
10
- title: "工作流节点类型实例化资源处理程序",
11
- description: "",
10
+ title: '工作流节点类型实例化资源处理程序',
11
+ description: ''
12
12
  };
13
13
  /**
14
14
  * Instantiate Resource Handler Specific Resource Settings
@@ -19,34 +19,34 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
19
19
  code: `export * from "@ldsg/workflow-node-type";`,
20
20
  dependencies: [
21
21
  {
22
- name: "@ldsg/workflow-node-type",
23
- },
24
- ],
22
+ name: '@ldsg/workflow-node-type'
23
+ }
24
+ ]
25
25
  };
26
26
  exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
27
- title: "工作流节点类型资源定义",
28
- description: "",
27
+ title: '工作流节点类型资源定义',
28
+ description: ''
29
29
  };
30
30
  exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
31
- kind: "workflow_node_type",
32
- parentKind: constants_1.ROOT_RESOURCE_KIND,
31
+ kind: 'workflow_node_type',
32
+ parentKind: constants_1.ROOT_RESOURCE_KIND
33
33
  };
34
34
  /**
35
35
  * Default Extended Handler General Resource Settings
36
36
  * 默认扩展处理程序普通资源配置
37
37
  */
38
38
  exports.DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS = {
39
- title: "工作流节点类型默认扩展处理程序",
40
- description: "",
39
+ title: '工作流节点类型默认扩展处理程序',
40
+ description: ''
41
41
  };
42
42
  /**
43
43
  * Default Extended Handler Specific Resource Settings
44
44
  * 默认扩展处理程序特殊资源配置
45
45
  */
46
46
  exports.DEFAULT_EXTENDED_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
47
- code: `import { WorkflowNodeTypeResourceHandler } from "@ldsg/workflow-node-type";
47
+ code: `import { WorkflowNodeTypeResourceExtendedHandler } from "@ldsg/workflow-node-type";
48
48
 
49
- export const handler: WorkflowNodeTypeResourceHandler = async (params) => {
49
+ export const handler: WorkflowNodeTypeResourceExtendedHandler = async (params) => {
50
50
  const { variables } = params;
51
51
 
52
52
  const res = {
@@ -58,7 +58,7 @@ export const handler: WorkflowNodeTypeResourceHandler = async (params) => {
58
58
  `,
59
59
  dependencies: [
60
60
  {
61
- name: "@ldsg/workflow-node-type",
62
- },
63
- ],
61
+ name: '@ldsg/workflow-node-type'
62
+ }
63
+ ]
64
64
  };
package/dist/handler.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
- import { WorkflowNodeTypeResource } from "./resource";
4
- import { WorkflowNodeTypeSpecificResourceSettings } from "./types";
5
- export declare const handler: Handler<[
6
- InstantiateResourceParams<HandlerExtendedResourceSettings<WorkflowNodeTypeSpecificResourceSettings>>
7
- ], InstantiateResourceRes<WorkflowNodeTypeResource>>;
1
+ import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
3
+ import { WorkflowNodeTypeResource } from './resource';
4
+ import { WorkflowNodeTypeSpecificResourceSettings } from './types';
5
+ export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<WorkflowNodeTypeSpecificResourceSettings>>, InstantiateResourceRes<WorkflowNodeTypeResource>>;
8
6
  //# sourceMappingURL=handler.d.ts.map
@@ -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,EACL,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAEnE,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B;IACE,yBAAyB,CACvB,+BAA+B,CAAC,wCAAwC,CAAC,CAC1E;CACF,EACD,sBAAsB,CAAC,wBAAwB,CAAC,CAC3B,CAAC"}
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,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC;AAEnE,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,wCAAwC,CAAC,CAAC,EACpG,sBAAsB,CAAC,wBAAwB,CAAC,CAC3B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./constants";
2
- export * from "./handler";
3
- export * from "./instantiate-resource";
4
- export * from "./resource";
5
- export * from "./resource-records";
6
- export * from "./types";
1
+ export * from './constants';
2
+ export * from './handler';
3
+ export * from './instantiate-resource';
4
+ export * from './resource';
5
+ export * from './resource-records';
6
+ export * from './types';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResource } from "@ldsg/resource";
3
- import { WorkflowNodeTypeResource } from "./resource";
4
- import { WorkflowNodeTypeSpecificResourceSettings } from "./types";
1
+ import { HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResource } from '@ldsg/resource';
3
+ import { WorkflowNodeTypeResource } from './resource';
4
+ import { WorkflowNodeTypeSpecificResourceSettings } from './types';
5
5
  export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<WorkflowNodeTypeSpecificResourceSettings>, WorkflowNodeTypeResource>;
6
6
  //# sourceMappingURL=instantiate-resource.d.ts.map
@@ -6,7 +6,7 @@ const instantiateResource = (params) => {
6
6
  const { resourceConstructorParams } = params;
7
7
  const resource = new resource_1.WorkflowNodeTypeResource(resourceConstructorParams);
8
8
  const res = {
9
- resource,
9
+ resource
10
10
  };
11
11
  return res;
12
12
  };
@@ -1,4 +1,4 @@
1
- import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
1
+ import { HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
3
  export declare const endWorkflowNodeTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resource-records/end/handler/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,eAAO,MAAM,wCAAwC,EAAE,cAAc,CAAC,+BAA+B,CAYlG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resource-records/end/handler/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,eAAO,MAAM,wCAAwC,EAAE,cAAc,CAAC,+BAA+B,CAUpG,CAAC"}
@@ -10,10 +10,9 @@ exports.endWorkflowNodeTypeHandlerResourceRecord = {
10
10
  kind: handler_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
11
11
  parentId: constants_1.ROOT_RESOURCE_ID,
12
12
  settings: {
13
- title: "结束工作流节点类型",
14
- description: "",
15
- code: "",
13
+ title: '结束工作流节点类型处理程序',
14
+ code: '',
16
15
  dependencies: [],
17
- handler: handler_2.handler,
18
- },
16
+ handler: handler_2.handler
17
+ }
19
18
  };
@@ -1,3 +1,3 @@
1
- import { WorkflowNodeTypeResourceHandler } from "../../../../types";
2
- export declare const handler: WorkflowNodeTypeResourceHandler;
1
+ import { WorkflowNodeTypeResourceExtendedHandler } from '../../../../types';
2
+ export declare const handler: WorkflowNodeTypeResourceExtendedHandler;
3
3
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../../src/resource-records/end/handler/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAEpE,eAAO,MAAM,OAAO,EAAE,+BAQrB,CAAC"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../../src/resource-records/end/handler/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAE5E,eAAO,MAAM,OAAO,EAAE,uCAQrB,CAAC"}
@@ -4,7 +4,7 @@ exports.handler = void 0;
4
4
  const handler = async (params) => {
5
5
  const { variables } = params;
6
6
  const res = {
7
- variables,
7
+ variables
8
8
  };
9
9
  return res;
10
10
  };
@@ -1,5 +1,5 @@
1
- import { ResourceRecord } from "@ldsg/types";
2
- import { WorkflowNodeTypeSpecificResourceSettings } from "../../types";
3
- export * from "./handler";
1
+ import { ResourceRecord } from '@ldsg/types';
2
+ import { WorkflowNodeTypeSpecificResourceSettings } from '../../types';
3
+ export * from './handler';
4
4
  export declare const endWorkflowNodeTypeResourceRecord: ResourceRecord<WorkflowNodeTypeSpecificResourceSettings>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resource-records/end/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAGvE,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC,wCAAwC,CAUpG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resource-records/end/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAGvE,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC,wCAAwC,CAQtG,CAAC"}
@@ -25,8 +25,7 @@ exports.endWorkflowNodeTypeResourceRecord = {
25
25
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
26
26
  parentId: constants_1.ROOT_RESOURCE_ID,
27
27
  settings: {
28
- title: "结束工作流节点类型",
29
- description: "",
30
- handlerResourceId: constants_3.END_WORKFLOW_NODE_TYPE_HANDLER_RESOURCE_ID,
31
- },
28
+ title: '结束工作流节点类型',
29
+ handlerResourceId: constants_3.END_WORKFLOW_NODE_TYPE_HANDLER_RESOURCE_ID
30
+ }
32
31
  };
@@ -1,4 +1,4 @@
1
- export * from "./end";
2
- export * from "./start";
1
+ export * from './end';
2
+ export * from './start';
3
3
  export declare const WORKFLOW_NODE_TYPE_RESOURCE_RECORDS: import("@ldsg/types").ResourceRecord<import("..").WorkflowNodeTypeSpecificResourceSettings>[];
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-records/index.ts"],"names":[],"mappings":"AASA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,mCAAmC,+FAK/C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-records/index.ts"],"names":[],"mappings":"AAGA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AAExB,eAAO,MAAM,mCAAmC,+FAK/C,CAAC"}
@@ -23,5 +23,5 @@ exports.WORKFLOW_NODE_TYPE_RESOURCE_RECORDS = [
23
23
  end_1.endWorkflowNodeTypeResourceRecord,
24
24
  end_1.endWorkflowNodeTypeHandlerResourceRecord,
25
25
  start_1.startWorkflowNodeTypeResourceRecord,
26
- start_1.startWorkflowNodeTypeHandlerResourceRecord,
26
+ start_1.startWorkflowNodeTypeHandlerResourceRecord
27
27
  ];
@@ -1,4 +1,4 @@
1
- import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
1
+ import { HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
3
  export declare const startWorkflowNodeTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resource-records/start/handler/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,eAAO,MAAM,0CAA0C,EAAE,cAAc,CAAC,+BAA+B,CAYpG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/resource-records/start/handler/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAI7C,eAAO,MAAM,0CAA0C,EAAE,cAAc,CAAC,+BAA+B,CAUtG,CAAC"}
@@ -10,10 +10,9 @@ exports.startWorkflowNodeTypeHandlerResourceRecord = {
10
10
  kind: handler_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
11
11
  parentId: constants_1.ROOT_RESOURCE_ID,
12
12
  settings: {
13
- title: "开始工作流节点类型",
14
- description: "",
15
- code: "",
13
+ title: '开始工作流节点类型处理程序',
14
+ code: '',
16
15
  dependencies: [],
17
- handler: handler_2.handler,
18
- },
16
+ handler: handler_2.handler
17
+ }
19
18
  };
@@ -1,3 +1,3 @@
1
- import { WorkflowNodeTypeResourceHandler } from "../../../../types";
2
- export declare const handler: WorkflowNodeTypeResourceHandler;
1
+ import { WorkflowNodeTypeResourceExtendedHandler } from '../../../../types';
2
+ export declare const handler: WorkflowNodeTypeResourceExtendedHandler;
3
3
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../../src/resource-records/start/handler/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAEpE,eAAO,MAAM,OAAO,EAAE,+BAQrB,CAAC"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../../src/resource-records/start/handler/utils/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAE5E,eAAO,MAAM,OAAO,EAAE,uCAQrB,CAAC"}
@@ -4,7 +4,7 @@ exports.handler = void 0;
4
4
  const handler = async (params) => {
5
5
  const { variables } = params;
6
6
  const res = {
7
- variables,
7
+ variables
8
8
  };
9
9
  return res;
10
10
  };
@@ -1,5 +1,5 @@
1
- import { ResourceRecord } from "@ldsg/types";
2
- import { WorkflowNodeTypeSpecificResourceSettings } from "../../types";
3
- export * from "./handler";
1
+ import { ResourceRecord } from '@ldsg/types';
2
+ import { WorkflowNodeTypeSpecificResourceSettings } from '../../types';
3
+ export * from './handler';
4
4
  export declare const startWorkflowNodeTypeResourceRecord: ResourceRecord<WorkflowNodeTypeSpecificResourceSettings>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resource-records/start/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAGvE,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,mCAAmC,EAAE,cAAc,CAAC,wCAAwC,CAUtG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resource-records/start/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAAE,wCAAwC,EAAE,MAAM,aAAa,CAAC;AAGvE,cAAc,WAAW,CAAC;AAE1B,eAAO,MAAM,mCAAmC,EAAE,cAAc,CAAC,wCAAwC,CAQxG,CAAC"}
@@ -25,8 +25,7 @@ exports.startWorkflowNodeTypeResourceRecord = {
25
25
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
26
26
  parentId: constants_1.ROOT_RESOURCE_ID,
27
27
  settings: {
28
- title: "开始",
29
- description: "",
30
- handlerResourceId: constants_3.START_WORKFLOW_NODE_TYPE_HANDLER_RESOURCE_ID,
31
- },
28
+ title: '开始工作流节点类型',
29
+ handlerResourceId: constants_3.START_WORKFLOW_NODE_TYPE_HANDLER_RESOURCE_ID
30
+ }
32
31
  };
@@ -1,5 +1,5 @@
1
- import { HandlerExtendedResource } from "@ldsg/handler";
2
- import { WorkflowNodeTypeInfo, WorkflowNodeTypeSpecificResourceSettings } from "./types";
1
+ import { HandlerExtendedResource } from '@ldsg/handler';
2
+ import { WorkflowNodeTypeInfo, WorkflowNodeTypeSpecificResourceSettings } from './types';
3
3
  export interface GetWorkflowNodeTypeInfoRes {
4
4
  workflowNodeTypeInfo: WorkflowNodeTypeInfo;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EACL,oBAAoB,EAEpB,wCAAwC,EACzC,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,0BAA0B,CAAC;AAEvE,qBAAa,wBAAyB,SAAQ,uBAAuB,CAAC,wCAAwC,CAAC;IAC7G,uBAAuB,EAAE,uBAAuB,CAa9C;CACH"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAEL,oBAAoB,EACpB,wCAAwC,EACzC,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,0BAA0B,CAAC;AAEvE,qBAAa,wBAAyB,SAAQ,uBAAuB,CAAC,wCAAwC,CAAC;IAC7G,uBAAuB,EAAE,uBAAuB,CAU9C;CACH"}
package/dist/resource.js CHANGED
@@ -6,12 +6,11 @@ class WorkflowNodeTypeResource extends handler_1.HandlerExtendedResource {
6
6
  constructor() {
7
7
  super(...arguments);
8
8
  this.getWorkflowNodeTypeInfo = () => {
9
- const { getExtendedHandler } = this;
10
- const extendedHandler = getExtendedHandler();
9
+ const { executeExtendedHandler } = this;
11
10
  const res = {
12
11
  workflowNodeTypeInfo: {
13
- execute: extendedHandler,
14
- },
12
+ execute: executeExtendedHandler
13
+ }
15
14
  };
16
15
  return res;
17
16
  };
@@ -1,3 +1,4 @@
1
- export * from "./specific-resource-settings";
2
- export * from "./workflow-node-type";
1
+ export * from './resource-extended-handler';
2
+ export * from './specific-resource-settings';
3
+ export * from './workflow-node-type';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sBAAsB,CAAC"}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./resource-extended-handler"), exports);
17
18
  __exportStar(require("./specific-resource-settings"), exports);
18
19
  __exportStar(require("./workflow-node-type"), exports);
@@ -0,0 +1,4 @@
1
+ import { ResourceExtendedHandler } from '@ldsg/handler';
2
+ import { WorkflowNodeTypeExecuteParams, WorkflowNodeTypeExecuteRes } from './workflow-node-type';
3
+ export type WorkflowNodeTypeResourceExtendedHandler<InputVariables = any, OutputVariables = any, Context = any> = ResourceExtendedHandler<WorkflowNodeTypeExecuteParams<InputVariables, Context>, WorkflowNodeTypeExecuteRes<OutputVariables>>;
4
+ //# sourceMappingURL=resource-extended-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-extended-handler.d.ts","sourceRoot":"","sources":["../../src/types/resource-extended-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAEjG,MAAM,MAAM,uCAAuC,CACjD,cAAc,GAAG,GAAG,EACpB,eAAe,GAAG,GAAG,EACrB,OAAO,GAAG,GAAG,IACX,uBAAuB,CACzB,6BAA6B,CAAC,cAAc,EAAE,OAAO,CAAC,EACtD,0BAA0B,CAAC,eAAe,CAAC,CAC5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,4 @@
1
- import { SpecificResourceSettings } from "@ldsg/types";
1
+ import { SpecificResourceSettings } from '@ldsg/types';
2
2
  export interface WorkflowNodeTypeSpecificResourceSettings extends SpecificResourceSettings {
3
3
  }
4
4
  //# sourceMappingURL=specific-resource-settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,wCACf,SAAQ,wBAAwB;CAAG"}
1
+ {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,wCAAyC,SAAQ,wBAAwB;CAAG"}
@@ -1,13 +1,13 @@
1
- import { WorkflowNodeExecuteParams, WorkflowNodeExecuteRes } from "@ldsg/workflow";
2
- export interface WorkflowNodeTypeExecuteParams extends WorkflowNodeExecuteParams {
1
+ import { WorkflowNodeExecuteParams, WorkflowNodeExecuteRes } from '@ldsg/workflow';
2
+ export interface WorkflowNodeTypeExecuteParams<InputVariables = any, Context = any> extends WorkflowNodeExecuteParams<InputVariables, Context> {
3
3
  }
4
- export interface WorkflowNodeTypeExecuteRes extends WorkflowNodeExecuteRes {
4
+ export interface WorkflowNodeTypeExecuteRes<OutputVariables = any> extends WorkflowNodeExecuteRes<OutputVariables> {
5
5
  }
6
6
  /**
7
7
  * 工作流执行方法
8
8
  * 工作执行时,实际运行的方法
9
9
  */
10
- export type WorkflowNodeTypeExecute = (params: WorkflowNodeTypeExecuteParams) => Promise<WorkflowNodeTypeExecuteRes>;
10
+ export type WorkflowNodeTypeExecute<InputVariables = any, OutputVariables = any, Context = any> = (params: WorkflowNodeTypeExecuteParams<InputVariables, Context>) => Promise<WorkflowNodeTypeExecuteRes<OutputVariables>>;
11
11
  export interface WorkflowNodeTypeInfo {
12
12
  /**
13
13
  * 工作流节点类型执行方法
@@ -15,5 +15,4 @@ export interface WorkflowNodeTypeInfo {
15
15
  */
16
16
  execute: WorkflowNodeTypeExecute;
17
17
  }
18
- export type WorkflowNodeTypeResourceHandler = WorkflowNodeTypeExecute;
19
18
  //# sourceMappingURL=workflow-node-type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-node-type.d.ts","sourceRoot":"","sources":["../../src/types/workflow-node-type.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,MAAM,WAAW,6BACf,SAAQ,yBAAyB;CAAG;AAEtC,MAAM,WAAW,0BAA2B,SAAQ,sBAAsB;CAAG;AAE7E;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,CACpC,MAAM,EAAE,6BAA6B,KAClC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAEzC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,OAAO,EAAE,uBAAuB,CAAC;CAClC;AAED,MAAM,MAAM,+BAA+B,GAAG,uBAAuB,CAAC"}
1
+ {"version":3,"file":"workflow-node-type.d.ts","sourceRoot":"","sources":["../../src/types/workflow-node-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,MAAM,WAAW,6BAA6B,CAAC,cAAc,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,CAChF,SAAQ,yBAAyB,CAAC,cAAc,EAAE,OAAO,CAAC;CAAG;AAE/D,MAAM,WAAW,0BAA0B,CAAC,eAAe,GAAG,GAAG,CAC/D,SAAQ,sBAAsB,CAAC,eAAe,CAAC;CAAG;AAEpD;;;GAGG;AACH,MAAM,MAAM,uBAAuB,CAAC,cAAc,GAAG,GAAG,EAAE,eAAe,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CAChG,MAAM,EAAE,6BAA6B,CAAC,cAAc,EAAE,OAAO,CAAC,KAC3D,OAAO,CAAC,0BAA0B,CAAC,eAAe,CAAC,CAAC,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,OAAO,EAAE,uBAAuB,CAAC;CAClC"}
package/package.json CHANGED
@@ -1,31 +1,38 @@
1
1
  {
2
2
  "name": "@ldsg/workflow-node-type",
3
- "version": "0.3.8",
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
14
  "json-schema": "0.4.0",
18
15
  "jsonata": "^2.0.6",
19
16
  "lodash": "^4.17.21",
20
- "@ldsg/handler": "0.3.8",
21
- "@ldsg/resource-definition": "0.3.8",
22
- "@ldsg/workflow": "0.3.8",
23
- "@ldsg/resource": "0.3.8"
17
+ "@ldsg/constants": "0.3.10",
18
+ "@ldsg/handler": "0.3.10",
19
+ "@ldsg/resource": "0.3.10",
20
+ "@ldsg/resource-definition": "0.3.10",
21
+ "@ldsg/workflow": "0.3.10"
24
22
  },
25
23
  "devDependencies": {
24
+ "@types/jest": "^29.5.2",
26
25
  "@types/json-schema": "^7.0.15",
27
26
  "@types/lodash": "^4.14.202",
28
- "@ldsg/types": "0.3.8"
27
+ "jest": "^29.5.0",
28
+ "supertest": "^6.3.4",
29
+ "ts-jest": "^29.1.5",
30
+ "ts-node": "^10.9.2",
31
+ "typescript": "^5.8.3",
32
+ "@ldsg/types": "0.3.10"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
29
36
  },
30
37
  "scripts": {
31
38
  "build": "tsc --project tsconfig.build.json",