@prismatic-io/spectral 7.8.4 → 8.0.0-preview3
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/index.d.ts +11 -10
- package/dist/index.js +11 -1
- package/dist/serverTypes/convert.d.ts +2 -1
- package/dist/serverTypes/convert.js +164 -1
- package/dist/serverTypes/index.d.ts +20 -19
- package/dist/types/ActionPerformFunction.d.ts +6 -6
- package/dist/types/{Customer.d.ts → CustomerAttributes.d.ts} +1 -1
- package/dist/types/DataSourcePerformFunction.d.ts +4 -4
- package/dist/types/{Flow.d.ts → FlowAttributes.d.ts} +1 -1
- package/dist/types/{Instance.d.ts → InstanceAttributes.d.ts} +1 -1
- package/dist/types/{Integration.d.ts → IntegrationAttributes.d.ts} +1 -1
- package/dist/types/IntegrationDefinition.d.ts +298 -0
- package/dist/types/IntegrationDefinition.js +78 -0
- package/dist/types/TriggerPayload.d.ts +6 -6
- package/dist/types/{User.d.ts → UserAttributes.d.ts} +1 -1
- package/dist/types/index.d.ts +6 -5
- package/dist/types/index.js +6 -5
- package/package.json +3 -2
- /package/dist/types/{Customer.js → CustomerAttributes.js} +0 -0
- /package/dist/types/{Flow.js → FlowAttributes.js} +0 -0
- /package/dist/types/{Instance.js → InstanceAttributes.js} +0 -0
- /package/dist/types/{Integration.js → IntegrationAttributes.js} +0 -0
- /package/dist/types/{User.js → UserAttributes.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,17 @@
|
|
|
3
3
|
* authors create inputs, actions, and components that can
|
|
4
4
|
* be processed by the Prismatic API.
|
|
5
5
|
*/
|
|
6
|
-
import { ActionDefinition, InputFieldDefinition, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, ActionPerformReturn, TriggerResult, DataSourceDefinition } from "./types";
|
|
7
|
-
import { convertComponent } from "./serverTypes/convert";
|
|
6
|
+
import { ActionDefinition, InputFieldDefinition, ComponentDefinition, DefaultConnectionDefinition, OAuth2ConnectionDefinition, Inputs, TriggerDefinition, ActionPerformReturn, TriggerResult, DataSourceDefinition, IntegrationDefinition } from "./types";
|
|
7
|
+
import { convertComponent, convertIntegration } from "./serverTypes/convert";
|
|
8
|
+
/**
|
|
9
|
+
* This function creates a Integration object that can be
|
|
10
|
+
* imported into the Prismatic API. For information on using
|
|
11
|
+
* this function to write code native integrations, see
|
|
12
|
+
* https://prismatic.io/docs/code-native-integrations/.
|
|
13
|
+
* @param definition An IntegrationDefinition type object.
|
|
14
|
+
* @returns This function returns an integration object that has the shape the Prismatic API expects.
|
|
15
|
+
*/
|
|
16
|
+
export declare const integration: (definition: IntegrationDefinition) => ReturnType<typeof convertIntegration>;
|
|
8
17
|
/**
|
|
9
18
|
* This function creates a component object that can be
|
|
10
19
|
* imported into the Prismatic API. For information on using
|
|
@@ -56,14 +65,6 @@ export declare const dataSource: <TInputs extends Inputs, TDataSourceType extend
|
|
|
56
65
|
boolean: boolean;
|
|
57
66
|
number: number;
|
|
58
67
|
connection: import("./types").Connection;
|
|
59
|
-
/**
|
|
60
|
-
* This function creates a component object that can be
|
|
61
|
-
* imported into the Prismatic API. For information on using
|
|
62
|
-
* this function to write custom components, see
|
|
63
|
-
* https://prismatic.io/docs/custom-components/writing-custom-components/#exporting-a-component.
|
|
64
|
-
* @param definition A ComponentDefinition type object, including display information, unique key, and a set of actions the component implements.
|
|
65
|
-
* @returns This function returns a component object that has the shape the Prismatic API expects.
|
|
66
|
-
*/
|
|
67
68
|
objectSelection: import("./types").ObjectSelection;
|
|
68
69
|
objectFieldMap: import("./types").ObjectFieldMap;
|
|
69
70
|
jsonForm: import("./types").JSONForm;
|
package/dist/index.js
CHANGED
|
@@ -22,8 +22,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.testing = exports.util = exports.oauth2Connection = exports.connection = exports.input = exports.dataSource = exports.trigger = exports.action = exports.component = void 0;
|
|
25
|
+
exports.testing = exports.util = exports.oauth2Connection = exports.connection = exports.input = exports.dataSource = exports.trigger = exports.action = exports.component = exports.integration = void 0;
|
|
26
26
|
const convert_1 = require("./serverTypes/convert");
|
|
27
|
+
/**
|
|
28
|
+
* This function creates a Integration object that can be
|
|
29
|
+
* imported into the Prismatic API. For information on using
|
|
30
|
+
* this function to write code native integrations, see
|
|
31
|
+
* https://prismatic.io/docs/code-native-integrations/.
|
|
32
|
+
* @param definition An IntegrationDefinition type object.
|
|
33
|
+
* @returns This function returns an integration object that has the shape the Prismatic API expects.
|
|
34
|
+
*/
|
|
35
|
+
const integration = (definition) => (0, convert_1.convertIntegration)(definition);
|
|
36
|
+
exports.integration = integration;
|
|
27
37
|
/**
|
|
28
38
|
* This function creates a component object that can be
|
|
29
39
|
* imported into the Prismatic API. For information on using
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { ComponentDefinition } from "../types";
|
|
1
|
+
import { ComponentDefinition, IntegrationDefinition } from "../types";
|
|
2
2
|
import { Component as ServerComponent } from ".";
|
|
3
3
|
export declare const convertComponent: <TPublic extends boolean, TKey extends string>({ connections, actions, triggers, dataSources, hooks, ...definition }: ComponentDefinition<TPublic, TKey>) => ServerComponent;
|
|
4
|
+
export declare const convertIntegration: (definition: IntegrationDefinition) => ServerComponent;
|
|
@@ -10,8 +10,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
10
10
|
}
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.convertComponent = void 0;
|
|
17
|
+
exports.convertIntegration = exports.convertComponent = void 0;
|
|
18
|
+
const yaml_1 = __importDefault(require("yaml"));
|
|
19
|
+
const uuid_1 = require("uuid");
|
|
15
20
|
const types_1 = require("../types");
|
|
16
21
|
const perform_1 = require("./perform");
|
|
17
22
|
const convertInput = (key, _a) => {
|
|
@@ -77,3 +82,161 @@ const convertComponent = (_a) => {
|
|
|
77
82
|
return Object.assign(Object.assign({}, definition), { connections: connections.map(convertConnection), actions: convertedActions, triggers: convertedTriggers, dataSources: convertedDataSources });
|
|
78
83
|
};
|
|
79
84
|
exports.convertComponent = convertComponent;
|
|
85
|
+
const convertIntegration = (definition) => {
|
|
86
|
+
// Generate a unique reference key that will be used to reference the
|
|
87
|
+
// actions, triggers, data sources, and connections that are created
|
|
88
|
+
// inline as part of the integration definition.
|
|
89
|
+
const referenceKey = (0, uuid_1.v4)();
|
|
90
|
+
return Object.assign(Object.assign({}, codeNativeIntegrationComponent(definition, referenceKey)), { codeNativeIntegrationYAML: codeNativeIntegrationYaml(definition, referenceKey) });
|
|
91
|
+
};
|
|
92
|
+
exports.convertIntegration = convertIntegration;
|
|
93
|
+
const codeNativeIntegrationYaml = ({ name, description, category, documentation, configVars, endpointType, preprocessFlowName, externalCustomerIdField, externalCustomerUserIdField, flowNameField, flows, configPages, }, referenceKey) => {
|
|
94
|
+
const DEFINITION_VERSION = 7;
|
|
95
|
+
// Transform the IntegrationDefinition into the structure that is appropriate
|
|
96
|
+
// for generating YAML, which will then be used by the Prismatic API to import
|
|
97
|
+
// the integration as a Code Native Integration.
|
|
98
|
+
const result = {
|
|
99
|
+
definitionVersion: DEFINITION_VERSION,
|
|
100
|
+
isCodeNative: true,
|
|
101
|
+
name,
|
|
102
|
+
description,
|
|
103
|
+
category,
|
|
104
|
+
documentation,
|
|
105
|
+
requiredConfigVars: configVars === null || configVars === void 0 ? void 0 : configVars.map((configVar) => convertConfigVar(configVar, referenceKey)),
|
|
106
|
+
endpointType,
|
|
107
|
+
preprocessFlowName,
|
|
108
|
+
externalCustomerIdField: fieldNameToReferenceInput("action", externalCustomerIdField),
|
|
109
|
+
externalCustomerUserIdField: fieldNameToReferenceInput("action", externalCustomerUserIdField),
|
|
110
|
+
flowNameField: fieldNameToReferenceInput("payload", flowNameField),
|
|
111
|
+
flows: flows.map((flow) => convertFlow(flow, referenceKey)),
|
|
112
|
+
configPages,
|
|
113
|
+
};
|
|
114
|
+
return yaml_1.default.stringify(result);
|
|
115
|
+
};
|
|
116
|
+
/** Converts a Flow into the structure necessary for YAML generation. */
|
|
117
|
+
const convertFlow = (flow, referenceKey) => {
|
|
118
|
+
const result = Object.assign({}, flow);
|
|
119
|
+
delete result.trigger;
|
|
120
|
+
delete result.action;
|
|
121
|
+
const triggerStep = {
|
|
122
|
+
name: "trigger",
|
|
123
|
+
isTrigger: true,
|
|
124
|
+
errorConfig: "errorConfig" in flow.trigger ? flow.trigger.errorConfig : undefined,
|
|
125
|
+
};
|
|
126
|
+
if ("perform" in flow.trigger) {
|
|
127
|
+
triggerStep.action = {
|
|
128
|
+
key: flowFunctionKey(flow.name, "trigger"),
|
|
129
|
+
component: { key: referenceKey, version: "LATEST", isPublic: false },
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
triggerStep.action = {
|
|
134
|
+
key: flow.trigger.key,
|
|
135
|
+
component: flow.trigger.component,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if ("inputs" in flow.trigger) {
|
|
139
|
+
triggerStep.inputs = flow.trigger.inputs;
|
|
140
|
+
delete result.inputs;
|
|
141
|
+
}
|
|
142
|
+
if ("schedule" in flow && typeof flow.schedule === "object") {
|
|
143
|
+
triggerStep.schedule = {
|
|
144
|
+
type: "cronExpression" in flow.schedule
|
|
145
|
+
? types_1.SimpleInputValueType.Value
|
|
146
|
+
: types_1.SimpleInputValueType.ConfigVar,
|
|
147
|
+
value: "cronExpression" in flow.schedule
|
|
148
|
+
? flow.schedule.cronExpression
|
|
149
|
+
: flow.schedule.configVarKey,
|
|
150
|
+
meta: {
|
|
151
|
+
scheduleType: types_1.ScheduleType.Custom,
|
|
152
|
+
timeZone: flow.schedule.timeZone,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
delete result.schedule;
|
|
156
|
+
}
|
|
157
|
+
const actionStep = {
|
|
158
|
+
action: {
|
|
159
|
+
key: flowFunctionKey(flow.name, "action"),
|
|
160
|
+
component: { key: referenceKey, version: "LATEST", isPublic: false },
|
|
161
|
+
},
|
|
162
|
+
name: "action",
|
|
163
|
+
errorConfig: "errorConfig" in flow.action ? flow.action.errorConfig : undefined,
|
|
164
|
+
};
|
|
165
|
+
result.steps = [triggerStep, actionStep];
|
|
166
|
+
return result;
|
|
167
|
+
};
|
|
168
|
+
/** Converts a Config Var into the structure necessary for YAML generation. */
|
|
169
|
+
const convertConfigVar = (configVar, referenceKey) => {
|
|
170
|
+
const result = Object.assign(Object.assign({}, configVar), { meta: {} });
|
|
171
|
+
// Handle some non-standard fields.
|
|
172
|
+
if ("visibleToOrgDeployer" in result) {
|
|
173
|
+
result.meta.visibleToOrgDeployer = result.visibleToOrgDeployer;
|
|
174
|
+
delete result.visibleToOrgDeployer;
|
|
175
|
+
}
|
|
176
|
+
if ("visibleToCustomerDeployer" in result) {
|
|
177
|
+
result.meta.visibleToCustomerDeployer = result.visibleToCustomerDeployer;
|
|
178
|
+
delete result.visibleToCustomerDeployer;
|
|
179
|
+
}
|
|
180
|
+
if ("connection" in result && typeof result.connection === "string") {
|
|
181
|
+
result.connection = {
|
|
182
|
+
key: result.connection,
|
|
183
|
+
component: { key: referenceKey, version: "LATEST", isPublic: false },
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
if ("dataSource" in result && typeof result.dataSource === "string") {
|
|
187
|
+
result.dataSource = {
|
|
188
|
+
key: result.dataSource,
|
|
189
|
+
component: { key: referenceKey, version: "LATEST", isPublic: false },
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return result;
|
|
193
|
+
};
|
|
194
|
+
/** Maps the step name field to a fully qualified input. */
|
|
195
|
+
const fieldNameToReferenceInput = (stepName, fieldName) => {
|
|
196
|
+
if (!fieldName) {
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
type: types_1.SimpleInputValueType.Reference,
|
|
201
|
+
value: `${stepName}.results.${fieldName}`,
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
/** Actions and Triggers will be scoped to their flow by combining the flow
|
|
205
|
+
* name and the function name. This is to ensure that the keys are unique
|
|
206
|
+
* on the resulting object, which will be turned into a Component. */
|
|
207
|
+
const flowFunctionKey = (flowName, functionName) => {
|
|
208
|
+
const flowKey = flowName
|
|
209
|
+
.replace(/[^0-9a-zA-Z]+/g, " ")
|
|
210
|
+
.trim()
|
|
211
|
+
.split(" ")
|
|
212
|
+
.map((w, i) => i === 0
|
|
213
|
+
? w.toLowerCase()
|
|
214
|
+
: w.charAt(0).toUpperCase() + w.slice(1).toLowerCase())
|
|
215
|
+
.join("");
|
|
216
|
+
// functionName is only going to be either 'action' or 'trigger'.
|
|
217
|
+
return `${flowKey}_${functionName}`;
|
|
218
|
+
};
|
|
219
|
+
/** Creates the structure necessary to import a Component as part of a
|
|
220
|
+
* Code Native integration. */
|
|
221
|
+
const codeNativeIntegrationComponent = ({ iconPath, description, flows = [], dataSources = {}, connections = [], }, referenceKey) => {
|
|
222
|
+
const convertedActions = flows.reduce((result, { name, action }) => {
|
|
223
|
+
const actionKey = flowFunctionKey(name, "action");
|
|
224
|
+
return Object.assign(Object.assign({}, result), { [actionKey]: convertAction(actionKey, Object.assign(Object.assign({}, action), { display: { label: "action", description: "" }, inputs: {} })) });
|
|
225
|
+
}, {});
|
|
226
|
+
const convertedTriggers = flows.reduce((result, { name, trigger }) => {
|
|
227
|
+
// Filter out TriggerReferences.
|
|
228
|
+
if (typeof trigger !== "object" || !("perform" in trigger))
|
|
229
|
+
return result;
|
|
230
|
+
const triggerKey = flowFunctionKey(name, "trigger");
|
|
231
|
+
return Object.assign(Object.assign({}, result), { [triggerKey]: convertTrigger(triggerKey, Object.assign(Object.assign({}, trigger), { display: { label: "trigger", description: "" }, inputs: {}, scheduleSupport: "valid", synchronousResponseSupport: "valid" })) });
|
|
232
|
+
}, {});
|
|
233
|
+
const convertedDataSources = Object.entries(dataSources).reduce((result, [dataSourceKey, dataSource]) => (Object.assign(Object.assign({}, result), { [dataSourceKey]: convertDataSource(dataSourceKey, Object.assign(Object.assign({}, dataSource), { inputs: {} })) })), {});
|
|
234
|
+
return {
|
|
235
|
+
key: referenceKey,
|
|
236
|
+
display: { label: referenceKey, iconPath, description: description || "" },
|
|
237
|
+
connections: connections.map(convertConnection),
|
|
238
|
+
actions: convertedActions,
|
|
239
|
+
triggers: convertedTriggers,
|
|
240
|
+
dataSources: convertedDataSources,
|
|
241
|
+
};
|
|
242
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import {
|
|
2
|
+
import { InstanceAttributes, CustomerAttributes, DataSourceType, DataSourceResultType, UserAttributes, TriggerEventFunctionReturn, IntegrationAttributes, FlowAttributes } from "../types";
|
|
3
3
|
interface DisplayDefinition {
|
|
4
4
|
label: string;
|
|
5
5
|
description: string;
|
|
6
6
|
}
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
7
|
+
export { InstanceAttributes } from "../types";
|
|
8
|
+
export { CustomerAttributes } from "../types";
|
|
9
|
+
export { UserAttributes } from "../types";
|
|
10
|
+
export { IntegrationAttributes } from "../types";
|
|
11
|
+
export { FlowAttributes } from "../types";
|
|
12
12
|
export interface Component {
|
|
13
13
|
key: string;
|
|
14
14
|
public?: boolean;
|
|
@@ -21,6 +21,7 @@ export interface Component {
|
|
|
21
21
|
triggers: Record<string, Trigger>;
|
|
22
22
|
dataSources: Record<string, DataSource>;
|
|
23
23
|
connections: Connection[];
|
|
24
|
+
codeNativeIntegrationYAML?: string;
|
|
24
25
|
}
|
|
25
26
|
export interface Action {
|
|
26
27
|
key: string;
|
|
@@ -58,11 +59,11 @@ export interface ActionContext {
|
|
|
58
59
|
webhookUrls: Record<string, string>;
|
|
59
60
|
webhookApiKeys: Record<string, string[]>;
|
|
60
61
|
invokeUrl: string;
|
|
61
|
-
customer:
|
|
62
|
-
instance:
|
|
63
|
-
user:
|
|
64
|
-
integration:
|
|
65
|
-
flow:
|
|
62
|
+
customer: CustomerAttributes;
|
|
63
|
+
instance: InstanceAttributes;
|
|
64
|
+
user: UserAttributes;
|
|
65
|
+
integration: IntegrationAttributes;
|
|
66
|
+
flow: FlowAttributes;
|
|
66
67
|
startedAt: string;
|
|
67
68
|
}
|
|
68
69
|
declare type TriggerOptionChoice = "invalid" | "valid" | "required";
|
|
@@ -82,11 +83,11 @@ export interface TriggerPayload {
|
|
|
82
83
|
webhookApiKeys: Record<string, string[]>;
|
|
83
84
|
invokeUrl: string;
|
|
84
85
|
executionId: string;
|
|
85
|
-
customer:
|
|
86
|
-
instance:
|
|
87
|
-
user:
|
|
88
|
-
integration:
|
|
89
|
-
flow:
|
|
86
|
+
customer: CustomerAttributes;
|
|
87
|
+
instance: InstanceAttributes;
|
|
88
|
+
user: UserAttributes;
|
|
89
|
+
integration: IntegrationAttributes;
|
|
90
|
+
flow: FlowAttributes;
|
|
90
91
|
startedAt: string;
|
|
91
92
|
}
|
|
92
93
|
interface HttpResponse {
|
|
@@ -136,9 +137,9 @@ export interface Trigger {
|
|
|
136
137
|
}
|
|
137
138
|
export interface DataSourceContext {
|
|
138
139
|
logger: ActionLogger;
|
|
139
|
-
customer:
|
|
140
|
-
instance:
|
|
141
|
-
user:
|
|
140
|
+
customer: CustomerAttributes;
|
|
141
|
+
instance: InstanceAttributes;
|
|
142
|
+
user: UserAttributes;
|
|
142
143
|
}
|
|
143
144
|
export declare type DataSourceResult = {
|
|
144
145
|
result: DataSourceResultType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger,
|
|
1
|
+
import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes } from ".";
|
|
2
2
|
/** Definition of the function to perform when an Action is invoked. */
|
|
3
3
|
export declare type ActionPerformFunction<TInputs extends Inputs, TAllowsBranching extends boolean | undefined, TReturn extends ActionPerformReturn<TAllowsBranching, unknown>> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<TReturn>;
|
|
4
4
|
/** Context provided to perform method containing helpers and contextual data */
|
|
@@ -24,15 +24,15 @@ export interface ActionContext {
|
|
|
24
24
|
/** The URL used to invoke the current execution */
|
|
25
25
|
invokeUrl: string;
|
|
26
26
|
/** Contains attributes of the Customer for whom an Instance is being executed. */
|
|
27
|
-
customer:
|
|
27
|
+
customer: CustomerAttributes;
|
|
28
28
|
/** Contains attributes of the Instance that is being executed. */
|
|
29
|
-
instance:
|
|
29
|
+
instance: InstanceAttributes;
|
|
30
30
|
/** Contains attributes of the User for whom a User Level Configuration is being used. */
|
|
31
|
-
user:
|
|
31
|
+
user: UserAttributes;
|
|
32
32
|
/** Contains attributes of the Integration that is being executed. */
|
|
33
|
-
integration:
|
|
33
|
+
integration: IntegrationAttributes;
|
|
34
34
|
/** Contains attributes of the Flow that is being executed. */
|
|
35
|
-
flow:
|
|
35
|
+
flow: FlowAttributes;
|
|
36
36
|
/** The time in UTC that execution started. */
|
|
37
37
|
startedAt: string;
|
|
38
38
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Inputs, DataSourceResult, DataSourceType, ActionInputParameters, ActionLogger,
|
|
1
|
+
import { Inputs, DataSourceResult, DataSourceType, ActionInputParameters, ActionLogger, CustomerAttributes, InstanceAttributes, UserAttributes } from ".";
|
|
2
2
|
/** Context provided to perform method containing helpers and contextual data */
|
|
3
3
|
export interface DataSourceContext {
|
|
4
4
|
logger: ActionLogger;
|
|
5
|
-
customer:
|
|
6
|
-
instance:
|
|
7
|
-
user:
|
|
5
|
+
customer: CustomerAttributes;
|
|
6
|
+
instance: InstanceAttributes;
|
|
7
|
+
user: UserAttributes;
|
|
8
8
|
}
|
|
9
9
|
/** Definition of the function to perform when a Data Source is invoked. */
|
|
10
10
|
export declare type DataSourcePerformFunction<TInputs extends Inputs, TDataSourceType extends DataSourceType> = (context: DataSourceContext, params: ActionInputParameters<TInputs>) => Promise<DataSourceResult<TDataSourceType>>;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { DataSourceDefinition, ConnectionDefinition, ActionDefinition, ActionPerformReturn, TriggerDefinition, Inputs, TriggerResult, DataSourceType } from ".";
|
|
2
|
+
/** Defines attributes of a Code-Native Integration. */
|
|
3
|
+
export declare type IntegrationDefinition = {
|
|
4
|
+
/** The unique name for this Integration. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Optional description for this Integration. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Optional path to icon to use for this Integration. Path should be relative to the built Integration source. */
|
|
9
|
+
iconPath?: string;
|
|
10
|
+
/** Optional category for this Integration. */
|
|
11
|
+
category?: string;
|
|
12
|
+
/** Optional documentation for this Integration. */
|
|
13
|
+
documentation?: string;
|
|
14
|
+
/** Optional version identifier for this Integration. */
|
|
15
|
+
version?: string;
|
|
16
|
+
/** Optional labels for this Integration. */
|
|
17
|
+
labels?: string[];
|
|
18
|
+
/** Optional endpoint type used by Instances of this Integration. @default EndpointType.FlowSpecific. */
|
|
19
|
+
endpointType?: EndpointType;
|
|
20
|
+
/** Optional name of the Flow to use as a Preprocess Flow for 'Instance Specific' or 'Shared Instance' endpoint types. */
|
|
21
|
+
preprocessFlowName?: string;
|
|
22
|
+
/** Optional name of the field in the data payload returned by the Preprocess Flow to use for an External Customer Id,
|
|
23
|
+
* or by the data payload returned by the Trigger if there is no Preprocess Flow specified. */
|
|
24
|
+
externalCustomerIdField?: string;
|
|
25
|
+
/** Optional name of the field in the data payload returned by the Preprocess Flow to use for an External Customer User Id,
|
|
26
|
+
* or by the data payload returned by the Trigger if there is no Preprocess Flow specified. */
|
|
27
|
+
externalCustomerUserIdField?: string;
|
|
28
|
+
/** Optional name of the field in the data payload returned by the Preprocess Flow to use for a Flow Name,
|
|
29
|
+
* or by the data payload returned by the Trigger if there is no Preprocess Flow specified. */
|
|
30
|
+
flowNameField?: string;
|
|
31
|
+
/** Flows for this Integration. */
|
|
32
|
+
flows: Flow[];
|
|
33
|
+
/** Config Vars used on this Integration. */
|
|
34
|
+
configVars?: ConfigVar[];
|
|
35
|
+
/** Config Wizard Pages for this Integration. */
|
|
36
|
+
configPages?: ConfigPage[];
|
|
37
|
+
/** Specifies any Data Sources that are defined as part of this Integration. */
|
|
38
|
+
dataSources?: Record<string, CodeNativeDataSource>;
|
|
39
|
+
/** Specifies any Connections that are defined as part of this Integration. */
|
|
40
|
+
connections?: ConnectionDefinition[];
|
|
41
|
+
};
|
|
42
|
+
/** Defines attributes of a Flow of a Code-Native Integration. */
|
|
43
|
+
export declare type Flow = {
|
|
44
|
+
/** The unique name for this Flow. */
|
|
45
|
+
name: string;
|
|
46
|
+
/** Optional description for this Flow. */
|
|
47
|
+
description?: string;
|
|
48
|
+
/** Optional value that specifies whether this Flow is synchronous. @default false */
|
|
49
|
+
isSynchronous?: boolean;
|
|
50
|
+
/** Optional Retry Configuration for this Flow. */
|
|
51
|
+
retryConfig?: RetryConfig;
|
|
52
|
+
/** Optional security configuration to use for the endpoint of this Flow. @default EndpointSecurityType.CustomerOptional */
|
|
53
|
+
endpointSecurityType?: EndpointSecurityType;
|
|
54
|
+
/** Optional list of API key(s) to use for the endpoint of this Flow when the endpoint security type is EndpointSecurityType.Organization. */
|
|
55
|
+
organizationApiKeys?: string[];
|
|
56
|
+
/** Optional schedule configuration that defines the frequency with which this Flow will be automatically executed. */
|
|
57
|
+
schedule?: FlowSchedule;
|
|
58
|
+
/** Specifies the trigger for this Flow. */
|
|
59
|
+
trigger: (CodeNativeTrigger | TriggerReference) & {
|
|
60
|
+
/** Optional error handling configuration. */
|
|
61
|
+
errorConfig?: StepErrorConfig;
|
|
62
|
+
};
|
|
63
|
+
/** Specifies the main function for this Flow. */
|
|
64
|
+
action: CodeNativeAction;
|
|
65
|
+
};
|
|
66
|
+
/** Defines attributes of a Data Source that is defined as part of a Code Native Integration. */
|
|
67
|
+
export declare type CodeNativeDataSource = Pick<DataSourceDefinition<Inputs, DataSourceType>, // TODO: Are these values correct?
|
|
68
|
+
// TODO: Are these values correct?
|
|
69
|
+
"display" | "perform" | "dataSourceType" | "detailDataSource">;
|
|
70
|
+
/** Defines attributes of a Trigger that is defined as part of a Code Native Integration. */
|
|
71
|
+
export declare type CodeNativeTrigger = Pick<TriggerDefinition<Inputs, false, TriggerResult<false>>, // TODO: Are these values correct?
|
|
72
|
+
// TODO: Are these values correct?
|
|
73
|
+
"perform" | "onInstanceDeploy" | "onInstanceDelete">;
|
|
74
|
+
/** Defines attributes of an CodeNativeAction, which is the main function that will be executed for a Flow of a Code Native Integration. */
|
|
75
|
+
export declare type CodeNativeAction = Pick<ActionDefinition<Inputs, false, ActionPerformReturn<false, unknown>>, // TODO: Are these values correct?
|
|
76
|
+
"perform"> & {
|
|
77
|
+
/** Optional error handling configuration. */
|
|
78
|
+
errorConfig?: StepErrorConfig;
|
|
79
|
+
};
|
|
80
|
+
/** Defines attributes of a reference to an existing Trigger. */
|
|
81
|
+
export declare type TriggerReference = {
|
|
82
|
+
/** Attributes of the referenced Component. */
|
|
83
|
+
component: ComponentReference;
|
|
84
|
+
/** The unique key that identifies the Trigger within the Component. */
|
|
85
|
+
key: string;
|
|
86
|
+
/** Optional input values for this Trigger. */
|
|
87
|
+
inputs?: InputValues;
|
|
88
|
+
};
|
|
89
|
+
/** Defines attributes of a reference to an existing Data Source. */
|
|
90
|
+
export declare type DataSourceReference = {
|
|
91
|
+
/** Attributes of the referenced Component. */
|
|
92
|
+
component: ComponentReference;
|
|
93
|
+
/** The unique key that identifies the Data Source within the Component. */
|
|
94
|
+
key: string;
|
|
95
|
+
};
|
|
96
|
+
/** Defines attributes of a reference to an existing Connection. */
|
|
97
|
+
export declare type ConnectionReference = {
|
|
98
|
+
/** Attributes of the referenced Component. */
|
|
99
|
+
component: ComponentReference;
|
|
100
|
+
/** The unique key that identifies the Connection within the Component. */
|
|
101
|
+
key: string;
|
|
102
|
+
};
|
|
103
|
+
/** Defines attributes of a reference to a member of an existing Component. */
|
|
104
|
+
export declare type ComponentReference = {
|
|
105
|
+
/** The unique key that identifies the Component. */
|
|
106
|
+
key: string;
|
|
107
|
+
/** The version of the Component. */
|
|
108
|
+
version: number | "LATEST";
|
|
109
|
+
/** Specifies whether the Component is in the public library or a private Component. */
|
|
110
|
+
isPublic: boolean;
|
|
111
|
+
};
|
|
112
|
+
/** Common attribute shared by all types of Config Vars. */
|
|
113
|
+
declare type BaseConfigVar = {
|
|
114
|
+
/** The unique key for this Config Var. */
|
|
115
|
+
key: string;
|
|
116
|
+
/** Optional description for this Config Var. */
|
|
117
|
+
description?: string;
|
|
118
|
+
/** Optional value that specifies whether this Config Var is only configurable by Organization users. @default false */
|
|
119
|
+
orgOnly?: boolean;
|
|
120
|
+
/** Optional input values for this Config Var. */
|
|
121
|
+
inputs?: InputValues;
|
|
122
|
+
/** Optional value that specifies whether this Config Var is visible to an Organization deployer. @default true */
|
|
123
|
+
visibleToOrgDeployer?: boolean;
|
|
124
|
+
/** Optional value that specifies whether this Config Var is visible to a Customer deployer. @default true */
|
|
125
|
+
visibleToCustomerDeployer?: boolean;
|
|
126
|
+
};
|
|
127
|
+
/** Defines attributes of a standard Config Var. */
|
|
128
|
+
declare type StandardConfigVar = BaseConfigVar & {
|
|
129
|
+
/** Optional default value for the Config Var. */
|
|
130
|
+
defaultValue?: string;
|
|
131
|
+
/** The data type of the Config Var. */
|
|
132
|
+
dataType: ConfigVarDataType;
|
|
133
|
+
/** Optional list of picklist values if the Config Var is a multi-choice selection value. */
|
|
134
|
+
pickList?: string[];
|
|
135
|
+
/** Optional schedule type that defines the cadence of the schedule. */
|
|
136
|
+
scheduleType?: ScheduleType;
|
|
137
|
+
/** Optional value to use as a timezone if the Config Var is a schedule value. */
|
|
138
|
+
timeZone?: string;
|
|
139
|
+
/** Optional value to specify the type of language if the Config Var is a code value. */
|
|
140
|
+
codeLanguage?: CodeLanguageType;
|
|
141
|
+
/** Optional value to specify the type of collection if the Config Var is multi-value. */
|
|
142
|
+
collectionType?: CollectionType;
|
|
143
|
+
/** Optional value to specify the Data Source where the Config Var sources
|
|
144
|
+
* its values. If it's a string then it's expected to be the key of a
|
|
145
|
+
* CodeNativeDataSource defined in the Code Native Integration. Otherwise it
|
|
146
|
+
* is expected to be a reference to an existing Data Source. */
|
|
147
|
+
dataSource?: string | DataSourceReference;
|
|
148
|
+
};
|
|
149
|
+
/** Defines attributes of a Config Var that represents a Connection. */
|
|
150
|
+
declare type ConnectionConfigVar = BaseConfigVar & {
|
|
151
|
+
dataType: "connection";
|
|
152
|
+
/** Optional value to specify the Data Source where the Config Var sources
|
|
153
|
+
* its values. If it's a string then it's expected to be the key of a
|
|
154
|
+
* Connection defined in the Code Native Integration. Otherwise it is
|
|
155
|
+
* expected to be a reference to an existing Connection. */
|
|
156
|
+
connection: string | ConnectionReference;
|
|
157
|
+
};
|
|
158
|
+
/** Defines attributes of a Config Var whose value is configured as part of deploying an Instance of an Integration. */
|
|
159
|
+
export declare type ConfigVar = StandardConfigVar | ConnectionConfigVar;
|
|
160
|
+
/** Defines attributes of a Config Wizard Page used when deploying an Instance of an Integration. */
|
|
161
|
+
export declare type ConfigPage = {
|
|
162
|
+
/** The unique name for this Config Page. */
|
|
163
|
+
name: string;
|
|
164
|
+
/** Specifies an optional tagline for this Config Page. */
|
|
165
|
+
tagline?: string;
|
|
166
|
+
/** Optional value that specifies whether this Config Page is configured as
|
|
167
|
+
* part of User Level Configuration. @default false */
|
|
168
|
+
userLevelConfigured?: boolean;
|
|
169
|
+
/** Elements included on this Config Page. */
|
|
170
|
+
elements: ConfigPageElement[];
|
|
171
|
+
};
|
|
172
|
+
/** Defines attributes of Inputs for Connections, Actions, Triggers,
|
|
173
|
+
* Data Sources, and Config Vars. */
|
|
174
|
+
export declare type InputValues = Record<string, InputValue>;
|
|
175
|
+
export declare type InputValue = SimpleInputValue | ComplexInputValue;
|
|
176
|
+
export declare type SimpleInputValue = {
|
|
177
|
+
name?: string;
|
|
178
|
+
type: SimpleInputValueType;
|
|
179
|
+
value: string;
|
|
180
|
+
meta?: Record<string, unknown>;
|
|
181
|
+
};
|
|
182
|
+
export declare type ComplexInputValue = {
|
|
183
|
+
name?: string;
|
|
184
|
+
type: "complex";
|
|
185
|
+
value: ComplexInputValueType;
|
|
186
|
+
meta?: Record<string, unknown>;
|
|
187
|
+
};
|
|
188
|
+
export declare type ComplexInputValueType = (string | InputValue | ComplexInputValueType)[];
|
|
189
|
+
/** Defines attributes of an Element that appears on a Config Wizard Page. */
|
|
190
|
+
export declare type ConfigPageElement = {
|
|
191
|
+
/** Specifies what type of data is represented by this Element. */
|
|
192
|
+
type: ConfigPageElementType;
|
|
193
|
+
/** Specifies the value of this Element. */
|
|
194
|
+
value: string;
|
|
195
|
+
};
|
|
196
|
+
/** Defines attributes of a Retry Configuration used by a Flow of an Integration. */
|
|
197
|
+
export declare type RetryConfig = {
|
|
198
|
+
/** The maximum number of retry attempts. Must be between 0 and 10. */
|
|
199
|
+
maxAttempts: number;
|
|
200
|
+
/** The delay in minutes to wait between retry attempts. Must be between 0 and 60. */
|
|
201
|
+
delayMinutes: number;
|
|
202
|
+
/** Specifies whether to use exponential backoff to calculate the delay between retry attempts. */
|
|
203
|
+
usesExponentialBackoff: boolean;
|
|
204
|
+
/** Name of the field in the data payload returned by the Flow Trigger to use as a Unique Request ID for retry request cancellation. */
|
|
205
|
+
uniqueRequestIdField?: string;
|
|
206
|
+
};
|
|
207
|
+
/** Defines attributes of a Step Error Configuration used to determine how to handle errors during Flow step execution. */
|
|
208
|
+
export declare type StepErrorConfig = {
|
|
209
|
+
/** Defines the type of error handler. */
|
|
210
|
+
errorHandlerType: StepErrorHandlerType;
|
|
211
|
+
/** The maximum number of retry attempts. Must be between 0 and 5. */
|
|
212
|
+
maxAttempts?: number;
|
|
213
|
+
/** The delay in seconds to wait between retry attempts. Must be between 0 and 60. */
|
|
214
|
+
delaySeconds?: number;
|
|
215
|
+
/** Specifies whether to use exponential backoff to calculate the delay between retry attempts. @default false */
|
|
216
|
+
usesExponentialBackoff?: boolean;
|
|
217
|
+
/** Specifies whether to ignore the final error after the final retry attempt. @default false */
|
|
218
|
+
ignoreFinalError?: boolean;
|
|
219
|
+
};
|
|
220
|
+
/** Defines attributes of a Schedule that controls how often a Flow is automatically executed. */
|
|
221
|
+
export declare type FlowSchedule = {
|
|
222
|
+
/** The cron expression to use for defining an execution schedule. */
|
|
223
|
+
cronExpression: string;
|
|
224
|
+
/** Specifies an optional value to use as the timezone. */
|
|
225
|
+
timeZone?: string;
|
|
226
|
+
} | {
|
|
227
|
+
/** The key of the Config Var whose value will define the execution schedule. */
|
|
228
|
+
configVarKey: string;
|
|
229
|
+
/** Specifies an optional value to use as the timezone. */
|
|
230
|
+
timeZone?: string;
|
|
231
|
+
};
|
|
232
|
+
/** Choices of Simple Input Value Types that may be used by Simple Input Values. */
|
|
233
|
+
export declare enum SimpleInputValueType {
|
|
234
|
+
Value = "value",
|
|
235
|
+
Reference = "reference",
|
|
236
|
+
ConfigVar = "configVar",
|
|
237
|
+
Template = "template"
|
|
238
|
+
}
|
|
239
|
+
/** Choices of Endpoint Types that may be used by Instances of an Integration. */
|
|
240
|
+
export declare enum EndpointType {
|
|
241
|
+
FlowSpecific = "flow_specific",
|
|
242
|
+
InstanceSpecific = "instance_specific",
|
|
243
|
+
SharedInstance = "shared_instance"
|
|
244
|
+
}
|
|
245
|
+
/** Choices of Endpoint Security Types that may be used by endpoints of a Flow. */
|
|
246
|
+
export declare enum EndpointSecurityType {
|
|
247
|
+
Unsecured = "unsecured",
|
|
248
|
+
CustomerOptional = "customer_optional",
|
|
249
|
+
CustomerRequired = "customer_required",
|
|
250
|
+
Organization = "organization"
|
|
251
|
+
}
|
|
252
|
+
/** Choices of Config Page Element Types that may be used for Elements on a Config Wizard Page. */
|
|
253
|
+
export declare enum ConfigPageElementType {
|
|
254
|
+
ConfigVar = "configVar",
|
|
255
|
+
HTML = "htmlElement",
|
|
256
|
+
JSONForm = "jsonForm"
|
|
257
|
+
}
|
|
258
|
+
/** Choices of Step Error Handlers that define the behavior when a step error occurs. */
|
|
259
|
+
export declare enum StepErrorHandlerType {
|
|
260
|
+
Fail = "fail",
|
|
261
|
+
Ignore = "ignore",
|
|
262
|
+
Retry = "retry"
|
|
263
|
+
}
|
|
264
|
+
/** Choices for Schedules that add context for the cadence of a given schedule. */
|
|
265
|
+
export declare enum ScheduleType {
|
|
266
|
+
None = "none",
|
|
267
|
+
Custom = "custom",
|
|
268
|
+
Minute = "minute",
|
|
269
|
+
Hour = "hour",
|
|
270
|
+
Day = "day",
|
|
271
|
+
Week = "week"
|
|
272
|
+
}
|
|
273
|
+
/** Supported data types for Config Vars. */
|
|
274
|
+
export declare enum ConfigVarDataType {
|
|
275
|
+
String = "string",
|
|
276
|
+
Date = "date",
|
|
277
|
+
Timestamp = "timestamp",
|
|
278
|
+
Picklist = "picklist",
|
|
279
|
+
Schedule = "schedule",
|
|
280
|
+
Code = "code",
|
|
281
|
+
Boolean = "boolean",
|
|
282
|
+
Number = "number",
|
|
283
|
+
ObjectSelection = "objectSelection",
|
|
284
|
+
ObjectFieldMap = "objectFieldMap",
|
|
285
|
+
JSONForm = "jsonForm"
|
|
286
|
+
}
|
|
287
|
+
/** Choices of programming languages that may be used for Config Var code values. */
|
|
288
|
+
export declare enum CodeLanguageType {
|
|
289
|
+
JSON = "json",
|
|
290
|
+
XML = "xml",
|
|
291
|
+
HTML = "html"
|
|
292
|
+
}
|
|
293
|
+
/** Choices of collection types for multi-value Config Vars. */
|
|
294
|
+
export declare enum CollectionType {
|
|
295
|
+
ValueList = "valuelist",
|
|
296
|
+
KeyValueList = "keyvaluelist"
|
|
297
|
+
}
|
|
298
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionType = exports.CodeLanguageType = exports.ConfigVarDataType = exports.ScheduleType = exports.StepErrorHandlerType = exports.ConfigPageElementType = exports.EndpointSecurityType = exports.EndpointType = exports.SimpleInputValueType = void 0;
|
|
4
|
+
/** Choices of Simple Input Value Types that may be used by Simple Input Values. */
|
|
5
|
+
var SimpleInputValueType;
|
|
6
|
+
(function (SimpleInputValueType) {
|
|
7
|
+
SimpleInputValueType["Value"] = "value";
|
|
8
|
+
SimpleInputValueType["Reference"] = "reference";
|
|
9
|
+
SimpleInputValueType["ConfigVar"] = "configVar";
|
|
10
|
+
SimpleInputValueType["Template"] = "template";
|
|
11
|
+
})(SimpleInputValueType = exports.SimpleInputValueType || (exports.SimpleInputValueType = {}));
|
|
12
|
+
/** Choices of Endpoint Types that may be used by Instances of an Integration. */
|
|
13
|
+
var EndpointType;
|
|
14
|
+
(function (EndpointType) {
|
|
15
|
+
EndpointType["FlowSpecific"] = "flow_specific";
|
|
16
|
+
EndpointType["InstanceSpecific"] = "instance_specific";
|
|
17
|
+
EndpointType["SharedInstance"] = "shared_instance";
|
|
18
|
+
})(EndpointType = exports.EndpointType || (exports.EndpointType = {}));
|
|
19
|
+
/** Choices of Endpoint Security Types that may be used by endpoints of a Flow. */
|
|
20
|
+
var EndpointSecurityType;
|
|
21
|
+
(function (EndpointSecurityType) {
|
|
22
|
+
EndpointSecurityType["Unsecured"] = "unsecured";
|
|
23
|
+
EndpointSecurityType["CustomerOptional"] = "customer_optional";
|
|
24
|
+
EndpointSecurityType["CustomerRequired"] = "customer_required";
|
|
25
|
+
EndpointSecurityType["Organization"] = "organization";
|
|
26
|
+
})(EndpointSecurityType = exports.EndpointSecurityType || (exports.EndpointSecurityType = {}));
|
|
27
|
+
/** Choices of Config Page Element Types that may be used for Elements on a Config Wizard Page. */
|
|
28
|
+
var ConfigPageElementType;
|
|
29
|
+
(function (ConfigPageElementType) {
|
|
30
|
+
ConfigPageElementType["ConfigVar"] = "configVar";
|
|
31
|
+
ConfigPageElementType["HTML"] = "htmlElement";
|
|
32
|
+
ConfigPageElementType["JSONForm"] = "jsonForm";
|
|
33
|
+
})(ConfigPageElementType = exports.ConfigPageElementType || (exports.ConfigPageElementType = {}));
|
|
34
|
+
/** Choices of Step Error Handlers that define the behavior when a step error occurs. */
|
|
35
|
+
var StepErrorHandlerType;
|
|
36
|
+
(function (StepErrorHandlerType) {
|
|
37
|
+
StepErrorHandlerType["Fail"] = "fail";
|
|
38
|
+
StepErrorHandlerType["Ignore"] = "ignore";
|
|
39
|
+
StepErrorHandlerType["Retry"] = "retry";
|
|
40
|
+
})(StepErrorHandlerType = exports.StepErrorHandlerType || (exports.StepErrorHandlerType = {}));
|
|
41
|
+
/** Choices for Schedules that add context for the cadence of a given schedule. */
|
|
42
|
+
var ScheduleType;
|
|
43
|
+
(function (ScheduleType) {
|
|
44
|
+
ScheduleType["None"] = "none";
|
|
45
|
+
ScheduleType["Custom"] = "custom";
|
|
46
|
+
ScheduleType["Minute"] = "minute";
|
|
47
|
+
ScheduleType["Hour"] = "hour";
|
|
48
|
+
ScheduleType["Day"] = "day";
|
|
49
|
+
ScheduleType["Week"] = "week";
|
|
50
|
+
})(ScheduleType = exports.ScheduleType || (exports.ScheduleType = {}));
|
|
51
|
+
/** Supported data types for Config Vars. */
|
|
52
|
+
var ConfigVarDataType;
|
|
53
|
+
(function (ConfigVarDataType) {
|
|
54
|
+
ConfigVarDataType["String"] = "string";
|
|
55
|
+
ConfigVarDataType["Date"] = "date";
|
|
56
|
+
ConfigVarDataType["Timestamp"] = "timestamp";
|
|
57
|
+
ConfigVarDataType["Picklist"] = "picklist";
|
|
58
|
+
ConfigVarDataType["Schedule"] = "schedule";
|
|
59
|
+
ConfigVarDataType["Code"] = "code";
|
|
60
|
+
ConfigVarDataType["Boolean"] = "boolean";
|
|
61
|
+
ConfigVarDataType["Number"] = "number";
|
|
62
|
+
ConfigVarDataType["ObjectSelection"] = "objectSelection";
|
|
63
|
+
ConfigVarDataType["ObjectFieldMap"] = "objectFieldMap";
|
|
64
|
+
ConfigVarDataType["JSONForm"] = "jsonForm";
|
|
65
|
+
})(ConfigVarDataType = exports.ConfigVarDataType || (exports.ConfigVarDataType = {}));
|
|
66
|
+
/** Choices of programming languages that may be used for Config Var code values. */
|
|
67
|
+
var CodeLanguageType;
|
|
68
|
+
(function (CodeLanguageType) {
|
|
69
|
+
CodeLanguageType["JSON"] = "json";
|
|
70
|
+
CodeLanguageType["XML"] = "xml";
|
|
71
|
+
CodeLanguageType["HTML"] = "html";
|
|
72
|
+
})(CodeLanguageType = exports.CodeLanguageType || (exports.CodeLanguageType = {}));
|
|
73
|
+
/** Choices of collection types for multi-value Config Vars. */
|
|
74
|
+
var CollectionType;
|
|
75
|
+
(function (CollectionType) {
|
|
76
|
+
CollectionType["ValueList"] = "valuelist";
|
|
77
|
+
CollectionType["KeyValueList"] = "keyvaluelist";
|
|
78
|
+
})(CollectionType = exports.CollectionType || (exports.CollectionType = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes } from ".";
|
|
2
2
|
/** Represents a Trigger Payload, which is data passed into a Trigger to invoke an Integration execution. */
|
|
3
3
|
export interface TriggerPayload {
|
|
4
4
|
headers: {
|
|
@@ -29,15 +29,15 @@ export interface TriggerPayload {
|
|
|
29
29
|
invokeUrl: string;
|
|
30
30
|
executionId: string;
|
|
31
31
|
/** Contains attributes of the Customer for whom an Instance is being executed. */
|
|
32
|
-
customer:
|
|
32
|
+
customer: CustomerAttributes;
|
|
33
33
|
/** Contains attributes of the Instance that is being executed. */
|
|
34
|
-
instance:
|
|
34
|
+
instance: InstanceAttributes;
|
|
35
35
|
/** Contains attributes of the User for whom a User Level Configuration is being used. */
|
|
36
|
-
user:
|
|
36
|
+
user: UserAttributes;
|
|
37
37
|
/** Contains attributes of the Integration that is being executed. */
|
|
38
|
-
integration:
|
|
38
|
+
integration: IntegrationAttributes;
|
|
39
39
|
/** Contains attributes of the Flow that is being executed. */
|
|
40
|
-
flow:
|
|
40
|
+
flow: FlowAttributes;
|
|
41
41
|
/** The time in UTC that execution started. */
|
|
42
42
|
startedAt: string;
|
|
43
43
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -22,9 +22,10 @@ export * from "./TriggerPayload";
|
|
|
22
22
|
export * from "./DataSourceDefinition";
|
|
23
23
|
export * from "./DataSourcePerformFunction";
|
|
24
24
|
export * from "./DataSourceResult";
|
|
25
|
-
export * from "./
|
|
26
|
-
export * from "./
|
|
27
|
-
export * from "./
|
|
28
|
-
export * from "./
|
|
29
|
-
export * from "./
|
|
25
|
+
export * from "./InstanceAttributes";
|
|
26
|
+
export * from "./CustomerAttributes";
|
|
27
|
+
export * from "./UserAttributes";
|
|
28
|
+
export * from "./IntegrationAttributes";
|
|
29
|
+
export * from "./FlowAttributes";
|
|
30
|
+
export * from "./IntegrationDefinition";
|
|
30
31
|
export * as serverTypes from "../serverTypes";
|
package/dist/types/index.js
CHANGED
|
@@ -51,9 +51,10 @@ __exportStar(require("./TriggerPayload"), exports);
|
|
|
51
51
|
__exportStar(require("./DataSourceDefinition"), exports);
|
|
52
52
|
__exportStar(require("./DataSourcePerformFunction"), exports);
|
|
53
53
|
__exportStar(require("./DataSourceResult"), exports);
|
|
54
|
-
__exportStar(require("./
|
|
55
|
-
__exportStar(require("./
|
|
56
|
-
__exportStar(require("./
|
|
57
|
-
__exportStar(require("./
|
|
58
|
-
__exportStar(require("./
|
|
54
|
+
__exportStar(require("./InstanceAttributes"), exports);
|
|
55
|
+
__exportStar(require("./CustomerAttributes"), exports);
|
|
56
|
+
__exportStar(require("./UserAttributes"), exports);
|
|
57
|
+
__exportStar(require("./IntegrationAttributes"), exports);
|
|
58
|
+
__exportStar(require("./FlowAttributes"), exports);
|
|
59
|
+
__exportStar(require("./IntegrationDefinition"), exports);
|
|
59
60
|
exports.serverTypes = __importStar(require("../serverTypes"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prismatic-io/spectral",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-preview3",
|
|
4
4
|
"description": "Utility library for building Prismatic components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"prismatic"
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"soap": "1.0.0",
|
|
49
49
|
"url-join": "5.0.0",
|
|
50
50
|
"uuid": "8.3.2",
|
|
51
|
-
"valid-url": "1.0.9"
|
|
51
|
+
"valid-url": "1.0.9",
|
|
52
|
+
"yaml": "2.3.4"
|
|
52
53
|
},
|
|
53
54
|
"devDependencies": {
|
|
54
55
|
"@types/jest": "27.4.1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|