@managespace/sdk 0.0.160 → 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 +10 -1
- 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 +29 -6
|
@@ -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":"
|
|
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"}
|
|
@@ -16,12 +16,21 @@ const defineWorkflow = (...args) => {
|
|
|
16
16
|
};
|
|
17
17
|
exports.defineWorkflow = defineWorkflow;
|
|
18
18
|
const stepTest = (0, workflow_step_1.defineWorkflowStep)(async (payload, api, state) => {
|
|
19
|
-
|
|
19
|
+
return {
|
|
20
|
+
result: 'one',
|
|
21
|
+
state: {},
|
|
22
|
+
};
|
|
23
|
+
}).setDescription('test');
|
|
24
|
+
const stepTestTwo = (0, workflow_step_1.defineWorkflowStep)(async (payload, api, state) => {
|
|
20
25
|
return {
|
|
21
26
|
result: 'Success',
|
|
22
27
|
state: {},
|
|
23
28
|
};
|
|
24
29
|
}).setDescription('test');
|
|
25
30
|
const defineTest = (0, exports.defineWorkflow)((0, exports.define)(stepTest, {
|
|
31
|
+
one: stepTestTwo,
|
|
32
|
+
three: stepTest,
|
|
33
|
+
}), (0, exports.define)(stepTestTwo, {
|
|
26
34
|
ManualInputReceived: stepTest,
|
|
35
|
+
Success: 'End',
|
|
27
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<T>;
|
|
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,5 +1,5 @@
|
|
|
1
|
+
import { CommunicationMethod } from '../functions';
|
|
1
2
|
import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
|
|
2
|
-
import { StepFunctionSignature } from '../types/step-function-signature';
|
|
3
3
|
import { DefinedWorkflowStep, defineWorkflowStep } from './workflow-step';
|
|
4
4
|
|
|
5
5
|
export const define = <T extends string = DefaultPorts>(
|
|
@@ -19,11 +19,29 @@ export const defineWorkflow = <T extends ExtPlugin>(...args: any[]) => {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
type
|
|
22
|
+
// type OtherTestPorts = 'four' | 'five' | 'six';
|
|
23
|
+
// const stepTestThree = defineWorkflowStep<testThree>(
|
|
24
|
+
// async (payload, api, state) => {
|
|
25
|
+
// const test3 = api.configurationSettings['test'];
|
|
26
|
+
// return {
|
|
27
|
+
// // result: 'Success',
|
|
28
|
+
// result: '4',
|
|
29
|
+
// state: {},
|
|
30
|
+
// };
|
|
31
|
+
// },
|
|
32
|
+
// ).setDescription('test');
|
|
23
33
|
|
|
24
|
-
|
|
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>(
|
|
25
44
|
async (payload, api, state) => {
|
|
26
|
-
const test3 = api.configurationSettings['test'];
|
|
27
45
|
return {
|
|
28
46
|
result: 'Success',
|
|
29
47
|
state: {},
|
|
@@ -31,8 +49,13 @@ const stepTest = defineWorkflowStep<DefaultPorts>(
|
|
|
31
49
|
},
|
|
32
50
|
).setDescription('test');
|
|
33
51
|
|
|
34
|
-
const defineTest = defineWorkflow(
|
|
35
|
-
define<
|
|
52
|
+
const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
|
|
53
|
+
define<TestPorts>(stepTest, {
|
|
54
|
+
one: stepTestTwo,
|
|
55
|
+
three: stepTest,
|
|
56
|
+
}),
|
|
57
|
+
define<DefaultPorts>(stepTestTwo, {
|
|
36
58
|
ManualInputReceived: stepTest,
|
|
59
|
+
Success: 'End',
|
|
37
60
|
}),
|
|
38
61
|
);
|