@managespace/sdk 0.0.159 → 0.0.161

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.
@@ -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;
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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI;KACtD,CAAC,IAAI,CAAC,CAAC,CAAC,EACH,YAAY,GACZ,SAAS,GACT;QACI,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACnC,cAAc,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;KACjD;CACV,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;AAGhD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,YAAY,IAAI;KACtD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,mBAAmB;CAC5D,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { DefaultPorts, StepFunctionSignature } from '../types';
2
- export declare const defineWorkflowStep: <T extends string = DefaultPorts>(callback: StepFunctionSignature<T>) => {
2
+ export type DefinedWorkflowStep<T extends string = DefaultPorts> = {
3
3
  callback: StepFunctionSignature<T>;
4
- setDescription: (description: string) => any;
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,eAAO,MAAM,kBAAkB;;kCAWO,MAAM;CAM3C,CAAC"}
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 { StepFunctionSignature } from '../types/step-function-signature';
3
- export declare const define: <T extends string = DefaultPorts>(fn: {
4
- callback: StepFunctionSignature<T>;
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;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,eAAO,MAAM,MAAM;;kCAGmB,MAAM,KAAK,IAAI;wCAGnC,MAAM;;;sCAHc,MAAM,KAAK,IAAI;;;;CAMpD,CAAC;AAGF,eAAO,MAAM,cAAc,iCAAkC,GAAG,EAAE;kCAI5B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE3C,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;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"}
@@ -18,12 +18,29 @@ exports.defineWorkflow = defineWorkflow;
18
18
  // const stepTest = defineWorkflowStep<test>(async (payload, api, state) => {
19
19
  // const test3 = api.configurationSettings['test'];
20
20
  // return {
21
+ // // result: 'Success',
21
22
  // result: '1',
22
23
  // state: {},
23
24
  // };
24
- // });
25
- // const defineTest = defineWorkflow(
25
+ // }).setDescription('test');
26
+ // const stepTestTwo = defineWorkflowStep<DefaultPorts>(
27
+ // async (payload, api, state) => {
28
+ // const test3 = api.configurationSettings['test'];
29
+ // return {
30
+ // result: 'Success',
31
+ // // result: '1',
32
+ // state: {},
33
+ // };
34
+ // },
35
+ // ).setDescription('test');
36
+ // const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
26
37
  // define<test>(stepTest, {
27
- // '1': stepTest,
38
+ // // ManualInputReceived: stepTestTwo,
39
+ // '1': stepTestTwo,
40
+ // }),
41
+ // define<DefaultPorts>(stepTestTwo, {
42
+ // ManualInputReceived: stepTestTwo,
43
+ // Success: 'End',
44
+ // // '1': stepTest,
28
45
  // }),
29
46
  // );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managespace/sdk",
3
- "version": "0.0.159",
3
+ "version": "0.0.161",
4
4
  "scripts": {
5
5
  "dev": "tsc -w --preserveWatchOutput",
6
6
  "build": "tsc",
@@ -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]?: // | StepFunctionSignature<T>
6
- | DefaultPorts
7
- | undefined
8
- | {
9
- callback: StepFunctionSignature<T>;
10
- setDescription: (description: string) => void;
11
- };
6
+ [K in T]?: DefaultPorts | undefined | DefinedWorkflowStep; // | 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,10 @@
1
+ import { CommunicationMethod } from '../functions';
1
2
  import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
2
3
  import { StepFunctionSignature } from '../types/step-function-signature';
3
- import { defineWorkflowStep } from './workflow-step';
4
+ import { DefinedWorkflowStep, defineWorkflowStep } from './workflow-step';
4
5
 
5
6
  export const define = <T extends string = DefaultPorts>(
6
- fn: {
7
- callback: StepFunctionSignature<T>;
8
- setDescription: (description: string) => void;
9
- },
7
+ fn: DefinedWorkflowStep<T>,
10
8
  ports: MappedPorts<T>,
11
9
  maxRunCount?: number,
12
10
  ) => {
@@ -27,13 +25,31 @@ export const defineWorkflow = <T extends ExtPlugin>(...args: any[]) => {
27
25
  // const stepTest = defineWorkflowStep<test>(async (payload, api, state) => {
28
26
  // const test3 = api.configurationSettings['test'];
29
27
  // return {
28
+ // // result: 'Success',
30
29
  // result: '1',
31
30
  // state: {},
32
31
  // };
33
- // });
32
+ // }).setDescription('test');
34
33
 
35
- // const defineTest = defineWorkflow(
34
+ // const stepTestTwo = defineWorkflowStep<DefaultPorts>(
35
+ // async (payload, api, state) => {
36
+ // const test3 = api.configurationSettings['test'];
37
+ // return {
38
+ // result: 'Success',
39
+ // // result: '1',
40
+ // state: {},
41
+ // };
42
+ // },
43
+ // ).setDescription('test');
44
+
45
+ // const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
36
46
  // define<test>(stepTest, {
37
- // '1': stepTest,
47
+ // // ManualInputReceived: stepTestTwo,
48
+ // '1': stepTestTwo,
49
+ // }),
50
+ // define<DefaultPorts>(stepTestTwo, {
51
+ // ManualInputReceived: stepTestTwo,
52
+ // Success: 'End',
53
+ // // '1': stepTest,
38
54
  // }),
39
55
  // );