@wix/auto_sdk_automations_trigger-provider 1.0.0
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/build/cjs/index.d.ts +3 -0
- package/build/cjs/index.js +20 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +53 -0
- package/build/cjs/index.typings.js +19 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js +9 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js +89 -0
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/cjs/src/service-plugins-error-classes.d.ts +17 -0
- package/build/cjs/src/service-plugins-error-classes.js +21 -0
- package/build/cjs/src/service-plugins-error-classes.js.map +1 -0
- package/build/cjs/src/service-plugins-types.d.ts +592 -0
- package/build/cjs/src/service-plugins-types.js +73 -0
- package/build/cjs/src/service-plugins-types.js.map +1 -0
- package/build/es/index.d.ts +3 -0
- package/build/es/index.js +4 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +53 -0
- package/build/es/index.typings.js +3 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js +6 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js +86 -0
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/es/src/service-plugins-error-classes.d.ts +17 -0
- package/build/es/src/service-plugins-error-classes.js +17 -0
- package/build/es/src/service-plugins-error-classes.js.map +1 -0
- package/build/es/src/service-plugins-types.d.ts +592 -0
- package/build/es/src/service-plugins-types.js +70 -0
- package/build/es/src/service-plugins-types.js.map +1 -0
- package/build/internal/cjs/index.d.ts +3 -0
- package/build/internal/cjs/index.js +20 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +53 -0
- package/build/internal/cjs/index.typings.js +19 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js +9 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js +89 -0
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-error-classes.d.ts +17 -0
- package/build/internal/cjs/src/service-plugins-error-classes.js +21 -0
- package/build/internal/cjs/src/service-plugins-error-classes.js.map +1 -0
- package/build/internal/cjs/src/service-plugins-types.d.ts +592 -0
- package/build/internal/cjs/src/service-plugins-types.js +73 -0
- package/build/internal/cjs/src/service-plugins-types.js.map +1 -0
- package/build/internal/es/index.d.ts +3 -0
- package/build/internal/es/index.js +4 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +53 -0
- package/build/internal/es/index.typings.js +3 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +5 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js +6 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js.map +1 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +70 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js +86 -0
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js.map +1 -0
- package/build/internal/es/src/service-plugins-error-classes.d.ts +17 -0
- package/build/internal/es/src/service-plugins-error-classes.js +17 -0
- package/build/internal/es/src/service-plugins-error-classes.js.map +1 -0
- package/build/internal/es/src/service-plugins-types.d.ts +592 -0
- package/build/internal/es/src/service-plugins-types.js +70 -0
- package/build/internal/es/src/service-plugins-types.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
export interface ValidateConfigurationRequest {
|
|
2
|
+
/** Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. */
|
|
3
|
+
triggerKey: string;
|
|
4
|
+
/** Current selection state of the trigger's filters. */
|
|
5
|
+
selectedFilterOptions?: SelectedFilterOptions[];
|
|
6
|
+
/** Trigger configuration mapping that's saved on the automation. */
|
|
7
|
+
automationConfigMapping?: Record<string, any> | null;
|
|
8
|
+
}
|
|
9
|
+
export interface SelectedFilterOptions {
|
|
10
|
+
/** Key representing a field from the trigger's [payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema) that has been configured as an [item selection filter](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields#item-selection). For example `formId`. */
|
|
11
|
+
fieldKey?: string;
|
|
12
|
+
/** Values selected for the filter field. */
|
|
13
|
+
values?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface ValidateConfigurationResponse {
|
|
16
|
+
/** Whether the trigger configuration is valid. */
|
|
17
|
+
valid?: boolean;
|
|
18
|
+
/** Error details for an invalid trigger configuration. */
|
|
19
|
+
configurationErrors?: ProviderConfigurationError[];
|
|
20
|
+
}
|
|
21
|
+
export interface ProviderConfigurationError {
|
|
22
|
+
/** Key corresponding to the field in the schema. */
|
|
23
|
+
fieldKey?: string | null;
|
|
24
|
+
/** Error message. */
|
|
25
|
+
message?: string;
|
|
26
|
+
/** Label for a call-to-action button that's displayed with the error. Translated according to the SPI language context. */
|
|
27
|
+
ctaLabel?: string | null;
|
|
28
|
+
/** URL to redirect to when the call-to-action button is clicked. */
|
|
29
|
+
ctaUrl?: string | null;
|
|
30
|
+
/** Title for the error. */
|
|
31
|
+
title?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface GetDynamicSchemaRequest {
|
|
34
|
+
/** Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. */
|
|
35
|
+
triggerKey: string;
|
|
36
|
+
/** Current selection state of the trigger's filters. */
|
|
37
|
+
selectedFilterOptions?: SelectedFilterOptions[];
|
|
38
|
+
}
|
|
39
|
+
export interface GetDynamicSchemaResponse {
|
|
40
|
+
/** A [JSON schema](https://json-schema.org/) corresponding to the filter selection sent in the request. */
|
|
41
|
+
dynamicSchema?: Record<string, any> | null;
|
|
42
|
+
}
|
|
43
|
+
export interface RefreshPayloadRequest {
|
|
44
|
+
/** Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`. */
|
|
45
|
+
triggerKey?: string;
|
|
46
|
+
/** ID of the related resource in GUID format. */
|
|
47
|
+
externalEntityId?: string | null;
|
|
48
|
+
/** Payload to update. */
|
|
49
|
+
payload: Record<string, any> | null;
|
|
50
|
+
}
|
|
51
|
+
export interface RefreshPayloadResponse {
|
|
52
|
+
/** Updated payload. */
|
|
53
|
+
payload?: Record<string, any> | null;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the automation activation should be canceled.
|
|
56
|
+
*
|
|
57
|
+
* Default: `false`.
|
|
58
|
+
*/
|
|
59
|
+
cancelActivation?: boolean | null;
|
|
60
|
+
}
|
|
61
|
+
export interface OnAutomationSavedRequest {
|
|
62
|
+
/** Saved automation. */
|
|
63
|
+
automation: Automation;
|
|
64
|
+
}
|
|
65
|
+
export interface Automation extends AutomationOriginInfoOneOf {
|
|
66
|
+
/** Application info */
|
|
67
|
+
applicationInfo?: ApplicationOrigin;
|
|
68
|
+
/** Preinstalled info */
|
|
69
|
+
preinstalledInfo?: PreinstalledOrigin;
|
|
70
|
+
/**
|
|
71
|
+
* Automation ID.
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
74
|
+
_id?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Revision number, which increments by 1 each time the automation is updated.
|
|
77
|
+
* To prevent conflicting changes,
|
|
78
|
+
* the current revision must be passed when updating the automation.
|
|
79
|
+
*
|
|
80
|
+
* Ignored when creating an automation.
|
|
81
|
+
* @readonly
|
|
82
|
+
*/
|
|
83
|
+
revision?: string | null;
|
|
84
|
+
/**
|
|
85
|
+
* Information about the creator of the automation.
|
|
86
|
+
* @readonly
|
|
87
|
+
*/
|
|
88
|
+
createdBy?: AuditInfo;
|
|
89
|
+
/**
|
|
90
|
+
* Date and time the automation was created.
|
|
91
|
+
* @readonly
|
|
92
|
+
*/
|
|
93
|
+
_createdDate?: Date | null;
|
|
94
|
+
/**
|
|
95
|
+
* The entity that last updated the automation.
|
|
96
|
+
* @readonly
|
|
97
|
+
*/
|
|
98
|
+
updatedBy?: AuditInfo;
|
|
99
|
+
/**
|
|
100
|
+
* Date and time the automation was last updated.
|
|
101
|
+
* @readonly
|
|
102
|
+
*/
|
|
103
|
+
_updatedDate?: Date | null;
|
|
104
|
+
/** Automation name that is displayed on the user's site. */
|
|
105
|
+
name?: string;
|
|
106
|
+
/** Automation description. */
|
|
107
|
+
description?: string | null;
|
|
108
|
+
/** Object that defines the automation's trigger, actions, and activation status. */
|
|
109
|
+
configuration?: AutomationConfiguration;
|
|
110
|
+
/** Defines how the automation was added to the site. */
|
|
111
|
+
origin?: Origin;
|
|
112
|
+
/** Automation settings. */
|
|
113
|
+
settings?: AutomationSettings;
|
|
114
|
+
/**
|
|
115
|
+
* Draft info (optional - only if the automation is a draft)
|
|
116
|
+
* @readonly
|
|
117
|
+
*/
|
|
118
|
+
draftInfo?: DraftInfo;
|
|
119
|
+
/** Namespace */
|
|
120
|
+
namespace?: string | null;
|
|
121
|
+
/** Extended Fields */
|
|
122
|
+
extendedFields?: ExtendedFields;
|
|
123
|
+
}
|
|
124
|
+
/** @oneof */
|
|
125
|
+
export interface AutomationOriginInfoOneOf {
|
|
126
|
+
/** Application info */
|
|
127
|
+
applicationInfo?: ApplicationOrigin;
|
|
128
|
+
/** Preinstalled info */
|
|
129
|
+
preinstalledInfo?: PreinstalledOrigin;
|
|
130
|
+
}
|
|
131
|
+
export interface ActionSettings {
|
|
132
|
+
/**
|
|
133
|
+
* List of actions that cannot be deleted.
|
|
134
|
+
* Default: Empty. All actions are deletable by default.
|
|
135
|
+
*/
|
|
136
|
+
permanentActionIds?: string[];
|
|
137
|
+
/**
|
|
138
|
+
* List of actions that cannot be edited.
|
|
139
|
+
* Default: Empty. All actions are editable by default.
|
|
140
|
+
*/
|
|
141
|
+
readonlyActionIds?: string[];
|
|
142
|
+
/** Whether the option to add a delay is disabled for the automation. */
|
|
143
|
+
disableDelayAddition?: boolean;
|
|
144
|
+
/** Whether the option to add a condition is disabled for the automation. */
|
|
145
|
+
disableConditionAddition?: boolean;
|
|
146
|
+
}
|
|
147
|
+
export declare enum Domain {
|
|
148
|
+
/** User domain (default). */
|
|
149
|
+
USER = "USER",
|
|
150
|
+
/** Wix domain. */
|
|
151
|
+
WIX = "WIX"
|
|
152
|
+
}
|
|
153
|
+
export interface Enrichment {
|
|
154
|
+
/** Enrichment input mappings. */
|
|
155
|
+
inputMappings?: Record<string, any>[] | null;
|
|
156
|
+
}
|
|
157
|
+
export interface AuditInfo extends AuditInfoIdOneOf {
|
|
158
|
+
/** User ID. */
|
|
159
|
+
userId?: string;
|
|
160
|
+
/** Application ID. */
|
|
161
|
+
appId?: string;
|
|
162
|
+
}
|
|
163
|
+
/** @oneof */
|
|
164
|
+
export interface AuditInfoIdOneOf {
|
|
165
|
+
/** User ID. */
|
|
166
|
+
userId?: string;
|
|
167
|
+
/** Application ID. */
|
|
168
|
+
appId?: string;
|
|
169
|
+
}
|
|
170
|
+
/** Automation runtime configuration */
|
|
171
|
+
export interface AutomationConfiguration {
|
|
172
|
+
/** Status of the automation on the site. */
|
|
173
|
+
status?: Status;
|
|
174
|
+
/** Automation trigger configuration. */
|
|
175
|
+
trigger?: Trigger;
|
|
176
|
+
/** List of IDs of root actions. Root actions are the first actions to run after the trigger. The actions in the list run in parallel. */
|
|
177
|
+
rootActionIds?: string[];
|
|
178
|
+
/**
|
|
179
|
+
* Map of all actions that the automation may execute.
|
|
180
|
+
* The key is the action ID, and the value is the action configuration.
|
|
181
|
+
*/
|
|
182
|
+
actions?: Record<string, Action>;
|
|
183
|
+
}
|
|
184
|
+
export declare enum TimeUnit {
|
|
185
|
+
UNKNOWN_TIME_UNIT = "UNKNOWN_TIME_UNIT",
|
|
186
|
+
MINUTES = "MINUTES",
|
|
187
|
+
HOURS = "HOURS",
|
|
188
|
+
DAYS = "DAYS",
|
|
189
|
+
WEEKS = "WEEKS",
|
|
190
|
+
MONTHS = "MONTHS"
|
|
191
|
+
}
|
|
192
|
+
export interface Filter {
|
|
193
|
+
/** Filter ID. */
|
|
194
|
+
_id?: string;
|
|
195
|
+
/** Field key from the payload schema, for example "formId". */
|
|
196
|
+
fieldKey?: string;
|
|
197
|
+
/** Filter expression that evaluates to a boolean. */
|
|
198
|
+
filterExpression?: string;
|
|
199
|
+
}
|
|
200
|
+
export interface FutureDateActivationOffset {
|
|
201
|
+
/**
|
|
202
|
+
* The offset value. The value is always taken as negative, so that the automation runs before the trigger date.
|
|
203
|
+
* To create an offset that causes the automation to run after the trigger date, use a delay action.
|
|
204
|
+
*/
|
|
205
|
+
preScheduledEventOffsetExpression?: string;
|
|
206
|
+
/** Time unit for the scheduled event offset. */
|
|
207
|
+
scheduledEventOffsetTimeUnit?: TimeUnit;
|
|
208
|
+
}
|
|
209
|
+
export interface RateLimit {
|
|
210
|
+
/** Value expressing the maximum number of times the trigger can be activated. */
|
|
211
|
+
maxActivationsExpression?: string;
|
|
212
|
+
/** Duration of the rate limiting window in the selected time unit. If no value is set, the rate limit is permanent. */
|
|
213
|
+
durationExpression?: string | null;
|
|
214
|
+
/** Time unit for the rate limit duration. */
|
|
215
|
+
durationTimeUnit?: TimeUnit;
|
|
216
|
+
/** Unique identifier of each activation, by which rate limiter will count activations. */
|
|
217
|
+
uniqueIdentifierExpression?: string | null;
|
|
218
|
+
}
|
|
219
|
+
export interface ConditionExpressionGroup {
|
|
220
|
+
/** Expression group operator. */
|
|
221
|
+
operator?: Operator;
|
|
222
|
+
/** List of boolean expressions to be evaluated with the given operator. */
|
|
223
|
+
booleanExpressions?: string[];
|
|
224
|
+
}
|
|
225
|
+
export declare enum Operator {
|
|
226
|
+
UNKNOWN_OPERATOR = "UNKNOWN_OPERATOR",
|
|
227
|
+
OR = "OR",
|
|
228
|
+
AND = "AND"
|
|
229
|
+
}
|
|
230
|
+
export declare enum Type {
|
|
231
|
+
/** Automation will be triggered according to the trigger configuration. */
|
|
232
|
+
UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
|
|
233
|
+
/** App defined Action. */
|
|
234
|
+
APP_DEFINED = "APP_DEFINED",
|
|
235
|
+
/** Condition Action. */
|
|
236
|
+
CONDITION = "CONDITION",
|
|
237
|
+
/** Delay Action. */
|
|
238
|
+
DELAY = "DELAY",
|
|
239
|
+
/** RateLimit Action. */
|
|
240
|
+
RATE_LIMIT = "RATE_LIMIT",
|
|
241
|
+
/** Set Variables Action. */
|
|
242
|
+
SET_VARIABLES = "SET_VARIABLES",
|
|
243
|
+
/** Output Action. */
|
|
244
|
+
OUTPUT = "OUTPUT"
|
|
245
|
+
}
|
|
246
|
+
export interface AppDefinedAction {
|
|
247
|
+
/** ID of the app that defines the action. */
|
|
248
|
+
appId?: string;
|
|
249
|
+
/** Action key. */
|
|
250
|
+
actionKey?: string;
|
|
251
|
+
/** Action input mapping. */
|
|
252
|
+
inputMapping?: Record<string, any> | null;
|
|
253
|
+
/**
|
|
254
|
+
* Array of conditions determining whether to skip the action in the automation flow.
|
|
255
|
+
* The action will be skipped if any of the expression groups evaluate to `true`.
|
|
256
|
+
* Actions following a skipped action will still run.
|
|
257
|
+
*/
|
|
258
|
+
skipConditionOrExpressionGroups?: ConditionExpressionGroup[];
|
|
259
|
+
/** List of IDs of actions to run in parallel once the action completes. */
|
|
260
|
+
postActionIds?: string[];
|
|
261
|
+
/** Optional output schema of the action. It will be used instead the action schema in case it's provided. */
|
|
262
|
+
overrideOutputSchema?: Record<string, any> | null;
|
|
263
|
+
}
|
|
264
|
+
export interface ConditionAction {
|
|
265
|
+
/** The condition evaluates to `true` if either of the expression groups evaluate to `true`. */
|
|
266
|
+
orExpressionGroups?: ConditionExpressionGroup[];
|
|
267
|
+
/** List of IDs of actions to run when the entire condition is evaluated to `true`. */
|
|
268
|
+
truePostActionIds?: string[];
|
|
269
|
+
/** List of IDs of actions to run when the entire condition is evaluated to `false`. */
|
|
270
|
+
falsePostActionIds?: string[];
|
|
271
|
+
}
|
|
272
|
+
export interface DelayAction {
|
|
273
|
+
/** Value expressing the amount of time to wait from a specific date or from the time the action is executed. */
|
|
274
|
+
offsetExpression?: string | null;
|
|
275
|
+
/** Time unit for delay offset. */
|
|
276
|
+
offsetTimeUnit?: TimeUnit;
|
|
277
|
+
/**
|
|
278
|
+
* The action due date. If defined without an offset, the automation will wait until this date to execute the next step.
|
|
279
|
+
* If an offset is defined, it's calculated from this date.
|
|
280
|
+
* The date is expressed in the number of milliseconds since the Unix Epoch (1 January, 1970 UTC).
|
|
281
|
+
*/
|
|
282
|
+
dueDateEpochExpression?: string | null;
|
|
283
|
+
/** List of IDs of actions to run in parallel after the delay. */
|
|
284
|
+
postActionIds?: string[];
|
|
285
|
+
}
|
|
286
|
+
export interface RateLimitAction {
|
|
287
|
+
/** The maximum number of activations allowed for the action. */
|
|
288
|
+
maxActivationsExpression?: string;
|
|
289
|
+
/**
|
|
290
|
+
* Duration of the rate limiting window, expressed in selected time unit.
|
|
291
|
+
* If no value is set, then there is no time limit on the rate limiter.
|
|
292
|
+
*/
|
|
293
|
+
rateLimitDurationExpression?: string | null;
|
|
294
|
+
/** Time unit for the rate limit duration. */
|
|
295
|
+
rateLimitDurationTimeUnit?: TimeUnit;
|
|
296
|
+
/** Unique identifier of each activation by which rate limiter counts activations. */
|
|
297
|
+
uniqueIdentifierExpression?: string | null;
|
|
298
|
+
/** List of IDs of actions to run in parallel once the action completes. */
|
|
299
|
+
postActionIds?: string[];
|
|
300
|
+
}
|
|
301
|
+
export interface SetVariablesAction {
|
|
302
|
+
/**
|
|
303
|
+
* output mapping
|
|
304
|
+
* for example: {"someField": "{{10}}", "someOtherField": "{{multiply( var('account.points.balance') ;2 )}}" }
|
|
305
|
+
*/
|
|
306
|
+
outputMapping?: Record<string, any> | null;
|
|
307
|
+
/**
|
|
308
|
+
* output json schema representation
|
|
309
|
+
* could be string instead of Struct (and introduce some compression to minimize the size of it)
|
|
310
|
+
*/
|
|
311
|
+
outputSchema?: Record<string, any> | null;
|
|
312
|
+
/** List of IDs of actions to run in parallel after variable initialization. */
|
|
313
|
+
postActionIds?: string[];
|
|
314
|
+
}
|
|
315
|
+
export interface OutputAction {
|
|
316
|
+
/** Output action output mapping. */
|
|
317
|
+
outputMapping?: Record<string, any> | null;
|
|
318
|
+
}
|
|
319
|
+
export declare enum Status {
|
|
320
|
+
/** unused */
|
|
321
|
+
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
322
|
+
/** Automation will be triggered according to the trigger configuration */
|
|
323
|
+
ACTIVE = "ACTIVE",
|
|
324
|
+
/** Automation will not be triggered */
|
|
325
|
+
INACTIVE = "INACTIVE"
|
|
326
|
+
}
|
|
327
|
+
export interface Trigger {
|
|
328
|
+
/** ID of the app that defines the trigger. */
|
|
329
|
+
appId?: string;
|
|
330
|
+
/** Trigger key. */
|
|
331
|
+
triggerKey?: string;
|
|
332
|
+
/**
|
|
333
|
+
* List of filters on schema fields.
|
|
334
|
+
* In order for the automation to run, all filter expressions must evaluate to `true` for a given payload.
|
|
335
|
+
*/
|
|
336
|
+
filters?: Filter[];
|
|
337
|
+
/** Defines the time offset between the trigger date and when the automation runs. */
|
|
338
|
+
scheduledEventOffset?: FutureDateActivationOffset;
|
|
339
|
+
/** Limits the number of times an automation can be triggered. */
|
|
340
|
+
rateLimit?: RateLimit;
|
|
341
|
+
/**
|
|
342
|
+
* An optional configuration, per automation, of a schema that is optionally offered by the trigger provider to affect the behavior of the trigger.
|
|
343
|
+
* For example, a trigger provider may offer a schema that allows the user to configure the trigger to happen at a certain time of day,
|
|
344
|
+
* He would define a schema with a field called "startDate" and using this parameter the user can define his preferred startDate, per automation.
|
|
345
|
+
*/
|
|
346
|
+
automationConfigMapping?: Record<string, any> | null;
|
|
347
|
+
/** Optional schema of the trigger. It will be used instead the trigger schema in case it's provided. */
|
|
348
|
+
overrideSchema?: Record<string, any> | null;
|
|
349
|
+
}
|
|
350
|
+
export interface Action extends ActionInfoOneOf {
|
|
351
|
+
/** Action defined by an app (via RPC, HTTP or Velo). */
|
|
352
|
+
appDefinedInfo?: AppDefinedAction;
|
|
353
|
+
/** Condition action. */
|
|
354
|
+
conditionInfo?: ConditionAction;
|
|
355
|
+
/** Delay action. */
|
|
356
|
+
delayInfo?: DelayAction;
|
|
357
|
+
/** Rate-limiting action. */
|
|
358
|
+
rateLimitInfo?: RateLimitAction;
|
|
359
|
+
/** Action ID. If not specified, a new ID is generated. */
|
|
360
|
+
_id?: string | null;
|
|
361
|
+
/** Action type. */
|
|
362
|
+
type?: Type;
|
|
363
|
+
/**
|
|
364
|
+
* Human-readable name to differentiate the action from other actions of the same type.
|
|
365
|
+
* The name can contain only alphanumeric characters and underscores. If not provided, a namespace in the form `actionkey-indexOfAction` is
|
|
366
|
+
* generated automatically.
|
|
367
|
+
* If the action has output, the output will be available in the payload under this name.
|
|
368
|
+
* If the user has multiple actions with the same appId and actionKey, previous action output will be overwritten.
|
|
369
|
+
*/
|
|
370
|
+
namespace?: string | null;
|
|
371
|
+
}
|
|
372
|
+
/** @oneof */
|
|
373
|
+
export interface ActionInfoOneOf {
|
|
374
|
+
/** Action defined by an app (via RPC, HTTP or Velo). */
|
|
375
|
+
appDefinedInfo?: AppDefinedAction;
|
|
376
|
+
/** Condition action. */
|
|
377
|
+
conditionInfo?: ConditionAction;
|
|
378
|
+
/** Delay action. */
|
|
379
|
+
delayInfo?: DelayAction;
|
|
380
|
+
/** Rate-limiting action. */
|
|
381
|
+
rateLimitInfo?: RateLimitAction;
|
|
382
|
+
}
|
|
383
|
+
export declare enum Origin {
|
|
384
|
+
/** Default value. This is unused. */
|
|
385
|
+
UNKNOWN_ORIGIN = "UNKNOWN_ORIGIN",
|
|
386
|
+
/** User created automation. */
|
|
387
|
+
USER = "USER",
|
|
388
|
+
/** Automation created by application (site specific). */
|
|
389
|
+
APPLICATION = "APPLICATION",
|
|
390
|
+
/** Preinstalled application automation. */
|
|
391
|
+
PREINSTALLED = "PREINSTALLED",
|
|
392
|
+
/** Automation created from a recipe. */
|
|
393
|
+
RECIPE = "RECIPE"
|
|
394
|
+
}
|
|
395
|
+
export interface ApplicationOrigin {
|
|
396
|
+
/** Application ID. */
|
|
397
|
+
appId?: string;
|
|
398
|
+
}
|
|
399
|
+
export interface PreinstalledOrigin {
|
|
400
|
+
/** ID of the app that defines the preinstalled automation. */
|
|
401
|
+
appId?: string;
|
|
402
|
+
/** Application component ID. */
|
|
403
|
+
componentId?: string;
|
|
404
|
+
/** Application component version. */
|
|
405
|
+
componentVersion?: number;
|
|
406
|
+
/**
|
|
407
|
+
* Whether the automation is an override automation. If the user modifies the preinstalled automation installed on their site, a site-specific
|
|
408
|
+
* automation is created that overrides the original one. If the user makes no modifications this boolean is set to `false` and the original
|
|
409
|
+
* preinstalled automation is used.
|
|
410
|
+
*
|
|
411
|
+
* Default: `false`
|
|
412
|
+
* @readonly
|
|
413
|
+
*/
|
|
414
|
+
override?: boolean | null;
|
|
415
|
+
}
|
|
416
|
+
export interface AutomationSettings {
|
|
417
|
+
/**
|
|
418
|
+
* Whether the automation is hidden from users.
|
|
419
|
+
* Default: `false`
|
|
420
|
+
*/
|
|
421
|
+
hidden?: boolean;
|
|
422
|
+
/**
|
|
423
|
+
* Whether the automation is read-only.
|
|
424
|
+
* Default: `false`
|
|
425
|
+
*/
|
|
426
|
+
readonly?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Whether the option to delete the automation from the site is disabled.
|
|
429
|
+
* Default: `false`
|
|
430
|
+
*/
|
|
431
|
+
disableDelete?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Whether the option to change the automation status (from active to inactive and vice versa) is disabled.
|
|
434
|
+
* Default: `false`
|
|
435
|
+
*/
|
|
436
|
+
disableStatusChange?: boolean;
|
|
437
|
+
/** Automation action settings. */
|
|
438
|
+
actionSettings?: ActionSettings;
|
|
439
|
+
}
|
|
440
|
+
export interface DraftInfo {
|
|
441
|
+
/**
|
|
442
|
+
* Optional - automationId of the original automation.
|
|
443
|
+
* @readonly
|
|
444
|
+
*/
|
|
445
|
+
originalAutomationId?: string | null;
|
|
446
|
+
}
|
|
447
|
+
export interface Enrichments {
|
|
448
|
+
/** Whether the studio site enrichment is wanted. */
|
|
449
|
+
studioSite?: Enrichment;
|
|
450
|
+
}
|
|
451
|
+
export interface ExtendedFields {
|
|
452
|
+
/**
|
|
453
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
454
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
455
|
+
*
|
|
456
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
457
|
+
*
|
|
458
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
459
|
+
*/
|
|
460
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
461
|
+
}
|
|
462
|
+
export interface OnAutomationSavedResponse {
|
|
463
|
+
}
|
|
464
|
+
export interface OnAutomationDeletedRequest {
|
|
465
|
+
/** ID of the deleted automation. */
|
|
466
|
+
automationId: string;
|
|
467
|
+
}
|
|
468
|
+
export interface OnAutomationDeletedResponse {
|
|
469
|
+
}
|
|
470
|
+
export interface TriggerProviderSPIConfig {
|
|
471
|
+
/**
|
|
472
|
+
* The trigger configuration
|
|
473
|
+
*
|
|
474
|
+
* example of a trigger:
|
|
475
|
+
*
|
|
476
|
+
* {
|
|
477
|
+
* appId: "56cc7843-fdfc-417f-a660-d4af9a2eafe3",
|
|
478
|
+
* triggerKey: "form_submit",
|
|
479
|
+
* displayName: "Visitor submits a form",
|
|
480
|
+
* payloadDataSchema: {
|
|
481
|
+
* "$schema": "http://json-schema.org/draft-07/schema",
|
|
482
|
+
* "type": "object",
|
|
483
|
+
* "title": "Visitor submits a form Payload Schema",
|
|
484
|
+
* "description": "The schema of the payload that is part of the triggered event",
|
|
485
|
+
* "default": {},
|
|
486
|
+
* "examples": [
|
|
487
|
+
* {
|
|
488
|
+
* "formId": "60d2cd50-1047-4164-884d-8c24fbda84bb",
|
|
489
|
+
* "formName": "My Cool Form
|
|
490
|
+
* }
|
|
491
|
+
* ],
|
|
492
|
+
* "properties": {
|
|
493
|
+
* "formId": {
|
|
494
|
+
* "$id": "#/properties/formId",
|
|
495
|
+
* "type": "string",
|
|
496
|
+
* "format": "uuid",
|
|
497
|
+
* "title": "Form ID",
|
|
498
|
+
* "description": "The form identifier",
|
|
499
|
+
* "default": "",
|
|
500
|
+
* "examples": [
|
|
501
|
+
* "60d2cd50-1047-4164-884d-8c24fbda84bb"
|
|
502
|
+
* ]
|
|
503
|
+
* },
|
|
504
|
+
* "formName": {
|
|
505
|
+
* "$id": "#/properties/formName",
|
|
506
|
+
* "type": "string",
|
|
507
|
+
* "title": "Form Name",
|
|
508
|
+
* "description": "The form display name",
|
|
509
|
+
* "default": "",
|
|
510
|
+
* "examples": [
|
|
511
|
+
* "My Form"
|
|
512
|
+
* ]
|
|
513
|
+
* },
|
|
514
|
+
* "contactId": {
|
|
515
|
+
* "$id": "#/properties/contactId",
|
|
516
|
+
* "type": "string",
|
|
517
|
+
* "format": "uuid",
|
|
518
|
+
* "title": "Contact Id",
|
|
519
|
+
* "description": "The Id of the contact which submitted the form",
|
|
520
|
+
* "default": "",
|
|
521
|
+
* "identityType": "contact", // can be contact, visitor, user limited to 1 type per identity,
|
|
522
|
+
* "namespace": "contact" // friendly name to be used later on, in order to user that person's data "contact.firstName"
|
|
523
|
+
* }
|
|
524
|
+
* },
|
|
525
|
+
* "required": [
|
|
526
|
+
* "formId",
|
|
527
|
+
* "formName",
|
|
528
|
+
* "contactId"
|
|
529
|
+
* ],
|
|
530
|
+
* "additionalProperties": false
|
|
531
|
+
* }
|
|
532
|
+
* }
|
|
533
|
+
*/
|
|
534
|
+
triggerConfig?: Record<string, any> | null;
|
|
535
|
+
/** URL to the trigger provider service */
|
|
536
|
+
baseUri?: string;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* this message is not directly used by any service,
|
|
540
|
+
* it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
|
|
541
|
+
* e.g. SPIs, event-handlers, etc..
|
|
542
|
+
* NOTE: this context object MUST be provided as the last argument in each Velo method signature.
|
|
543
|
+
*
|
|
544
|
+
* Example:
|
|
545
|
+
* ```typescript
|
|
546
|
+
* export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
|
|
547
|
+
* ...
|
|
548
|
+
* }
|
|
549
|
+
* ```
|
|
550
|
+
*/
|
|
551
|
+
export interface Context {
|
|
552
|
+
/** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */
|
|
553
|
+
requestId?: string | null;
|
|
554
|
+
/** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
|
|
555
|
+
currency?: string | null;
|
|
556
|
+
/** An object that describes the identity that triggered this request. */
|
|
557
|
+
identity?: IdentificationData;
|
|
558
|
+
/** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */
|
|
559
|
+
languages?: string[];
|
|
560
|
+
/** The service provider app's instance ID. */
|
|
561
|
+
instanceId?: string | null;
|
|
562
|
+
}
|
|
563
|
+
export declare enum IdentityType {
|
|
564
|
+
UNKNOWN = "UNKNOWN",
|
|
565
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
566
|
+
MEMBER = "MEMBER",
|
|
567
|
+
WIX_USER = "WIX_USER",
|
|
568
|
+
APP = "APP"
|
|
569
|
+
}
|
|
570
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
571
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
572
|
+
anonymousVisitorId?: string;
|
|
573
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
574
|
+
memberId?: string;
|
|
575
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
576
|
+
wixUserId?: string;
|
|
577
|
+
/** ID of an app. */
|
|
578
|
+
appId?: string;
|
|
579
|
+
/** @readonly */
|
|
580
|
+
identityType?: IdentityType;
|
|
581
|
+
}
|
|
582
|
+
/** @oneof */
|
|
583
|
+
export interface IdentificationDataIdOneOf {
|
|
584
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
585
|
+
anonymousVisitorId?: string;
|
|
586
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
587
|
+
memberId?: string;
|
|
588
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
589
|
+
wixUserId?: string;
|
|
590
|
+
/** ID of an app. */
|
|
591
|
+
appId?: string;
|
|
592
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export var Domain;
|
|
2
|
+
(function (Domain) {
|
|
3
|
+
/** User domain (default). */
|
|
4
|
+
Domain["USER"] = "USER";
|
|
5
|
+
/** Wix domain. */
|
|
6
|
+
Domain["WIX"] = "WIX";
|
|
7
|
+
})(Domain || (Domain = {}));
|
|
8
|
+
export var TimeUnit;
|
|
9
|
+
(function (TimeUnit) {
|
|
10
|
+
TimeUnit["UNKNOWN_TIME_UNIT"] = "UNKNOWN_TIME_UNIT";
|
|
11
|
+
TimeUnit["MINUTES"] = "MINUTES";
|
|
12
|
+
TimeUnit["HOURS"] = "HOURS";
|
|
13
|
+
TimeUnit["DAYS"] = "DAYS";
|
|
14
|
+
TimeUnit["WEEKS"] = "WEEKS";
|
|
15
|
+
TimeUnit["MONTHS"] = "MONTHS";
|
|
16
|
+
})(TimeUnit || (TimeUnit = {}));
|
|
17
|
+
export var Operator;
|
|
18
|
+
(function (Operator) {
|
|
19
|
+
Operator["UNKNOWN_OPERATOR"] = "UNKNOWN_OPERATOR";
|
|
20
|
+
Operator["OR"] = "OR";
|
|
21
|
+
Operator["AND"] = "AND";
|
|
22
|
+
})(Operator || (Operator = {}));
|
|
23
|
+
export var Type;
|
|
24
|
+
(function (Type) {
|
|
25
|
+
/** Automation will be triggered according to the trigger configuration. */
|
|
26
|
+
Type["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
|
|
27
|
+
/** App defined Action. */
|
|
28
|
+
Type["APP_DEFINED"] = "APP_DEFINED";
|
|
29
|
+
/** Condition Action. */
|
|
30
|
+
Type["CONDITION"] = "CONDITION";
|
|
31
|
+
/** Delay Action. */
|
|
32
|
+
Type["DELAY"] = "DELAY";
|
|
33
|
+
/** RateLimit Action. */
|
|
34
|
+
Type["RATE_LIMIT"] = "RATE_LIMIT";
|
|
35
|
+
/** Set Variables Action. */
|
|
36
|
+
Type["SET_VARIABLES"] = "SET_VARIABLES";
|
|
37
|
+
/** Output Action. */
|
|
38
|
+
Type["OUTPUT"] = "OUTPUT";
|
|
39
|
+
})(Type || (Type = {}));
|
|
40
|
+
export var Status;
|
|
41
|
+
(function (Status) {
|
|
42
|
+
/** unused */
|
|
43
|
+
Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
44
|
+
/** Automation will be triggered according to the trigger configuration */
|
|
45
|
+
Status["ACTIVE"] = "ACTIVE";
|
|
46
|
+
/** Automation will not be triggered */
|
|
47
|
+
Status["INACTIVE"] = "INACTIVE";
|
|
48
|
+
})(Status || (Status = {}));
|
|
49
|
+
export var Origin;
|
|
50
|
+
(function (Origin) {
|
|
51
|
+
/** Default value. This is unused. */
|
|
52
|
+
Origin["UNKNOWN_ORIGIN"] = "UNKNOWN_ORIGIN";
|
|
53
|
+
/** User created automation. */
|
|
54
|
+
Origin["USER"] = "USER";
|
|
55
|
+
/** Automation created by application (site specific). */
|
|
56
|
+
Origin["APPLICATION"] = "APPLICATION";
|
|
57
|
+
/** Preinstalled application automation. */
|
|
58
|
+
Origin["PREINSTALLED"] = "PREINSTALLED";
|
|
59
|
+
/** Automation created from a recipe. */
|
|
60
|
+
Origin["RECIPE"] = "RECIPE";
|
|
61
|
+
})(Origin || (Origin = {}));
|
|
62
|
+
export var IdentityType;
|
|
63
|
+
(function (IdentityType) {
|
|
64
|
+
IdentityType["UNKNOWN"] = "UNKNOWN";
|
|
65
|
+
IdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
66
|
+
IdentityType["MEMBER"] = "MEMBER";
|
|
67
|
+
IdentityType["WIX_USER"] = "WIX_USER";
|
|
68
|
+
IdentityType["APP"] = "APP";
|
|
69
|
+
})(IdentityType || (IdentityType = {}));
|
|
70
|
+
//# sourceMappingURL=service-plugins-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../src/service-plugins-types.ts"],"names":[],"mappings":"AA8JA,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,6BAA6B;IAC7B,uBAAa,CAAA;IACb,kBAAkB;IAClB,qBAAW,CAAA;AACb,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAqCD,MAAM,CAAN,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,mDAAuC,CAAA;IACvC,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,6BAAiB,CAAA;AACnB,CAAC,EAPW,QAAQ,KAAR,QAAQ,QAOnB;AAuCD,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,iDAAqC,CAAA;IACrC,qBAAS,CAAA;IACT,uBAAW,CAAA;AACb,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED,MAAM,CAAN,IAAY,IAeX;AAfD,WAAY,IAAI;IACd,2EAA2E;IAC3E,mDAA2C,CAAA;IAC3C,0BAA0B;IAC1B,mCAA2B,CAAA;IAC3B,wBAAwB;IACxB,+BAAuB,CAAA;IACvB,oBAAoB;IACpB,uBAAe,CAAA;IACf,wBAAwB;IACxB,iCAAyB,CAAA;IACzB,4BAA4B;IAC5B,uCAA+B,CAAA;IAC/B,qBAAqB;IACrB,yBAAiB,CAAA;AACnB,CAAC,EAfW,IAAI,KAAJ,IAAI,QAef;AAiFD,MAAM,CAAN,IAAY,MAOX;AAPD,WAAY,MAAM;IAChB,aAAa;IACb,2CAAiC,CAAA;IACjC,0EAA0E;IAC1E,2BAAiB,CAAA;IACjB,uCAAuC;IACvC,+BAAqB,CAAA;AACvB,CAAC,EAPW,MAAM,KAAN,MAAM,QAOjB;AA6DD,MAAM,CAAN,IAAY,MAWX;AAXD,WAAY,MAAM;IAChB,qCAAqC;IACrC,2CAAiC,CAAA;IACjC,+BAA+B;IAC/B,uBAAa,CAAA;IACb,yDAAyD;IACzD,qCAA2B,CAAA;IAC3B,2CAA2C;IAC3C,uCAA6B,CAAA;IAC7B,wCAAwC;IACxC,2BAAiB,CAAA;AACnB,CAAC,EAXW,MAAM,KAAN,MAAM,QAWjB;AAmLD,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/service-plugins-types"), exports);
|
|
18
|
+
__exportStar(require("./src/interfaces-automations-v1-trigger-provider.context"), exports);
|
|
19
|
+
__exportStar(require("./src/service-plugins-error-classes"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|