@prismatic-io/spectral 5.0.0-rc.3 → 5.2.0
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/clients/soap/index.d.ts +2 -0
- package/dist/clients/soap/index.js +14 -0
- package/dist/clients/soap/types.d.ts +67 -0
- package/dist/clients/soap/types.js +15 -0
- package/dist/clients/soap/utils.d.ts +13 -0
- package/dist/clients/soap/utils.js +165 -0
- package/dist/testing.js +4 -2
- package/dist/types/ActionDefinition.d.ts +2 -0
- package/dist/types/ActionLogger.d.ts +2 -0
- package/dist/types/ActionPerformFunction.d.ts +2 -0
- package/dist/types/ActionPerformReturn.d.ts +3 -1
- package/dist/types/DisplayDefinition.d.ts +2 -2
- package/dist/types/Inputs.d.ts +10 -2
- package/dist/types/TriggerDefinition.d.ts +2 -0
- package/dist/types/TriggerResult.d.ts +3 -1
- package/dist/types/server-types.d.ts +8 -2
- package/package.json +7 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./types"), exports);
|
|
14
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Connection } from "../../index";
|
|
2
|
+
import { Client, IMTOMAttachments } from "soap";
|
|
3
|
+
export interface SOAPConnection extends Connection {
|
|
4
|
+
fields: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
wsdlDefinitionUrl?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const isSOAPConnection: (connection: unknown) => connection is SOAPConnection;
|
|
10
|
+
export interface GetClient {
|
|
11
|
+
(connection: SOAPConnection): Promise<Client>;
|
|
12
|
+
(wsdlDefinition: string): Promise<Client>;
|
|
13
|
+
}
|
|
14
|
+
export interface SOAPRequest {
|
|
15
|
+
(params: RequestParams): Promise<[any, any, any, any, IMTOMAttachments?]>;
|
|
16
|
+
(params: RequestParams, methodParams: Record<string, unknown>): Promise<[
|
|
17
|
+
any,
|
|
18
|
+
any,
|
|
19
|
+
any,
|
|
20
|
+
any,
|
|
21
|
+
IMTOMAttachments?
|
|
22
|
+
]>;
|
|
23
|
+
(params: RequestParams, methodParams: undefined): Promise<[
|
|
24
|
+
any,
|
|
25
|
+
any,
|
|
26
|
+
any,
|
|
27
|
+
any,
|
|
28
|
+
IMTOMAttachments?
|
|
29
|
+
]>;
|
|
30
|
+
}
|
|
31
|
+
export interface RequestParams {
|
|
32
|
+
wsdlParam: SOAPConnection | string;
|
|
33
|
+
method: string;
|
|
34
|
+
overrides?: ClientOverrides;
|
|
35
|
+
debug?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ClientOverrides {
|
|
38
|
+
endpointURL?: string;
|
|
39
|
+
soapHeaders?: unknown[];
|
|
40
|
+
}
|
|
41
|
+
export interface HeaderPayload {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
}
|
|
44
|
+
export interface GenerateHeader {
|
|
45
|
+
(wsdlParam: SOAPConnection | string, headerPayload: HeaderPayload, headerOptions: undefined): Promise<string>;
|
|
46
|
+
(wsdlParam: SOAPConnection | string, headerPayload: HeaderPayload, headerOptions: {
|
|
47
|
+
namespace: string;
|
|
48
|
+
xmlns: string;
|
|
49
|
+
}): Promise<string>;
|
|
50
|
+
}
|
|
51
|
+
export interface BasicAuthConnection extends Connection {
|
|
52
|
+
fields: {
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
username: unknown;
|
|
55
|
+
password: unknown;
|
|
56
|
+
loginMethod: unknown;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export declare const isBasicAuthConnection: (connection: Connection) => connection is BasicAuthConnection;
|
|
60
|
+
export interface SOAPAuth {
|
|
61
|
+
(connection: BasicAuthConnection, wsdlDefinition: string): Promise<any>;
|
|
62
|
+
(connection: BasicAuthConnection & SOAPConnection): Promise<any>;
|
|
63
|
+
}
|
|
64
|
+
export interface DescribeWSDL {
|
|
65
|
+
(connection: SOAPConnection): Promise<any>;
|
|
66
|
+
(wsdlDefinition: string): Promise<any>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isBasicAuthConnection = exports.isSOAPConnection = void 0;
|
|
4
|
+
const isSOAPConnection = (connection) => {
|
|
5
|
+
var _a;
|
|
6
|
+
if (typeof connection === "object" && connection !== null)
|
|
7
|
+
return "wsdlDefinitionURL" in ((_a = connection) === null || _a === void 0 ? void 0 : _a.fields);
|
|
8
|
+
return false;
|
|
9
|
+
};
|
|
10
|
+
exports.isSOAPConnection = isSOAPConnection;
|
|
11
|
+
const isBasicAuthConnection = (connection) => {
|
|
12
|
+
const { fields } = connection;
|
|
13
|
+
return ("username" in fields && "password" in fields && "loginMethod" in fields);
|
|
14
|
+
};
|
|
15
|
+
exports.isBasicAuthConnection = isBasicAuthConnection;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ClientOverrides, GenerateHeader, GetClient, SOAPAuth, SOAPRequest, DescribeWSDL } from "./types";
|
|
2
|
+
import { Client } from "soap";
|
|
3
|
+
export declare const describeWSDL: DescribeWSDL;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
generateHeader: GenerateHeader;
|
|
6
|
+
getSOAPClient: GetClient;
|
|
7
|
+
getSOAPAuth: SOAPAuth;
|
|
8
|
+
getWSDL: (wsdlDefinitionURL: string) => Promise<string>;
|
|
9
|
+
overrideClientDefaults: (client: Client, overrides: ClientOverrides) => void;
|
|
10
|
+
soapRequest: SOAPRequest;
|
|
11
|
+
describeWSDL: DescribeWSDL;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.describeWSDL = void 0;
|
|
16
|
+
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
17
|
+
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
|
18
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
|
19
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
20
|
+
const types_1 = require("./types");
|
|
21
|
+
const index_1 = require("../../index");
|
|
22
|
+
const soap_1 = require("soap");
|
|
23
|
+
const axios_1 = __importDefault(require("axios"));
|
|
24
|
+
const promises_1 = require("fs/promises");
|
|
25
|
+
const uuid_1 = require("uuid");
|
|
26
|
+
const debugRequest = (client) => {
|
|
27
|
+
console.debug(client.lastRequest);
|
|
28
|
+
console.debug(client.lastResponse);
|
|
29
|
+
};
|
|
30
|
+
const describeWSDL = (wsdlParam) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
let client;
|
|
32
|
+
if (types_1.isSOAPConnection(wsdlParam)) {
|
|
33
|
+
client = yield getSOAPClient(wsdlParam);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
client = yield getSOAPClient(index_1.util.types.toString(wsdlParam));
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
const result = client.describe();
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw new Error("Unable to parse WSDL Services due to circular references");
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
exports.describeWSDL = describeWSDL;
|
|
47
|
+
const getWSDL = (wsdlDefinitionURL) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
+
const httpClient = axios_1.default.create({
|
|
49
|
+
baseURL: wsdlDefinitionURL,
|
|
50
|
+
headers: { "Content-Type": "text/xml" },
|
|
51
|
+
});
|
|
52
|
+
const { data } = yield httpClient.get("");
|
|
53
|
+
return index_1.util.types.toString(data);
|
|
54
|
+
});
|
|
55
|
+
const getSOAPClient = (wsdlParam) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
if (typeof wsdlParam === "string") {
|
|
57
|
+
const wsdl = index_1.util.types.toString(wsdlParam);
|
|
58
|
+
const filePath = `/tmp/${uuid_1.v4()}.wsdl`;
|
|
59
|
+
yield promises_1.writeFile(filePath, wsdl);
|
|
60
|
+
const client = yield soap_1.createClientAsync(filePath);
|
|
61
|
+
yield promises_1.rm(filePath);
|
|
62
|
+
return client;
|
|
63
|
+
}
|
|
64
|
+
else if (types_1.isSOAPConnection(wsdlParam)) {
|
|
65
|
+
const { fields: { wsdlDefinitionURL }, } = wsdlParam;
|
|
66
|
+
if (!wsdlDefinitionURL ||
|
|
67
|
+
!index_1.util.types.isUrl(index_1.util.types.toString(wsdlDefinitionURL))) {
|
|
68
|
+
throw new Error("WSDL Definition or the Connection field 'wsdlDefinitionURL' must be supplied.");
|
|
69
|
+
}
|
|
70
|
+
const client = yield soap_1.createClientAsync(index_1.util.types.toString(wsdlDefinitionURL));
|
|
71
|
+
return client;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw new Error("WSDL Definition or the Connection field 'wsdlDefinitionURL' must be supplied.");
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const overrideClientDefaults = (client, overrides) => {
|
|
78
|
+
const { endpointURL, soapHeaders } = overrides;
|
|
79
|
+
if (endpointURL) {
|
|
80
|
+
client.setEndpoint(endpointURL);
|
|
81
|
+
}
|
|
82
|
+
if (soapHeaders) {
|
|
83
|
+
soapHeaders.map((header) => {
|
|
84
|
+
client.addSoapHeader(header);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const soapRequest = ({ wsdlParam, method, overrides, debug }, methodParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
let client;
|
|
90
|
+
if (types_1.isSOAPConnection(wsdlParam)) {
|
|
91
|
+
client = yield getSOAPClient(wsdlParam);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
client = yield getSOAPClient(wsdlParam);
|
|
95
|
+
}
|
|
96
|
+
if (overrides) {
|
|
97
|
+
overrideClientDefaults(client, overrides);
|
|
98
|
+
}
|
|
99
|
+
const requestFunction = client[`${method}Async`];
|
|
100
|
+
let results = undefined;
|
|
101
|
+
try {
|
|
102
|
+
if (typeof methodParams === "object" && methodParams !== null) {
|
|
103
|
+
results = yield requestFunction(methodParams);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
results = yield requestFunction({});
|
|
107
|
+
}
|
|
108
|
+
if (index_1.util.types.isBool(debug) && debug) {
|
|
109
|
+
debugRequest(client);
|
|
110
|
+
}
|
|
111
|
+
return results;
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (index_1.util.types.isBool(debug) && debug) {
|
|
115
|
+
debugRequest(client);
|
|
116
|
+
}
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const generateHeader = (wsdlParam, headerPayload, headerOptions) => __awaiter(void 0, void 0, void 0, function* () {
|
|
121
|
+
let client;
|
|
122
|
+
if (types_1.isSOAPConnection(wsdlParam)) {
|
|
123
|
+
client = yield getSOAPClient(wsdlParam);
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
client = yield getSOAPClient(wsdlParam);
|
|
127
|
+
}
|
|
128
|
+
let options = [];
|
|
129
|
+
if (headerOptions) {
|
|
130
|
+
options = Object.values(headerOptions);
|
|
131
|
+
}
|
|
132
|
+
const index = client.addSoapHeader(headerPayload, "", ...options);
|
|
133
|
+
return client.getSoapHeaders()[index];
|
|
134
|
+
});
|
|
135
|
+
const getSOAPAuth = (connection, wsdlDefinition) => __awaiter(void 0, void 0, void 0, function* () {
|
|
136
|
+
if (types_1.isBasicAuthConnection(connection) && wsdlDefinition) {
|
|
137
|
+
const { fields: { username, password, loginMethod }, } = connection;
|
|
138
|
+
const result = yield soapRequest({
|
|
139
|
+
wsdlParam: index_1.util.types.toString(wsdlDefinition),
|
|
140
|
+
method: index_1.util.types.toString(loginMethod),
|
|
141
|
+
}, { username, password });
|
|
142
|
+
return result;
|
|
143
|
+
}
|
|
144
|
+
else if (types_1.isSOAPConnection(connection) &&
|
|
145
|
+
types_1.isBasicAuthConnection(connection)) {
|
|
146
|
+
const { fields: { username, password, loginMethod }, } = connection;
|
|
147
|
+
const result = yield soapRequest({
|
|
148
|
+
wsdlParam: connection,
|
|
149
|
+
method: index_1.util.types.toString(loginMethod),
|
|
150
|
+
}, { username, password });
|
|
151
|
+
return result;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
throw new Error("Must supply a SOAP Connection or a WSDL Definition");
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
exports.default = {
|
|
158
|
+
generateHeader,
|
|
159
|
+
getSOAPClient,
|
|
160
|
+
getSOAPAuth,
|
|
161
|
+
getWSDL,
|
|
162
|
+
overrideClientDefaults,
|
|
163
|
+
soapRequest,
|
|
164
|
+
describeWSDL: exports.describeWSDL,
|
|
165
|
+
};
|
package/dist/testing.js
CHANGED
|
@@ -28,6 +28,8 @@ exports.createConnection = createConnection;
|
|
|
28
28
|
* See https://prismatic.io/docs/custom-components/writing-custom-components/#verifying-correct-logging-in-action-tests for information on testing correct logging behavior in your custom component.
|
|
29
29
|
*/
|
|
30
30
|
const loggerMock = () => ({
|
|
31
|
+
metric: console.log,
|
|
32
|
+
trace: jest_mock_1.spyOn(console, "trace"),
|
|
31
33
|
debug: jest_mock_1.spyOn(console, "debug"),
|
|
32
34
|
info: jest_mock_1.spyOn(console, "info"),
|
|
33
35
|
log: jest_mock_1.spyOn(console, "log"),
|
|
@@ -43,7 +45,7 @@ exports.loggerMock = loggerMock;
|
|
|
43
45
|
*/
|
|
44
46
|
const invoke = (actionBase, params, context) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
47
|
const action = (actionBase.perform ? actionBase : Object.values(actionBase)[0]);
|
|
46
|
-
const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
|
|
48
|
+
const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, executionState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
|
|
47
49
|
const result = yield action.perform(realizedContext, params);
|
|
48
50
|
return {
|
|
49
51
|
result,
|
|
@@ -88,7 +90,7 @@ exports.defaultTriggerPayload = defaultTriggerPayload;
|
|
|
88
90
|
*/
|
|
89
91
|
const invokeTrigger = (triggerBase, context, payload, params) => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
92
|
const trigger = (triggerBase.perform ? triggerBase : Object.values(triggerBase)[0]);
|
|
91
|
-
const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
|
|
93
|
+
const realizedContext = Object.assign({ logger: exports.loggerMock(), instanceState: {}, executionState: {}, stepId: "mockStepId", executionId: "mockExecutionId" }, context);
|
|
92
94
|
const realizedPayload = Object.assign(Object.assign({}, exports.defaultTriggerPayload()), payload);
|
|
93
95
|
const realizedParams = params || {};
|
|
94
96
|
const result = yield trigger.perform(realizedContext, realizedPayload, realizedParams);
|
|
@@ -12,6 +12,8 @@ export interface ActionDefinition<T extends Inputs, AllowsBranching extends bool
|
|
|
12
12
|
inputs: T;
|
|
13
13
|
/** Optional attribute that specifies whether an Action will terminate execution.*/
|
|
14
14
|
terminateExecution?: boolean;
|
|
15
|
+
/** Specifies whether an Action will break out of a loop. */
|
|
16
|
+
breakLoop?: boolean;
|
|
15
17
|
/** Determines whether an Action will allow Conditional Branching.*/
|
|
16
18
|
allowsBranching?: AllowsBranching;
|
|
17
19
|
/** Static Branch names associated with an Action. */
|
|
@@ -12,6 +12,8 @@ export declare type ActionLoggerFunction = (...args: unknown[]) => void;
|
|
|
12
12
|
* An object containing logger functions.
|
|
13
13
|
*/
|
|
14
14
|
export interface ActionLogger {
|
|
15
|
+
metric: ActionLoggerFunction;
|
|
16
|
+
trace: ActionLoggerFunction;
|
|
15
17
|
debug: ActionLoggerFunction;
|
|
16
18
|
info: ActionLoggerFunction;
|
|
17
19
|
log: ActionLoggerFunction;
|
|
@@ -7,6 +7,8 @@ export interface ActionContext {
|
|
|
7
7
|
logger: ActionLogger;
|
|
8
8
|
/** A key/value store that may be used to store small amounts of data that is persisted between Instance executions */
|
|
9
9
|
instanceState: Record<string, unknown>;
|
|
10
|
+
/** A key/value store that may be used to store small amounts of data for use later during the execution */
|
|
11
|
+
executionState: Record<string, unknown>;
|
|
10
12
|
/** A unique id that corresponds to the step on the Integration */
|
|
11
13
|
stepId: string;
|
|
12
14
|
/** A unique id that corresponds to the specific execution of the Integration */
|
|
@@ -7,7 +7,9 @@ export interface ActionPerformDataReturn<ReturnData> {
|
|
|
7
7
|
/** The HTTP Status code that will be used if this terminates a synchronous invocation */
|
|
8
8
|
statusCode?: number;
|
|
9
9
|
/** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
|
|
10
|
-
|
|
10
|
+
instanceState?: Record<string, unknown>;
|
|
11
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
12
|
+
executionState?: Record<string, unknown>;
|
|
11
13
|
}
|
|
12
14
|
/** Used to represent a branching return of conventional data and does not require content type to be specified */
|
|
13
15
|
/** Used to represent a binary or serialized data branching return as content type must be specified */
|
|
@@ -9,8 +9,8 @@ interface DisplayDefinition {
|
|
|
9
9
|
description: string;
|
|
10
10
|
}
|
|
11
11
|
interface ExtraDisplayDefinitionFields {
|
|
12
|
-
/** Path to icon to use for this Component. Path should be relative to component
|
|
13
|
-
iconPath
|
|
12
|
+
/** Path to icon to use for this Component. Path should be relative to the built component source. */
|
|
13
|
+
iconPath: string;
|
|
14
14
|
/** Category of the Component. */
|
|
15
15
|
category?: string;
|
|
16
16
|
}
|
package/dist/types/Inputs.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare type Inputs = Record<string, InputFieldDefinition>;
|
|
|
3
3
|
export declare type ConnectionInput = DefaultInputFieldDefinition & {
|
|
4
4
|
shown?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare type InputFieldDefinition = DefaultInputFieldDefinition | CodeInputFieldDefinition;
|
|
6
|
+
export declare type InputFieldDefinition = DefaultInputFieldDefinition | CodeInputFieldDefinition | ConditionalInputField | ConnectionInputField;
|
|
7
7
|
interface BaseInputFieldDefinition {
|
|
8
8
|
/** Interface label of the InputField. */
|
|
9
9
|
label: string;
|
|
@@ -24,13 +24,21 @@ interface BaseInputFieldDefinition {
|
|
|
24
24
|
}
|
|
25
25
|
/** Defines attributes of a InputField. */
|
|
26
26
|
export interface DefaultInputFieldDefinition extends BaseInputFieldDefinition {
|
|
27
|
-
type: Exclude<InputFieldType, "code">;
|
|
27
|
+
type: Exclude<InputFieldType, "code" | "conditional" | "connection">;
|
|
28
28
|
}
|
|
29
29
|
/** Defines attributes of a CodeInputField. */
|
|
30
30
|
export interface CodeInputFieldDefinition extends BaseInputFieldDefinition {
|
|
31
31
|
type: Extract<InputFieldType, "code">;
|
|
32
32
|
language?: string;
|
|
33
33
|
}
|
|
34
|
+
/** Defines attributes of a ConditionalInputField. */
|
|
35
|
+
export interface ConditionalInputField extends BaseInputFieldDefinition {
|
|
36
|
+
type: Extract<InputFieldType, "conditional">;
|
|
37
|
+
}
|
|
38
|
+
/** Defines attributes of a ConnectionInputField. */
|
|
39
|
+
export interface ConnectionInputField extends BaseInputFieldDefinition {
|
|
40
|
+
type: Extract<InputFieldType, "connection">;
|
|
41
|
+
}
|
|
34
42
|
export interface Connection {
|
|
35
43
|
/** Key of the Connection type. */
|
|
36
44
|
key: string;
|
|
@@ -19,6 +19,8 @@ export interface TriggerDefinition<T extends Inputs, AllowsBranching extends boo
|
|
|
19
19
|
synchronousResponseSupport: TriggerOptionChoice;
|
|
20
20
|
/** Optional attribute that specifies whether this Trigger will terminate execution. */
|
|
21
21
|
terminateExecution?: boolean;
|
|
22
|
+
/** Specifies whether an Action will break out of a loop. */
|
|
23
|
+
breakLoop?: boolean;
|
|
22
24
|
/** Determines whether this Trigger allows Conditional Branching. */
|
|
23
25
|
allowsBranching?: AllowsBranching;
|
|
24
26
|
/** Static Branch names associated with this Trigger. */
|
|
@@ -7,7 +7,9 @@ export interface TriggerBaseResult {
|
|
|
7
7
|
/** Optional HTTP response to the request that invoked the integration. */
|
|
8
8
|
response?: HttpResponse;
|
|
9
9
|
/** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
|
|
10
|
-
|
|
10
|
+
instanceState?: Record<string, unknown>;
|
|
11
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
12
|
+
executionState?: Record<string, unknown>;
|
|
11
13
|
}
|
|
12
14
|
/** Represents the result of a Trigger action that uses branching. */
|
|
13
15
|
export interface TriggerBranchingResult extends TriggerBaseResult {
|
|
@@ -45,6 +45,8 @@ interface BaseAction {
|
|
|
45
45
|
inputs: InputField[];
|
|
46
46
|
/** Optional attribute that specifies whether an Action will terminate execution. */
|
|
47
47
|
terminateExecution?: boolean;
|
|
48
|
+
/** Specifies whether an Action will break out of a loop. */
|
|
49
|
+
breakLoop?: boolean;
|
|
48
50
|
/** Determines whether an Action will allow Conditional Branching. */
|
|
49
51
|
allowsBranching?: boolean;
|
|
50
52
|
/** Static Branch names associated with an Action. */
|
|
@@ -95,7 +97,9 @@ export interface ServerPerformDataStructureReturn {
|
|
|
95
97
|
/** The HTTP Status code that will be used if this terminates a synchronous invocation */
|
|
96
98
|
statusCode?: number;
|
|
97
99
|
/** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
|
|
98
|
-
|
|
100
|
+
instanceState?: Record<string, unknown>;
|
|
101
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
102
|
+
executionState?: Record<string, unknown>;
|
|
99
103
|
}
|
|
100
104
|
/** Used to represent a binary or serialized data return as content type must be specified */
|
|
101
105
|
interface ServerPerformDataReturn {
|
|
@@ -106,7 +110,9 @@ interface ServerPerformDataReturn {
|
|
|
106
110
|
/** The HTTP Status code that will be used if this terminates a synchronous invocation */
|
|
107
111
|
statusCode?: number;
|
|
108
112
|
/** An optional object, the keys and values of which will be persisted in the instanceState and available for subsequent actions and executions */
|
|
109
|
-
|
|
113
|
+
instanceState?: Record<string, unknown>;
|
|
114
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
115
|
+
executionState?: Record<string, unknown>;
|
|
110
116
|
}
|
|
111
117
|
/** Used to represent a branching return of conventional data and does not require content type to be specified */
|
|
112
118
|
export interface ServerPerformBranchingDataStructureReturn extends ServerPerformDataStructureReturn {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Utility library for building Prismatic components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -32,13 +32,19 @@
|
|
|
32
32
|
"dist/"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"axios": "0.24.0",
|
|
35
36
|
"date-fns": "2.17.0",
|
|
36
37
|
"jest-mock": "27.0.3",
|
|
38
|
+
"soap": "0.43.0",
|
|
39
|
+
"uuid": "8.3.1",
|
|
37
40
|
"valid-url": "1.0.9"
|
|
38
41
|
},
|
|
39
42
|
"devDependencies": {
|
|
43
|
+
"@types/axios": "0.14.0",
|
|
40
44
|
"@types/jest": "26.0.23",
|
|
41
45
|
"@types/node": "14.14.35",
|
|
46
|
+
"@types/sax": "1.2.4",
|
|
47
|
+
"@types/uuid": "8.3.1",
|
|
42
48
|
"@types/valid-url": "1.0.3",
|
|
43
49
|
"@typescript-eslint/eslint-plugin": "4.27.0",
|
|
44
50
|
"@typescript-eslint/parser": "4.27.0",
|