@prismatic-io/spectral 10.4.4 → 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 -6
- package/dist/serverTypes/index.d.ts +2 -0
- package/dist/serverTypes/integration.d.ts +0 -1
- 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 +82 -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,203 +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;
|
|
101
|
+
/** Key of the data source that can be used to set the value of this input. */
|
|
102
|
+
dataSource?: string;
|
|
90
103
|
}
|
|
91
104
|
type CollectionOptions<T> = SingleValue<T> | ValueListCollection<T> | KeyValueListCollection<T>;
|
|
92
105
|
interface SingleValue<T> {
|
|
93
|
-
/** Collection type of the
|
|
106
|
+
/** Collection type of the input. */
|
|
94
107
|
collection?: undefined;
|
|
95
108
|
/** Default value for this field. */
|
|
96
109
|
default?: T;
|
|
97
110
|
}
|
|
98
111
|
interface ValueListCollection<T> {
|
|
99
|
-
/** Collection type of the
|
|
112
|
+
/** Collection type of the input. */
|
|
100
113
|
collection: "valuelist";
|
|
101
114
|
/** Default value for this field. */
|
|
102
115
|
default?: T[];
|
|
103
116
|
}
|
|
104
117
|
interface KeyValueListCollection<T> {
|
|
105
|
-
/** Collection type of the
|
|
118
|
+
/** Collection type of the input. */
|
|
106
119
|
collection: "keyvaluelist";
|
|
107
120
|
/** Default value for this field. */
|
|
108
121
|
default?: KeyValuePair<T>[];
|
|
109
122
|
}
|
|
110
123
|
export type StringInputField = BaseInputField & {
|
|
111
|
-
/** Data type the
|
|
124
|
+
/** Data type the input will collect. */
|
|
112
125
|
type: "string";
|
|
113
126
|
/** Dictates possible choices for the input. */
|
|
114
127
|
model?: InputFieldChoice[];
|
|
115
|
-
/** Clean function */
|
|
128
|
+
/** Clean function. */
|
|
116
129
|
clean?: InputCleanFunction<unknown>;
|
|
117
130
|
} & CollectionOptions<string>;
|
|
118
131
|
export type DataInputField = BaseInputField & {
|
|
119
|
-
/** Data type the
|
|
132
|
+
/** Data type the input will collect. */
|
|
120
133
|
type: "data";
|
|
121
134
|
/** Dictates possible choices for the input. */
|
|
122
135
|
model?: InputFieldChoice[];
|
|
123
|
-
/** Clean function */
|
|
136
|
+
/** Clean function. */
|
|
124
137
|
clean?: InputCleanFunction<unknown>;
|
|
125
138
|
} & CollectionOptions<string>;
|
|
126
139
|
export type TextInputField = BaseInputField & {
|
|
127
|
-
/** Data type the
|
|
140
|
+
/** Data type the input will collect. */
|
|
128
141
|
type: "text";
|
|
129
142
|
/** Dictates possible choices for the input. */
|
|
130
143
|
model?: InputFieldChoice[];
|
|
131
|
-
/** Clean function */
|
|
144
|
+
/** Clean function. */
|
|
132
145
|
clean?: InputCleanFunction<unknown>;
|
|
133
146
|
} & CollectionOptions<string>;
|
|
134
147
|
export type PasswordInputField = BaseInputField & {
|
|
135
|
-
/** Data type the
|
|
148
|
+
/** Data type the input will collect. */
|
|
136
149
|
type: "password";
|
|
137
150
|
/** Dictates possible choices for the input. */
|
|
138
151
|
model?: InputFieldChoice[];
|
|
139
|
-
/** Clean function */
|
|
152
|
+
/** Clean function. */
|
|
140
153
|
clean?: InputCleanFunction<unknown>;
|
|
141
154
|
} & CollectionOptions<string>;
|
|
142
155
|
export type BooleanInputField = BaseInputField & {
|
|
143
|
-
/** Data type the
|
|
156
|
+
/** Data type the input will collect. */
|
|
144
157
|
type: "boolean";
|
|
145
158
|
/** Dictates possible choices for the input. */
|
|
146
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;
|
|
147
170
|
/** Clean function */
|
|
148
171
|
clean?: InputCleanFunction<unknown>;
|
|
149
172
|
} & CollectionOptions<string>;
|
|
150
173
|
/** Defines attributes of a CodeInputField. */
|
|
151
174
|
export type CodeInputField = BaseInputField & {
|
|
152
|
-
/** Data type the
|
|
175
|
+
/** Data type the input will collect. */
|
|
153
176
|
type: "code";
|
|
154
177
|
/** Code language for syntax highlighting. For no syntax highlighting, choose "plaintext" */
|
|
155
178
|
language: "css" | "graphql" | "handlebars" | "hcl" | "html" | "javascript" | "json" | "liquid" | "markdown" | "mysql" | "pgsql" | "plaintext" | "sql" | "typescript" | "xml" | "yaml";
|
|
156
179
|
/** Dictates possible choices for the input. */
|
|
157
180
|
model?: InputFieldChoice[];
|
|
158
|
-
/** Clean function */
|
|
181
|
+
/** Clean function. */
|
|
159
182
|
clean?: InputCleanFunction<unknown>;
|
|
160
183
|
} & CollectionOptions<string>;
|
|
161
184
|
/** Defines attributes of a ConditionalInputField. */
|
|
162
185
|
export interface ConditionalInputField extends BaseInputField {
|
|
163
|
-
/** Data type the
|
|
186
|
+
/** Data type the input will collect. */
|
|
164
187
|
type: "conditional";
|
|
165
|
-
/** Collection type of the InputField */
|
|
188
|
+
/** Collection type of the InputField. */
|
|
166
189
|
collection: InputFieldCollection;
|
|
167
190
|
/** Default value for this field. */
|
|
168
191
|
default?: ConditionalExpression;
|
|
169
|
-
/** Clean function */
|
|
192
|
+
/** Clean function. */
|
|
170
193
|
clean?: InputCleanFunction<this["default"] | null>;
|
|
171
194
|
}
|
|
172
195
|
/** Defines attributes of a ConnectionInputField. */
|
|
173
196
|
export interface ConnectionInputField extends BaseInputField {
|
|
174
|
-
/** Data type the
|
|
197
|
+
/** Data type the input will collect. */
|
|
175
198
|
type: "connection";
|
|
176
|
-
/** Collection type of the InputField */
|
|
199
|
+
/** Collection type of the InputField. */
|
|
177
200
|
collection?: InputFieldCollection;
|
|
178
201
|
/** Default value for this field. */
|
|
179
202
|
default?: Connection;
|
|
180
|
-
/** Clean function */
|
|
203
|
+
/** Clean function. */
|
|
181
204
|
clean?: InputCleanFunction<this["default"] | null>;
|
|
182
205
|
}
|
|
183
206
|
export interface Connection {
|
|
184
|
-
/**
|
|
207
|
+
/** Programmatic unique key of the connection type. */
|
|
185
208
|
key: string;
|
|
186
|
-
/**
|
|
209
|
+
/** Name of the config variable hosting this connection. */
|
|
187
210
|
configVarKey: string;
|
|
188
|
-
/**
|
|
211
|
+
/** Values of input fields supplied to this connection. */
|
|
189
212
|
fields: {
|
|
190
213
|
[key: string]: unknown;
|
|
191
214
|
};
|
|
215
|
+
/** If this connection implements OAuth 2.0, this will be an object with properties like `access_token` and `refresh_token` */
|
|
192
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). */
|
|
193
218
|
context?: Record<string, unknown>;
|
|
194
219
|
}
|
|
195
220
|
/** Defines attributes of an ObjectSelectionInputField. */
|
|
196
221
|
export interface ObjectSelectionInputField extends BaseInputField {
|
|
197
|
-
/** Data type the
|
|
222
|
+
/** Data type the input will collect. */
|
|
198
223
|
type: "objectSelection";
|
|
199
|
-
/** Collection type of the InputField */
|
|
224
|
+
/** Collection type of the InputField. */
|
|
200
225
|
collection?: InputFieldCollection;
|
|
201
226
|
/** Default value for this field. */
|
|
202
227
|
default?: ObjectSelection;
|
|
203
|
-
/** Clean function */
|
|
228
|
+
/** Clean function. */
|
|
204
229
|
clean?: InputCleanFunction<this["default"]>;
|
|
205
230
|
}
|
|
206
231
|
/** Defines attributes of an ObjectFieldMapInputField. */
|
|
207
232
|
export interface ObjectFieldMapInputField extends BaseInputField {
|
|
208
|
-
/** Data type the
|
|
233
|
+
/** Data type the input will collect. */
|
|
209
234
|
type: "objectFieldMap";
|
|
210
|
-
/** Collection type of the InputField */
|
|
235
|
+
/** Collection type of the InputField. */
|
|
211
236
|
collection?: InputFieldCollection;
|
|
212
237
|
/** Default value for this field. */
|
|
213
238
|
default?: ObjectFieldMap;
|
|
214
|
-
/** Clean function */
|
|
239
|
+
/** Clean function. */
|
|
215
240
|
clean?: InputCleanFunction<this["default"]>;
|
|
216
241
|
}
|
|
217
242
|
/** Defines attributes of a JSONFormInputField. */
|
|
218
243
|
export interface JSONFormInputField extends BaseInputField {
|
|
219
|
-
/** Data type the
|
|
244
|
+
/** Data type the input will collect. */
|
|
220
245
|
type: "jsonForm";
|
|
221
|
-
/** Collection type of the InputField */
|
|
246
|
+
/** Collection type of the InputField. */
|
|
222
247
|
collection?: InputFieldCollection;
|
|
223
248
|
/** Default value for this field. */
|
|
224
249
|
default?: JSONForm;
|
|
225
|
-
/** Clean function */
|
|
250
|
+
/** Clean function. */
|
|
226
251
|
clean?: InputCleanFunction<this["default"]>;
|
|
227
252
|
}
|
|
228
|
-
/** Defines attributes of a DynamicObjectSelectionInputField */
|
|
253
|
+
/** Defines attributes of a DynamicObjectSelectionInputField. */
|
|
229
254
|
export interface DynamicObjectSelectionInputField extends BaseInputField {
|
|
230
|
-
/** Data type the
|
|
255
|
+
/** Data type the input will collect. */
|
|
231
256
|
type: "dynamicObjectSelection";
|
|
232
|
-
/** Collection type of the InputField */
|
|
257
|
+
/** Collection type of the InputField. */
|
|
233
258
|
collection?: InputFieldCollection;
|
|
234
259
|
/** Default value for this field. */
|
|
235
260
|
default?: unknown;
|
|
236
|
-
/** Clean function */
|
|
261
|
+
/** Clean function. */
|
|
237
262
|
clean?: InputCleanFunction<this["default"]>;
|
|
238
263
|
}
|
|
239
|
-
/** Defines attributes of a SelectedFieldInputField */
|
|
264
|
+
/** Defines attributes of a SelectedFieldInputField. */
|
|
240
265
|
export interface DynamicFieldSelectionInputField extends BaseInputField {
|
|
241
|
-
/** Data type the
|
|
266
|
+
/** Data type the input will collect. */
|
|
242
267
|
type: "dynamicFieldSelection";
|
|
243
|
-
/** Collection type of the InputField */
|
|
268
|
+
/** Collection type of the InputField. */
|
|
244
269
|
collection?: InputFieldCollection;
|
|
245
270
|
/** Default value for this field. */
|
|
246
271
|
default?: unknown;
|
|
247
|
-
/** Clean function */
|
|
272
|
+
/** Clean function. */
|
|
248
273
|
clean?: InputCleanFunction<this["default"]>;
|
|
249
274
|
}
|
|
250
275
|
export type DateInputField = BaseInputField & {
|
|
251
|
-
/** Data type the
|
|
276
|
+
/** Data type the input will collect. */
|
|
252
277
|
type: "date";
|
|
253
278
|
/** Dictates possible choices for the input. */
|
|
254
279
|
model?: InputFieldChoice[];
|
|
255
|
-
/** Clean function */
|
|
280
|
+
/** Clean function. */
|
|
256
281
|
clean?: InputCleanFunction<unknown>;
|
|
257
282
|
} & CollectionOptions<string>;
|
|
258
283
|
export type DateTimeInputField = BaseInputField & {
|
|
259
|
-
/** Data type the
|
|
284
|
+
/** Data type the input will collect. */
|
|
260
285
|
type: "timestamp";
|
|
261
286
|
/** Dictates possible choices for the input. */
|
|
262
287
|
model?: InputFieldChoice[];
|
|
263
|
-
/** Clean function */
|
|
288
|
+
/** Clean function. */
|
|
264
289
|
clean?: InputCleanFunction<unknown>;
|
|
265
290
|
} & CollectionOptions<string>;
|
|
266
291
|
/** Defines a single Choice option for a InputField. */
|
|
@@ -270,14 +295,14 @@ export interface InputFieldChoice {
|
|
|
270
295
|
/** Value to use if this Choice is chosen. */
|
|
271
296
|
value: string;
|
|
272
297
|
}
|
|
273
|
-
/** InputField collection enumeration */
|
|
298
|
+
/** InputField collection enumeration. */
|
|
274
299
|
export type InputFieldCollection = "valuelist" | "keyvaluelist";
|
|
275
|
-
/** Config variable result collection */
|
|
300
|
+
/** Config variable result collection. */
|
|
276
301
|
export type ConfigVarResultCollection = Record<string, string | Schedule | Connection | unknown | ObjectSelection | ObjectFieldMap>;
|
|
277
302
|
export type FlowInputField = BaseInputField & {
|
|
278
|
-
/** Data type the
|
|
303
|
+
/** Data type the input will collect. */
|
|
279
304
|
type: "flow";
|
|
280
|
-
/** Clean function */
|
|
305
|
+
/** Clean function. */
|
|
281
306
|
clean?: InputCleanFunction<unknown>;
|
|
282
307
|
} & CollectionOptions<string>;
|
|
283
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. */
|