@prismatic-io/spectral 7.10.0 → 8.0.0-preview11

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 (40) hide show
  1. package/dist/clients/http/index.d.ts +1 -1
  2. package/dist/clients/soap/index.d.ts +2 -0
  3. package/dist/clients/soap/index.js +18 -0
  4. package/dist/clients/soap/types.d.ts +71 -0
  5. package/dist/clients/soap/types.js +24 -0
  6. package/dist/clients/soap/utils.d.ts +12 -0
  7. package/dist/clients/soap/utils.js +191 -0
  8. package/dist/index.d.ts +41 -12
  9. package/dist/index.js +43 -1
  10. package/dist/serverTypes/convert.d.ts +2 -1
  11. package/dist/serverTypes/convert.js +250 -1
  12. package/dist/serverTypes/index.d.ts +27 -24
  13. package/dist/testing.d.ts +14 -9
  14. package/dist/testing.js +57 -49
  15. package/dist/types/ActionDefinition.d.ts +3 -3
  16. package/dist/types/ActionInputParameters.d.ts +14 -1
  17. package/dist/types/ActionPerformFunction.d.ts +12 -9
  18. package/dist/types/ComponentDefinition.d.ts +2 -2
  19. package/dist/types/{Customer.d.ts → CustomerAttributes.d.ts} +1 -1
  20. package/dist/types/DataSourcePerformFunction.d.ts +4 -4
  21. package/dist/types/{Flow.d.ts → FlowAttributes.d.ts} +1 -1
  22. package/dist/types/Inputs.d.ts +44 -50
  23. package/dist/types/{Instance.d.ts → InstanceAttributes.d.ts} +1 -1
  24. package/dist/types/{Integration.d.ts → IntegrationAttributes.d.ts} +2 -1
  25. package/dist/types/IntegrationDefinition.d.ts +273 -0
  26. package/dist/types/IntegrationDefinition.js +78 -0
  27. package/dist/types/TriggerDefinition.d.ts +5 -5
  28. package/dist/types/TriggerEventFunction.d.ts +2 -2
  29. package/dist/types/TriggerPayload.d.ts +6 -6
  30. package/dist/types/TriggerPerformFunction.d.ts +2 -2
  31. package/dist/types/TriggerResult.d.ts +4 -4
  32. package/dist/types/{User.d.ts → UserAttributes.d.ts} +1 -1
  33. package/dist/types/index.d.ts +6 -5
  34. package/dist/types/index.js +6 -5
  35. package/package.json +6 -4
  36. /package/dist/types/{Customer.js → CustomerAttributes.js} +0 -0
  37. /package/dist/types/{Flow.js → FlowAttributes.js} +0 -0
  38. /package/dist/types/{Instance.js → InstanceAttributes.js} +0 -0
  39. /package/dist/types/{Integration.js → IntegrationAttributes.js} +0 -0
  40. /package/dist/types/{User.js → UserAttributes.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { Inputs, ActionPerformReturn, ActionInputParameters, ActionLogger, Instance, Customer, User, Integration, Flow } from ".";
1
+ import { Inputs, ConfigVarResultCollection, ActionPerformReturn, ActionInputParameters, ActionLogger, InstanceAttributes, CustomerAttributes, UserAttributes, IntegrationAttributes, FlowAttributes } from ".";
2
2
  /** Definition of the function to perform when an Action is invoked. */
3
- export declare type ActionPerformFunction<TInputs extends Inputs, TAllowsBranching extends boolean | undefined, TReturn extends ActionPerformReturn<TAllowsBranching, unknown>> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<TReturn>;
3
+ export declare type ActionPerformFunction<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, THasConfigVars extends boolean, TAllowsBranching extends boolean | undefined, TReturn extends ActionPerformReturn<TAllowsBranching, unknown>> = (context: ActionContext<TConfigVars, THasConfigVars>, params: ActionInputParameters<TInputs>) => Promise<TReturn>;
4
4
  /** Context provided to perform method containing helpers and contextual data */
5
- export interface ActionContext {
5
+ export declare type ActionContext<TConfigVars extends ConfigVarResultCollection = ConfigVarResultCollection, THasConfigVars extends boolean = false> = {
6
6
  /** Logger for permanent logging; console calls are also captured */
7
7
  logger: ActionLogger;
8
8
  /** A a flow-specific key/value store that may be used to store small amounts of data that is persisted between Instance executions */
@@ -24,15 +24,18 @@ export interface ActionContext {
24
24
  /** The URL used to invoke the current execution */
25
25
  invokeUrl: string;
26
26
  /** Contains attributes of the Customer for whom an Instance is being executed. */
27
- customer: Customer;
27
+ customer: CustomerAttributes;
28
28
  /** Contains attributes of the Instance that is being executed. */
29
- instance: Instance;
29
+ instance: InstanceAttributes;
30
30
  /** Contains attributes of the User for whom a User Level Configuration is being used. */
31
- user: User;
31
+ user: UserAttributes;
32
32
  /** Contains attributes of the Integration that is being executed. */
33
- integration: Integration;
33
+ integration: IntegrationAttributes;
34
34
  /** Contains attributes of the Flow that is being executed. */
35
- flow: Flow;
35
+ flow: FlowAttributes;
36
36
  /** The time in UTC that execution started. */
37
37
  startedAt: string;
38
- }
38
+ } & (THasConfigVars extends true ? {
39
+ /** Key/value collection of config variables of the integration. */
40
+ configVars: TConfigVars;
41
+ } : Record<string, never>);
@@ -13,9 +13,9 @@ export declare type ComponentDefinition<TPublic extends boolean, TKey extends st
13
13
  /** Defines how the Component is displayed in the Prismatic interface. */
14
14
  display: ComponentDisplayDefinition<TPublic>;
15
15
  /** Specifies the supported Actions of this Component. */
16
- actions?: Record<string, ActionDefinition<any, boolean, any>>;
16
+ actions?: Record<string, ActionDefinition<any, any, boolean, any>>;
17
17
  /** Specifies the supported Triggers of this Component. */
18
- triggers?: Record<string, TriggerDefinition<any, boolean, any>>;
18
+ triggers?: Record<string, TriggerDefinition<any, any, boolean, any>>;
19
19
  /** Specifies the supported Data Sources of this Component. */
20
20
  dataSources?: Record<string, DataSourceDefinition<any, any>>;
21
21
  /** Specifies the supported Connections of this Component. */
@@ -1,5 +1,5 @@
1
1
  /** Contains attributes of the Customer for whom an Instance is being executed. */
2
- export interface Customer {
2
+ export interface CustomerAttributes {
3
3
  id: string;
4
4
  externalId: string;
5
5
  name: string;
@@ -1,10 +1,10 @@
1
- import { Inputs, DataSourceResult, DataSourceType, ActionInputParameters, ActionLogger, Customer, Instance, User } from ".";
1
+ import { Inputs, DataSourceResult, DataSourceType, ActionInputParameters, ActionLogger, CustomerAttributes, InstanceAttributes, UserAttributes } from ".";
2
2
  /** Context provided to perform method containing helpers and contextual data */
3
3
  export interface DataSourceContext {
4
4
  logger: ActionLogger;
5
- customer: Customer;
6
- instance: Instance;
7
- user: User;
5
+ customer: CustomerAttributes;
6
+ instance: InstanceAttributes;
7
+ user: UserAttributes;
8
8
  }
9
9
  /** Definition of the function to perform when a Data Source is invoked. */
10
10
  export declare type DataSourcePerformFunction<TInputs extends Inputs, TDataSourceType extends DataSourceType> = (context: DataSourceContext, params: ActionInputParameters<TInputs>) => Promise<DataSourceResult<TDataSourceType>>;
@@ -1,5 +1,5 @@
1
1
  /** Contains attributes of the Flow that is being executed. */
2
- export interface Flow {
2
+ export interface FlowAttributes {
3
3
  id: string;
4
4
  name: string;
5
5
  }
@@ -1,18 +1,5 @@
1
1
  import { ConditionalExpression } from "./conditional-logic";
2
2
  import { JsonSchema, UISchemaElement } from "@jsonforms/core";
3
- /**
4
- * KeyValuePair input parameter type.
5
- * This allows users to input multiple keys / values as an input.
6
- * To see an example of how this can be used, see the `tagging` input
7
- * of the `putObject` action of the AWS S3 component:
8
- * https://github.com/prismatic-io/examples/blob/main/components/aws-s3/src/actions.ts
9
- */
10
- export interface KeyValuePair<V = unknown> {
11
- /** Key of the KeyValuePair */
12
- key: string;
13
- /** Value of the KeyValuePair */
14
- value: V;
15
- }
16
3
  export declare type Element = {
17
4
  key: string;
18
5
  label?: string;
@@ -79,76 +66,81 @@ interface BaseInputField {
79
66
  /** Indicate if this InputField is required. */
80
67
  required?: boolean;
81
68
  }
82
- declare type CollectionOptions<T> = SingleValue<T> | ValueListCollection<T> | KeyValueListCollection<T>;
83
- interface SingleValue<T> {
84
- /** Collection type of the InputField */
85
- collection?: undefined;
86
- /** Default value for this field. */
87
- default?: T;
88
- }
89
- interface ValueListCollection<T> {
90
- /** Collection type of the InputField */
91
- collection: "valuelist";
92
- /** Default value for this field. */
93
- default?: T[];
94
- }
95
- interface KeyValueListCollection<T> {
96
- /** Collection type of the InputField */
97
- collection: "keyvaluelist";
98
- /** Default value for this field. */
99
- default?: KeyValuePair<T>[];
100
- }
101
- export declare type StringInputField = BaseInputField & CollectionOptions<string> & {
69
+ export interface StringInputField extends BaseInputField {
102
70
  /** Data type the InputField will collect. */
103
71
  type: "string";
72
+ /** Collection type of the InputField */
73
+ collection?: InputFieldCollection;
74
+ /** Default value for this field. */
75
+ default?: unknown;
104
76
  /** Dictates possible choices for the input. */
105
77
  model?: InputFieldChoice[];
106
78
  /** Clean function */
107
- clean?: InputCleanFunction<unknown>;
108
- };
109
- export declare type DataInputField = BaseInputField & CollectionOptions<string> & {
79
+ clean?: InputCleanFunction<this["default"]>;
80
+ }
81
+ export interface DataInputField extends BaseInputField {
110
82
  /** Data type the InputField will collect. */
111
83
  type: "data";
84
+ /** Collection type of the InputField */
85
+ collection?: InputFieldCollection;
86
+ /** Default value for this field. */
87
+ default?: unknown;
112
88
  /** Dictates possible choices for the input. */
113
89
  model?: InputFieldChoice[];
114
90
  /** Clean function */
115
- clean?: InputCleanFunction<unknown>;
116
- };
117
- export declare type TextInputField = BaseInputField & CollectionOptions<string> & {
91
+ clean?: InputCleanFunction<this["default"]>;
92
+ }
93
+ export interface TextInputField extends BaseInputField {
118
94
  /** Data type the InputField will collect. */
119
95
  type: "text";
96
+ /** Collection type of the InputField */
97
+ collection?: InputFieldCollection;
98
+ /** Default value for this field. */
99
+ default?: unknown;
120
100
  /** Dictates possible choices for the input. */
121
101
  model?: InputFieldChoice[];
122
102
  /** Clean function */
123
- clean?: InputCleanFunction<unknown>;
124
- };
125
- export declare type PasswordInputField = BaseInputField & CollectionOptions<string> & {
103
+ clean?: InputCleanFunction<this["default"]>;
104
+ }
105
+ export interface PasswordInputField extends BaseInputField {
126
106
  /** Data type the InputField will collect. */
127
107
  type: "password";
108
+ /** Collection type of the InputField */
109
+ collection?: InputFieldCollection;
110
+ /** Default value for this field. */
111
+ default?: unknown;
128
112
  /** Dictates possible choices for the input. */
129
113
  model?: InputFieldChoice[];
130
114
  /** Clean function */
131
- clean?: InputCleanFunction<unknown>;
132
- };
133
- export declare type BooleanInputField = BaseInputField & CollectionOptions<string> & {
115
+ clean?: InputCleanFunction<this["default"]>;
116
+ }
117
+ export interface BooleanInputField extends BaseInputField {
134
118
  /** Data type the InputField will collect. */
135
119
  type: "boolean";
120
+ /** Collection type of the InputField */
121
+ collection?: InputFieldCollection;
122
+ /** Default value for this field. */
123
+ default?: unknown;
136
124
  /** Dictates possible choices for the input. */
137
125
  model?: InputFieldChoice[];
138
126
  /** Clean function */
139
- clean?: InputCleanFunction<unknown>;
140
- };
127
+ clean?: InputCleanFunction<this["default"]>;
128
+ }
141
129
  /** Defines attributes of a CodeInputField. */
142
- export declare type CodeInputField = BaseInputField & CollectionOptions<string> & {
130
+ export interface CodeInputField extends BaseInputField {
143
131
  /** Data type the InputField will collect. */
144
132
  type: "code";
133
+ /** Collection type of the InputField */
134
+ collection?: InputFieldCollection;
135
+ /** Default value for this field. */
136
+ default?: unknown;
145
137
  /** Code language for syntax highlighting. For no syntax highlighting, choose "plaintext" */
146
138
  language: "css" | "graphql" | "handlebars" | "hcl" | "html" | "javascript" | "json" | "liquid" | "markdown" | "mysql" | "pgsql" | "plaintext" | "sql" | "typescript" | "xml" | "yaml";
147
139
  /** Dictates possible choices for the input. */
148
140
  model?: InputFieldChoice[];
149
141
  /** Clean function */
150
- clean?: InputCleanFunction<unknown>;
151
- };
142
+ clean?: InputCleanFunction<this["default"]>;
143
+ }
152
144
  /** Defines attributes of a ConditionalInputField. */
153
145
  export interface ConditionalInputField extends BaseInputField {
154
146
  /** Data type the InputField will collect. */
@@ -247,4 +239,6 @@ export interface InputFieldChoice {
247
239
  }
248
240
  /** InputField collection enumeration */
249
241
  export declare type InputFieldCollection = "valuelist" | "keyvaluelist";
242
+ /** Config variable result collection */
243
+ export declare type ConfigVarResultCollection = Record<string, string | Connection | JSONForm | ObjectSelection>;
250
244
  export {};
@@ -1,5 +1,5 @@
1
1
  /** Contains attributes of the Instance that is being executed. */
2
- export interface Instance {
2
+ export interface InstanceAttributes {
3
3
  id: string;
4
4
  name: string;
5
5
  }
@@ -1,6 +1,7 @@
1
1
  /** Contains attributes of the Integration that is being executed. */
2
- export interface Integration {
2
+ export interface IntegrationAttributes {
3
3
  id: string;
4
4
  name: string;
5
5
  versionSequenceId: string;
6
+ externalVersion: string;
6
7
  }
@@ -0,0 +1,273 @@
1
+ import { DataSourceDefinition, ConnectionDefinition, ActionPerformFunction, ActionPerformReturn, TriggerEventFunction, TriggerPerformFunction, Inputs, TriggerResult, DataSourceType, Connection as ConnectionResult, TriggerPayload } from ".";
2
+ export declare type ConfigVarCollection = Record<string, ConfigVar>;
3
+ export declare type ConfigVarDefinitionsToResults<TConfigVars extends ConfigVarCollection> = {
4
+ [Key in keyof TConfigVars]: TConfigVars[Key]["inputs"] extends Record<string, any> ? ConnectionResult : string;
5
+ };
6
+ /** Defines attributes of a Code-Native Integration. */
7
+ export declare type IntegrationDefinition<TConfigVars extends ConfigVarCollection = ConfigVarCollection> = {
8
+ /** The unique name for this Integration. */
9
+ name: string;
10
+ /** Optional description for this Integration. */
11
+ description?: string;
12
+ /** Optional path to icon to use for this Integration. Path should be relative to the built Integration source. */
13
+ iconPath?: string;
14
+ /** Optional category for this Integration. */
15
+ category?: string;
16
+ /** Optional documentation for this Integration. */
17
+ documentation?: string;
18
+ /** Optional version identifier for this Integration. */
19
+ version?: string;
20
+ /** Optional labels for this Integration. */
21
+ labels?: string[];
22
+ /** Optional endpoint type used by Instances of this Integration.
23
+ * A Preprocess Flow Config must be specified when using anything other than 'Flow Specific'.
24
+ * @default EndpointType.FlowSpecific. */
25
+ endpointType?: EndpointType;
26
+ /** Optional Preprocess Flow configuration for when the Trigger payload contains the flow routing attributes.
27
+ * Cannot specify this if a Preprocess Flow is also configured. */
28
+ triggerPreprocessFlowConfig?: PreprocessFlowConfig;
29
+ /** Flows for this Integration. */
30
+ flows: Flow<TConfigVars>[];
31
+ /** Config Vars used on this Integration. */
32
+ configVars?: TConfigVars;
33
+ /** Config Wizard Pages for this Integration. */
34
+ configPages?: ConfigPage<TConfigVars>[];
35
+ /** Specifies any Data Sources that are defined as part of this Integration. */
36
+ dataSources?: Record<string, CodeNativeDataSource>;
37
+ };
38
+ /** Defines attributes of a Flow of a Code-Native Integration. */
39
+ export interface Flow<TConfigVars extends ConfigVarCollection = ConfigVarCollection, TTriggerPayload extends TriggerPayload = TriggerPayload> {
40
+ /** The unique name for this Flow. */
41
+ name: string;
42
+ /** A unique, unchanging value that is used to maintain identity for the Flow even if the name changes. */
43
+ stableKey: string;
44
+ /** Optional description for this Flow. */
45
+ description?: string;
46
+ /** Optional Preprocess Flow configuration for when the result of this Flow contains the flow routing attributes. Only one Flow per Integration may define this. */
47
+ preprocessFlowConfig?: PreprocessFlowConfig;
48
+ /** Optional value that specifies whether this Flow is synchronous. @default false */
49
+ isSynchronous?: boolean;
50
+ /** Optional Retry Configuration for this Flow. */
51
+ retryConfig?: RetryConfig;
52
+ /** Optional security configuration to use for the endpoint of this Flow. @default EndpointSecurityType.CustomerOptional */
53
+ endpointSecurityType?: EndpointSecurityType;
54
+ /** Optional list of API key(s) to use for the endpoint of this Flow when the endpoint security type is EndpointSecurityType.Organization. */
55
+ organizationApiKeys?: string[];
56
+ /** Optional schedule configuration that defines the frequency with which this Flow will be automatically executed. */
57
+ schedule?: FlowSchedule;
58
+ /** Optional error handling configuration. */
59
+ errorConfig?: StepErrorConfig;
60
+ /** Specifies the trigger function for this Flow, which returns a payload and optional HTTP response. */
61
+ onTrigger: TriggerPerformFunction<Inputs, ConfigVarDefinitionsToResults<TConfigVars>, true, false, TriggerResult<false, TTriggerPayload>>;
62
+ /** Specifies the function to execute when an Instance of this Integration is deployed. */
63
+ onInstanceDeploy?: TriggerEventFunction<Inputs, ConfigVarDefinitionsToResults<TConfigVars>, true>;
64
+ /** Specifies the function to execute when an Instance of an Integration is deleted. */
65
+ onInstanceDelete?: TriggerEventFunction<Inputs, ConfigVarDefinitionsToResults<TConfigVars>, true>;
66
+ /** Specifies the main function for this Flow */
67
+ onExecution: ActionPerformFunction<{
68
+ onTrigger: {
69
+ type: "data";
70
+ label: string;
71
+ clean: (value: unknown) => {
72
+ results: TTriggerPayload;
73
+ };
74
+ };
75
+ }, ConfigVarDefinitionsToResults<TConfigVars>, true, false, ActionPerformReturn<false, unknown>>;
76
+ }
77
+ /** Defines attributes of a Data Source that is defined as part of a Code Native Integration. */
78
+ export declare type CodeNativeDataSource = Pick<DataSourceDefinition<Inputs, DataSourceType>, "display" | "perform" | "dataSourceType" | "detailDataSource">;
79
+ /** Common attribute shared by all types of Config Vars. */
80
+ declare type BaseConfigVar = {
81
+ /** The unique key for this Config Var. */
82
+ key: string;
83
+ /** A unique, unchanging value that is used to maintain identity for the Config Var even if the key changes. */
84
+ stableKey: string;
85
+ /** Optional description for this Config Var. */
86
+ description?: string;
87
+ /** Optional value that specifies whether this Config Var is only configurable by Organization users. @default false */
88
+ orgOnly?: boolean;
89
+ /** Optional input values for this Config Var. */
90
+ inputs?: InputValues;
91
+ /** Optional value that specifies whether this Config Var is visible to an Organization deployer. @default true */
92
+ visibleToOrgDeployer?: boolean;
93
+ /** Optional value that specifies whether this Config Var is visible to a Customer deployer. @default true */
94
+ visibleToCustomerDeployer?: boolean;
95
+ };
96
+ /** Defines attributes of a standard Config Var. */
97
+ export declare type StandardConfigVar = BaseConfigVar & {
98
+ /** Optional default value for the Config Var. */
99
+ defaultValue?: string;
100
+ /** The data type of the Config Var. */
101
+ dataType: ConfigVarDataType;
102
+ /** Optional list of picklist values if the Config Var is a multi-choice selection value. */
103
+ pickList?: string[];
104
+ /** Optional schedule type that defines the cadence of the schedule. */
105
+ scheduleType?: ScheduleType;
106
+ /** Optional value to use as a timezone if the Config Var is a schedule value. */
107
+ timeZone?: string;
108
+ /** Optional value to specify the type of language if the Config Var is a code value. */
109
+ codeLanguage?: CodeLanguageType;
110
+ /** Optional value to specify the type of collection if the Config Var is multi-value. */
111
+ collectionType?: CollectionType;
112
+ /** Optional value to specify the key of a Data Source defined in this CNI
113
+ * where the Config Var sources its values. */
114
+ dataSource?: string;
115
+ };
116
+ /** Defines attributes of a Config Var that represents a Connection. */
117
+ export declare type ConnectionConfigVar = Omit<BaseConfigVar, "description" | "inputs"> & ConnectionDefinition;
118
+ export declare type ConfigVar = StandardConfigVar | ConnectionConfigVar;
119
+ /** Defines attributes of a Config Wizard Page used when deploying an Instance of an Integration. */
120
+ export declare type ConfigPage<TConfigVars extends ConfigVarCollection = ConfigVarCollection> = {
121
+ /** The unique name for this Config Page. */
122
+ name: string;
123
+ /** Specifies an optional tagline for this Config Page. */
124
+ tagline?: string;
125
+ /** Optional value that specifies whether this Config Page is configured as
126
+ * part of User Level Configuration. @default false */
127
+ userLevelConfigured?: boolean;
128
+ /** Elements included on this Config Page. */
129
+ elements: ConfigPageElement<TConfigVars>[];
130
+ };
131
+ /** Defines attributes of Inputs for Connections, Actions, Triggers,
132
+ * Data Sources, and Config Vars. */
133
+ export declare type InputValues = Record<string, InputValue>;
134
+ export declare type InputValue = SimpleInputValue | ComplexInputValue;
135
+ export declare type SimpleInputValue = {
136
+ name?: string;
137
+ type: SimpleInputValueType;
138
+ value: string;
139
+ meta?: Record<string, unknown>;
140
+ };
141
+ export declare type ComplexInputValue = {
142
+ name?: string;
143
+ type: "complex";
144
+ value: ComplexInputValueType;
145
+ meta?: Record<string, unknown>;
146
+ };
147
+ export declare type ComplexInputValueType = (string | InputValue | ComplexInputValueType)[];
148
+ /** Defines attributes of an Element that appears on a Config Wizard Page. */
149
+ export declare type ConfigPageElement<TConfigVars extends ConfigVarCollection = ConfigVarCollection> = HTMLConfigPageElement | JSONFormConfigPageElement | ConfigVarPageElement<TConfigVars>;
150
+ declare type HTMLConfigPageElement = {
151
+ type: ConfigPageElementType.HTML;
152
+ value: string;
153
+ };
154
+ declare type JSONFormConfigPageElement = {
155
+ type: ConfigPageElementType.JSONForm;
156
+ value: string;
157
+ };
158
+ declare type ConfigVarPageElement<TConfigVars extends ConfigVarCollection = ConfigVarCollection> = {
159
+ type: ConfigPageElementType.ConfigVar;
160
+ value: keyof TConfigVars;
161
+ };
162
+ /** Defines attributes of a Preprocess Flow Configuration used by a Flow of an Integration. */
163
+ export declare type PreprocessFlowConfig = {
164
+ /** Name of the field in the data payload returned by the Preprocess Flow to use for a Flow Name. */
165
+ flowNameField: string;
166
+ /** Optional name of the field in the data payload returned by the Preprocess Flow to use for an External Customer Id. */
167
+ externalCustomerIdField?: string;
168
+ /** Optional name of the field in the data payload returned by the Preprocess Flow to use for an External Customer User Id. */
169
+ externalCustomerUserIdField?: string;
170
+ };
171
+ /** Defines attributes of a Retry Configuration used by a Flow of an Integration. */
172
+ export declare type RetryConfig = {
173
+ /** The maximum number of retry attempts. Must be between 0 and 10. */
174
+ maxAttempts: number;
175
+ /** The delay in minutes to wait between retry attempts. Must be between 0 and 60. */
176
+ delayMinutes: number;
177
+ /** Specifies whether to use exponential backoff to calculate the delay between retry attempts. */
178
+ usesExponentialBackoff: boolean;
179
+ /** Name of the field in the data payload returned by the Flow Trigger to use as a Unique Request ID for retry request cancellation. */
180
+ uniqueRequestIdField?: string;
181
+ };
182
+ /** Defines attributes of a Step Error Configuration used to determine how to handle errors during Flow step execution. */
183
+ export declare type StepErrorConfig = {
184
+ /** Defines the type of error handler. */
185
+ errorHandlerType: StepErrorHandlerType;
186
+ /** The maximum number of retry attempts. Must be between 0 and 5. */
187
+ maxAttempts?: number;
188
+ /** The delay in seconds to wait between retry attempts. Must be between 0 and 60. */
189
+ delaySeconds?: number;
190
+ /** Specifies whether to use exponential backoff to calculate the delay between retry attempts. @default false */
191
+ usesExponentialBackoff?: boolean;
192
+ /** Specifies whether to ignore the final error after the final retry attempt. @default false */
193
+ ignoreFinalError?: boolean;
194
+ };
195
+ /** Defines attributes of a Schedule that controls how often a Flow is automatically executed. */
196
+ export declare type FlowSchedule = {
197
+ /** The cron expression to use for defining an execution schedule. */
198
+ cronExpression: string;
199
+ /** Specifies an optional value to use as the timezone. */
200
+ timeZone?: string;
201
+ } | {
202
+ /** The key of the Config Var whose value will define the execution schedule. */
203
+ configVarKey: string;
204
+ /** Specifies an optional value to use as the timezone. */
205
+ timeZone?: string;
206
+ };
207
+ /** Choices of Simple Input Value Types that may be used by Simple Input Values. */
208
+ export declare enum SimpleInputValueType {
209
+ Value = "value",
210
+ Reference = "reference",
211
+ ConfigVar = "configVar",
212
+ Template = "template"
213
+ }
214
+ /** Choices of Endpoint Types that may be used by Instances of an Integration. */
215
+ export declare enum EndpointType {
216
+ FlowSpecific = "flow_specific",
217
+ InstanceSpecific = "instance_specific",
218
+ SharedInstance = "shared_instance"
219
+ }
220
+ /** Choices of Endpoint Security Types that may be used by endpoints of a Flow. */
221
+ export declare enum EndpointSecurityType {
222
+ Unsecured = "unsecured",
223
+ CustomerOptional = "customer_optional",
224
+ CustomerRequired = "customer_required",
225
+ Organization = "organization"
226
+ }
227
+ /** Choices of Config Page Element Types that may be used for Elements on a Config Wizard Page. */
228
+ export declare enum ConfigPageElementType {
229
+ ConfigVar = "configVar",
230
+ HTML = "htmlElement",
231
+ JSONForm = "jsonForm"
232
+ }
233
+ /** Choices of Step Error Handlers that define the behavior when a step error occurs. */
234
+ export declare enum StepErrorHandlerType {
235
+ Fail = "fail",
236
+ Ignore = "ignore",
237
+ Retry = "retry"
238
+ }
239
+ /** Choices for Schedules that add context for the cadence of a given schedule. */
240
+ export declare enum ScheduleType {
241
+ None = "none",
242
+ Custom = "custom",
243
+ Minute = "minute",
244
+ Hour = "hour",
245
+ Day = "day",
246
+ Week = "week"
247
+ }
248
+ /** Supported data types for Config Vars. */
249
+ export declare enum ConfigVarDataType {
250
+ String = "string",
251
+ Date = "date",
252
+ Timestamp = "timestamp",
253
+ Picklist = "picklist",
254
+ Schedule = "schedule",
255
+ Code = "code",
256
+ Boolean = "boolean",
257
+ Number = "number",
258
+ ObjectSelection = "objectSelection",
259
+ ObjectFieldMap = "objectFieldMap",
260
+ JSONForm = "jsonForm"
261
+ }
262
+ /** Choices of programming languages that may be used for Config Var code values. */
263
+ export declare enum CodeLanguageType {
264
+ JSON = "json",
265
+ XML = "xml",
266
+ HTML = "html"
267
+ }
268
+ /** Choices of collection types for multi-value Config Vars. */
269
+ export declare enum CollectionType {
270
+ ValueList = "valuelist",
271
+ KeyValueList = "keyvaluelist"
272
+ }
273
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CollectionType = exports.CodeLanguageType = exports.ConfigVarDataType = exports.ScheduleType = exports.StepErrorHandlerType = exports.ConfigPageElementType = exports.EndpointSecurityType = exports.EndpointType = exports.SimpleInputValueType = void 0;
4
+ /** Choices of Simple Input Value Types that may be used by Simple Input Values. */
5
+ var SimpleInputValueType;
6
+ (function (SimpleInputValueType) {
7
+ SimpleInputValueType["Value"] = "value";
8
+ SimpleInputValueType["Reference"] = "reference";
9
+ SimpleInputValueType["ConfigVar"] = "configVar";
10
+ SimpleInputValueType["Template"] = "template";
11
+ })(SimpleInputValueType = exports.SimpleInputValueType || (exports.SimpleInputValueType = {}));
12
+ /** Choices of Endpoint Types that may be used by Instances of an Integration. */
13
+ var EndpointType;
14
+ (function (EndpointType) {
15
+ EndpointType["FlowSpecific"] = "flow_specific";
16
+ EndpointType["InstanceSpecific"] = "instance_specific";
17
+ EndpointType["SharedInstance"] = "shared_instance";
18
+ })(EndpointType = exports.EndpointType || (exports.EndpointType = {}));
19
+ /** Choices of Endpoint Security Types that may be used by endpoints of a Flow. */
20
+ var EndpointSecurityType;
21
+ (function (EndpointSecurityType) {
22
+ EndpointSecurityType["Unsecured"] = "unsecured";
23
+ EndpointSecurityType["CustomerOptional"] = "customer_optional";
24
+ EndpointSecurityType["CustomerRequired"] = "customer_required";
25
+ EndpointSecurityType["Organization"] = "organization";
26
+ })(EndpointSecurityType = exports.EndpointSecurityType || (exports.EndpointSecurityType = {}));
27
+ /** Choices of Config Page Element Types that may be used for Elements on a Config Wizard Page. */
28
+ var ConfigPageElementType;
29
+ (function (ConfigPageElementType) {
30
+ ConfigPageElementType["ConfigVar"] = "configVar";
31
+ ConfigPageElementType["HTML"] = "htmlElement";
32
+ ConfigPageElementType["JSONForm"] = "jsonForm";
33
+ })(ConfigPageElementType = exports.ConfigPageElementType || (exports.ConfigPageElementType = {}));
34
+ /** Choices of Step Error Handlers that define the behavior when a step error occurs. */
35
+ var StepErrorHandlerType;
36
+ (function (StepErrorHandlerType) {
37
+ StepErrorHandlerType["Fail"] = "fail";
38
+ StepErrorHandlerType["Ignore"] = "ignore";
39
+ StepErrorHandlerType["Retry"] = "retry";
40
+ })(StepErrorHandlerType = exports.StepErrorHandlerType || (exports.StepErrorHandlerType = {}));
41
+ /** Choices for Schedules that add context for the cadence of a given schedule. */
42
+ var ScheduleType;
43
+ (function (ScheduleType) {
44
+ ScheduleType["None"] = "none";
45
+ ScheduleType["Custom"] = "custom";
46
+ ScheduleType["Minute"] = "minute";
47
+ ScheduleType["Hour"] = "hour";
48
+ ScheduleType["Day"] = "day";
49
+ ScheduleType["Week"] = "week";
50
+ })(ScheduleType = exports.ScheduleType || (exports.ScheduleType = {}));
51
+ /** Supported data types for Config Vars. */
52
+ var ConfigVarDataType;
53
+ (function (ConfigVarDataType) {
54
+ ConfigVarDataType["String"] = "string";
55
+ ConfigVarDataType["Date"] = "date";
56
+ ConfigVarDataType["Timestamp"] = "timestamp";
57
+ ConfigVarDataType["Picklist"] = "picklist";
58
+ ConfigVarDataType["Schedule"] = "schedule";
59
+ ConfigVarDataType["Code"] = "code";
60
+ ConfigVarDataType["Boolean"] = "boolean";
61
+ ConfigVarDataType["Number"] = "number";
62
+ ConfigVarDataType["ObjectSelection"] = "objectSelection";
63
+ ConfigVarDataType["ObjectFieldMap"] = "objectFieldMap";
64
+ ConfigVarDataType["JSONForm"] = "jsonForm";
65
+ })(ConfigVarDataType = exports.ConfigVarDataType || (exports.ConfigVarDataType = {}));
66
+ /** Choices of programming languages that may be used for Config Var code values. */
67
+ var CodeLanguageType;
68
+ (function (CodeLanguageType) {
69
+ CodeLanguageType["JSON"] = "json";
70
+ CodeLanguageType["XML"] = "xml";
71
+ CodeLanguageType["HTML"] = "html";
72
+ })(CodeLanguageType = exports.CodeLanguageType || (exports.CodeLanguageType = {}));
73
+ /** Choices of collection types for multi-value Config Vars. */
74
+ var CollectionType;
75
+ (function (CollectionType) {
76
+ CollectionType["ValueList"] = "valuelist";
77
+ CollectionType["KeyValueList"] = "keyvaluelist";
78
+ })(CollectionType = exports.CollectionType || (exports.CollectionType = {}));
@@ -1,4 +1,4 @@
1
- import { ActionDisplayDefinition, TriggerPerformFunction, TriggerEventFunction, Inputs, TriggerResult } from ".";
1
+ import { ActionDisplayDefinition, TriggerPerformFunction, TriggerEventFunction, Inputs, TriggerResult, ConfigVarResultCollection, TriggerPayload } from ".";
2
2
  declare const optionChoices: readonly ["invalid", "valid", "required"];
3
3
  export declare type TriggerOptionChoice = typeof optionChoices[number];
4
4
  export declare const TriggerOptionChoices: TriggerOptionChoice[];
@@ -6,15 +6,15 @@ export declare const TriggerOptionChoices: TriggerOptionChoice[];
6
6
  * TriggerDefinition is the type of the object that is passed in to `trigger` function to
7
7
  * define a component trigger.
8
8
  */
9
- export interface TriggerDefinition<TInputs extends Inputs, TAllowsBranching extends boolean, TResult extends TriggerResult<TAllowsBranching>> {
9
+ export interface TriggerDefinition<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, TAllowsBranching extends boolean, TResult extends TriggerResult<TAllowsBranching, TriggerPayload>> {
10
10
  /** Defines how the Trigger is displayed in the Prismatic interface. */
11
11
  display: ActionDisplayDefinition;
12
12
  /** Function to perform when this Trigger is invoked. */
13
- perform: TriggerPerformFunction<TInputs, TAllowsBranching, TResult>;
13
+ perform: TriggerPerformFunction<TInputs, TConfigVars, false, TAllowsBranching, TResult>;
14
14
  /** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deployed. */
15
- onInstanceDeploy?: TriggerEventFunction<TInputs>;
15
+ onInstanceDeploy?: TriggerEventFunction<TInputs, TConfigVars, false>;
16
16
  /** Function to execute when an Instance of an Integration with a Flow that uses this Trigger is deleted. */
17
- onInstanceDelete?: TriggerEventFunction<TInputs>;
17
+ onInstanceDelete?: TriggerEventFunction<TInputs, TConfigVars, false>;
18
18
  /** InputFields to present in the Prismatic interface for configuration of this Trigger. */
19
19
  inputs: TInputs;
20
20
  /** Specifies whether this Trigger supports executing the Integration on a recurring schedule. */
@@ -1,4 +1,4 @@
1
- import { Inputs, ActionContext, ActionInputParameters } from ".";
1
+ import { Inputs, ActionContext, ActionInputParameters, ConfigVarResultCollection } from ".";
2
2
  export declare type TriggerEventFunctionReturn = {
3
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>;
@@ -10,4 +10,4 @@ export declare type TriggerEventFunctionReturn = {
10
10
  integrationState?: Record<string, unknown>;
11
11
  };
12
12
  /** Definition of the function to execute when a Trigger Event occurs. */
13
- export declare type TriggerEventFunction<TInputs extends Inputs> = (context: ActionContext, params: ActionInputParameters<TInputs>) => Promise<void | TriggerEventFunctionReturn>;
13
+ export declare type TriggerEventFunction<TInputs extends Inputs, TConfigVars extends ConfigVarResultCollection, THasConfigVars extends boolean> = (context: ActionContext<TConfigVars, THasConfigVars>, params: ActionInputParameters<TInputs>) => Promise<void | TriggerEventFunctionReturn>;