@managespace/sdk 0.0.162 → 0.0.163

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,8 +1,16 @@
1
1
  import { DefaultApi } from '../../generated';
2
2
  import { ExtReturnType } from '../types';
3
3
  import { ExtPlugin, ExtBasePayload } from '../types';
4
- export declare const defineExFn: <T extends ExtPlugin>(callback: (payload: ExtBasePayload & T["payload"], api: DefaultApi) => Promise<ExtReturnType<T["responseType"], null>>) => {
4
+ export declare const defineExFn: <T extends ExtPlugin>(callback: (payload: ExtBasePayload & T["payload"], api: DefaultApi & {
5
+ configurationSettings: {
6
+ [key: string]: string | number | boolean | Record<string, unknown>;
7
+ };
8
+ }) => Promise<ExtReturnType<T["responseType"], null>>) => {
5
9
  message: string;
6
- callback: (payload: ExtBasePayload & T["payload"], api: DefaultApi) => Promise<ExtReturnType<T["responseType"], null>>;
10
+ callback: (payload: ExtBasePayload & T["payload"], api: DefaultApi & {
11
+ configurationSettings: {
12
+ [key: string]: string | number | boolean | Record<string, unknown>;
13
+ };
14
+ }) => Promise<ExtReturnType<T["responseType"], null>>;
7
15
  };
8
16
  //# sourceMappingURL=extensibility-function.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensibility-function.d.ts","sourceRoot":"","sources":["../../../src/extensibility/functions/extensibility-function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,UAAU,gFAGV,UAAU;;4DAAV,UAAU;CAYtB,CAAC"}
1
+ {"version":3,"file":"extensibility-function.d.ts","sourceRoot":"","sources":["../../../src/extensibility/functions/extensibility-function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAErD,eAAO,MAAM,UAAU;;;;;;;;;;;CAuBtB,CAAC"}
@@ -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;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
+ {"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;KACtD,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC;CACjE,CAAC"}
@@ -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;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
+ {"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,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,MAAM,qGAGD,MAAM;;;;CAGvB,CAAC;AAGF,eAAO,MAAM,cAAc,iCAAkC,GAAG,EAAE;kCAI5B,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAE3C,CAAC"}
@@ -1,7 +1,6 @@
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");
5
4
  const define = (fn, ports, maxRunCount) => {
6
5
  return { fn, ports, maxRunCount };
7
6
  };
@@ -15,22 +14,39 @@ const defineWorkflow = (...args) => {
15
14
  };
16
15
  };
17
16
  exports.defineWorkflow = defineWorkflow;
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
- }));
17
+ // type OtherTestPorts = 'four' | 'five' | 'six';
18
+ // const stepTestThree = defineWorkflowStep<testThree>(
19
+ // async (payload, api, state) => {
20
+ // const test3 = api.configurationSettings['test'];
21
+ // return {
22
+ // // result: 'Success',
23
+ // result: '4',
24
+ // state: {},
25
+ // };
26
+ // },
27
+ // ).setDescription('test');
28
+ // type TestPorts = 'one' | 'two' | 'three';
29
+ // const stepTest = defineWorkflowStep<TestPorts>(async (payload, api, state) => {
30
+ // return {
31
+ // result: 'one',
32
+ // state: {},
33
+ // };
34
+ // }).setDescription('test');
35
+ // const stepTestTwo = defineWorkflowStep<DefaultPorts>(
36
+ // async (payload, api, state) => {
37
+ // return {
38
+ // result: 'Success',
39
+ // state: {},
40
+ // };
41
+ // },
42
+ // ).setDescription('test');
43
+ // const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
44
+ // define<TestPorts>(stepTest, {
45
+ // one: stepTestTwo,
46
+ // three: stepTest,
47
+ // }),
48
+ // define<DefaultPorts>(stepTestTwo, {
49
+ // ManualInputReceived: stepTest,
50
+ // Success: 'End',
51
+ // }),
52
+ // );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managespace/sdk",
3
- "version": "0.0.162",
3
+ "version": "0.0.163",
4
4
  "scripts": {
5
5
  "dev": "tsc -w --preserveWatchOutput",
6
6
  "build": "tsc",
@@ -5,7 +5,15 @@ import { ExtPlugin, ExtBasePayload } from '../types';
5
5
  export const defineExFn = <T extends ExtPlugin>(
6
6
  callback: (
7
7
  payload: ExtBasePayload & T['payload'],
8
- api: DefaultApi,
8
+ api: DefaultApi & {
9
+ configurationSettings: {
10
+ [key: string]:
11
+ | string
12
+ | number
13
+ | boolean
14
+ | Record<string, unknown>;
15
+ };
16
+ },
9
17
  ) => Promise<ExtReturnType<T['responseType']>>,
10
18
  ) => {
11
19
  // let fnDescription = 'some default description';
@@ -2,6 +2,5 @@ import { DefinedWorkflowStep } from '../workflow/workflow-step';
2
2
  import { DefaultPorts } from './default-result';
3
3
 
4
4
  export type MappedPorts<T extends string = DefaultPorts> = {
5
- // [K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<T>;
6
5
  [K in T]?: DefaultPorts | undefined | DefinedWorkflowStep<any>;
7
6
  };
@@ -1,6 +1,5 @@
1
- import { CommunicationMethod } from '../functions';
2
1
  import { DefaultPorts, ExtPlugin, MappedPorts } from '../types';
3
- import { DefinedWorkflowStep, defineWorkflowStep } from './workflow-step';
2
+ import { DefinedWorkflowStep } from './workflow-step';
4
3
 
5
4
  export const define = <T extends string = DefaultPorts>(
6
5
  fn: DefinedWorkflowStep<T>,
@@ -31,31 +30,31 @@ export const defineWorkflow = <T extends ExtPlugin>(...args: any[]) => {
31
30
  // },
32
31
  // ).setDescription('test');
33
32
 
34
- type TestPorts = 'one' | 'two' | 'three';
33
+ // type TestPorts = 'one' | 'two' | 'three';
35
34
 
36
- const stepTest = defineWorkflowStep<TestPorts>(async (payload, api, state) => {
37
- return {
38
- result: 'one',
39
- state: {},
40
- };
41
- }).setDescription('test');
35
+ // const stepTest = defineWorkflowStep<TestPorts>(async (payload, api, state) => {
36
+ // return {
37
+ // result: 'one',
38
+ // state: {},
39
+ // };
40
+ // }).setDescription('test');
42
41
 
43
- const stepTestTwo = defineWorkflowStep<DefaultPorts>(
44
- async (payload, api, state) => {
45
- return {
46
- result: 'Success',
47
- state: {},
48
- };
49
- },
50
- ).setDescription('test');
42
+ // const stepTestTwo = defineWorkflowStep<DefaultPorts>(
43
+ // async (payload, api, state) => {
44
+ // return {
45
+ // result: 'Success',
46
+ // state: {},
47
+ // };
48
+ // },
49
+ // ).setDescription('test');
51
50
 
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
- );
51
+ // const defineTest = defineWorkflow<CommunicationMethod.SendEmail>(
52
+ // define<TestPorts>(stepTest, {
53
+ // one: stepTestTwo,
54
+ // three: stepTest,
55
+ // }),
56
+ // define<DefaultPorts>(stepTestTwo, {
57
+ // ManualInputReceived: stepTest,
58
+ // Success: 'End',
59
+ // }),
60
+ // );