@wix/auto_sdk_automations_trigger-provider 1.0.8 → 1.0.10
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 -3
- package/build/cjs/index.js +3 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/src/service-plugins-types.d.ts +229 -149
- package/build/cjs/src/service-plugins-types.js +30 -19
- package/build/cjs/src/service-plugins-types.js.map +1 -1
- package/build/es/index.d.ts +3 -3
- package/build/es/index.js +3 -3
- package/build/es/index.js.map +1 -1
- package/build/es/src/service-plugins-types.d.ts +229 -149
- package/build/es/src/service-plugins-types.js +29 -18
- package/build/es/src/service-plugins-types.js.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -3
- package/build/internal/cjs/index.js +3 -3
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/src/service-plugins-types.d.ts +229 -149
- package/build/internal/cjs/src/service-plugins-types.js +30 -19
- package/build/internal/cjs/src/service-plugins-types.js.map +1 -1
- package/build/internal/es/index.d.ts +3 -3
- package/build/internal/es/index.js +3 -3
- package/build/internal/es/index.js.map +1 -1
- package/build/internal/es/src/service-plugins-types.d.ts +229 -149
- package/build/internal/es/src/service-plugins-types.js +29 -18
- package/build/internal/es/src/service-plugins-types.js.map +1 -1
- package/package.json +4 -4
|
@@ -91,9 +91,9 @@ export interface OnAutomationSavedRequest {
|
|
|
91
91
|
automation: Automation;
|
|
92
92
|
}
|
|
93
93
|
export interface Automation extends AutomationOriginInfoOneOf {
|
|
94
|
-
/**
|
|
94
|
+
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
95
95
|
applicationInfo?: ApplicationOrigin;
|
|
96
|
-
/**
|
|
96
|
+
/** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
|
|
97
97
|
preinstalledInfo?: PreinstalledOrigin;
|
|
98
98
|
/**
|
|
99
99
|
* Automation ID.
|
|
@@ -102,37 +102,33 @@ export interface Automation extends AutomationOriginInfoOneOf {
|
|
|
102
102
|
*/
|
|
103
103
|
_id?: string | null;
|
|
104
104
|
/**
|
|
105
|
-
* Revision number
|
|
106
|
-
* To prevent conflicting changes,
|
|
107
|
-
* the current revision must be passed when updating the automation.
|
|
108
|
-
*
|
|
109
|
-
* Ignored when creating an automation.
|
|
105
|
+
* Revision number. This increments by 1 whenever the automation is updated. Specify the current revision number whenever updating an existing automation.
|
|
110
106
|
* @readonly
|
|
111
107
|
*/
|
|
112
108
|
revision?: string | null;
|
|
113
109
|
/**
|
|
114
|
-
*
|
|
110
|
+
* Who created the automation.
|
|
115
111
|
* @immutable
|
|
116
112
|
* @readonly
|
|
117
113
|
*/
|
|
118
114
|
createdBy?: AuditInfo;
|
|
119
115
|
/**
|
|
120
|
-
*
|
|
116
|
+
* When the automation was created.
|
|
121
117
|
* @readonly
|
|
122
118
|
*/
|
|
123
119
|
_createdDate?: Date | null;
|
|
124
120
|
/**
|
|
125
|
-
*
|
|
121
|
+
* Who last updated the automation.
|
|
126
122
|
* @readonly
|
|
127
123
|
*/
|
|
128
124
|
updatedBy?: AuditInfo;
|
|
129
125
|
/**
|
|
130
|
-
*
|
|
126
|
+
* When the automation was last updated.
|
|
131
127
|
* @readonly
|
|
132
128
|
*/
|
|
133
129
|
_updatedDate?: Date | null;
|
|
134
130
|
/**
|
|
135
|
-
* Automation name
|
|
131
|
+
* Automation name as displayed on the user's site.
|
|
136
132
|
* @minLength 1
|
|
137
133
|
* @maxLength 500
|
|
138
134
|
*/
|
|
@@ -142,60 +138,71 @@ export interface Automation extends AutomationOriginInfoOneOf {
|
|
|
142
138
|
* @maxLength 2000
|
|
143
139
|
*/
|
|
144
140
|
description?: string | null;
|
|
145
|
-
/**
|
|
141
|
+
/** Automation configuration. */
|
|
146
142
|
configuration?: AutomationConfiguration;
|
|
147
143
|
/**
|
|
148
|
-
*
|
|
144
|
+
* How the automation was added to the user's site.
|
|
149
145
|
* @immutable
|
|
150
146
|
*/
|
|
151
147
|
origin?: Origin;
|
|
152
148
|
/** Automation settings. */
|
|
153
149
|
settings?: AutomationSettings;
|
|
154
150
|
/**
|
|
155
|
-
*
|
|
151
|
+
* When the automation is a draft, the draft details.
|
|
156
152
|
* @readonly
|
|
157
153
|
*/
|
|
158
154
|
draftInfo?: DraftInfo;
|
|
159
155
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
156
|
+
* Whether the automation is archived.
|
|
157
|
+
*
|
|
158
|
+
* To archive an automation, set this to `true`. To restore an archived automation, set this to `false`.
|
|
162
159
|
*/
|
|
163
|
-
|
|
164
|
-
/** Extended Fields */
|
|
165
|
-
extendedFields?: ExtendedFields;
|
|
160
|
+
archived?: boolean;
|
|
166
161
|
}
|
|
167
162
|
/** @oneof */
|
|
168
163
|
export interface AutomationOriginInfoOneOf {
|
|
169
|
-
/**
|
|
164
|
+
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
170
165
|
applicationInfo?: ApplicationOrigin;
|
|
171
|
-
/**
|
|
166
|
+
/** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
|
|
172
167
|
preinstalledInfo?: PreinstalledOrigin;
|
|
173
168
|
}
|
|
174
169
|
export interface ActionSettings {
|
|
175
170
|
/**
|
|
176
|
-
*
|
|
177
|
-
*
|
|
171
|
+
* Permanent actions. Permanent actions cannot be deleted.
|
|
172
|
+
*
|
|
173
|
+
* When empty, all actions can be deleted by the user.
|
|
178
174
|
* @maxSize 30
|
|
179
175
|
* @format GUID
|
|
180
176
|
*/
|
|
181
177
|
permanentActionIds?: string[];
|
|
182
178
|
/**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
179
|
+
* Read-only actions. Read-only actions cannot be edited.
|
|
180
|
+
*
|
|
181
|
+
* When empty, all actions are editable.
|
|
185
182
|
* @maxSize 30
|
|
186
183
|
* @format GUID
|
|
187
184
|
*/
|
|
188
185
|
readonlyActionIds?: string[];
|
|
189
|
-
/**
|
|
186
|
+
/**
|
|
187
|
+
* Whether to disable the ability to add a delay to the automation.
|
|
188
|
+
*
|
|
189
|
+
* Default: `false`.
|
|
190
|
+
*/
|
|
190
191
|
disableDelayAddition?: boolean;
|
|
191
|
-
/**
|
|
192
|
+
/**
|
|
193
|
+
* Whether to disable the ability to add a condition to the automation.
|
|
194
|
+
*
|
|
195
|
+
* Default: `false`.
|
|
196
|
+
*/
|
|
192
197
|
disableConditionAddition?: boolean;
|
|
193
198
|
}
|
|
194
199
|
export declare enum Domain {
|
|
195
200
|
/** User domain (default). */
|
|
196
201
|
USER = "USER",
|
|
197
202
|
/** Wix domain. */
|
|
198
|
-
WIX = "WIX"
|
|
203
|
+
WIX = "WIX",
|
|
204
|
+
/** Wix account-level domain. */
|
|
205
|
+
WIX_ACCOUNT = "WIX_ACCOUNT"
|
|
199
206
|
}
|
|
200
207
|
export interface Enrichment {
|
|
201
208
|
/**
|
|
@@ -206,12 +213,14 @@ export interface Enrichment {
|
|
|
206
213
|
}
|
|
207
214
|
export interface AuditInfo extends AuditInfoIdOneOf {
|
|
208
215
|
/**
|
|
209
|
-
* User ID.
|
|
216
|
+
* [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
|
|
210
217
|
* @format GUID
|
|
211
218
|
*/
|
|
212
219
|
userId?: string;
|
|
213
220
|
/**
|
|
214
|
-
*
|
|
221
|
+
* [App ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#app-id).
|
|
222
|
+
*
|
|
223
|
+
* You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.
|
|
215
224
|
* @format GUID
|
|
216
225
|
*/
|
|
217
226
|
appId?: string;
|
|
@@ -219,40 +228,45 @@ export interface AuditInfo extends AuditInfoIdOneOf {
|
|
|
219
228
|
/** @oneof */
|
|
220
229
|
export interface AuditInfoIdOneOf {
|
|
221
230
|
/**
|
|
222
|
-
* User ID.
|
|
231
|
+
* [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
|
|
223
232
|
* @format GUID
|
|
224
233
|
*/
|
|
225
234
|
userId?: string;
|
|
226
235
|
/**
|
|
227
|
-
*
|
|
236
|
+
* [App ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#app-id).
|
|
237
|
+
*
|
|
238
|
+
* You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.
|
|
228
239
|
* @format GUID
|
|
229
240
|
*/
|
|
230
241
|
appId?: string;
|
|
231
242
|
}
|
|
232
|
-
/** Automation runtime configuration */
|
|
233
243
|
export interface AutomationConfiguration {
|
|
234
244
|
/** Status of the automation on the site. */
|
|
235
245
|
status?: Status;
|
|
236
|
-
/**
|
|
246
|
+
/** Trigger configuration. */
|
|
237
247
|
trigger?: Trigger;
|
|
238
248
|
/**
|
|
239
|
-
*
|
|
249
|
+
* Root action IDs. A root action is the first action that runs after the trigger occurs. Root actions run in parallel.
|
|
250
|
+
*
|
|
251
|
+
* > **Note**: You can currently only specify 1 root action.
|
|
240
252
|
* @maxSize 20
|
|
241
253
|
* @format GUID
|
|
242
254
|
*/
|
|
243
255
|
rootActionIds?: string[];
|
|
244
|
-
/**
|
|
245
|
-
* Map of all actions that the automation may execute.
|
|
246
|
-
* The key is the action ID, and the value is the action configuration.
|
|
247
|
-
*/
|
|
256
|
+
/** Actions the automation can execute, as key:value pairs. For the key, specify the action ID. The value must be an object structured as described below. */
|
|
248
257
|
actions?: Record<string, Action>;
|
|
249
258
|
}
|
|
250
259
|
export declare enum TimeUnit {
|
|
251
260
|
UNKNOWN_TIME_UNIT = "UNKNOWN_TIME_UNIT",
|
|
261
|
+
/** Minutes. */
|
|
252
262
|
MINUTES = "MINUTES",
|
|
263
|
+
/** Hours. */
|
|
253
264
|
HOURS = "HOURS",
|
|
265
|
+
/** Days. */
|
|
254
266
|
DAYS = "DAYS",
|
|
267
|
+
/** Weeks. */
|
|
255
268
|
WEEKS = "WEEKS",
|
|
269
|
+
/** Months. */
|
|
256
270
|
MONTHS = "MONTHS"
|
|
257
271
|
}
|
|
258
272
|
export interface Filter {
|
|
@@ -262,42 +276,49 @@ export interface Filter {
|
|
|
262
276
|
*/
|
|
263
277
|
_id?: string;
|
|
264
278
|
/**
|
|
265
|
-
* Field key
|
|
279
|
+
* Field key.
|
|
280
|
+
*
|
|
281
|
+
* You can find the field key in [the trigger payload schema](https://dev.wix.com/docs/rest/business-management/automations/triggers/the-trigger-payload-schema).
|
|
266
282
|
* @minLength 1
|
|
267
283
|
* @maxLength 110
|
|
268
284
|
*/
|
|
269
285
|
fieldKey?: string;
|
|
270
286
|
/**
|
|
271
|
-
* Filter expression
|
|
287
|
+
* Filter expression.
|
|
288
|
+
*
|
|
289
|
+
* For the automation to run, the expression must evaluate to `true`.
|
|
272
290
|
* @maxLength 2500
|
|
273
291
|
*/
|
|
274
292
|
filterExpression?: string;
|
|
275
293
|
}
|
|
276
294
|
export interface FutureDateActivationOffset {
|
|
277
295
|
/**
|
|
278
|
-
*
|
|
279
|
-
*
|
|
296
|
+
* Amount of time before the trigger to run the automation.
|
|
297
|
+
*
|
|
298
|
+
* > **Note**: To delay an automation after the trigger event occurs, use a [delay action](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#delay-action).
|
|
280
299
|
* @maxLength 1000
|
|
281
300
|
*/
|
|
282
301
|
preScheduledEventOffsetExpression?: string;
|
|
283
|
-
/**
|
|
302
|
+
/** Unit in which to set the action offset. */
|
|
284
303
|
scheduledEventOffsetTimeUnit?: TimeUnit;
|
|
285
304
|
}
|
|
286
305
|
export interface RateLimit {
|
|
287
306
|
/**
|
|
288
|
-
*
|
|
307
|
+
* Maximum number of times the trigger can be activated.
|
|
289
308
|
* @maxLength 1000
|
|
290
309
|
*/
|
|
291
310
|
maxActivationsExpression?: string;
|
|
292
311
|
/**
|
|
293
|
-
* Duration of the rate
|
|
312
|
+
* Duration of the rate limit. The rate limit applies for the specified duration and then expires.
|
|
313
|
+
*
|
|
314
|
+
* When empty, the rate limit does not expire.
|
|
294
315
|
* @maxLength 1000
|
|
295
316
|
*/
|
|
296
317
|
durationExpression?: string | null;
|
|
297
|
-
/**
|
|
318
|
+
/** Unit in which to set the duration of the rate limit. */
|
|
298
319
|
durationTimeUnit?: TimeUnit;
|
|
299
320
|
/**
|
|
300
|
-
*
|
|
321
|
+
* Activation identifier used to count the number of activations.
|
|
301
322
|
* @minLength 1
|
|
302
323
|
* @maxLength 400
|
|
303
324
|
*/
|
|
@@ -305,17 +326,17 @@ export interface RateLimit {
|
|
|
305
326
|
}
|
|
306
327
|
export interface FilterValueSelection {
|
|
307
328
|
/**
|
|
308
|
-
* Values that can help the user filter certain automations
|
|
329
|
+
* Values that can help the user filter certain automations. Specify values in the following format: `<filter_id>__<selected_value>`.
|
|
309
330
|
* @maxLength 80
|
|
310
331
|
* @maxSize 50
|
|
311
332
|
*/
|
|
312
333
|
selectedFilterValues?: string[];
|
|
313
334
|
}
|
|
314
335
|
export interface ConditionExpressionGroup {
|
|
315
|
-
/**
|
|
336
|
+
/** Logical operator used to evaluate the condition expressions. */
|
|
316
337
|
operator?: Operator;
|
|
317
338
|
/**
|
|
318
|
-
*
|
|
339
|
+
* Expressions evaluated using the selected operator.
|
|
319
340
|
* @minSize 1
|
|
320
341
|
* @maxSize 20
|
|
321
342
|
* @maxLength 2500
|
|
@@ -323,25 +344,58 @@ export interface ConditionExpressionGroup {
|
|
|
323
344
|
booleanExpressions?: string[];
|
|
324
345
|
}
|
|
325
346
|
export declare enum Operator {
|
|
347
|
+
/** Unknown. */
|
|
326
348
|
UNKNOWN_OPERATOR = "UNKNOWN_OPERATOR",
|
|
349
|
+
/** `OR` operator. */
|
|
327
350
|
OR = "OR",
|
|
351
|
+
/** `AND` operator. */
|
|
328
352
|
AND = "AND"
|
|
329
353
|
}
|
|
354
|
+
export interface CodeSnippet {
|
|
355
|
+
/** Logical operator used to evaluate the condition expressions. */
|
|
356
|
+
language?: Language;
|
|
357
|
+
/**
|
|
358
|
+
* Expressions evaluated using the selected operator. this code should comply the language syntax. and format
|
|
359
|
+
* @maxLength 1000
|
|
360
|
+
*/
|
|
361
|
+
code?: string;
|
|
362
|
+
}
|
|
363
|
+
export declare enum Language {
|
|
364
|
+
/** Unknown. */
|
|
365
|
+
UNKNOWN_LANGUAGE = "UNKNOWN_LANGUAGE",
|
|
366
|
+
/** `JAVASCRIPT` language. */
|
|
367
|
+
JAVASCRIPT = "JAVASCRIPT"
|
|
368
|
+
}
|
|
369
|
+
/** Path definition */
|
|
370
|
+
export interface Path {
|
|
371
|
+
/**
|
|
372
|
+
* Unique path ID.
|
|
373
|
+
* @format GUID
|
|
374
|
+
*/
|
|
375
|
+
_id?: string;
|
|
376
|
+
/**
|
|
377
|
+
* Path display name.
|
|
378
|
+
* @minLength 1
|
|
379
|
+
* @maxLength 100
|
|
380
|
+
*/
|
|
381
|
+
name?: string;
|
|
382
|
+
/**
|
|
383
|
+
* ID of the action to run when this path is taken.
|
|
384
|
+
* @format GUID
|
|
385
|
+
*/
|
|
386
|
+
postActionId?: string | null;
|
|
387
|
+
}
|
|
330
388
|
export declare enum Type {
|
|
331
|
-
/**
|
|
389
|
+
/** Based on the trigger. */
|
|
332
390
|
UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
|
|
333
|
-
/**
|
|
391
|
+
/** Defined by a [Wix app](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#app-defined-actions). This action type is available in the site dashboard. */
|
|
334
392
|
APP_DEFINED = "APP_DEFINED",
|
|
335
|
-
/** Condition
|
|
393
|
+
/** Condition. This determines which action runs next. */
|
|
336
394
|
CONDITION = "CONDITION",
|
|
337
|
-
/** Delay
|
|
395
|
+
/** Delay. The automation must wait before executing the next step. */
|
|
338
396
|
DELAY = "DELAY",
|
|
339
|
-
/**
|
|
340
|
-
RATE_LIMIT = "RATE_LIMIT"
|
|
341
|
-
/** Set Variables Action. */
|
|
342
|
-
SET_VARIABLES = "SET_VARIABLES",
|
|
343
|
-
/** Output Action. */
|
|
344
|
-
OUTPUT = "OUTPUT"
|
|
397
|
+
/** Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. */
|
|
398
|
+
RATE_LIMIT = "RATE_LIMIT"
|
|
345
399
|
}
|
|
346
400
|
export interface AppDefinedAction {
|
|
347
401
|
/**
|
|
@@ -355,39 +409,55 @@ export interface AppDefinedAction {
|
|
|
355
409
|
* @maxLength 100
|
|
356
410
|
*/
|
|
357
411
|
actionKey?: string;
|
|
358
|
-
/** Action input mapping. */
|
|
412
|
+
/** Action input mapping as defined in the action's [input schema](https://dev.wix.com/docs/rest/business-management/automations/actions/the-action-input-schema). */
|
|
359
413
|
inputMapping?: Record<string, any> | null;
|
|
360
414
|
/**
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
* Actions
|
|
415
|
+
* Action skip conditions. An action is skipped if any of the specified conditions evaluates to `true`.
|
|
416
|
+
*
|
|
417
|
+
* > **Note**: Actions that follow a skipped action still run.
|
|
364
418
|
* @maxSize 10
|
|
365
419
|
*/
|
|
366
420
|
skipConditionOrExpressionGroups?: ConditionExpressionGroup[];
|
|
367
421
|
/**
|
|
368
|
-
*
|
|
422
|
+
* IDs of actions that run in parallel after the action completes.
|
|
369
423
|
* @maxSize 20
|
|
370
424
|
* @format GUID
|
|
371
425
|
*/
|
|
372
426
|
postActionIds?: string[];
|
|
373
|
-
/**
|
|
427
|
+
/** Action output schema. When specified, this replaces the action schema. */
|
|
374
428
|
overrideOutputSchema?: Record<string, any> | null;
|
|
375
429
|
}
|
|
376
430
|
export interface ConditionAction {
|
|
377
431
|
/**
|
|
378
|
-
*
|
|
432
|
+
* Condition is `true` if one or more of the expression groups evaluates to `true`.
|
|
379
433
|
* @minSize 1
|
|
380
434
|
* @maxSize 10
|
|
381
435
|
*/
|
|
382
436
|
orExpressionGroups?: ConditionExpressionGroup[];
|
|
383
437
|
/**
|
|
384
|
-
*
|
|
438
|
+
* IDs of actions to run when the condition evaluates to `true`.
|
|
385
439
|
* @maxSize 20
|
|
386
440
|
* @format GUID
|
|
387
441
|
*/
|
|
388
442
|
truePostActionIds?: string[];
|
|
389
443
|
/**
|
|
390
|
-
*
|
|
444
|
+
* IDs of actions to run when the condition evaluates to `false`.
|
|
445
|
+
* @maxSize 20
|
|
446
|
+
* @format GUID
|
|
447
|
+
*/
|
|
448
|
+
falsePostActionIds?: string[];
|
|
449
|
+
}
|
|
450
|
+
export interface CodeConditionAction {
|
|
451
|
+
/** condition code. This is a code that can be used to identify the condition in the automation. code should return a boolean value. otherwise the value will be tried to be casted to boolean. */
|
|
452
|
+
snippet?: CodeSnippet;
|
|
453
|
+
/**
|
|
454
|
+
* IDs of actions to run when the condition evaluates to `true`.
|
|
455
|
+
* @maxSize 20
|
|
456
|
+
* @format GUID
|
|
457
|
+
*/
|
|
458
|
+
truePostActionIds?: string[];
|
|
459
|
+
/**
|
|
460
|
+
* IDs of actions to run when the condition evaluates to `false`.
|
|
391
461
|
* @maxSize 20
|
|
392
462
|
* @format GUID
|
|
393
463
|
*/
|
|
@@ -395,21 +465,23 @@ export interface ConditionAction {
|
|
|
395
465
|
}
|
|
396
466
|
export interface DelayAction {
|
|
397
467
|
/**
|
|
398
|
-
*
|
|
468
|
+
* Time to wait before running the action. The wait time starts from when the current action completes.
|
|
469
|
+
*
|
|
470
|
+
* > **Note**: To define the wait time from a specific moment in time, use `dueDateEpochExpression`.
|
|
399
471
|
* @maxLength 1000
|
|
400
472
|
*/
|
|
401
473
|
offsetExpression?: string | null;
|
|
402
|
-
/**
|
|
474
|
+
/** Unit in which to set the wait time to wait before the action runs. */
|
|
403
475
|
offsetTimeUnit?: TimeUnit;
|
|
404
476
|
/**
|
|
405
|
-
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
477
|
+
* Action run date in milliseconds elapsed since January 1, 1970 UTC.
|
|
478
|
+
*
|
|
479
|
+
* > **Note**: If an `offsetExpression` is defined, the delay is calculated from the time of the offset.
|
|
408
480
|
* @maxLength 1000
|
|
409
481
|
*/
|
|
410
482
|
dueDateEpochExpression?: string | null;
|
|
411
483
|
/**
|
|
412
|
-
*
|
|
484
|
+
* IDs of actions to run in parallel after the time delay.
|
|
413
485
|
* @maxSize 20
|
|
414
486
|
* @format GUID
|
|
415
487
|
*/
|
|
@@ -417,17 +489,18 @@ export interface DelayAction {
|
|
|
417
489
|
}
|
|
418
490
|
export interface RateLimitAction {
|
|
419
491
|
/**
|
|
420
|
-
*
|
|
492
|
+
* Maximum number of times the action can run.
|
|
421
493
|
* @maxLength 1000
|
|
422
494
|
*/
|
|
423
495
|
maxActivationsExpression?: string;
|
|
424
496
|
/**
|
|
425
|
-
*
|
|
426
|
-
*
|
|
497
|
+
* Rate limit duration.
|
|
498
|
+
*
|
|
499
|
+
* When empty, the rate limit does not expire.
|
|
427
500
|
* @maxLength 1000
|
|
428
501
|
*/
|
|
429
502
|
rateLimitDurationExpression?: string | null;
|
|
430
|
-
/**
|
|
503
|
+
/** Unit in which to set the duration of the rate limit. */
|
|
431
504
|
rateLimitDurationTimeUnit?: TimeUnit;
|
|
432
505
|
/**
|
|
433
506
|
* Unique identifier of each activation by which rate limiter counts activations.
|
|
@@ -436,25 +509,23 @@ export interface RateLimitAction {
|
|
|
436
509
|
*/
|
|
437
510
|
uniqueIdentifierExpression?: string | null;
|
|
438
511
|
/**
|
|
439
|
-
*
|
|
512
|
+
* IDs of actions to run in parallel after the action completes.
|
|
440
513
|
* @maxSize 20
|
|
441
514
|
* @format GUID
|
|
442
515
|
*/
|
|
443
516
|
postActionIds?: string[];
|
|
444
517
|
}
|
|
445
518
|
export interface SetVariablesAction {
|
|
446
|
-
/**
|
|
447
|
-
* output mapping
|
|
448
|
-
* for example: {"someField": "{{10}}", "someOtherField": "{{multiply( var('account.points.balance') ;2 )}}" }
|
|
449
|
-
*/
|
|
519
|
+
/** Output mapping. For example: `{"someField": "{{10}}", "someOtherField": "{{multiply( var('account.points.balance') ;2 )}}" }`. */
|
|
450
520
|
outputMapping?: Record<string, any> | null;
|
|
451
521
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
522
|
+
* Output JSON schema representation.
|
|
523
|
+
*
|
|
524
|
+
* > **Note**: To minimize request size, you can also specify a string.
|
|
454
525
|
*/
|
|
455
526
|
outputSchema?: Record<string, any> | null;
|
|
456
527
|
/**
|
|
457
|
-
*
|
|
528
|
+
* IDs of actions to run in parallel after variable initialization.
|
|
458
529
|
* @maxSize 20
|
|
459
530
|
* @format GUID
|
|
460
531
|
*/
|
|
@@ -464,12 +535,20 @@ export interface OutputAction {
|
|
|
464
535
|
/** Output action output mapping. */
|
|
465
536
|
outputMapping?: Record<string, any> | null;
|
|
466
537
|
}
|
|
538
|
+
export interface SplitAction {
|
|
539
|
+
/**
|
|
540
|
+
* List of paths to split execution into.
|
|
541
|
+
* @minSize 2
|
|
542
|
+
* @maxSize 10
|
|
543
|
+
*/
|
|
544
|
+
paths?: Path[];
|
|
545
|
+
}
|
|
467
546
|
export declare enum Status {
|
|
468
|
-
/**
|
|
547
|
+
/** Unknown. */
|
|
469
548
|
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
470
|
-
/**
|
|
549
|
+
/** Active. Active automations can be triggered. */
|
|
471
550
|
ACTIVE = "ACTIVE",
|
|
472
|
-
/**
|
|
551
|
+
/** Inactive. Inactive automations cannot be triggered. */
|
|
473
552
|
INACTIVE = "INACTIVE"
|
|
474
553
|
}
|
|
475
554
|
export interface Trigger {
|
|
@@ -480,51 +559,54 @@ export interface Trigger {
|
|
|
480
559
|
appId?: string;
|
|
481
560
|
/**
|
|
482
561
|
* Trigger key.
|
|
562
|
+
*
|
|
563
|
+
* Learn about [setting up a trigger](https://dev.wix.com/docs/rest/business-management/automations/triggers/add-a-trigger-to-your-app#step-1--set-up-the-trigger).
|
|
483
564
|
* @minLength 1
|
|
484
565
|
* @maxLength 100
|
|
485
566
|
*/
|
|
486
567
|
triggerKey?: string;
|
|
487
568
|
/**
|
|
488
|
-
*
|
|
489
|
-
*
|
|
569
|
+
* Schema field filters. All filter conditions must be met for the automation to run.
|
|
570
|
+
*
|
|
571
|
+
* Learn more about setting up [automation filters](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#filters).
|
|
490
572
|
* @maxSize 5
|
|
491
573
|
*/
|
|
492
574
|
filters?: Filter[];
|
|
493
|
-
/** Defines the time offset between the trigger date and when the automation runs. */
|
|
494
|
-
scheduledEventOffset?: FutureDateActivationOffset;
|
|
495
|
-
/** Limits the number of times an automation can be triggered. */
|
|
496
|
-
rateLimit?: RateLimit;
|
|
497
575
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
576
|
+
* Automation offset. You can schedule automations to run before the trigger occurs.
|
|
577
|
+
*
|
|
578
|
+
* Learn more about [scheduled events](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/configure-your-automation#scheduled-events).
|
|
501
579
|
*/
|
|
502
|
-
|
|
503
|
-
/**
|
|
580
|
+
scheduledEventOffset?: FutureDateActivationOffset;
|
|
581
|
+
/** Limit on the number of times an automation can be triggered. */
|
|
582
|
+
rateLimit?: RateLimit;
|
|
583
|
+
/** Trigger schema override. When specified, this replaces the trigger schema. */
|
|
504
584
|
overrideSchema?: Record<string, any> | null;
|
|
505
585
|
}
|
|
506
586
|
export interface Action extends ActionInfoOneOf {
|
|
507
|
-
/**
|
|
587
|
+
/** Details of the action when its `type` is `APP_DEFINED`. */
|
|
508
588
|
appDefinedInfo?: AppDefinedAction;
|
|
509
|
-
/**
|
|
589
|
+
/** Details of the action when its `type` is `CONDITION`. */
|
|
510
590
|
conditionInfo?: ConditionAction;
|
|
511
|
-
/**
|
|
591
|
+
/** Details of the action when its `type` is `CODE_CONDITION`. */
|
|
592
|
+
codeConditionInfo?: CodeConditionAction;
|
|
593
|
+
/** Details of the action when its `type` is `DELAY`. */
|
|
512
594
|
delayInfo?: DelayAction;
|
|
513
|
-
/**
|
|
595
|
+
/** Details of the action when its `type` is `RATE_LIMIT`. */
|
|
514
596
|
rateLimitInfo?: RateLimitAction;
|
|
515
597
|
/**
|
|
516
|
-
* Action ID.
|
|
598
|
+
* Action ID.
|
|
599
|
+
*
|
|
600
|
+
* If not specified, automatically generated by Wix.
|
|
517
601
|
* @format GUID
|
|
518
602
|
*/
|
|
519
603
|
_id?: string | null;
|
|
520
|
-
/** Action type. */
|
|
604
|
+
/** [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#action-type). */
|
|
521
605
|
type?: Type;
|
|
522
606
|
/**
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
* If the action has output, the output will be available in the payload under this name.
|
|
527
|
-
* If the user has multiple actions with the same appId and actionKey, previous action output will be overwritten.
|
|
607
|
+
* [Action namespace](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#namespace). This differentiates it from other actions of the same type.
|
|
608
|
+
*
|
|
609
|
+
* If the action outputs any data, the data appears under the namespace in the payload sent to the subsequent steps in the automation. If the user has multiple actions with the same `appId` and `actionKey`, the output of the previous action is overwritten.
|
|
528
610
|
* @minLength 1
|
|
529
611
|
* @maxLength 100
|
|
530
612
|
*/
|
|
@@ -532,18 +614,20 @@ export interface Action extends ActionInfoOneOf {
|
|
|
532
614
|
}
|
|
533
615
|
/** @oneof */
|
|
534
616
|
export interface ActionInfoOneOf {
|
|
535
|
-
/**
|
|
617
|
+
/** Details of the action when its `type` is `APP_DEFINED`. */
|
|
536
618
|
appDefinedInfo?: AppDefinedAction;
|
|
537
|
-
/**
|
|
619
|
+
/** Details of the action when its `type` is `CONDITION`. */
|
|
538
620
|
conditionInfo?: ConditionAction;
|
|
539
|
-
/**
|
|
621
|
+
/** Details of the action when its `type` is `CODE_CONDITION`. */
|
|
622
|
+
codeConditionInfo?: CodeConditionAction;
|
|
623
|
+
/** Details of the action when its `type` is `DELAY`. */
|
|
540
624
|
delayInfo?: DelayAction;
|
|
541
|
-
/**
|
|
625
|
+
/** Details of the action when its `type` is `RATE_LIMIT`. */
|
|
542
626
|
rateLimitInfo?: RateLimitAction;
|
|
543
627
|
}
|
|
544
628
|
export interface FilterableAppDefinedActions {
|
|
545
629
|
/**
|
|
546
|
-
* App
|
|
630
|
+
* App-defined action identifiers. Identifiers have the following format: `${appId}_${actionKey}`.
|
|
547
631
|
* @minSize 1
|
|
548
632
|
* @maxSize 100
|
|
549
633
|
* @minLength 1
|
|
@@ -552,48 +636,40 @@ export interface FilterableAppDefinedActions {
|
|
|
552
636
|
actionIdentifiers?: string[];
|
|
553
637
|
}
|
|
554
638
|
export declare enum Origin {
|
|
555
|
-
/** Default value.
|
|
639
|
+
/** Default value. */
|
|
556
640
|
UNKNOWN_ORIGIN = "UNKNOWN_ORIGIN",
|
|
557
|
-
/**
|
|
641
|
+
/** Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-user). */
|
|
558
642
|
USER = "USER",
|
|
559
|
-
/**
|
|
643
|
+
/** Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-app) for a particular site. */
|
|
560
644
|
APPLICATION = "APPLICATION",
|
|
561
|
-
/** Preinstalled
|
|
562
|
-
PREINSTALLED = "PREINSTALLED"
|
|
563
|
-
/** Automation created from a recipe. */
|
|
564
|
-
RECIPE = "RECIPE"
|
|
645
|
+
/** [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations). */
|
|
646
|
+
PREINSTALLED = "PREINSTALLED"
|
|
565
647
|
}
|
|
566
648
|
export interface ApplicationOrigin {
|
|
567
649
|
/**
|
|
568
|
-
*
|
|
650
|
+
* [App ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#app-id).
|
|
651
|
+
*
|
|
652
|
+
* You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.
|
|
569
653
|
* @format GUID
|
|
570
654
|
*/
|
|
571
655
|
appId?: string;
|
|
572
|
-
/**
|
|
573
|
-
* External ID to correlate multiple sites to an automation
|
|
574
|
-
* @format GUID
|
|
575
|
-
*/
|
|
576
|
-
appDefinedExternalId?: string | null;
|
|
577
656
|
}
|
|
578
657
|
export interface PreinstalledOrigin {
|
|
579
658
|
/**
|
|
580
|
-
* ID of the app that
|
|
659
|
+
* ID of the app that added the [preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations).
|
|
581
660
|
* @format GUID
|
|
582
661
|
*/
|
|
583
662
|
appId?: string;
|
|
584
663
|
/**
|
|
585
|
-
*
|
|
586
|
-
* @format GUID
|
|
587
|
-
*/
|
|
588
|
-
componentId?: string;
|
|
589
|
-
/** Application component version. */
|
|
590
|
-
componentVersion?: number;
|
|
591
|
-
/**
|
|
592
|
-
* Whether the automation is an override automation. If the user modifies the preinstalled automation installed on their site, a site-specific
|
|
593
|
-
* automation is created that overrides the original one. If the user makes no modifications this boolean is set to `false` and the original
|
|
594
|
-
* preinstalled automation is used.
|
|
664
|
+
* Whether the automation is an override.
|
|
595
665
|
*
|
|
596
|
-
*
|
|
666
|
+
* When a user modifies the preinstalled automation installed on their site, a site-specific version of the automation is created that overrides the automation that was originally installed. This override automation has the same automation ID as the original preinstalled automation.
|
|
667
|
+
*
|
|
668
|
+
* > **Note**: An override automation can no longer be updated by the app that originally installed it.
|
|
669
|
+
* >
|
|
670
|
+
* > To revert to the original preinstalled version, the user must delete the override by calling the Delete Automation method. Calling Delete Automation on an override automation removes the override method and restores the preinstalled automation that was previously installed.
|
|
671
|
+
*
|
|
672
|
+
* Default: `false`.
|
|
597
673
|
* @immutable
|
|
598
674
|
* @readonly
|
|
599
675
|
*/
|
|
@@ -602,22 +678,26 @@ export interface PreinstalledOrigin {
|
|
|
602
678
|
export interface AutomationSettings {
|
|
603
679
|
/**
|
|
604
680
|
* Whether the automation is hidden from users.
|
|
681
|
+
*
|
|
605
682
|
* Default: `false`
|
|
606
683
|
*/
|
|
607
684
|
hidden?: boolean;
|
|
608
685
|
/**
|
|
609
686
|
* Whether the automation is read-only.
|
|
687
|
+
*
|
|
610
688
|
* Default: `false`
|
|
611
689
|
*/
|
|
612
690
|
readonly?: boolean;
|
|
613
691
|
/**
|
|
614
|
-
* Whether the option to delete the automation from the site
|
|
615
|
-
*
|
|
692
|
+
* Whether to disable the option to delete the automation from the site.
|
|
693
|
+
*
|
|
694
|
+
* Default: `false`.
|
|
616
695
|
*/
|
|
617
696
|
disableDelete?: boolean;
|
|
618
697
|
/**
|
|
619
|
-
* Whether the option to change the automation status
|
|
620
|
-
*
|
|
698
|
+
* Whether to disable the option to change the automation's `configuration.status`, for example from `ACTIVE` to `INACTIVE`.
|
|
699
|
+
*
|
|
700
|
+
* Default: `false`.
|
|
621
701
|
*/
|
|
622
702
|
disableStatusChange?: boolean;
|
|
623
703
|
/** Automation action settings. */
|
|
@@ -625,7 +705,7 @@ export interface AutomationSettings {
|
|
|
625
705
|
}
|
|
626
706
|
export interface DraftInfo {
|
|
627
707
|
/**
|
|
628
|
-
*
|
|
708
|
+
* ID of the original automation.
|
|
629
709
|
* @format GUID
|
|
630
710
|
* @readonly
|
|
631
711
|
*/
|