@managespace/sdk 0.0.161 → 0.0.162
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/extensibility/types/mapped-ports.d.ts +1 -1
- package/dist/extensibility/types/mapped-ports.d.ts.map +1 -1
- package/dist/extensibility/types/step-function-signature.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow-step.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow-step.js +1 -7
- package/dist/extensibility/workflow/workflow.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow.js +20 -30
- package/package.json +1 -1
- package/src/extensibility/types/mapped-ports.ts +2 -2
- package/src/extensibility/types/step-function-signature.ts +1 -1
- package/src/extensibility/workflow/workflow-step.ts +0 -10
- package/src/extensibility/workflow/workflow.ts +32 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefinedWorkflowStep } from '../workflow/workflow-step';
|
|
2
2
|
import { DefaultPorts } from './default-result';
|
|
3
3
|
export type MappedPorts<T extends string = DefaultPorts> = {
|
|
4
|
-
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep
|
|
4
|
+
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<any>;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=mapped-ports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapped-ports.d.ts","sourceRoot":"","sources":["../../../src/extensibility/types/mapped-ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"mapped-ports.d.ts","sourceRoot":"","sources":["../../../src/extensibility/types/mapped-ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI;KAEtD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC;CACjE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-function-signature.d.ts","sourceRoot":"","sources":["../../../src/extensibility/types/step-function-signature.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"step-function-signature.d.ts","sourceRoot":"","sources":["../../../src/extensibility/types/step-function-signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACH,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI,CACjE,OAAO,EAAE,uBAAuB,GAAG,GAAG,EACtC,GAAG,EAAE,UAAU,GAAG;IACd,qBAAqB,EAAE;QACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACtE,CAAC;CACL,EACD,KAAK,EAAE,GAAG,KACT,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow-step.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow-step.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow-step.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAE/D,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI;IAC/D,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACnC,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,mBAAmB,CAAC,CAAC,CAAC,CAAC;CACnE,CAAC;AAEF,eAAO,MAAM,kBAAkB,iGAY9B,CAAC"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineWorkflowStep = void 0;
|
|
4
|
-
const defineWorkflowStep = (
|
|
5
|
-
// callback: (
|
|
6
|
-
// payload: WorkflowStepBasePayload & any,
|
|
7
|
-
// api: DefaultApi,
|
|
8
|
-
// state: any,
|
|
9
|
-
// ) => Promise<WorkflowStepReturnType<T>>,
|
|
10
|
-
callback) => {
|
|
4
|
+
const defineWorkflowStep = (callback) => {
|
|
11
5
|
const step = {
|
|
12
6
|
callback,
|
|
13
7
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAsB,MAAM,iBAAiB,CAAC;AAE1E,eAAO,MAAM,MAAM,qGAGD,MAAM;;;;CAGvB,CAAC;AAGF,eAAO,MAAM,cAAc,iCAAkC,GAAG,EAAE;kCAI5B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE3C,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineWorkflow = exports.define = void 0;
|
|
4
|
+
const workflow_step_1 = require("./workflow-step");
|
|
4
5
|
const define = (fn, ports, maxRunCount) => {
|
|
5
6
|
return { fn, ports, maxRunCount };
|
|
6
7
|
};
|
|
@@ -14,33 +15,22 @@ const defineWorkflow = (...args) => {
|
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
exports.defineWorkflow = defineWorkflow;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
|
|
37
|
-
// define<test>(stepTest, {
|
|
38
|
-
// // ManualInputReceived: stepTestTwo,
|
|
39
|
-
// '1': stepTestTwo,
|
|
40
|
-
// }),
|
|
41
|
-
// define<DefaultPorts>(stepTestTwo, {
|
|
42
|
-
// ManualInputReceived: stepTestTwo,
|
|
43
|
-
// Success: 'End',
|
|
44
|
-
// // '1': stepTest,
|
|
45
|
-
// }),
|
|
46
|
-
// );
|
|
18
|
+
const stepTest = (0, workflow_step_1.defineWorkflowStep)(async (payload, api, state) => {
|
|
19
|
+
return {
|
|
20
|
+
result: 'one',
|
|
21
|
+
state: {},
|
|
22
|
+
};
|
|
23
|
+
}).setDescription('test');
|
|
24
|
+
const stepTestTwo = (0, workflow_step_1.defineWorkflowStep)(async (payload, api, state) => {
|
|
25
|
+
return {
|
|
26
|
+
result: 'Success',
|
|
27
|
+
state: {},
|
|
28
|
+
};
|
|
29
|
+
}).setDescription('test');
|
|
30
|
+
const defineTest = (0, exports.defineWorkflow)((0, exports.define)(stepTest, {
|
|
31
|
+
one: stepTestTwo,
|
|
32
|
+
three: stepTest,
|
|
33
|
+
}), (0, exports.define)(stepTestTwo, {
|
|
34
|
+
ManualInputReceived: stepTest,
|
|
35
|
+
Success: 'End',
|
|
36
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefinedWorkflowStep } from '../workflow/workflow-step';
|
|
2
2
|
import { DefaultPorts } from './default-result';
|
|
3
|
-
import { StepFunctionSignature } from './step-function-signature';
|
|
4
3
|
|
|
5
4
|
export type MappedPorts<T extends string = DefaultPorts> = {
|
|
6
|
-
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep
|
|
5
|
+
// [K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<T>;
|
|
6
|
+
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<any>;
|
|
7
7
|
};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { DefaultApi } from '../../generated';
|
|
2
1
|
import { DefaultPorts, StepFunctionSignature } from '../types';
|
|
3
|
-
import {
|
|
4
|
-
WorkflowStepBasePayload,
|
|
5
|
-
WorkflowStepReturnType,
|
|
6
|
-
} from '../types/workflow-step';
|
|
7
2
|
|
|
8
3
|
export type DefinedWorkflowStep<T extends string = DefaultPorts> = {
|
|
9
4
|
callback: StepFunctionSignature<T>;
|
|
@@ -11,11 +6,6 @@ export type DefinedWorkflowStep<T extends string = DefaultPorts> = {
|
|
|
11
6
|
};
|
|
12
7
|
|
|
13
8
|
export const defineWorkflowStep = <T extends string = DefaultPorts>(
|
|
14
|
-
// callback: (
|
|
15
|
-
// payload: WorkflowStepBasePayload & any,
|
|
16
|
-
// api: DefaultApi,
|
|
17
|
-
// state: any,
|
|
18
|
-
// ) => Promise<WorkflowStepReturnType<T>>,
|
|
19
9
|
callback: StepFunctionSignature<T>,
|
|
20
10
|
): DefinedWorkflowStep<T> => {
|
|
21
11
|
const step = {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CommunicationMethod } from '../functions';
|
|
2
2
|
import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
|
|
3
|
-
import { StepFunctionSignature } from '../types/step-function-signature';
|
|
4
3
|
import { DefinedWorkflowStep, defineWorkflowStep } from './workflow-step';
|
|
5
4
|
|
|
6
5
|
export const define = <T extends string = DefaultPorts>(
|
|
@@ -20,36 +19,43 @@ export const defineWorkflow = <T extends ExtPlugin>(...args: any[]) => {
|
|
|
20
19
|
};
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
// type
|
|
24
|
-
|
|
25
|
-
// const stepTest = defineWorkflowStep<test>(async (payload, api, state) => {
|
|
26
|
-
// const test3 = api.configurationSettings['test'];
|
|
27
|
-
// return {
|
|
28
|
-
// // result: 'Success',
|
|
29
|
-
// result: '1',
|
|
30
|
-
// state: {},
|
|
31
|
-
// };
|
|
32
|
-
// }).setDescription('test');
|
|
33
|
-
|
|
34
|
-
// const stepTestTwo = defineWorkflowStep<DefaultPorts>(
|
|
22
|
+
// type OtherTestPorts = 'four' | 'five' | 'six';
|
|
23
|
+
// const stepTestThree = defineWorkflowStep<testThree>(
|
|
35
24
|
// async (payload, api, state) => {
|
|
36
25
|
// const test3 = api.configurationSettings['test'];
|
|
37
26
|
// return {
|
|
38
|
-
// result: 'Success',
|
|
39
|
-
//
|
|
27
|
+
// // result: 'Success',
|
|
28
|
+
// result: '4',
|
|
40
29
|
// state: {},
|
|
41
30
|
// };
|
|
42
31
|
// },
|
|
43
32
|
// ).setDescription('test');
|
|
44
33
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
type TestPorts = 'one' | 'two' | 'three';
|
|
35
|
+
|
|
36
|
+
const stepTest = defineWorkflowStep<TestPorts>(async (payload, api, state) => {
|
|
37
|
+
return {
|
|
38
|
+
result: 'one',
|
|
39
|
+
state: {},
|
|
40
|
+
};
|
|
41
|
+
}).setDescription('test');
|
|
42
|
+
|
|
43
|
+
const stepTestTwo = defineWorkflowStep<DefaultPorts>(
|
|
44
|
+
async (payload, api, state) => {
|
|
45
|
+
return {
|
|
46
|
+
result: 'Success',
|
|
47
|
+
state: {},
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
).setDescription('test');
|
|
51
|
+
|
|
52
|
+
const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
|
|
53
|
+
define<TestPorts>(stepTest, {
|
|
54
|
+
one: stepTestTwo,
|
|
55
|
+
three: stepTest,
|
|
56
|
+
}),
|
|
57
|
+
define<DefaultPorts>(stepTestTwo, {
|
|
58
|
+
ManualInputReceived: stepTest,
|
|
59
|
+
Success: 'End',
|
|
60
|
+
}),
|
|
61
|
+
);
|