@prismatic-io/spectral 10.5.0 → 10.5.2

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