@prismatic-io/spectral 10.5.0 → 10.5.1
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/http/index.d.ts +37 -0
- package/dist/clients/http/index.js +24 -0
- package/dist/generators/componentManifest/getInputs.js +1 -0
- package/dist/index.d.ts +71 -36
- package/dist/index.js +68 -33
- package/dist/serverTypes/convertComponent.d.ts +2 -1
- package/dist/serverTypes/convertComponent.js +12 -2
- package/dist/serverTypes/convertIntegration.js +17 -5
- package/dist/serverTypes/index.d.ts +1 -0
- package/dist/testing.d.ts +42 -4
- package/dist/testing.js +42 -4
- package/dist/types/ActionDefinition.d.ts +21 -10
- package/dist/types/ActionLogger.d.ts +3 -2
- package/dist/types/ActionLogger.js +1 -1
- package/dist/types/ActionPerformFunction.d.ts +12 -12
- package/dist/types/ActionPerformReturn.d.ts +11 -11
- package/dist/types/ComponentDefinition.d.ts +34 -11
- package/dist/types/ConfigVars.d.ts +36 -24
- package/dist/types/ConnectionDefinition.d.ts +92 -13
- package/dist/types/ConnectionDefinition.js +16 -0
- package/dist/types/CustomerAttributes.d.ts +6 -0
- package/dist/types/DataPayload.d.ts +4 -4
- package/dist/types/DataSourceDefinition.d.ts +11 -7
- package/dist/types/DataSourcePerformFunction.d.ts +1 -1
- package/dist/types/FlowAttributes.d.ts +2 -0
- package/dist/types/HttpResponse.d.ts +7 -0
- package/dist/types/Inputs.d.ts +80 -57
- package/dist/types/Inputs.js +1 -0
- package/dist/types/InstanceAttributes.d.ts +3 -1
- package/dist/types/IntegrationAttributes.d.ts +4 -1
- package/dist/types/IntegrationDefinition.d.ts +78 -41
- package/dist/types/TriggerDefinition.d.ts +29 -14
- package/dist/types/TriggerEventFunction.d.ts +4 -4
- package/dist/types/TriggerPayload.d.ts +6 -2
- package/dist/types/TriggerResult.d.ts +6 -6
- package/dist/types/UserAttributes.d.ts +11 -1
- package/package.json +1 -1
package/dist/types/Inputs.d.ts
CHANGED
|
@@ -8,13 +8,15 @@ import { JsonSchema, UISchemaElement } from "@jsonforms/core";
|
|
|
8
8
|
* https://github.com/prismatic-io/examples/blob/main/components/aws-s3/src/actions.ts
|
|
9
9
|
*/
|
|
10
10
|
export interface KeyValuePair<V = unknown> {
|
|
11
|
-
/** Key of the KeyValuePair */
|
|
11
|
+
/** Key of the KeyValuePair. */
|
|
12
12
|
key: string;
|
|
13
|
-
/** Value of the KeyValuePair */
|
|
13
|
+
/** Value of the KeyValuePair. */
|
|
14
14
|
value: V;
|
|
15
15
|
}
|
|
16
16
|
export type Element = {
|
|
17
|
+
/** The value to return for this field. */
|
|
17
18
|
key: string;
|
|
19
|
+
/** The string to show in the UI for this field. Defaults to the value of `key` */
|
|
18
20
|
label?: string;
|
|
19
21
|
};
|
|
20
22
|
export type ObjectSelection = {
|
|
@@ -64,205 +66,226 @@ export type DynamicFieldSelection = string;
|
|
|
64
66
|
export type InputFieldType = InputFieldDefinition["type"];
|
|
65
67
|
export declare const InputFieldDefaultMap: Record<InputFieldType, string | undefined>;
|
|
66
68
|
export type Inputs = Record<string, InputFieldDefinition>;
|
|
67
|
-
export type ConnectionInput = (StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField) & {
|
|
69
|
+
export type ConnectionInput = (StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField | ConnectionTemplateInputField) & {
|
|
70
|
+
/** Determines if this input field should be shown in the UI. */
|
|
68
71
|
shown?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Determines if this input should be write-only. See
|
|
74
|
+
* https://prismatic.io/docs/integrations/config-wizard/config-variables/#write-only-connection-inputs
|
|
75
|
+
*/
|
|
69
76
|
writeOnly?: true;
|
|
70
77
|
};
|
|
71
78
|
export type OnPremConnectionInput = {
|
|
79
|
+
/**
|
|
80
|
+
* When this connection is attached to an on-prem agent, this
|
|
81
|
+
* field will be overridden by a local on-prem value
|
|
82
|
+
*/
|
|
72
83
|
onPremControlled: true;
|
|
73
84
|
} & ConnectionInput;
|
|
74
|
-
export type InputFieldDefinition = StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField | CodeInputField | ConditionalInputField | ConnectionInputField | ObjectSelectionInputField | ObjectFieldMapInputField | JSONFormInputField | DynamicObjectSelectionInputField | DynamicFieldSelectionInputField | DateInputField | DateTimeInputField | FlowInputField;
|
|
85
|
+
export type InputFieldDefinition = StringInputField | DataInputField | TextInputField | PasswordInputField | BooleanInputField | CodeInputField | ConditionalInputField | ConnectionInputField | ConnectionTemplateInputField | ObjectSelectionInputField | ObjectFieldMapInputField | JSONFormInputField | DynamicObjectSelectionInputField | DynamicFieldSelectionInputField | DateInputField | DateTimeInputField | FlowInputField;
|
|
75
86
|
export type InputCleanFunction<TValue, TResult = TValue> = (value: TValue) => TResult;
|
|
76
87
|
interface BaseInputField {
|
|
77
|
-
/**
|
|
88
|
+
/** Name of this field to present in the UI. */
|
|
78
89
|
label: {
|
|
79
90
|
key: string;
|
|
80
91
|
value: string;
|
|
81
92
|
} | string;
|
|
82
|
-
/** Text to show as the
|
|
93
|
+
/** Text to show in the UI as the input's placeholder. */
|
|
83
94
|
placeholder?: string;
|
|
84
|
-
/** Additional text to give guidance to the user configuring the
|
|
95
|
+
/** Additional text to give guidance to the user configuring the input. */
|
|
85
96
|
comments?: string;
|
|
86
|
-
/** Example valid input for this
|
|
97
|
+
/** Example valid input for this input. */
|
|
87
98
|
example?: string;
|
|
88
|
-
/** Indicate if this
|
|
99
|
+
/** Indicate if this input field is required. */
|
|
89
100
|
required?: boolean;
|
|
90
101
|
/** Key of the data source that can be used to set the value of this input. */
|
|
91
102
|
dataSource?: string;
|
|
92
103
|
}
|
|
93
104
|
type CollectionOptions<T> = SingleValue<T> | ValueListCollection<T> | KeyValueListCollection<T>;
|
|
94
105
|
interface SingleValue<T> {
|
|
95
|
-
/** Collection type of the
|
|
106
|
+
/** Collection type of the input. */
|
|
96
107
|
collection?: undefined;
|
|
97
108
|
/** Default value for this field. */
|
|
98
109
|
default?: T;
|
|
99
110
|
}
|
|
100
111
|
interface ValueListCollection<T> {
|
|
101
|
-
/** Collection type of the
|
|
112
|
+
/** Collection type of the input. */
|
|
102
113
|
collection: "valuelist";
|
|
103
114
|
/** Default value for this field. */
|
|
104
115
|
default?: T[];
|
|
105
116
|
}
|
|
106
117
|
interface KeyValueListCollection<T> {
|
|
107
|
-
/** Collection type of the
|
|
118
|
+
/** Collection type of the input. */
|
|
108
119
|
collection: "keyvaluelist";
|
|
109
120
|
/** Default value for this field. */
|
|
110
121
|
default?: KeyValuePair<T>[];
|
|
111
122
|
}
|
|
112
123
|
export type StringInputField = BaseInputField & {
|
|
113
|
-
/** Data type the
|
|
124
|
+
/** Data type the input will collect. */
|
|
114
125
|
type: "string";
|
|
115
126
|
/** Dictates possible choices for the input. */
|
|
116
127
|
model?: InputFieldChoice[];
|
|
117
|
-
/** Clean function */
|
|
128
|
+
/** Clean function. */
|
|
118
129
|
clean?: InputCleanFunction<unknown>;
|
|
119
130
|
} & CollectionOptions<string>;
|
|
120
131
|
export type DataInputField = BaseInputField & {
|
|
121
|
-
/** Data type the
|
|
132
|
+
/** Data type the input will collect. */
|
|
122
133
|
type: "data";
|
|
123
134
|
/** Dictates possible choices for the input. */
|
|
124
135
|
model?: InputFieldChoice[];
|
|
125
|
-
/** Clean function */
|
|
136
|
+
/** Clean function. */
|
|
126
137
|
clean?: InputCleanFunction<unknown>;
|
|
127
138
|
} & CollectionOptions<string>;
|
|
128
139
|
export type TextInputField = BaseInputField & {
|
|
129
|
-
/** Data type the
|
|
140
|
+
/** Data type the input will collect. */
|
|
130
141
|
type: "text";
|
|
131
142
|
/** Dictates possible choices for the input. */
|
|
132
143
|
model?: InputFieldChoice[];
|
|
133
|
-
/** Clean function */
|
|
144
|
+
/** Clean function. */
|
|
134
145
|
clean?: InputCleanFunction<unknown>;
|
|
135
146
|
} & CollectionOptions<string>;
|
|
136
147
|
export type PasswordInputField = BaseInputField & {
|
|
137
|
-
/** Data type the
|
|
148
|
+
/** Data type the input will collect. */
|
|
138
149
|
type: "password";
|
|
139
150
|
/** Dictates possible choices for the input. */
|
|
140
151
|
model?: InputFieldChoice[];
|
|
141
|
-
/** Clean function */
|
|
152
|
+
/** Clean function. */
|
|
142
153
|
clean?: InputCleanFunction<unknown>;
|
|
143
154
|
} & CollectionOptions<string>;
|
|
144
155
|
export type BooleanInputField = BaseInputField & {
|
|
145
|
-
/** Data type the
|
|
156
|
+
/** Data type the input will collect. */
|
|
146
157
|
type: "boolean";
|
|
147
158
|
/** Dictates possible choices for the input. */
|
|
148
159
|
model?: InputFieldChoice[];
|
|
160
|
+
/** Clean function. */
|
|
161
|
+
clean?: InputCleanFunction<unknown>;
|
|
162
|
+
} & CollectionOptions<string>;
|
|
163
|
+
export type ConnectionTemplateInputField = BaseInputField & {
|
|
164
|
+
/** Data type the InputField will collect. */
|
|
165
|
+
type: "template";
|
|
166
|
+
/** Default templated string. */
|
|
167
|
+
templateValue: string;
|
|
168
|
+
/** Will not be user-facing. */
|
|
169
|
+
shown?: false;
|
|
149
170
|
/** Clean function */
|
|
150
171
|
clean?: InputCleanFunction<unknown>;
|
|
151
172
|
} & CollectionOptions<string>;
|
|
152
173
|
/** Defines attributes of a CodeInputField. */
|
|
153
174
|
export type CodeInputField = BaseInputField & {
|
|
154
|
-
/** Data type the
|
|
175
|
+
/** Data type the input will collect. */
|
|
155
176
|
type: "code";
|
|
156
177
|
/** Code language for syntax highlighting. For no syntax highlighting, choose "plaintext" */
|
|
157
178
|
language: "css" | "graphql" | "handlebars" | "hcl" | "html" | "javascript" | "json" | "liquid" | "markdown" | "mysql" | "pgsql" | "plaintext" | "sql" | "typescript" | "xml" | "yaml";
|
|
158
179
|
/** Dictates possible choices for the input. */
|
|
159
180
|
model?: InputFieldChoice[];
|
|
160
|
-
/** Clean function */
|
|
181
|
+
/** Clean function. */
|
|
161
182
|
clean?: InputCleanFunction<unknown>;
|
|
162
183
|
} & CollectionOptions<string>;
|
|
163
184
|
/** Defines attributes of a ConditionalInputField. */
|
|
164
185
|
export interface ConditionalInputField extends BaseInputField {
|
|
165
|
-
/** Data type the
|
|
186
|
+
/** Data type the input will collect. */
|
|
166
187
|
type: "conditional";
|
|
167
|
-
/** Collection type of the InputField */
|
|
188
|
+
/** Collection type of the InputField. */
|
|
168
189
|
collection: InputFieldCollection;
|
|
169
190
|
/** Default value for this field. */
|
|
170
191
|
default?: ConditionalExpression;
|
|
171
|
-
/** Clean function */
|
|
192
|
+
/** Clean function. */
|
|
172
193
|
clean?: InputCleanFunction<this["default"] | null>;
|
|
173
194
|
}
|
|
174
195
|
/** Defines attributes of a ConnectionInputField. */
|
|
175
196
|
export interface ConnectionInputField extends BaseInputField {
|
|
176
|
-
/** Data type the
|
|
197
|
+
/** Data type the input will collect. */
|
|
177
198
|
type: "connection";
|
|
178
|
-
/** Collection type of the InputField */
|
|
199
|
+
/** Collection type of the InputField. */
|
|
179
200
|
collection?: InputFieldCollection;
|
|
180
201
|
/** Default value for this field. */
|
|
181
202
|
default?: Connection;
|
|
182
|
-
/** Clean function */
|
|
203
|
+
/** Clean function. */
|
|
183
204
|
clean?: InputCleanFunction<this["default"] | null>;
|
|
184
205
|
}
|
|
185
206
|
export interface Connection {
|
|
186
|
-
/**
|
|
207
|
+
/** Programmatic unique key of the connection type. */
|
|
187
208
|
key: string;
|
|
188
|
-
/**
|
|
209
|
+
/** Name of the config variable hosting this connection. */
|
|
189
210
|
configVarKey: string;
|
|
190
|
-
/**
|
|
211
|
+
/** Values of input fields supplied to this connection. */
|
|
191
212
|
fields: {
|
|
192
213
|
[key: string]: unknown;
|
|
193
214
|
};
|
|
215
|
+
/** If this connection implements OAuth 2.0, this will be an object with properties like `access_token` and `refresh_token` */
|
|
194
216
|
token?: Record<string, unknown>;
|
|
217
|
+
/** If this connection implements OAuth 2.0, this will contain metadata about the OAuth 2.0 tokens (like expiration time, etc). */
|
|
195
218
|
context?: Record<string, unknown>;
|
|
196
219
|
}
|
|
197
220
|
/** Defines attributes of an ObjectSelectionInputField. */
|
|
198
221
|
export interface ObjectSelectionInputField extends BaseInputField {
|
|
199
|
-
/** Data type the
|
|
222
|
+
/** Data type the input will collect. */
|
|
200
223
|
type: "objectSelection";
|
|
201
|
-
/** Collection type of the InputField */
|
|
224
|
+
/** Collection type of the InputField. */
|
|
202
225
|
collection?: InputFieldCollection;
|
|
203
226
|
/** Default value for this field. */
|
|
204
227
|
default?: ObjectSelection;
|
|
205
|
-
/** Clean function */
|
|
228
|
+
/** Clean function. */
|
|
206
229
|
clean?: InputCleanFunction<this["default"]>;
|
|
207
230
|
}
|
|
208
231
|
/** Defines attributes of an ObjectFieldMapInputField. */
|
|
209
232
|
export interface ObjectFieldMapInputField extends BaseInputField {
|
|
210
|
-
/** Data type the
|
|
233
|
+
/** Data type the input will collect. */
|
|
211
234
|
type: "objectFieldMap";
|
|
212
|
-
/** Collection type of the InputField */
|
|
235
|
+
/** Collection type of the InputField. */
|
|
213
236
|
collection?: InputFieldCollection;
|
|
214
237
|
/** Default value for this field. */
|
|
215
238
|
default?: ObjectFieldMap;
|
|
216
|
-
/** Clean function */
|
|
239
|
+
/** Clean function. */
|
|
217
240
|
clean?: InputCleanFunction<this["default"]>;
|
|
218
241
|
}
|
|
219
242
|
/** Defines attributes of a JSONFormInputField. */
|
|
220
243
|
export interface JSONFormInputField extends BaseInputField {
|
|
221
|
-
/** Data type the
|
|
244
|
+
/** Data type the input will collect. */
|
|
222
245
|
type: "jsonForm";
|
|
223
|
-
/** Collection type of the InputField */
|
|
246
|
+
/** Collection type of the InputField. */
|
|
224
247
|
collection?: InputFieldCollection;
|
|
225
248
|
/** Default value for this field. */
|
|
226
249
|
default?: JSONForm;
|
|
227
|
-
/** Clean function */
|
|
250
|
+
/** Clean function. */
|
|
228
251
|
clean?: InputCleanFunction<this["default"]>;
|
|
229
252
|
}
|
|
230
|
-
/** Defines attributes of a DynamicObjectSelectionInputField */
|
|
253
|
+
/** Defines attributes of a DynamicObjectSelectionInputField. */
|
|
231
254
|
export interface DynamicObjectSelectionInputField extends BaseInputField {
|
|
232
|
-
/** Data type the
|
|
255
|
+
/** Data type the input will collect. */
|
|
233
256
|
type: "dynamicObjectSelection";
|
|
234
|
-
/** Collection type of the InputField */
|
|
257
|
+
/** Collection type of the InputField. */
|
|
235
258
|
collection?: InputFieldCollection;
|
|
236
259
|
/** Default value for this field. */
|
|
237
260
|
default?: unknown;
|
|
238
|
-
/** Clean function */
|
|
261
|
+
/** Clean function. */
|
|
239
262
|
clean?: InputCleanFunction<this["default"]>;
|
|
240
263
|
}
|
|
241
|
-
/** Defines attributes of a SelectedFieldInputField */
|
|
264
|
+
/** Defines attributes of a SelectedFieldInputField. */
|
|
242
265
|
export interface DynamicFieldSelectionInputField extends BaseInputField {
|
|
243
|
-
/** Data type the
|
|
266
|
+
/** Data type the input will collect. */
|
|
244
267
|
type: "dynamicFieldSelection";
|
|
245
|
-
/** Collection type of the InputField */
|
|
268
|
+
/** Collection type of the InputField. */
|
|
246
269
|
collection?: InputFieldCollection;
|
|
247
270
|
/** Default value for this field. */
|
|
248
271
|
default?: unknown;
|
|
249
|
-
/** Clean function */
|
|
272
|
+
/** Clean function. */
|
|
250
273
|
clean?: InputCleanFunction<this["default"]>;
|
|
251
274
|
}
|
|
252
275
|
export type DateInputField = BaseInputField & {
|
|
253
|
-
/** Data type the
|
|
276
|
+
/** Data type the input will collect. */
|
|
254
277
|
type: "date";
|
|
255
278
|
/** Dictates possible choices for the input. */
|
|
256
279
|
model?: InputFieldChoice[];
|
|
257
|
-
/** Clean function */
|
|
280
|
+
/** Clean function. */
|
|
258
281
|
clean?: InputCleanFunction<unknown>;
|
|
259
282
|
} & CollectionOptions<string>;
|
|
260
283
|
export type DateTimeInputField = BaseInputField & {
|
|
261
|
-
/** Data type the
|
|
284
|
+
/** Data type the input will collect. */
|
|
262
285
|
type: "timestamp";
|
|
263
286
|
/** Dictates possible choices for the input. */
|
|
264
287
|
model?: InputFieldChoice[];
|
|
265
|
-
/** Clean function */
|
|
288
|
+
/** Clean function. */
|
|
266
289
|
clean?: InputCleanFunction<unknown>;
|
|
267
290
|
} & CollectionOptions<string>;
|
|
268
291
|
/** Defines a single Choice option for a InputField. */
|
|
@@ -272,14 +295,14 @@ export interface InputFieldChoice {
|
|
|
272
295
|
/** Value to use if this Choice is chosen. */
|
|
273
296
|
value: string;
|
|
274
297
|
}
|
|
275
|
-
/** InputField collection enumeration */
|
|
298
|
+
/** InputField collection enumeration. */
|
|
276
299
|
export type InputFieldCollection = "valuelist" | "keyvaluelist";
|
|
277
|
-
/** Config variable result collection */
|
|
300
|
+
/** Config variable result collection. */
|
|
278
301
|
export type ConfigVarResultCollection = Record<string, string | Schedule | Connection | unknown | ObjectSelection | ObjectFieldMap>;
|
|
279
302
|
export type FlowInputField = BaseInputField & {
|
|
280
|
-
/** Data type the
|
|
303
|
+
/** Data type the input will collect. */
|
|
281
304
|
type: "flow";
|
|
282
|
-
/** Clean function */
|
|
305
|
+
/** Clean function. */
|
|
283
306
|
clean?: InputCleanFunction<unknown>;
|
|
284
307
|
} & CollectionOptions<string>;
|
|
285
308
|
export {};
|
package/dist/types/Inputs.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
/** Contains attributes of the
|
|
1
|
+
/** Contains attributes of the instance that is being executed. */
|
|
2
2
|
export interface InstanceAttributes {
|
|
3
|
+
/** Programmatic ID of the deployed instance. */
|
|
3
4
|
id: string;
|
|
5
|
+
/** Name of the deployed instance. */
|
|
4
6
|
name: string;
|
|
5
7
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
/** Contains attributes of the
|
|
1
|
+
/** Contains attributes of the integration that is being executed. */
|
|
2
2
|
export interface IntegrationAttributes {
|
|
3
|
+
/** Programmatic ID of the integration being executed. */
|
|
3
4
|
id: string;
|
|
5
|
+
/** Name of the integration being executed. */
|
|
4
6
|
name: string;
|
|
7
|
+
/** ID of the version of the integration being executed. */
|
|
5
8
|
versionSequenceId: string;
|
|
6
9
|
externalVersion: string;
|
|
7
10
|
}
|
|
@@ -1,35 +1,57 @@
|
|
|
1
1
|
import { ActionPerformFunction, ActionPerformReturn, TriggerEventFunction, TriggerPerformFunction, Inputs, TriggerResult, TriggerPayload, ComponentRegistry, TriggerReference, ConfigVars, ConfigPages, UserLevelConfigPages, ValueExpression, ConfigVarExpression, ActionContext, ScopedConfigVarMap } from ".";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Defines attributes of a code-native integration. See
|
|
4
|
+
* https://prismatic.io/docs/integrations/code-native/
|
|
5
|
+
*/
|
|
3
6
|
export type IntegrationDefinition = {
|
|
4
|
-
/** The unique name for this
|
|
7
|
+
/** The unique name for this integration. */
|
|
5
8
|
name: string;
|
|
6
|
-
/**
|
|
9
|
+
/** Description for this integration. */
|
|
7
10
|
description?: string;
|
|
8
|
-
/**
|
|
11
|
+
/** Path to icon to use for this integration. Path should be relative to the built integration source. */
|
|
9
12
|
iconPath?: string;
|
|
10
|
-
/**
|
|
13
|
+
/** Category for this integration. */
|
|
11
14
|
category?: string;
|
|
12
|
-
/**
|
|
15
|
+
/** Documentation for this integration. */
|
|
13
16
|
documentation?: string;
|
|
14
|
-
/**
|
|
17
|
+
/** Version identifier for this integration. */
|
|
15
18
|
version?: string;
|
|
16
|
-
/**
|
|
19
|
+
/** Labels for this integration. */
|
|
17
20
|
labels?: string[];
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
+
/**
|
|
22
|
+
* Endpoint type used by Instances of this integration.
|
|
23
|
+
* A Preprocess Flow Config must be specified when using anything other than 'Flow Specific'. See
|
|
24
|
+
* https://prismatic.io/docs/integrations/code-native/endpoint-config/.
|
|
25
|
+
*
|
|
26
|
+
* @default `EndpointType.FlowSpecific` */
|
|
21
27
|
endpointType?: EndpointType;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
28
|
+
/**
|
|
29
|
+
* Preprocess Flow configuration for when the Trigger payload contains the flow routing attributes.
|
|
30
|
+
* Cannot specify this if a Preprocess Flow is also configured. See
|
|
31
|
+
* https://prismatic.io/docs/integrations/code-native/endpoint-config/#endpoint-configuration-in-code-native-with-preprocess-flow
|
|
32
|
+
*/
|
|
24
33
|
triggerPreprocessFlowConfig?: PreprocessFlowConfig;
|
|
25
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Flows for this integration. See
|
|
36
|
+
* https://prismatic.io/docs/integrations/code-native/flows/
|
|
37
|
+
*/
|
|
26
38
|
flows: Flow[];
|
|
27
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Config wizard pages for this integration. See
|
|
41
|
+
* https://prismatic.io/docs/integrations/code-native/config-wizard/
|
|
42
|
+
*/
|
|
28
43
|
configPages?: ConfigPages;
|
|
29
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* User Level Config Wizard Pages for this integration. See
|
|
46
|
+
* https://prismatic.io/docs/integrations/code-native/config-wizard/#user-level-config-wizards-in-code-native-integrations
|
|
47
|
+
*/
|
|
30
48
|
userLevelConfigPages?: UserLevelConfigPages;
|
|
31
|
-
/** Scoped ConfigVars for this
|
|
49
|
+
/** Scoped ConfigVars for this integration. */
|
|
32
50
|
scopedConfigVars?: ScopedConfigVarMap;
|
|
51
|
+
/**
|
|
52
|
+
* A list of components this code-native integration uses. See
|
|
53
|
+
* https://prismatic.io/docs/integrations/code-native/existing-components/
|
|
54
|
+
*/
|
|
33
55
|
componentRegistry?: ComponentRegistry;
|
|
34
56
|
};
|
|
35
57
|
export type FlowOnExecution<TTriggerPayload extends TriggerPayload> = ActionPerformFunction<{
|
|
@@ -47,49 +69,64 @@ export type FlowExecutionContext = ActionContext<ConfigVars, {
|
|
|
47
69
|
[Key in keyof ComponentRegistry]: ComponentRegistry[Key]["actions"];
|
|
48
70
|
}>;
|
|
49
71
|
export type FlowExecutionContextActions = FlowExecutionContext["components"];
|
|
50
|
-
/** Defines attributes of a
|
|
72
|
+
/** Defines attributes of a flow of a code-native integration. */
|
|
51
73
|
export interface Flow<TTriggerPayload extends TriggerPayload = TriggerPayload> {
|
|
52
|
-
/** The unique name for this
|
|
74
|
+
/** The unique name for this flow. */
|
|
53
75
|
name: string;
|
|
54
|
-
/** A unique, unchanging value that is used to maintain identity for the
|
|
76
|
+
/** A unique, unchanging value that is used to maintain identity for the flow even if the name changes. */
|
|
55
77
|
stableKey: string;
|
|
56
|
-
/**
|
|
78
|
+
/** Description for this flow. */
|
|
57
79
|
description?: string;
|
|
58
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Preprocess flow configuration for when the result of this flow contains the flow routing attributes.
|
|
82
|
+
* Only one flow per integration may define this.
|
|
83
|
+
*/
|
|
59
84
|
preprocessFlowConfig?: PreprocessFlowConfig;
|
|
60
|
-
/**
|
|
85
|
+
/** Value that specifies whether this flow is synchronous. @default `false` */
|
|
61
86
|
isSynchronous?: boolean;
|
|
62
|
-
/**
|
|
87
|
+
/** Retry Configuration for this flow. */
|
|
63
88
|
retryConfig?: RetryConfig;
|
|
64
|
-
/**
|
|
89
|
+
/**
|
|
90
|
+
* Security configuration to use for the endpoint of this flow.
|
|
91
|
+
* @default `EndpointSecurityType.CustomerOptional`
|
|
92
|
+
*/
|
|
65
93
|
endpointSecurityType?: EndpointSecurityType;
|
|
66
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* List of API key(s) to use for the endpoint of this flow
|
|
96
|
+
* when the endpoint security type is `EndpointSecurityType.Organization`.
|
|
97
|
+
*/
|
|
67
98
|
organizationApiKeys?: string[];
|
|
68
|
-
/**
|
|
99
|
+
/** Schedule configuration that defines the frequency with which this flow will be automatically executed. */
|
|
69
100
|
schedule?: (ValueExpression<string> | ConfigVarExpression) & {
|
|
70
101
|
timezone?: string;
|
|
71
102
|
};
|
|
72
|
-
/**
|
|
103
|
+
/** Error handling configuration. */
|
|
73
104
|
errorConfig?: StepErrorConfig;
|
|
74
|
-
/** Specifies the trigger function for this
|
|
105
|
+
/** Specifies the trigger function for this flow, which returns a payload and optional HTTP response. */
|
|
75
106
|
onTrigger?: TriggerReference | TriggerPerformFunction<Inputs, ConfigVars, false, TriggerResult<false, TTriggerPayload>>;
|
|
76
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Specifies the function to execute when an instance of this integration is deployed. See
|
|
109
|
+
* https://prismatic.io/docs/custom-connectors/triggers/#instance-deploy-and-delete-events-for-triggers
|
|
110
|
+
*/
|
|
77
111
|
onInstanceDeploy?: TriggerEventFunction<Inputs, ConfigVars>;
|
|
78
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* Specifies the function to execute when an instance of an integration is deleted. See
|
|
114
|
+
* https://prismatic.io/docs/custom-connectors/triggers/#instance-deploy-and-delete-events-for-triggers
|
|
115
|
+
*/
|
|
79
116
|
onInstanceDelete?: TriggerEventFunction<Inputs, ConfigVars>;
|
|
80
|
-
/** Specifies the main function for this
|
|
117
|
+
/** Specifies the main function for this flow which is run when this flow is invoked. */
|
|
81
118
|
onExecution: FlowOnExecution<TTriggerPayload>;
|
|
82
119
|
}
|
|
83
|
-
/** Defines attributes of a Preprocess
|
|
120
|
+
/** Defines attributes of a Preprocess flow Configuration used by a flow of an integration. */
|
|
84
121
|
export type PreprocessFlowConfig = {
|
|
85
|
-
/** Name of the field in the data payload returned by the Preprocess
|
|
122
|
+
/** Name of the field in the data payload returned by the Preprocess flow to use for a flow Name. */
|
|
86
123
|
flowNameField: string;
|
|
87
|
-
/**
|
|
124
|
+
/** Name of the field in the data payload returned by the Preprocess flow to use for an External Customer Id. */
|
|
88
125
|
externalCustomerIdField?: string;
|
|
89
|
-
/**
|
|
126
|
+
/** Name of the field in the data payload returned by the Preprocess flow to use for an External Customer User Id. */
|
|
90
127
|
externalCustomerUserIdField?: string;
|
|
91
128
|
};
|
|
92
|
-
/** Defines attributes of a
|
|
129
|
+
/** Defines attributes of a retry configuration used by a flow of an integration. */
|
|
93
130
|
export type RetryConfig = {
|
|
94
131
|
/** The maximum number of retry attempts. Must be between 0 and 10. */
|
|
95
132
|
maxAttempts: number;
|
|
@@ -97,10 +134,10 @@ export type RetryConfig = {
|
|
|
97
134
|
delayMinutes: number;
|
|
98
135
|
/** Specifies whether to use exponential backoff to calculate the delay between retry attempts. */
|
|
99
136
|
usesExponentialBackoff: boolean;
|
|
100
|
-
/** Name of the field in the data payload returned by the
|
|
137
|
+
/** Name of the field in the data payload returned by the flow's trigger to use as a Unique Request ID for retry request cancellation. */
|
|
101
138
|
uniqueRequestIdField?: string;
|
|
102
139
|
};
|
|
103
|
-
/** Defines attributes of a
|
|
140
|
+
/** Defines attributes of a step error configuration used to determine how to handle errors during flow step execution. */
|
|
104
141
|
export type StepErrorConfig = {
|
|
105
142
|
/** Defines the type of error handler. */
|
|
106
143
|
errorHandlerType: StepErrorHandlerType;
|
|
@@ -113,9 +150,9 @@ export type StepErrorConfig = {
|
|
|
113
150
|
/** Specifies whether to ignore the final error after the final retry attempt. @default false */
|
|
114
151
|
ignoreFinalError?: boolean;
|
|
115
152
|
};
|
|
116
|
-
/** Choices of Endpoint Types that may be used by Instances of an
|
|
153
|
+
/** Choices of Endpoint Types that may be used by Instances of an integration. */
|
|
117
154
|
export type EndpointType = "flow_specific" | "instance_specific" | "shared_instance";
|
|
118
|
-
/** Choices of Endpoint Security Types that may be used by endpoints of a
|
|
155
|
+
/** Choices of Endpoint Security Types that may be used by endpoints of a flow. */
|
|
119
156
|
export type EndpointSecurityType = "unsecured" | "customer_optional" | "customer_required" | "organization";
|
|
120
157
|
/** Choices of Step Error Handlers that define the behavior when a step error occurs. */
|
|
121
158
|
export type StepErrorHandlerType = "fail" | "ignore" | "retry";
|
|
@@ -4,36 +4,51 @@ export type TriggerOptionChoice = (typeof optionChoices)[number];
|
|
|
4
4
|
export declare const TriggerOptionChoices: TriggerOptionChoice[];
|
|
5
5
|
/**
|
|
6
6
|
* TriggerDefinition is the type of the object that is passed in to `trigger` function to
|
|
7
|
-
* define a component trigger.
|
|
7
|
+
* define a component trigger. See
|
|
8
|
+
* https://prismatic.io/docs/custom-connectors/triggers/
|
|
8
9
|
*/
|
|
9
10
|
export interface TriggerDefinition<TInputs extends Inputs = Inputs, TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, TAllowsBranching extends boolean = boolean, TResult extends TriggerResult<TAllowsBranching, TriggerPayload> = TriggerResult<TAllowsBranching, TriggerPayload>> {
|
|
10
|
-
/** Defines how the
|
|
11
|
+
/** Defines how the trigger is displayed in the Prismatic UI. */
|
|
11
12
|
display: ActionDisplayDefinition;
|
|
12
|
-
/** Function to perform when this
|
|
13
|
+
/** Function to perform when this trigger is invoked. */
|
|
13
14
|
perform: TriggerPerformFunction<TInputs, TConfigVars, TAllowsBranching, TResult>;
|
|
14
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Function to execute when an instance of an integration with a flow that uses this trigger is deployed. See
|
|
17
|
+
* https://prismatic.io/docs/custom-connectors/triggers/#instance-deploy-and-delete-events-for-triggers
|
|
18
|
+
*/
|
|
15
19
|
onInstanceDeploy?: TriggerEventFunction<TInputs, TConfigVars>;
|
|
16
|
-
/** Function to execute when an
|
|
20
|
+
/** Function to execute when an instance of an integration with a flow that uses this trigger is deleted. See
|
|
21
|
+
* https://prismatic.io/docs/custom-connectors/triggers/#instance-deploy-and-delete-events-for-triggers
|
|
22
|
+
*/
|
|
17
23
|
onInstanceDelete?: TriggerEventFunction<TInputs, TConfigVars>;
|
|
18
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The inputs to present a low-code integration builder. Values of these inputs
|
|
26
|
+
* are passed to the `perform` function when the trigger is invoked.
|
|
27
|
+
*/
|
|
19
28
|
inputs: TInputs;
|
|
20
|
-
/** Specifies whether this
|
|
29
|
+
/** Specifies whether this trigger supports executing the integration on a recurring schedule. */
|
|
21
30
|
scheduleSupport: TriggerOptionChoice;
|
|
22
|
-
/** Specifies whether this
|
|
31
|
+
/** Specifies whether this trigger supports synchronous responses to a webhook request. */
|
|
23
32
|
synchronousResponseSupport: TriggerOptionChoice;
|
|
24
|
-
/**
|
|
33
|
+
/** Attribute that specifies whether this Trigger will terminate execution. */
|
|
25
34
|
terminateExecution?: boolean;
|
|
26
35
|
/** Specifies whether an Action will break out of a loop. */
|
|
27
36
|
breakLoop?: boolean;
|
|
28
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Determines whether this trigger supports branching. See
|
|
39
|
+
* https://prismatic.io/docs/custom-connectors/branching/
|
|
40
|
+
*/
|
|
29
41
|
allowsBranching?: TAllowsBranching;
|
|
30
|
-
/** Static Branch names associated with this
|
|
42
|
+
/** Static Branch names associated with this trigger. */
|
|
31
43
|
staticBranchNames?: string[];
|
|
32
|
-
/** The
|
|
44
|
+
/** The input field associated with dynamic branching. */
|
|
33
45
|
dynamicBranchInput?: string;
|
|
34
|
-
/** An example of the payload outputted by this
|
|
46
|
+
/** An example of the payload outputted by this trigger. */
|
|
35
47
|
examplePayload?: Awaited<ReturnType<this["perform"]>>;
|
|
36
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Specifies if this trigger appears in the list of 'common' triggers. Only configurable by Prismatic.
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
37
52
|
isCommonTrigger?: boolean;
|
|
38
53
|
}
|
|
39
54
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Inputs, ActionContext, ActionInputParameters, ConfigVarResultCollection } from ".";
|
|
2
2
|
export type TriggerEventFunctionReturn = {
|
|
3
|
-
/** An optional object, the keys and values of which will be persisted in the flow-specific instanceState and available for subsequent actions and executions */
|
|
3
|
+
/** An optional object, the keys and values of which will be persisted in the flow-specific instanceState and available for subsequent actions and executions. */
|
|
4
4
|
instanceState?: Record<string, unknown>;
|
|
5
|
-
/** An optional object, the keys and values of which will be persisted in the crossFlowState and available in any flow for subsequent actions and executions */
|
|
5
|
+
/** An optional object, the keys and values of which will be persisted in the crossFlowState and available in any flow for subsequent actions and executions. */
|
|
6
6
|
crossFlowState?: Record<string, unknown>;
|
|
7
|
-
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution */
|
|
7
|
+
/** An optional object, the keys and values of which will be persisted in the executionState and available for the duration of the execution. */
|
|
8
8
|
executionState?: Record<string, unknown>;
|
|
9
|
-
/** An optional object, the keys and values of which will be persisted in the integrationState and available in any flow of an Instance for any version of an Integration for subsequent actions and executions */
|
|
9
|
+
/** An optional object, the keys and values of which will be persisted in the integrationState and available in any flow of an Instance for any version of an Integration for subsequent actions and executions. */
|
|
10
10
|
integrationState?: Record<string, unknown>;
|
|
11
11
|
};
|
|
12
12
|
/** Definition of the function to execute when a Trigger Event occurs. */
|