@useparagon/core 0.0.1-canary.38 → 0.0.1-canary.4
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/event/event.interface.d.ts +1 -1
- package/dist/execution/context.constants.d.ts +0 -4
- package/dist/execution/context.constants.js +1 -6
- package/dist/execution/context.constants.js.map +1 -1
- package/dist/execution/context.d.ts +22 -3
- package/dist/execution/context.interface.d.ts +18 -6
- package/dist/execution/context.interface.js +1 -4
- package/dist/execution/context.interface.js.map +1 -1
- package/dist/execution/context.js +170 -4
- package/dist/execution/context.js.map +1 -1
- package/dist/execution/context.utils.d.ts +0 -1
- package/dist/execution/context.utils.js +25 -68
- package/dist/execution/context.utils.js.map +1 -1
- package/dist/execution/index.d.ts +0 -2
- package/dist/execution/index.js +0 -2
- package/dist/execution/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/inputs/input.constants.d.ts +1 -1
- package/dist/inputs/input.constants.js +10 -5
- package/dist/inputs/input.constants.js.map +1 -1
- package/dist/inputs/input.interface.d.ts +7 -28
- package/dist/inputs/input.interface.js +7 -17
- package/dist/inputs/input.interface.js.map +1 -1
- package/dist/inputs/input.utils.d.ts +1 -3
- package/dist/inputs/input.utils.js +25 -25
- package/dist/inputs/input.utils.js.map +1 -1
- package/dist/integration/custom.integration.d.ts +1 -5
- package/dist/integration/custom.integration.interface.d.ts +0 -43
- package/dist/integration/custom.integration.js +1 -18
- package/dist/integration/custom.integration.js.map +1 -1
- package/dist/integration/index.d.ts +0 -4
- package/dist/integration/index.js +0 -4
- package/dist/integration/index.js.map +1 -1
- package/dist/integration/integration.d.ts +2 -2
- package/dist/integration/integration.interface.d.ts +1 -6
- package/dist/integration/integration.js +3 -7
- package/dist/integration/integration.js.map +1 -1
- package/dist/operator/operators/BooleanFalse.d.ts +1 -1
- package/dist/operator/operators/BooleanFalse.js.map +1 -1
- package/dist/operator/operators/BooleanTrue.d.ts +1 -1
- package/dist/operator/operators/BooleanTrue.js.map +1 -1
- package/dist/operator/operators/DateTimeAfter.d.ts +1 -1
- package/dist/operator/operators/DateTimeAfter.js.map +1 -1
- package/dist/operator/operators/DateTimeBefore.d.ts +1 -1
- package/dist/operator/operators/DateTimeBefore.js.map +1 -1
- package/dist/operator/operators/DateTimeEquals.d.ts +1 -1
- package/dist/operator/operators/DateTimeEquals.js.map +1 -1
- package/dist/operator/operators/NumberDoesNotEqual.d.ts +1 -1
- package/dist/operator/operators/NumberDoesNotEqual.js.map +1 -1
- package/dist/operator/operators/NumberEquals.d.ts +1 -1
- package/dist/operator/operators/NumberEquals.js.map +1 -1
- package/dist/operator/operators/NumberGreaterThan.d.ts +1 -1
- package/dist/operator/operators/NumberGreaterThan.js.map +1 -1
- package/dist/operator/operators/NumberGreaterThanOrEqualTo.d.ts +1 -1
- package/dist/operator/operators/NumberGreaterThanOrEqualTo.js.map +1 -1
- package/dist/operator/operators/NumberLessThan.d.ts +1 -1
- package/dist/operator/operators/NumberLessThan.js.map +1 -1
- package/dist/operator/operators/NumberLessThanOrEqualTo.d.ts +1 -1
- package/dist/operator/operators/NumberLessThanOrEqualTo.js.map +1 -1
- package/dist/operator/operators/StringContains.d.ts +1 -1
- package/dist/operator/operators/StringContains.js.map +1 -1
- package/dist/operator/operators/StringDoesNotContain.d.ts +1 -1
- package/dist/operator/operators/StringDoesNotContain.js.map +1 -1
- package/dist/operator/operators/StringDoesNotEndWith.d.ts +1 -1
- package/dist/operator/operators/StringDoesNotEndWith.js.map +1 -1
- package/dist/operator/operators/StringDoesNotExactlyMatch.d.ts +1 -1
- package/dist/operator/operators/StringDoesNotExactlyMatch.js.map +1 -1
- package/dist/operator/operators/StringDoesNotStartWith.d.ts +1 -1
- package/dist/operator/operators/StringDoesNotStartWith.js.map +1 -1
- package/dist/operator/operators/StringEndsWith.d.ts +1 -1
- package/dist/operator/operators/StringEndsWith.js.map +1 -1
- package/dist/operator/operators/StringExactlyMatches.d.ts +1 -1
- package/dist/operator/operators/StringExactlyMatches.js.map +1 -1
- package/dist/operator/operators/StringGreaterThan.d.ts +1 -1
- package/dist/operator/operators/StringGreaterThan.js.map +1 -1
- package/dist/operator/operators/StringIsIn.d.ts +1 -1
- package/dist/operator/operators/StringIsIn.js.map +1 -1
- package/dist/operator/operators/StringIsNotIn.d.ts +1 -1
- package/dist/operator/operators/StringIsNotIn.js.map +1 -1
- package/dist/operator/operators/StringLessThan.d.ts +1 -1
- package/dist/operator/operators/StringLessThan.js.map +1 -1
- package/dist/operator/operators/StringStartsWith.d.ts +1 -1
- package/dist/operator/operators/StringStartsWith.js.map +1 -1
- package/dist/resolvers/resolver.utils.d.ts +2 -3
- package/dist/resolvers/resolver.utils.js +22 -54
- package/dist/resolvers/resolver.utils.js.map +1 -1
- package/dist/resolvers/resolvers.interface.d.ts +5 -12
- package/dist/resolvers/resolvers.interface.js.map +1 -1
- package/dist/secret/index.d.ts +0 -1
- package/dist/secret/index.js +0 -1
- package/dist/secret/index.js.map +1 -1
- package/dist/secret/secret.interface.d.ts +0 -6
- package/dist/stateMachine/stateMachine.utils.js +21 -16
- package/dist/stateMachine/stateMachine.utils.js.map +1 -1
- package/dist/steps/library/action/action.interface.d.ts +5 -3
- package/dist/steps/library/action/action.step.d.ts +2 -2
- package/dist/steps/library/action/action.step.js +6 -16
- package/dist/steps/library/action/action.step.js.map +1 -1
- package/dist/steps/library/conditional/conditional.interface.d.ts +2 -5
- package/dist/steps/library/conditional/conditional.step.d.ts +5 -6
- package/dist/steps/library/conditional/conditional.step.js +8 -13
- package/dist/steps/library/conditional/conditional.step.js.map +1 -1
- package/dist/steps/library/delay/delay.step.js +3 -6
- package/dist/steps/library/delay/delay.step.js.map +1 -1
- package/dist/steps/library/fanout/fanout.interface.d.ts +2 -2
- package/dist/steps/library/fanout/fanout.step.d.ts +3 -4
- package/dist/steps/library/fanout/fanout.step.js +4 -10
- package/dist/steps/library/fanout/fanout.step.js.map +1 -1
- package/dist/steps/library/function/function.interface.d.ts +6 -8
- package/dist/steps/library/function/function.step.d.ts +3 -4
- package/dist/steps/library/function/function.step.js +3 -13
- package/dist/steps/library/function/function.step.js.map +1 -1
- package/dist/steps/library/integrationRequest/integrationRequest.interface.d.ts +13 -28
- package/dist/steps/library/integrationRequest/integrationRequest.step.d.ts +3 -4
- package/dist/steps/library/integrationRequest/integrationRequest.step.js +14 -47
- package/dist/steps/library/integrationRequest/integrationRequest.step.js.map +1 -1
- package/dist/steps/library/request/request.interface.d.ts +12 -53
- package/dist/steps/library/request/request.interface.js +1 -7
- package/dist/steps/library/request/request.interface.js.map +1 -1
- package/dist/steps/library/request/request.step.d.ts +3 -4
- package/dist/steps/library/request/request.step.js +11 -43
- package/dist/steps/library/request/request.step.js.map +1 -1
- package/dist/steps/library/response/response.interface.d.ts +1 -6
- package/dist/steps/library/response/response.interface.js.map +1 -1
- package/dist/steps/library/response/response.step.d.ts +3 -4
- package/dist/steps/library/response/response.step.js +2 -8
- package/dist/steps/library/response/response.step.js.map +1 -1
- package/dist/steps/step.interface-base.d.ts +0 -15
- package/dist/steps/step.interface.d.ts +0 -3
- package/dist/steps/step.interface.js.map +1 -1
- package/dist/steps/step.js +9 -10
- package/dist/steps/step.js.map +1 -1
- package/dist/steps/step.utils.js +10 -27
- package/dist/steps/step.utils.js.map +1 -1
- package/dist/triggers/actionTrigger/actionTrigger.step.d.ts +2 -3
- package/dist/triggers/actionTrigger/actionTrigger.step.js +3 -14
- package/dist/triggers/actionTrigger/actionTrigger.step.js.map +1 -1
- package/dist/triggers/cron/cron.step.js +2 -7
- package/dist/triggers/cron/cron.step.js.map +1 -1
- package/dist/triggers/cron/cron.utils.js +2 -2
- package/dist/triggers/cron/cron.utils.js.map +1 -1
- package/dist/triggers/endpoint/endpoint.interface.d.ts +1 -9
- package/dist/triggers/endpoint/endpoint.step.d.ts +3 -4
- package/dist/triggers/endpoint/endpoint.step.js +4 -9
- package/dist/triggers/endpoint/endpoint.step.js.map +1 -1
- package/dist/triggers/event/event.interface.d.ts +2 -1
- package/dist/triggers/event/event.step.d.ts +3 -3
- package/dist/triggers/event/event.step.js +6 -10
- package/dist/triggers/event/event.step.js.map +1 -1
- package/dist/triggers/integrationEnabled/integrationEnabled.step.d.ts +1 -1
- package/dist/triggers/integrationEnabled/integrationEnabled.step.js +2 -3
- package/dist/triggers/integrationEnabled/integrationEnabled.step.js.map +1 -1
- package/dist/triggers/trigger.js +4 -1
- package/dist/triggers/trigger.js.map +1 -1
- package/dist/triggers/unselected/unselected.step.js +3 -5
- package/dist/triggers/unselected/unselected.step.js.map +1 -1
- package/dist/user/user.d.ts +1 -7
- package/dist/user/user.interface.d.ts +1 -8
- package/dist/user/user.js +0 -14
- package/dist/user/user.js.map +1 -1
- package/dist/utils/utils.d.ts +4 -9
- package/dist/utils/utils.js +11 -45
- package/dist/utils/utils.js.map +1 -1
- package/dist/workflow/workflow.d.ts +6 -8
- package/dist/workflow/workflow.interface.d.ts +2 -5
- package/dist/workflow/workflow.interface.js.map +1 -1
- package/dist/workflow/workflow.js +29 -40
- package/dist/workflow/workflow.js.map +1 -1
- package/package.json +19 -61
- package/dist/integration/integration.utils.d.ts +0 -5
- package/dist/integration/integration.utils.js +0 -30
- package/dist/integration/integration.utils.js.map +0 -1
- package/dist/secret/secret.utils.d.ts +0 -2
- package/dist/secret/secret.utils.js +0 -15
- package/dist/secret/secret.utils.js.map +0 -1
- package/dist/steps/library/function/libraries.d.ts +0 -98
- package/dist/steps/library/function/libraries.js +0 -3
- package/dist/steps/library/function/libraries.js.map +0 -1
- package/dist/types/generics.d.ts +0 -5
- package/dist/types/generics.js +0 -3
- package/dist/types/generics.js.map +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -5
- package/dist/types/index.js.map +0 -1
|
@@ -1,7 +1,3 @@
|
|
|
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,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
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 = {}));
|
|
12
7
|
//# 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"}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import { UserDefinedInput } from '../inputs/input.interface';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
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];
|
|
5
23
|
getInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
|
|
24
|
+
getSharedInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
|
|
6
25
|
}
|
|
@@ -1,21 +1,33 @@
|
|
|
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;
|
|
3
9
|
export declare enum ProxyVariableSourceType {
|
|
4
10
|
STEP_REFERENCE = "STEP_REFERENCE",
|
|
5
11
|
SECRET_REFERENCE = "SECRET_REFERENCE",
|
|
6
12
|
PERSONA_META_REFERENCE = "PERSONA_META_REFERENCE",
|
|
7
13
|
PERSONA_ENDUSERID_REFERENCE = "PERSONA_ENDUSERID_REFERENCE",
|
|
8
14
|
WORKFLOW_INPUT_REFERENCE = "WORKFLOW_INPUT_REFERENCE",
|
|
9
|
-
|
|
10
|
-
CONNECT_USER_PROVIDER_DATA = "CONNECT_USER_PROVIDER_DATA",
|
|
11
|
-
SAME_STEP_REFERENCE = "SAME_STEP_REFERENCE",
|
|
12
|
-
OAUTH_ACCESS_TOKEN = "OAUTH_ACCESS_TOKEN"
|
|
15
|
+
INTEGRATION_INPUT_REFERENCE = "INTEGRATION_INPUT_REFERENCE"
|
|
13
16
|
}
|
|
14
17
|
export type PersonaInputKeyToOutputMap<P extends IPersona = IPersona> = {
|
|
15
18
|
userId: string;
|
|
16
19
|
meta: P['meta'];
|
|
17
20
|
};
|
|
18
|
-
export interface IContext<InputResultMap extends Record<string, unknown> = Record<string, string>> {
|
|
19
|
-
|
|
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];
|
|
20
30
|
getInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
|
|
31
|
+
getSharedInput<I extends UserDefinedInput<keyof InputResultMap>>(input: I): InputResultMap[I['type']];
|
|
21
32
|
}
|
|
33
|
+
export type IPermissionContext<P extends IPersona = IPersona, InputMap extends Record<string, unknown> = Record<string, string>> = Omit<IContext<P, InputMap>, 'getOutput' | 'getEnvironmentSecret'>;
|
|
@@ -8,9 +8,6 @@ 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["
|
|
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";
|
|
11
|
+
ProxyVariableSourceType["INTEGRATION_INPUT_REFERENCE"] = "INTEGRATION_INPUT_REFERENCE";
|
|
15
12
|
})(ProxyVariableSourceType || (exports.ProxyVariableSourceType = ProxyVariableSourceType = {}));
|
|
16
13
|
//# sourceMappingURL=context.interface.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.interface.js","sourceRoot":"","sources":["../../src/execution/context.interface.ts"],"names":[],"mappings":";;;
|
|
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,14 +1,180 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Context = void 0;
|
|
3
|
+
exports.Context = exports.getSecretKeysForProject = exports.TokenizedIdentifiers = void 0;
|
|
4
|
+
const context_constants_1 = require("./context.constants");
|
|
4
5
|
const context_interface_1 = require("./context.interface");
|
|
5
|
-
|
|
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;
|
|
6
16
|
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
|
+
}
|
|
7
48
|
getEnvironmentSecret(key) {
|
|
8
|
-
|
|
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;
|
|
9
116
|
}
|
|
10
117
|
getInput(input) {
|
|
11
|
-
|
|
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;
|
|
12
178
|
}
|
|
13
179
|
}
|
|
14
180
|
exports.Context = Context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/execution/context.ts"],"names":[],"mappings":";;;
|
|
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,I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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"}
|
|
@@ -5,5 +5,4 @@ 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;
|
|
9
8
|
export declare function proxyToSource<T extends DataType>(proxy: any, dataType: T, stepDependencies?: StepDependencies): Source<T>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.proxyToSource = exports.
|
|
3
|
+
exports.proxyToSource = 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");
|
|
8
7
|
const step_utils_1 = require("../steps/step.utils");
|
|
9
8
|
const context_constants_1 = require("./context.constants");
|
|
10
9
|
const context_interface_1 = require("./context.interface");
|
|
@@ -24,98 +23,56 @@ function getProxySourceType(proxy) {
|
|
|
24
23
|
return proxy[context_constants_1.PROXY_KEY_SOURCE_TYPE]();
|
|
25
24
|
}
|
|
26
25
|
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;
|
|
61
26
|
function proxyToSource(proxy, dataType, stepDependencies) {
|
|
62
27
|
const sourceType = getProxySourceType(proxy);
|
|
63
|
-
const keys = getKeysAccessedFromProxy(proxy);
|
|
64
28
|
switch (sourceType) {
|
|
65
|
-
case context_interface_1.ProxyVariableSourceType.STEP_REFERENCE:
|
|
29
|
+
case context_interface_1.ProxyVariableSourceType.STEP_REFERENCE: {
|
|
66
30
|
const step = getInputReferenceFromProxy(proxy);
|
|
31
|
+
const keys = getKeysAccessedFromProxy(proxy);
|
|
67
32
|
return {
|
|
68
33
|
type: 'VARIABLE',
|
|
69
34
|
stepId: (0, step_utils_1.extractCorrectStepId)(step.id, stepDependencies),
|
|
70
35
|
path: keys,
|
|
71
36
|
dataType,
|
|
72
37
|
};
|
|
73
|
-
|
|
38
|
+
}
|
|
39
|
+
case context_interface_1.ProxyVariableSourceType.PERSONA_META_REFERENCE: {
|
|
40
|
+
const keys = getKeysAccessedFromProxy(proxy);
|
|
74
41
|
return { type: 'PERSONA_METADATA', path: keys };
|
|
75
|
-
|
|
42
|
+
}
|
|
43
|
+
case context_interface_1.ProxyVariableSourceType.PERSONA_ENDUSERID_REFERENCE: {
|
|
76
44
|
return {
|
|
77
45
|
type: 'CONNECT_CREDENTIAL_FIELD',
|
|
78
46
|
fieldType: 'EXTERNAL_USER_ID',
|
|
79
47
|
};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
type: 'CONNECT_CREDENTIAL_FIELD',
|
|
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:
|
|
48
|
+
}
|
|
49
|
+
case context_interface_1.ProxyVariableSourceType.WORKFLOW_INPUT_REFERENCE: {
|
|
97
50
|
const input = getInputReferenceFromProxy(proxy);
|
|
51
|
+
const keys = getKeysAccessedFromProxy(proxy);
|
|
98
52
|
return (0, inputs_1.fixDataSourceReferencesInInputSource)({
|
|
99
53
|
type: 'CONNECT_CREDENTIAL_FIELD',
|
|
100
54
|
fieldType: 'WORKFLOW_SETTING',
|
|
101
55
|
path: keys,
|
|
102
56
|
inputId: input.id,
|
|
103
57
|
}, stepDependencies);
|
|
104
|
-
|
|
58
|
+
}
|
|
59
|
+
case context_interface_1.ProxyVariableSourceType.INTEGRATION_INPUT_REFERENCE: {
|
|
60
|
+
const input = getInputReferenceFromProxy(proxy);
|
|
61
|
+
const keys = getKeysAccessedFromProxy(proxy);
|
|
62
|
+
return (0, inputs_1.fixDataSourceReferencesInInputSource)({
|
|
63
|
+
type: 'CONNECT_CREDENTIAL_FIELD',
|
|
64
|
+
fieldType: 'SHARED_WORKFLOW_SETTING',
|
|
65
|
+
path: keys,
|
|
66
|
+
inputId: input.id,
|
|
67
|
+
}, stepDependencies);
|
|
68
|
+
}
|
|
69
|
+
case context_interface_1.ProxyVariableSourceType.SECRET_REFERENCE: {
|
|
105
70
|
const secretKey = getInputReferenceFromProxy(proxy);
|
|
106
71
|
return {
|
|
107
72
|
type: 'ENVIRONMENT_SECRET',
|
|
108
|
-
environmentSecretId:
|
|
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),
|
|
73
|
+
environmentSecretId: secretKey,
|
|
118
74
|
};
|
|
75
|
+
}
|
|
119
76
|
default:
|
|
120
77
|
throw new Error(`${sourceType} is not supported.`);
|
|
121
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.utils.js","sourceRoot":"","sources":["../../src/execution/context.utils.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,sCAGmB;
|
|
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,I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0B,CAAC,KAAK,CAAC,CAAC;YAC5D,OAAO;gBACL,IAAI,EAAE,oBAAoB;gBAC1B,mBAAmB,EAAE,SAAS;aAC/B,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,GAAG,UAAU,oBAAoB,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AA3ED,sCA2EC"}
|
package/dist/execution/index.js
CHANGED
|
@@ -2,7 +2,5 @@
|
|
|
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);
|
|
6
5
|
tslib_1.__exportStar(require("./context.interface"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./context.utils"), exports);
|
|
8
6
|
//# 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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SidebarInputType } from './input.interface';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const BASIC_INPUT_NAMES: string[];
|
|
3
3
|
export declare const INPUT_NAME_TO_INPUT_TYPE_MAP: Record<string, SidebarInputType>;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INPUT_NAME_TO_INPUT_TYPE_MAP = exports.
|
|
3
|
+
exports.INPUT_NAME_TO_INPUT_TYPE_MAP = exports.BASIC_INPUT_NAMES = void 0;
|
|
4
4
|
const input_interface_1 = require("./input.interface");
|
|
5
|
-
exports.
|
|
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 = {
|
|
6
14
|
text: input_interface_1.SidebarInputType.ValueText,
|
|
7
15
|
number: input_interface_1.SidebarInputType.Number,
|
|
8
16
|
email: input_interface_1.SidebarInputType.Email,
|
|
9
17
|
url: input_interface_1.SidebarInputType.URL,
|
|
10
18
|
boolean: input_interface_1.SidebarInputType.BooleanInput,
|
|
11
19
|
password: input_interface_1.SidebarInputType.Password,
|
|
12
|
-
};
|
|
13
|
-
exports.INPUT_NAME_TO_INPUT_TYPE_MAP = {
|
|
14
|
-
...exports.BASIC_INPUT_NAME_TO_INPUT_TYPE_MAP,
|
|
15
20
|
[input_interface_1.DataSourceType.DYNAMIC]: input_interface_1.SidebarInputType.DynamicEnum,
|
|
16
21
|
[input_interface_1.DataSourceType.FIELD_MAPPER]: input_interface_1.SidebarInputType.FieldMapper,
|
|
17
22
|
[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,
|
|
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,KAAK;IACL,SAAS;IACT,UAAU;CACX,CAAC;AAKW,QAAA,4BAA4B,GAAqC;IAC5E,IAAI,EAAE,kCAAgB,CAAC,SAAS;IAChC,MAAM,EAAE,kCAAgB,CAAC,MAAM;IAC/B,KAAK,EAAE,kCAAgB,CAAC,KAAK;IAC7B,GAAG,EAAE,kCAAgB,CAAC,GAAG;IACzB,OAAO,EAAE,kCAAgB,CAAC,YAAY;IACtC,QAAQ,EAAE,kCAAgB,CAAC,QAAQ;IACnC,CAAC,gCAAc,CAAC,OAAO,CAAC,EAAE,kCAAgB,CAAC,WAAW;IACtD,CAAC,gCAAc,CAAC,YAAY,CAAC,EAAE,kCAAgB,CAAC,WAAW;IAC3D,CAAC,gCAAc,CAAC,WAAW,CAAC,EAAE,kCAAgB,CAAC,UAAU;IACzD,CAAC,gCAAc,CAAC,WAAW,CAAC,EAAE,kCAAgB,CAAC,IAAI;CACpD,CAAC"}
|
|
@@ -38,24 +38,16 @@ export type UserDefinedInput<I> = {
|
|
|
38
38
|
type: I;
|
|
39
39
|
};
|
|
40
40
|
export declare enum SidebarInputType {
|
|
41
|
-
BooleanInput = "BOOLEAN_INPUT",
|
|
42
|
-
Code = "CODE",
|
|
43
|
-
ComboInput = "COMBO_INPUT",
|
|
44
|
-
Conditional = "CONDITIONAL",
|
|
45
|
-
DynamicEnum = "DYNAMIC_ENUM",
|
|
46
|
-
DynamicConditional = "DYNAMIC_CONDITIONAL",
|
|
47
|
-
EditableEnum = "EDITABLE_ENUM",
|
|
48
|
-
Email = "EMAIL",
|
|
49
41
|
Enum = "ENUM",
|
|
50
|
-
|
|
42
|
+
DynamicEnum = "DYNAMIC_ENUM",
|
|
43
|
+
ValueText = "TEXT_NO_VARS",
|
|
44
|
+
BooleanInput = "BOOLEAN_INPUT",
|
|
51
45
|
Number = "NUMBER",
|
|
52
|
-
|
|
53
|
-
Switch = "SWITCH",
|
|
54
|
-
Text = "TEXT",
|
|
55
|
-
TextArea = "TEXTAREA",
|
|
46
|
+
Email = "EMAIL",
|
|
56
47
|
URL = "URL",
|
|
57
|
-
|
|
58
|
-
|
|
48
|
+
FieldMapper = "FIELD_MAPPER",
|
|
49
|
+
ComboInput = "COMBO_INPUT",
|
|
50
|
+
Password = "PASSWORD"
|
|
59
51
|
}
|
|
60
52
|
export type DataSource = DynamicDataSource | StaticEnumDataSource | FieldMapperDataSource | ComboInputDataSource;
|
|
61
53
|
export type SerializedInput = {
|
|
@@ -63,9 +55,6 @@ export type SerializedInput = {
|
|
|
63
55
|
title: string;
|
|
64
56
|
required?: boolean;
|
|
65
57
|
tooltip?: string;
|
|
66
|
-
subtitle?: string;
|
|
67
|
-
placeholder?: string;
|
|
68
|
-
suffixLabel?: string;
|
|
69
58
|
} & ({
|
|
70
59
|
type: SidebarInputType.ValueText | SidebarInputType.Number | SidebarInputType.Email | SidebarInputType.URL | SidebarInputType.BooleanInput | SidebarInputType.Password;
|
|
71
60
|
} | {
|
|
@@ -78,13 +67,3 @@ export type SerializedInput = {
|
|
|
78
67
|
}[];
|
|
79
68
|
sourceType: string;
|
|
80
69
|
});
|
|
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;
|