@managespace/sdk 0.0.159 → 0.0.160
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 +2 -5
- package/dist/extensibility/types/mapped-ports.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow-step.d.ts +3 -2
- package/dist/extensibility/workflow/workflow-step.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow.d.ts +3 -9
- package/dist/extensibility/workflow/workflow.d.ts.map +1 -1
- package/dist/extensibility/workflow/workflow.js +11 -13
- package/package.json +1 -1
- package/src/extensibility/types/mapped-ports.ts +2 -7
- package/src/extensibility/workflow/workflow-step.ts +7 -2
- package/src/extensibility/workflow/workflow.ts +17 -18
|
@@ -1,9 +1,6 @@
|
|
|
1
|
+
import { DefinedWorkflowStep } from '../workflow/workflow-step';
|
|
1
2
|
import { DefaultPorts } from './default-result';
|
|
2
|
-
import { StepFunctionSignature } from './step-function-signature';
|
|
3
3
|
export type MappedPorts<T extends string = DefaultPorts> = {
|
|
4
|
-
[K in T]?: DefaultPorts | undefined |
|
|
5
|
-
callback: StepFunctionSignature<T>;
|
|
6
|
-
setDescription: (description: string) => void;
|
|
7
|
-
};
|
|
4
|
+
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<T>;
|
|
8
5
|
};
|
|
9
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,
|
|
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;AAGhD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI;KACtD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,mBAAmB,CAAC,CAAC,CAAC;CAC/D,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DefaultPorts, StepFunctionSignature } from '../types';
|
|
2
|
-
export
|
|
2
|
+
export type DefinedWorkflowStep<T extends string = DefaultPorts> = {
|
|
3
3
|
callback: StepFunctionSignature<T>;
|
|
4
|
-
setDescription: (description: string) =>
|
|
4
|
+
setDescription: (description: string) => DefinedWorkflowStep<T>;
|
|
5
5
|
};
|
|
6
|
+
export declare const defineWorkflowStep: <T extends string = DefaultPorts>(callback: StepFunctionSignature<T>) => DefinedWorkflowStep<T>;
|
|
6
7
|
//# sourceMappingURL=workflow-step.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-step.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow-step.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAM/D,
|
|
1
|
+
{"version":3,"file":"workflow-step.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow-step.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAM/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,iGAiB9B,CAAC"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
|
|
2
|
-
import {
|
|
3
|
-
export declare const define: <T extends string = DefaultPorts>(fn: {
|
|
4
|
-
|
|
5
|
-
setDescription: (description: string) => void;
|
|
6
|
-
}, ports: MappedPorts<T>, maxRunCount?: number) => {
|
|
7
|
-
fn: {
|
|
8
|
-
callback: StepFunctionSignature<T>;
|
|
9
|
-
setDescription: (description: string) => void;
|
|
10
|
-
};
|
|
2
|
+
import { DefinedWorkflowStep } from './workflow-step';
|
|
3
|
+
export declare const define: <T extends string = DefaultPorts>(fn: DefinedWorkflowStep<T>, ports: MappedPorts<T>, maxRunCount?: number) => {
|
|
4
|
+
fn: DefinedWorkflowStep<T>;
|
|
11
5
|
ports: MappedPorts<T>;
|
|
12
6
|
maxRunCount: number | undefined;
|
|
13
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/extensibility/workflow/workflow.ts"],"names":[],"mappings":"AAAA,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":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEhE,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,16 +15,13 @@ const defineWorkflow = (...args) => {
|
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
exports.defineWorkflow = defineWorkflow;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// '1': stepTest,
|
|
28
|
-
// }),
|
|
29
|
-
// );
|
|
18
|
+
const stepTest = (0, workflow_step_1.defineWorkflowStep)(async (payload, api, state) => {
|
|
19
|
+
const test3 = api.configurationSettings['test'];
|
|
20
|
+
return {
|
|
21
|
+
result: 'Success',
|
|
22
|
+
state: {},
|
|
23
|
+
};
|
|
24
|
+
}).setDescription('test');
|
|
25
|
+
const defineTest = (0, exports.defineWorkflow)((0, exports.define)(stepTest, {
|
|
26
|
+
ManualInputReceived: stepTest,
|
|
27
|
+
}));
|
package/package.json
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
import { DefinedWorkflowStep } from '../workflow/workflow-step';
|
|
1
2
|
import { DefaultPorts } from './default-result';
|
|
2
3
|
import { StepFunctionSignature } from './step-function-signature';
|
|
3
4
|
|
|
4
5
|
export type MappedPorts<T extends string = DefaultPorts> = {
|
|
5
|
-
[K in T]?:
|
|
6
|
-
| DefaultPorts
|
|
7
|
-
| undefined
|
|
8
|
-
| {
|
|
9
|
-
callback: StepFunctionSignature<T>;
|
|
10
|
-
setDescription: (description: string) => void;
|
|
11
|
-
};
|
|
6
|
+
[K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<T>; // | StepFunctionSignature<T>
|
|
12
7
|
};
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
WorkflowStepReturnType,
|
|
6
6
|
} from '../types/workflow-step';
|
|
7
7
|
|
|
8
|
+
export type DefinedWorkflowStep<T extends string = DefaultPorts> = {
|
|
9
|
+
callback: StepFunctionSignature<T>;
|
|
10
|
+
setDescription: (description: string) => DefinedWorkflowStep<T>;
|
|
11
|
+
};
|
|
12
|
+
|
|
8
13
|
export const defineWorkflowStep = <T extends string = DefaultPorts>(
|
|
9
14
|
// callback: (
|
|
10
15
|
// payload: WorkflowStepBasePayload & any,
|
|
@@ -12,11 +17,11 @@ export const defineWorkflowStep = <T extends string = DefaultPorts>(
|
|
|
12
17
|
// state: any,
|
|
13
18
|
// ) => Promise<WorkflowStepReturnType<T>>,
|
|
14
19
|
callback: StepFunctionSignature<T>,
|
|
15
|
-
) => {
|
|
20
|
+
): DefinedWorkflowStep<T> => {
|
|
16
21
|
const step = {
|
|
17
22
|
callback,
|
|
18
23
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
19
|
-
setDescription: (description: string) => {
|
|
24
|
+
setDescription: (description: string): DefinedWorkflowStep<T> => {
|
|
20
25
|
return step;
|
|
21
26
|
},
|
|
22
27
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
|
|
2
2
|
import { StepFunctionSignature } from '../types/step-function-signature';
|
|
3
|
-
import { defineWorkflowStep } from './workflow-step';
|
|
3
|
+
import { DefinedWorkflowStep, defineWorkflowStep } from './workflow-step';
|
|
4
4
|
|
|
5
5
|
export const define = <T extends string = DefaultPorts>(
|
|
6
|
-
fn:
|
|
7
|
-
callback: StepFunctionSignature<T>;
|
|
8
|
-
setDescription: (description: string) => void;
|
|
9
|
-
},
|
|
6
|
+
fn: DefinedWorkflowStep<T>,
|
|
10
7
|
ports: MappedPorts<T>,
|
|
11
8
|
maxRunCount?: number,
|
|
12
9
|
) => {
|
|
@@ -22,18 +19,20 @@ export const defineWorkflow = <T extends ExtPlugin>(...args: any[]) => {
|
|
|
22
19
|
};
|
|
23
20
|
};
|
|
24
21
|
|
|
25
|
-
|
|
22
|
+
type test = '1' | '2' | '3';
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
const stepTest = defineWorkflowStep<DefaultPorts>(
|
|
25
|
+
async (payload, api, state) => {
|
|
26
|
+
const test3 = api.configurationSettings['test'];
|
|
27
|
+
return {
|
|
28
|
+
result: 'Success',
|
|
29
|
+
state: {},
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
).setDescription('test');
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const defineTest = defineWorkflow(
|
|
35
|
+
define<DefaultPorts>(stepTest, {
|
|
36
|
+
ManualInputReceived: stepTest,
|
|
37
|
+
}),
|
|
38
|
+
);
|