@useparagon/core 0.0.1-canary.4 → 0.0.1-canary.41

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.
Files changed (184) hide show
  1. package/dist/event/event.interface.d.ts +1 -1
  2. package/dist/execution/context.constants.d.ts +4 -0
  3. package/dist/execution/context.constants.js +6 -1
  4. package/dist/execution/context.constants.js.map +1 -1
  5. package/dist/execution/context.d.ts +3 -22
  6. package/dist/execution/context.interface.d.ts +6 -18
  7. package/dist/execution/context.interface.js +4 -1
  8. package/dist/execution/context.interface.js.map +1 -1
  9. package/dist/execution/context.js +4 -170
  10. package/dist/execution/context.js.map +1 -1
  11. package/dist/execution/context.utils.d.ts +1 -0
  12. package/dist/execution/context.utils.js +68 -25
  13. package/dist/execution/context.utils.js.map +1 -1
  14. package/dist/execution/index.d.ts +2 -0
  15. package/dist/execution/index.js +2 -0
  16. package/dist/execution/index.js.map +1 -1
  17. package/dist/index.d.ts +1 -1
  18. package/dist/inputs/input.constants.d.ts +1 -1
  19. package/dist/inputs/input.constants.js +5 -10
  20. package/dist/inputs/input.constants.js.map +1 -1
  21. package/dist/inputs/input.interface.d.ts +28 -7
  22. package/dist/inputs/input.interface.js +17 -7
  23. package/dist/inputs/input.interface.js.map +1 -1
  24. package/dist/inputs/input.utils.d.ts +3 -1
  25. package/dist/inputs/input.utils.js +25 -25
  26. package/dist/inputs/input.utils.js.map +1 -1
  27. package/dist/integration/custom.integration.d.ts +5 -1
  28. package/dist/integration/custom.integration.interface.d.ts +43 -0
  29. package/dist/integration/custom.integration.js +18 -1
  30. package/dist/integration/custom.integration.js.map +1 -1
  31. package/dist/integration/index.d.ts +3 -0
  32. package/dist/integration/index.js +3 -0
  33. package/dist/integration/index.js.map +1 -1
  34. package/dist/integration/integration.interface.d.ts +8 -5
  35. package/dist/integration/integration.utils.d.ts +5 -0
  36. package/dist/integration/integration.utils.js +30 -0
  37. package/dist/integration/integration.utils.js.map +1 -0
  38. package/dist/operator/operators/BooleanFalse.d.ts +1 -1
  39. package/dist/operator/operators/BooleanFalse.js.map +1 -1
  40. package/dist/operator/operators/BooleanTrue.d.ts +1 -1
  41. package/dist/operator/operators/BooleanTrue.js.map +1 -1
  42. package/dist/operator/operators/DateTimeAfter.d.ts +1 -1
  43. package/dist/operator/operators/DateTimeAfter.js.map +1 -1
  44. package/dist/operator/operators/DateTimeBefore.d.ts +1 -1
  45. package/dist/operator/operators/DateTimeBefore.js.map +1 -1
  46. package/dist/operator/operators/DateTimeEquals.d.ts +1 -1
  47. package/dist/operator/operators/DateTimeEquals.js.map +1 -1
  48. package/dist/operator/operators/NumberDoesNotEqual.d.ts +1 -1
  49. package/dist/operator/operators/NumberDoesNotEqual.js.map +1 -1
  50. package/dist/operator/operators/NumberEquals.d.ts +1 -1
  51. package/dist/operator/operators/NumberEquals.js.map +1 -1
  52. package/dist/operator/operators/NumberGreaterThan.d.ts +1 -1
  53. package/dist/operator/operators/NumberGreaterThan.js.map +1 -1
  54. package/dist/operator/operators/NumberGreaterThanOrEqualTo.d.ts +1 -1
  55. package/dist/operator/operators/NumberGreaterThanOrEqualTo.js.map +1 -1
  56. package/dist/operator/operators/NumberLessThan.d.ts +1 -1
  57. package/dist/operator/operators/NumberLessThan.js.map +1 -1
  58. package/dist/operator/operators/NumberLessThanOrEqualTo.d.ts +1 -1
  59. package/dist/operator/operators/NumberLessThanOrEqualTo.js.map +1 -1
  60. package/dist/operator/operators/StringContains.d.ts +1 -1
  61. package/dist/operator/operators/StringContains.js.map +1 -1
  62. package/dist/operator/operators/StringDoesNotContain.d.ts +1 -1
  63. package/dist/operator/operators/StringDoesNotContain.js.map +1 -1
  64. package/dist/operator/operators/StringDoesNotEndWith.d.ts +1 -1
  65. package/dist/operator/operators/StringDoesNotEndWith.js.map +1 -1
  66. package/dist/operator/operators/StringDoesNotExactlyMatch.d.ts +1 -1
  67. package/dist/operator/operators/StringDoesNotExactlyMatch.js.map +1 -1
  68. package/dist/operator/operators/StringDoesNotStartWith.d.ts +1 -1
  69. package/dist/operator/operators/StringDoesNotStartWith.js.map +1 -1
  70. package/dist/operator/operators/StringEndsWith.d.ts +1 -1
  71. package/dist/operator/operators/StringEndsWith.js.map +1 -1
  72. package/dist/operator/operators/StringExactlyMatches.d.ts +1 -1
  73. package/dist/operator/operators/StringExactlyMatches.js.map +1 -1
  74. package/dist/operator/operators/StringGreaterThan.d.ts +1 -1
  75. package/dist/operator/operators/StringGreaterThan.js.map +1 -1
  76. package/dist/operator/operators/StringIsIn.d.ts +1 -1
  77. package/dist/operator/operators/StringIsIn.js.map +1 -1
  78. package/dist/operator/operators/StringIsNotIn.d.ts +1 -1
  79. package/dist/operator/operators/StringIsNotIn.js.map +1 -1
  80. package/dist/operator/operators/StringLessThan.d.ts +1 -1
  81. package/dist/operator/operators/StringLessThan.js.map +1 -1
  82. package/dist/operator/operators/StringStartsWith.d.ts +1 -1
  83. package/dist/operator/operators/StringStartsWith.js.map +1 -1
  84. package/dist/resolvers/resolver.utils.d.ts +3 -2
  85. package/dist/resolvers/resolver.utils.js +54 -22
  86. package/dist/resolvers/resolver.utils.js.map +1 -1
  87. package/dist/resolvers/resolvers.interface.d.ts +12 -5
  88. package/dist/resolvers/resolvers.interface.js.map +1 -1
  89. package/dist/secret/index.d.ts +1 -0
  90. package/dist/secret/index.js +1 -0
  91. package/dist/secret/index.js.map +1 -1
  92. package/dist/secret/secret.interface.d.ts +6 -0
  93. package/dist/secret/secret.utils.d.ts +2 -0
  94. package/dist/secret/secret.utils.js +15 -0
  95. package/dist/secret/secret.utils.js.map +1 -0
  96. package/dist/stateMachine/stateMachine.utils.js +16 -21
  97. package/dist/stateMachine/stateMachine.utils.js.map +1 -1
  98. package/dist/steps/library/action/action.interface.d.ts +3 -5
  99. package/dist/steps/library/action/action.step.d.ts +2 -2
  100. package/dist/steps/library/action/action.step.js +16 -6
  101. package/dist/steps/library/action/action.step.js.map +1 -1
  102. package/dist/steps/library/conditional/conditional.interface.d.ts +5 -2
  103. package/dist/steps/library/conditional/conditional.step.d.ts +6 -5
  104. package/dist/steps/library/conditional/conditional.step.js +13 -8
  105. package/dist/steps/library/conditional/conditional.step.js.map +1 -1
  106. package/dist/steps/library/delay/delay.step.js +6 -3
  107. package/dist/steps/library/delay/delay.step.js.map +1 -1
  108. package/dist/steps/library/fanout/fanout.interface.d.ts +2 -2
  109. package/dist/steps/library/fanout/fanout.step.d.ts +4 -3
  110. package/dist/steps/library/fanout/fanout.step.js +10 -4
  111. package/dist/steps/library/fanout/fanout.step.js.map +1 -1
  112. package/dist/steps/library/function/function.interface.d.ts +8 -6
  113. package/dist/steps/library/function/function.step.d.ts +4 -3
  114. package/dist/steps/library/function/function.step.js +13 -3
  115. package/dist/steps/library/function/function.step.js.map +1 -1
  116. package/dist/steps/library/function/libraries.d.ts +98 -0
  117. package/dist/steps/library/function/libraries.js +3 -0
  118. package/dist/steps/library/function/libraries.js.map +1 -0
  119. package/dist/steps/library/integrationRequest/integrationRequest.interface.d.ts +28 -13
  120. package/dist/steps/library/integrationRequest/integrationRequest.step.d.ts +4 -3
  121. package/dist/steps/library/integrationRequest/integrationRequest.step.js +47 -14
  122. package/dist/steps/library/integrationRequest/integrationRequest.step.js.map +1 -1
  123. package/dist/steps/library/request/request.interface.d.ts +53 -12
  124. package/dist/steps/library/request/request.interface.js +7 -1
  125. package/dist/steps/library/request/request.interface.js.map +1 -1
  126. package/dist/steps/library/request/request.step.d.ts +4 -3
  127. package/dist/steps/library/request/request.step.js +43 -11
  128. package/dist/steps/library/request/request.step.js.map +1 -1
  129. package/dist/steps/library/response/response.interface.d.ts +6 -1
  130. package/dist/steps/library/response/response.interface.js.map +1 -1
  131. package/dist/steps/library/response/response.step.d.ts +4 -3
  132. package/dist/steps/library/response/response.step.js +8 -2
  133. package/dist/steps/library/response/response.step.js.map +1 -1
  134. package/dist/steps/step.interface-base.d.ts +15 -0
  135. package/dist/steps/step.interface.d.ts +3 -0
  136. package/dist/steps/step.interface.js.map +1 -1
  137. package/dist/steps/step.js +10 -9
  138. package/dist/steps/step.js.map +1 -1
  139. package/dist/steps/step.utils.js +27 -10
  140. package/dist/steps/step.utils.js.map +1 -1
  141. package/dist/triggers/actionTrigger/actionTrigger.step.d.ts +3 -2
  142. package/dist/triggers/actionTrigger/actionTrigger.step.js +14 -3
  143. package/dist/triggers/actionTrigger/actionTrigger.step.js.map +1 -1
  144. package/dist/triggers/cron/cron.step.js +7 -2
  145. package/dist/triggers/cron/cron.step.js.map +1 -1
  146. package/dist/triggers/cron/cron.utils.js +2 -2
  147. package/dist/triggers/cron/cron.utils.js.map +1 -1
  148. package/dist/triggers/endpoint/endpoint.interface.d.ts +9 -1
  149. package/dist/triggers/endpoint/endpoint.step.d.ts +4 -3
  150. package/dist/triggers/endpoint/endpoint.step.js +9 -4
  151. package/dist/triggers/endpoint/endpoint.step.js.map +1 -1
  152. package/dist/triggers/event/event.interface.d.ts +1 -2
  153. package/dist/triggers/event/event.step.d.ts +3 -3
  154. package/dist/triggers/event/event.step.js +10 -6
  155. package/dist/triggers/event/event.step.js.map +1 -1
  156. package/dist/triggers/integrationEnabled/integrationEnabled.step.d.ts +1 -1
  157. package/dist/triggers/integrationEnabled/integrationEnabled.step.js +3 -2
  158. package/dist/triggers/integrationEnabled/integrationEnabled.step.js.map +1 -1
  159. package/dist/triggers/trigger.js +1 -4
  160. package/dist/triggers/trigger.js.map +1 -1
  161. package/dist/triggers/unselected/unselected.step.js +5 -3
  162. package/dist/triggers/unselected/unselected.step.js.map +1 -1
  163. package/dist/types/generics.d.ts +5 -0
  164. package/dist/types/generics.js +3 -0
  165. package/dist/types/generics.js.map +1 -0
  166. package/dist/types/index.d.ts +1 -0
  167. package/dist/types/index.js +5 -0
  168. package/dist/types/index.js.map +1 -0
  169. package/dist/user/user.d.ts +7 -1
  170. package/dist/user/user.interface.d.ts +8 -1
  171. package/dist/user/user.js +14 -0
  172. package/dist/user/user.js.map +1 -1
  173. package/dist/utils/utils.d.ts +9 -4
  174. package/dist/utils/utils.js +45 -11
  175. package/dist/utils/utils.js.map +1 -1
  176. package/dist/workflow/workflow.d.ts +8 -6
  177. package/dist/workflow/workflow.interface.d.ts +5 -2
  178. package/dist/workflow/workflow.interface.js.map +1 -1
  179. package/dist/workflow/workflow.js +40 -29
  180. package/dist/workflow/workflow.js.map +1 -1
  181. package/package.json +61 -19
  182. package/dist/integration/integration.d.ts +0 -11
  183. package/dist/integration/integration.js +0 -40
  184. package/dist/integration/integration.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  export interface IEvent<T extends Record<string, unknown> = Record<string, unknown>> {
2
2
  id: string;
3
3
  name: string;
4
- schema: T;
4
+ sampleData: T;
5
5
  }
6
6
  export interface IEventInit<T extends Record<string, unknown> = Record<string, unknown>> {
7
7
  name: string;
@@ -1,3 +1,7 @@
1
1
  export declare const PROXY_KEY_GET_KEYS: string;
2
2
  export declare const PROXY_KEY_SOURCE_TYPE = "@@__PROXY_SOURCE_TYPE__@@";
3
3
  export declare const PROXY_KEY_GET_INPUT_REFERENCE = "@@__PROXY_KEY_GET_INPUT_REFERENCE__@@";
4
+ export declare enum TokenizedIdentifiers {
5
+ START = "__TOKENIZED_START__",
6
+ END = "__TOKENIZED_END__"
7
+ }
@@ -1,7 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PROXY_KEY_GET_INPUT_REFERENCE = exports.PROXY_KEY_SOURCE_TYPE = exports.PROXY_KEY_GET_KEYS = void 0;
3
+ exports.TokenizedIdentifiers = exports.PROXY_KEY_GET_INPUT_REFERENCE = exports.PROXY_KEY_SOURCE_TYPE = exports.PROXY_KEY_GET_KEYS = void 0;
4
4
  exports.PROXY_KEY_GET_KEYS = '@@__PROXY_KEY_GET_KEYS__@@';
5
5
  exports.PROXY_KEY_SOURCE_TYPE = '@@__PROXY_SOURCE_TYPE__@@';
6
6
  exports.PROXY_KEY_GET_INPUT_REFERENCE = '@@__PROXY_KEY_GET_INPUT_REFERENCE__@@';
7
+ var TokenizedIdentifiers;
8
+ (function (TokenizedIdentifiers) {
9
+ TokenizedIdentifiers["START"] = "__TOKENIZED_START__";
10
+ TokenizedIdentifiers["END"] = "__TOKENIZED_END__";
11
+ })(TokenizedIdentifiers || (exports.TokenizedIdentifiers = TokenizedIdentifiers = {}));
7
12
  //# sourceMappingURL=context.constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.constants.js","sourceRoot":"","sources":["../../src/execution/context.constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAW,4BAA4B,CAAC;AAK1D,QAAA,qBAAqB,GAAG,2BAA2B,CAAC;AAKpD,QAAA,6BAA6B,GACxC,uCAAuC,CAAC"}
1
+ {"version":3,"file":"context.constants.js","sourceRoot":"","sources":["../../src/execution/context.constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAW,4BAA4B,CAAC;AAK1D,QAAA,qBAAqB,GAAG,2BAA2B,CAAC;AAKpD,QAAA,6BAA6B,GACxC,uCAAuC,CAAC;AAK1C,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qDAA6B,CAAA;IAC7B,iDAAyB,CAAA;AAC3B,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B"}
@@ -1,25 +1,6 @@
1
1
  import { UserDefinedInput } from '../inputs/input.interface';
2
- import { IPersona } from '../persona/persona.interface';
3
- import { ISecretOutput } from '../secret/secret.interface';
4
- import { IActionStep } from '../steps/library/action/action.interface';
5
- import { IFanOutStep } from '../steps/library/fanout/fanout.interface';
6
- import { IFunctionStep } from '../steps/library/function/function.interface';
7
- import { IEventStep } from '../triggers/event/event.interface';
8
- import { FirstElementType, IContext, PersonaInputKeyToOutputMap } from './context.interface';
9
- export declare enum TokenizedIdentifiers {
10
- START = "__TOKENIZED_START__",
11
- END = "__TOKENIZED_END__"
12
- }
13
- export declare const getSecretKeysForProject: () => string[];
14
- export declare class Context<P extends IPersona = IPersona, InputResultMap extends Record<string, unknown> = Record<string, string>> implements IContext<P, InputResultMap> {
15
- getOutput<S extends IEventStep>(step: S): S['parameters']['payload'];
16
- getOutput<I extends Record<string, unknown>, O, S extends IActionStep>(step: S): O;
17
- getOutput<S extends IFanOutStep, O = FirstElementType<S['parameters']['iterator']>>(step: S): O;
18
- getOutput<S extends IFunctionStep>(step: S): {
19
- result: any;
20
- };
21
- getEnvironmentSecret(key: string): ISecretOutput;
22
- getPersona<K extends keyof PersonaInputKeyToOutputMap>(key: K): PersonaInputKeyToOutputMap<P>[K];
2
+ import { IContext } from './context.interface';
3
+ export declare class Context<InputResultMap extends Record<string, unknown> = Record<string, string>> implements IContext<InputResultMap> {
4
+ getEnvironmentSecret(key: string): string;
23
5
  getInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
24
- getSharedInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
25
6
  }
@@ -1,33 +1,21 @@
1
1
  import { UserDefinedInput } from '../inputs/input.interface';
2
2
  import { IPersona } from '../persona/persona.interface';
3
- import { ISecretOutput } from '../secret/secret.interface';
4
- import { IActionStep } from '../steps/library/action/action.interface';
5
- import { IFanOutStep } from '../steps/library/fanout/fanout.interface';
6
- import { IFunctionStep } from '../steps/library/function';
7
- import { IEventStep } from '../triggers/event/event.interface';
8
- export type FirstElementType<T> = T extends [infer U, ...unknown[]] ? U : never;
9
3
  export declare enum ProxyVariableSourceType {
10
4
  STEP_REFERENCE = "STEP_REFERENCE",
11
5
  SECRET_REFERENCE = "SECRET_REFERENCE",
12
6
  PERSONA_META_REFERENCE = "PERSONA_META_REFERENCE",
13
7
  PERSONA_ENDUSERID_REFERENCE = "PERSONA_ENDUSERID_REFERENCE",
14
8
  WORKFLOW_INPUT_REFERENCE = "WORKFLOW_INPUT_REFERENCE",
15
- INTEGRATION_INPUT_REFERENCE = "INTEGRATION_INPUT_REFERENCE"
9
+ CONNECT_USER_PROVIDER_ID = "CONNECT_USER_PROVIDER_ID",
10
+ CONNECT_USER_PROVIDER_DATA = "CONNECT_USER_PROVIDER_DATA",
11
+ SAME_STEP_REFERENCE = "SAME_STEP_REFERENCE",
12
+ OAUTH_ACCESS_TOKEN = "OAUTH_ACCESS_TOKEN"
16
13
  }
17
14
  export type PersonaInputKeyToOutputMap<P extends IPersona = IPersona> = {
18
15
  userId: string;
19
16
  meta: P['meta'];
20
17
  };
21
- export interface IContext<P extends IPersona = IPersona, InputResultMap extends Record<string, unknown> = Record<string, string>> {
22
- getOutput<S extends IEventStep<any>>(step: S): S['schema'];
23
- getOutput<I extends Record<string, unknown>, O, S extends IActionStep>(step: S): O;
24
- getOutput<S extends IFanOutStep, O = FirstElementType<S['parameters']['iterator']>>(step: S): O;
25
- getOutput<S extends IFunctionStep>(step: S): {
26
- result: any;
27
- };
28
- getEnvironmentSecret(key: string): ISecretOutput;
29
- getPersona<K extends keyof PersonaInputKeyToOutputMap>(key: K): PersonaInputKeyToOutputMap<P>[K];
18
+ export interface IContext<InputResultMap extends Record<string, unknown> = Record<string, string>> {
19
+ getEnvironmentSecret(key: string): string;
30
20
  getInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
31
- getSharedInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
32
21
  }
33
- export type IPermissionContext<P extends IPersona = IPersona, InputMap extends Record<string, unknown> = Record<string, string>> = Omit<IContext<P, InputMap>, 'getOutput' | 'getEnvironmentSecret'>;
@@ -8,6 +8,9 @@ var ProxyVariableSourceType;
8
8
  ProxyVariableSourceType["PERSONA_META_REFERENCE"] = "PERSONA_META_REFERENCE";
9
9
  ProxyVariableSourceType["PERSONA_ENDUSERID_REFERENCE"] = "PERSONA_ENDUSERID_REFERENCE";
10
10
  ProxyVariableSourceType["WORKFLOW_INPUT_REFERENCE"] = "WORKFLOW_INPUT_REFERENCE";
11
- ProxyVariableSourceType["INTEGRATION_INPUT_REFERENCE"] = "INTEGRATION_INPUT_REFERENCE";
11
+ ProxyVariableSourceType["CONNECT_USER_PROVIDER_ID"] = "CONNECT_USER_PROVIDER_ID";
12
+ ProxyVariableSourceType["CONNECT_USER_PROVIDER_DATA"] = "CONNECT_USER_PROVIDER_DATA";
13
+ ProxyVariableSourceType["SAME_STEP_REFERENCE"] = "SAME_STEP_REFERENCE";
14
+ ProxyVariableSourceType["OAUTH_ACCESS_TOKEN"] = "OAUTH_ACCESS_TOKEN";
12
15
  })(ProxyVariableSourceType || (exports.ProxyVariableSourceType = ProxyVariableSourceType = {}));
13
16
  //# sourceMappingURL=context.interface.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.interface.js","sourceRoot":"","sources":["../../src/execution/context.interface.ts"],"names":[],"mappings":";;;AAkBA,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,4DAAiC,CAAA;IACjC,gEAAqC,CAAA;IACrC,4EAAiD,CAAA;IACjD,sFAA2D,CAAA;IAC3D,gFAAqD,CAAA;IACrD,sFAA2D,CAAA;AAC7D,CAAC,EAPW,uBAAuB,uCAAvB,uBAAuB,QAOlC"}
1
+ {"version":3,"file":"context.interface.js","sourceRoot":"","sources":["../../src/execution/context.interface.ts"],"names":[],"mappings":";;;AAMA,IAAY,uBAUX;AAVD,WAAY,uBAAuB;IACjC,4DAAiC,CAAA;IACjC,gEAAqC,CAAA;IACrC,4EAAiD,CAAA;IACjD,sFAA2D,CAAA;IAC3D,gFAAqD,CAAA;IACrD,gFAAqD,CAAA;IACrD,oFAAyD,CAAA;IACzD,sEAA2C,CAAA;IAC3C,oEAAyC,CAAA;AAC3C,CAAC,EAVW,uBAAuB,uCAAvB,uBAAuB,QAUlC"}
@@ -1,180 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Context = exports.getSecretKeysForProject = exports.TokenizedIdentifiers = void 0;
4
- const context_constants_1 = require("./context.constants");
3
+ exports.Context = void 0;
5
4
  const context_interface_1 = require("./context.interface");
6
- var TokenizedIdentifiers;
7
- (function (TokenizedIdentifiers) {
8
- TokenizedIdentifiers["START"] = "__TOKENIZED_START__";
9
- TokenizedIdentifiers["END"] = "__TOKENIZED_END__";
10
- })(TokenizedIdentifiers || (exports.TokenizedIdentifiers = TokenizedIdentifiers = {}));
11
- const secretKeysUsedInpProject = new Set();
12
- const getSecretKeysForProject = () => {
13
- return [...secretKeysUsedInpProject];
14
- };
15
- exports.getSecretKeysForProject = getSecretKeysForProject;
5
+ const context_utils_1 = require("./context.utils");
16
6
  class Context {
17
- getOutput(step) {
18
- const keys = [];
19
- const proxy = new Proxy(step, {
20
- get(_target, property) {
21
- if (property === '_isMockFunction') {
22
- return false;
23
- }
24
- else if (typeof property === 'string' &&
25
- property.startsWith('@@__IMMUTABLE_')) {
26
- return undefined;
27
- }
28
- else if (property === Symbol.toPrimitive) {
29
- return () => `${TokenizedIdentifiers.START}${context_interface_1.ProxyVariableSourceType.STEP_REFERENCE}:${step.id}:${keys.join('.')}${TokenizedIdentifiers.END}`;
30
- }
31
- else if (property === context_constants_1.PROXY_KEY_GET_KEYS) {
32
- return () => [...keys];
33
- }
34
- else if (property === context_constants_1.PROXY_KEY_GET_INPUT_REFERENCE) {
35
- return () => step;
36
- }
37
- else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
38
- return () => context_interface_1.ProxyVariableSourceType.STEP_REFERENCE;
39
- }
40
- if (!keys.includes(property.toString())) {
41
- keys.push(property.toString());
42
- }
43
- return proxy;
44
- },
45
- });
46
- return proxy;
47
- }
48
7
  getEnvironmentSecret(key) {
49
- const keys = [];
50
- const proxy = new Proxy({}, {
51
- get(_target, property) {
52
- if (property === '_isMockFunction') {
53
- return false;
54
- }
55
- else if (typeof property === 'string' &&
56
- property.startsWith('@@__IMMUTABLE_')) {
57
- return undefined;
58
- }
59
- else if (property === Symbol.toPrimitive) {
60
- return () => {
61
- secretKeysUsedInpProject.add(key);
62
- return `${TokenizedIdentifiers.START}${context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE}:${key}:${TokenizedIdentifiers.END}`;
63
- };
64
- }
65
- else if (property === context_constants_1.PROXY_KEY_GET_INPUT_REFERENCE) {
66
- return () => key;
67
- }
68
- else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
69
- return () => {
70
- secretKeysUsedInpProject.add(key);
71
- return context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE;
72
- };
73
- }
74
- if (!keys.includes(property.toString())) {
75
- keys.push(property.toString());
76
- }
77
- return proxy;
78
- },
79
- });
80
- return proxy;
81
- }
82
- getPersona(key) {
83
- if (!['userId', 'meta'].includes(key)) {
84
- throw new Error('Only "userId" and "meta" is valid input for Context#getPersona method.');
85
- }
86
- const keys = [];
87
- const proxy = new Proxy({}, {
88
- get(_target, property) {
89
- if (property === '_isMockFunction') {
90
- return false;
91
- }
92
- else if (typeof property === 'string' &&
93
- property.startsWith('@@__IMMUTABLE_')) {
94
- return undefined;
95
- }
96
- else if (property === Symbol.toPrimitive) {
97
- return () => `${TokenizedIdentifiers.START}${key === 'userId'
98
- ? context_interface_1.ProxyVariableSourceType.PERSONA_ENDUSERID_REFERENCE
99
- : context_interface_1.ProxyVariableSourceType.PERSONA_META_REFERENCE}::${keys.join('.')}${TokenizedIdentifiers.END}`;
100
- }
101
- else if (property === context_constants_1.PROXY_KEY_GET_KEYS) {
102
- return () => [...keys];
103
- }
104
- else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
105
- return () => key === 'userId'
106
- ? context_interface_1.ProxyVariableSourceType.PERSONA_ENDUSERID_REFERENCE
107
- : context_interface_1.ProxyVariableSourceType.PERSONA_META_REFERENCE;
108
- }
109
- if (!keys.includes(property.toString())) {
110
- keys.push(property.toString());
111
- }
112
- return proxy;
113
- },
114
- });
115
- return proxy;
8
+ return (0, context_utils_1.createProxyInputReference)(key, () => key, context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE);
116
9
  }
117
10
  getInput(input) {
118
- const keys = [];
119
- const proxy = new Proxy({}, {
120
- get(_target, property) {
121
- if (property === '_isMockFunction') {
122
- return false;
123
- }
124
- else if (typeof property === 'string' &&
125
- property.startsWith('@@__IMMUTABLE_')) {
126
- return undefined;
127
- }
128
- else if (property === Symbol.toPrimitive) {
129
- return () => `${TokenizedIdentifiers.START}${context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE}:${input.id}:${keys.join('.')}${TokenizedIdentifiers.END}`;
130
- }
131
- else if (property === context_constants_1.PROXY_KEY_GET_KEYS) {
132
- return () => [...keys];
133
- }
134
- else if (property === context_constants_1.PROXY_KEY_GET_INPUT_REFERENCE) {
135
- return () => input;
136
- }
137
- else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
138
- return () => context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE;
139
- }
140
- if (!keys.includes(property.toString())) {
141
- keys.push(property.toString());
142
- }
143
- return proxy;
144
- },
145
- });
146
- return proxy;
147
- }
148
- getSharedInput(input) {
149
- const keys = [];
150
- const proxy = new Proxy({}, {
151
- get(_target, property) {
152
- if (property === '_isMockFunction') {
153
- return false;
154
- }
155
- else if (typeof property === 'string' &&
156
- property.startsWith('@@__IMMUTABLE_')) {
157
- return undefined;
158
- }
159
- else if (property === Symbol.toPrimitive) {
160
- return () => `${TokenizedIdentifiers.START}${context_interface_1.ProxyVariableSourceType.INTEGRATION_INPUT_REFERENCE}:${input.id}:${keys.join('.')}${TokenizedIdentifiers.END}`;
161
- }
162
- else if (property === context_constants_1.PROXY_KEY_GET_KEYS) {
163
- return () => [...keys];
164
- }
165
- else if (property === context_constants_1.PROXY_KEY_GET_INPUT_REFERENCE) {
166
- return () => input;
167
- }
168
- else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
169
- return () => context_interface_1.ProxyVariableSourceType.INTEGRATION_INPUT_REFERENCE;
170
- }
171
- if (!keys.includes(property.toString())) {
172
- keys.push(property.toString());
173
- }
174
- return proxy;
175
- },
176
- });
177
- return proxy;
11
+ return (0, context_utils_1.createProxyInputReference)(input, () => input.id, context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE);
178
12
  }
179
13
  }
180
14
  exports.Context = Context;
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/execution/context.ts"],"names":[],"mappings":";;;AAQA,2DAI6B;AAC7B,2DAK6B;AAE7B,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,qDAA6B,CAAA;IAC7B,iDAAyB,CAAA;AAC3B,CAAC,EAHW,oBAAoB,oCAApB,oBAAoB,QAG/B;AAKD,MAAM,wBAAwB,GAAgB,IAAI,GAAG,EAAU,CAAC;AAQzD,MAAM,uBAAuB,GAAG,GAAa,EAAE;IACpD,OAAO,CAAC,GAAG,wBAAwB,CAAC,CAAC;AACvC,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC;AAEF,MAAa,OAAO;IAqBlB,SAAS,CAAC,IAAW;QACnB,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,EAAE;YAC5B,GAAG,CAAC,OAAY,EAAE,QAAyB;gBACzC,IAAI,QAAQ,KAAK,iBAAiB,EAAE,CAAC;oBACnC,OAAO,KAAK,CAAC;gBACf,CAAC;qBAAM,IACL,OAAO,QAAQ,KAAK,QAAQ;oBAC5B,QAAQ,CAAC,UAAU,CAAC,gBAAgB,CAAC,EACrC,CAAC;oBACD,OAAO,SAAS,CAAC;gBACnB,CAAC;qBAAM,IAAI,QAAQ,KAAK,MAAM,CAAC,WAAW,EAAE,CAAC;oBAC3C,OAAO,GAAG,EAAE,CACV,GAAG,oBAAoB,CAAC,KAAK,GAC3B,2CAAuB,CAAC,cAC1B,IAAI,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,oBAAoB,CAAC,GAAG,EAAE,CAAC;gBAC/D,CAAC;qBAAM,IAAI,QAAQ,KAAK,sCAAkB,EAAE,CAAC;oBAC3C,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,CAAC,2BAC1B,IAAI,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,oBAAoB,CAAC,GAAG,EAAE,CAAC;gBAChE,CAAC;qBAAM,IAAI,QAAQ,KAAK,sCAAkB,EAAE,CAAC;oBAC3C,OAAO,GAAa,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;gBACnC,CAAC;qBAAM,IAAI,QAAQ,KAAK,iDAA6B,EAAE,CAAC;oBACtD,OAAO,GAAM,EAAE,CAAC,KAAK,CAAC;gBACxB,CAAC;qBAAM,IAAI,QAAQ,KAAK,yCAAqB,EAAE,CAAC;oBAC9C,OAAO,GAA4B,EAAE,CACnC,2CAAuB,CAAC,2BAA2B,CAAC;gBACxD,CAAC;gBAED,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;oBACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACjC,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CACF,CAAC;QACF,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA9OD,0BA8OC"}
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/execution/context.ts"],"names":[],"mappings":";;;AACA,2DAAwE;AACxE,mDAA4D;AAE5D,MAAa,OAAO;IAQlB,oBAAoB,CAAC,GAAW;QAC9B,OAAO,IAAA,yCAAyB,EAC9B,GAAG,EACH,GAAG,EAAE,CAAC,GAAG,EACT,2CAAuB,CAAC,gBAAgB,CACzC,CAAC;IACJ,CAAC;IAOD,QAAQ,CACN,KAAQ;QAER,OAAO,IAAA,yCAAyB,EAC9B,KAAK,EACL,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,EACd,2CAAuB,CAAC,wBAAwB,CACjD,CAAC;IACJ,CAAC;CACF;AA9BD,0BA8BC"}
@@ -5,4 +5,5 @@ export declare function isProxy(maybeProxy: any): boolean;
5
5
  export declare function getKeysAccessedFromProxy(proxy: any): string[];
6
6
  export declare function getInputReferenceFromProxy<T>(proxy: any): T;
7
7
  export declare function getProxySourceType(proxy: any): ProxyVariableSourceType;
8
+ export declare function createProxyInputReference<I>(input: I, getInputId: () => string, sourceType: ProxyVariableSourceType, existingKeys?: string[]): any;
8
9
  export declare function proxyToSource<T extends DataType>(proxy: any, dataType: T, stepDependencies?: StepDependencies): Source<T>;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.proxyToSource = exports.getProxySourceType = exports.getInputReferenceFromProxy = exports.getKeysAccessedFromProxy = exports.isProxy = void 0;
3
+ exports.proxyToSource = exports.createProxyInputReference = exports.getProxySourceType = exports.getInputReferenceFromProxy = exports.getKeysAccessedFromProxy = exports.isProxy = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const node_util_1 = tslib_1.__importDefault(require("node:util"));
6
6
  const inputs_1 = require("../inputs");
7
+ const secret_1 = require("../secret");
7
8
  const step_utils_1 = require("../steps/step.utils");
8
9
  const context_constants_1 = require("./context.constants");
9
10
  const context_interface_1 = require("./context.interface");
@@ -23,56 +24,98 @@ function getProxySourceType(proxy) {
23
24
  return proxy[context_constants_1.PROXY_KEY_SOURCE_TYPE]();
24
25
  }
25
26
  exports.getProxySourceType = getProxySourceType;
27
+ function createProxyInputReference(input, getInputId, sourceType, existingKeys = []) {
28
+ const keys = [...existingKeys];
29
+ let inputToProxy = input;
30
+ if (!input || typeof input !== 'object') {
31
+ inputToProxy = {};
32
+ }
33
+ const proxy = new Proxy(inputToProxy, {
34
+ get(_target, property) {
35
+ if (property === '_isMockFunction') {
36
+ return false;
37
+ }
38
+ else if (typeof property === 'string' &&
39
+ property.startsWith('@@__IMMUTABLE_')) {
40
+ return undefined;
41
+ }
42
+ else if (property === Symbol.toPrimitive) {
43
+ return () => `${context_constants_1.TokenizedIdentifiers.START}${sourceType}:${getInputId()}:${keys.join('.')}${context_constants_1.TokenizedIdentifiers.END}`;
44
+ }
45
+ else if (property === context_constants_1.PROXY_KEY_GET_KEYS) {
46
+ return () => [...keys];
47
+ }
48
+ else if (property === context_constants_1.PROXY_KEY_GET_INPUT_REFERENCE) {
49
+ return () => input;
50
+ }
51
+ else if (property === context_constants_1.PROXY_KEY_SOURCE_TYPE) {
52
+ return () => sourceType;
53
+ }
54
+ keys.push(property.toString());
55
+ return proxy;
56
+ },
57
+ });
58
+ return proxy;
59
+ }
60
+ exports.createProxyInputReference = createProxyInputReference;
26
61
  function proxyToSource(proxy, dataType, stepDependencies) {
27
62
  const sourceType = getProxySourceType(proxy);
63
+ const keys = getKeysAccessedFromProxy(proxy);
28
64
  switch (sourceType) {
29
- case context_interface_1.ProxyVariableSourceType.STEP_REFERENCE: {
65
+ case context_interface_1.ProxyVariableSourceType.STEP_REFERENCE:
30
66
  const step = getInputReferenceFromProxy(proxy);
31
- const keys = getKeysAccessedFromProxy(proxy);
32
67
  return {
33
68
  type: 'VARIABLE',
34
69
  stepId: (0, step_utils_1.extractCorrectStepId)(step.id, stepDependencies),
35
70
  path: keys,
36
71
  dataType,
37
72
  };
38
- }
39
- case context_interface_1.ProxyVariableSourceType.PERSONA_META_REFERENCE: {
40
- const keys = getKeysAccessedFromProxy(proxy);
73
+ case context_interface_1.ProxyVariableSourceType.PERSONA_META_REFERENCE:
41
74
  return { type: 'PERSONA_METADATA', path: keys };
42
- }
43
- case context_interface_1.ProxyVariableSourceType.PERSONA_ENDUSERID_REFERENCE: {
75
+ case context_interface_1.ProxyVariableSourceType.PERSONA_ENDUSERID_REFERENCE:
44
76
  return {
45
77
  type: 'CONNECT_CREDENTIAL_FIELD',
46
78
  fieldType: 'EXTERNAL_USER_ID',
47
79
  };
48
- }
49
- case context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE: {
50
- const input = getInputReferenceFromProxy(proxy);
51
- const keys = getKeysAccessedFromProxy(proxy);
52
- return (0, inputs_1.fixDataSourceReferencesInInputSource)({
80
+ case context_interface_1.ProxyVariableSourceType.OAUTH_ACCESS_TOKEN:
81
+ return {
53
82
  type: 'CONNECT_CREDENTIAL_FIELD',
54
- fieldType: 'WORKFLOW_SETTING',
55
- path: keys,
56
- inputId: input.id,
57
- }, stepDependencies);
58
- }
59
- case context_interface_1.ProxyVariableSourceType.INTEGRATION_INPUT_REFERENCE: {
83
+ fieldType: 'OAUTH_ACCESS_TOKEN',
84
+ };
85
+ case context_interface_1.ProxyVariableSourceType.CONNECT_USER_PROVIDER_DATA:
86
+ return {
87
+ type: 'CONNECT_CREDENTIAL_FIELD',
88
+ fieldType: 'EXTERNAL_USER_PROVIDER_DATA',
89
+ dataKey: keys[0],
90
+ };
91
+ case context_interface_1.ProxyVariableSourceType.CONNECT_USER_PROVIDER_ID:
92
+ return {
93
+ type: 'CONNECT_CREDENTIAL_FIELD',
94
+ fieldType: 'EXTERNAL_USER_PROVIDER_ID',
95
+ };
96
+ case context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE:
60
97
  const input = getInputReferenceFromProxy(proxy);
61
- const keys = getKeysAccessedFromProxy(proxy);
62
98
  return (0, inputs_1.fixDataSourceReferencesInInputSource)({
63
99
  type: 'CONNECT_CREDENTIAL_FIELD',
64
- fieldType: 'SHARED_WORKFLOW_SETTING',
100
+ fieldType: 'WORKFLOW_SETTING',
65
101
  path: keys,
66
102
  inputId: input.id,
67
103
  }, stepDependencies);
68
- }
69
- case context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE: {
104
+ case context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE:
70
105
  const secretKey = getInputReferenceFromProxy(proxy);
71
106
  return {
72
107
  type: 'ENVIRONMENT_SECRET',
73
- environmentSecretId: secretKey,
108
+ environmentSecretId: (0, secret_1.getSecretIdForKey)(secretKey, stepDependencies),
109
+ };
110
+ case context_interface_1.ProxyVariableSourceType.SAME_STEP_REFERENCE:
111
+ const sameStep = getInputReferenceFromProxy(proxy);
112
+ return {
113
+ type: 'SAME_STEP_REFERENCE',
114
+ name: 'pageToken',
115
+ dataType,
116
+ path: keys,
117
+ stepId: (0, step_utils_1.extractCorrectStepId)(sameStep.id, stepDependencies),
74
118
  };
75
- }
76
119
  default:
77
120
  throw new Error(`${sourceType} is not supported.`);
78
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"context.utils.js","sourceRoot":"","sources":["../../src/execution/context.utils.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,sCAGmB;AAGnB,oDAA2D;AAC3D,2DAI6B;AAC7B,2DAA8D;AAO9D,SAAgB,OAAO,CAAC,UAAe;IACrC,OAAO,mBAAS,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC7C,CAAC;AAFD,0BAEC;AAQD,SAAgB,wBAAwB,CAAC,KAAU;IACjD,OAAO,KAAK,CAAC,sCAAkB,CAAC,EAAE,CAAC;AACrC,CAAC;AAFD,4DAEC;AAOD,SAAgB,0BAA0B,CAAI,KAAU;IACtD,OAAO,KAAK,CAAC,iDAA6B,CAAC,EAAE,CAAC;AAChD,CAAC;AAFD,gEAEC;AAOD,SAAgB,kBAAkB,CAAC,KAAU;IAC3C,OAAO,KAAK,CAAC,yCAAqB,CAAC,EAAE,CAAC;AACxC,CAAC;AAFD,gDAEC;AASD,SAAgB,aAAa,CAC3B,KAAU,EACV,QAAW,EACX,gBAAmC;IAEnC,MAAM,UAAU,GAA4B,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAEtE,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,2CAAuB,CAAC,cAAc,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,GAAU,0BAA0B,CAAC,KAAK,CAAC,CAAC;YACtD,MAAM,IAAI,GAAa,wBAAwB,CAAC,KAAK,CAAC,CAAC;YAEvD,OAAO;gBACL,IAAI,EAAE,UAAU;gBAChB,MAAM,EAAE,IAAA,iCAAoB,EAAC,IAAI,CAAC,EAAE,EA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B,CAAC;aACpE,CAAC;QAEJ,KAAK,2CAAuB,CAAC,mBAAmB;YAC9C,MAAM,QAAQ,GAAU,0BAA0B,CAAC,KAAK,CAAC,CAAC;YAC1D,OAAO;gBACL,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,WAAW;gBACjB,QAAQ;gBACR,IAAI,EAAE,IAAI;gBACV,MAAM,EAAE,IAAA,iCAAoB,EAAC,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC;aAC5D,CAAC;QAEJ;YACE,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,oBAAoB,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAjFD,sCAiFC"}
@@ -1,2 +1,4 @@
1
1
  export * from './context';
2
+ export * from './context.constants';
2
3
  export * from './context.interface';
4
+ export * from './context.utils';
@@ -2,5 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./context"), exports);
5
+ tslib_1.__exportStar(require("./context.constants"), exports);
5
6
  tslib_1.__exportStar(require("./context.interface"), exports);
7
+ tslib_1.__exportStar(require("./context.utils"), exports);
6
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,8DAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/execution/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,8DAAoC;AACpC,8DAAoC;AACpC,0DAAgC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from './integration';
2
- export { StateMachine } from './stateMachine/stateMachine.interface';
2
+ export { type StateMachine } from './stateMachine/stateMachine.interface';
3
3
  export * from './steps';
4
4
  export * from './triggers';
5
5
  export * from './user';
@@ -1,3 +1,3 @@
1
1
  import { SidebarInputType } from './input.interface';
2
- export declare const BASIC_INPUT_NAMES: string[];
2
+ export declare const BASIC_INPUT_NAME_TO_INPUT_TYPE_MAP: Record<string, SidebarInputType>;
3
3
  export declare const INPUT_NAME_TO_INPUT_TYPE_MAP: Record<string, SidebarInputType>;
@@ -1,22 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INPUT_NAME_TO_INPUT_TYPE_MAP = exports.BASIC_INPUT_NAMES = void 0;
3
+ exports.INPUT_NAME_TO_INPUT_TYPE_MAP = exports.BASIC_INPUT_NAME_TO_INPUT_TYPE_MAP = void 0;
4
4
  const input_interface_1 = require("./input.interface");
5
- exports.BASIC_INPUT_NAMES = [
6
- 'text',
7
- 'number',
8
- 'email',
9
- 'url',
10
- 'boolean',
11
- 'password',
12
- ];
13
- exports.INPUT_NAME_TO_INPUT_TYPE_MAP = {
5
+ exports.BASIC_INPUT_NAME_TO_INPUT_TYPE_MAP = {
14
6
  text: input_interface_1.SidebarInputType.ValueText,
15
7
  number: input_interface_1.SidebarInputType.Number,
16
8
  email: input_interface_1.SidebarInputType.Email,
17
9
  url: input_interface_1.SidebarInputType.URL,
18
10
  boolean: input_interface_1.SidebarInputType.BooleanInput,
19
11
  password: input_interface_1.SidebarInputType.Password,
12
+ };
13
+ exports.INPUT_NAME_TO_INPUT_TYPE_MAP = {
14
+ ...exports.BASIC_INPUT_NAME_TO_INPUT_TYPE_MAP,
20
15
  [input_interface_1.DataSourceType.DYNAMIC]: input_interface_1.SidebarInputType.DynamicEnum,
21
16
  [input_interface_1.DataSourceType.FIELD_MAPPER]: input_interface_1.SidebarInputType.FieldMapper,
22
17
  [input_interface_1.DataSourceType.COMBO_INPUT]: input_interface_1.SidebarInputType.ComboInput,
@@ -1 +1 @@
1
- {"version":3,"file":"input.constants.js","sourceRoot":"","sources":["../../src/inputs/input.constants.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAKxD,QAAA,iBAAiB,GAAa;IACzC,MAAM;IACN,QAAQ;IACR,OAAO;IACP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gB,CAAC,IAAI;CACpD,CAAC"}
@@ -38,16 +38,24 @@ export type UserDefinedInput<I> = {
38
38
  type: I;
39
39
  };
40
40
  export declare enum SidebarInputType {
41
- Enum = "ENUM",
42
- DynamicEnum = "DYNAMIC_ENUM",
43
- ValueText = "TEXT_NO_VARS",
44
41
  BooleanInput = "BOOLEAN_INPUT",
45
- Number = "NUMBER",
42
+ Code = "CODE",
43
+ ComboInput = "COMBO_INPUT",
44
+ Conditional = "CONDITIONAL",
45
+ DynamicEnum = "DYNAMIC_ENUM",
46
+ DynamicConditional = "DYNAMIC_CONDITIONAL",
47
+ EditableEnum = "EDITABLE_ENUM",
46
48
  Email = "EMAIL",
47
- URL = "URL",
49
+ Enum = "ENUM",
48
50
  FieldMapper = "FIELD_MAPPER",
49
- ComboInput = "COMBO_INPUT",
50
- Password = "PASSWORD"
51
+ Number = "NUMBER",
52
+ Password = "PASSWORD",
53
+ Switch = "SWITCH",
54
+ Text = "TEXT",
55
+ TextArea = "TEXTAREA",
56
+ URL = "URL",
57
+ ValueText = "TEXT_NO_VARS",
58
+ ValueTextArea = "TEXTAREA_NO_VARS"
51
59
  }
52
60
  export type DataSource = DynamicDataSource | StaticEnumDataSource | FieldMapperDataSource | ComboInputDataSource;
53
61
  export type SerializedInput = {
@@ -55,6 +63,9 @@ export type SerializedInput = {
55
63
  title: string;
56
64
  required?: boolean;
57
65
  tooltip?: string;
66
+ subtitle?: string;
67
+ placeholder?: string;
68
+ suffixLabel?: string;
58
69
  } & ({
59
70
  type: SidebarInputType.ValueText | SidebarInputType.Number | SidebarInputType.Email | SidebarInputType.URL | SidebarInputType.BooleanInput | SidebarInputType.Password;
60
71
  } | {
@@ -67,3 +78,13 @@ export type SerializedInput = {
67
78
  }[];
68
79
  sourceType: string;
69
80
  });
81
+ export type DefaultSuppportedInputType = 'text' | 'number' | 'email' | 'url' | 'boolean' | 'password';
82
+ export type DefaultInputToResultMap = {
83
+ email: string;
84
+ url: string;
85
+ password: string;
86
+ boolean: boolean;
87
+ text: string;
88
+ number: number;
89
+ };
90
+ export declare const createInputs: <T extends Record<string, UserDefinedInput<DefaultSuppportedInputType>>>(inputs: T) => T;