@wix/auto_sdk_automations_trigger-provider 1.0.11 → 1.0.13

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 (77) hide show
  1. package/build/cjs/index.d.ts +967 -3
  2. package/build/cjs/index.js +173 -16
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/{cjs/src/service-plugins-types.d.ts → es/index.d.mts} +131 -56
  5. package/build/es/index.mjs +143 -0
  6. package/build/es/index.mjs.map +1 -0
  7. package/build/internal/cjs/index.d.ts +967 -3
  8. package/build/internal/cjs/index.js +173 -16
  9. package/build/internal/cjs/index.js.map +1 -1
  10. package/build/{es/src/service-plugins-types.d.ts → internal/es/index.d.mts} +131 -56
  11. package/build/internal/es/index.mjs +143 -0
  12. package/build/internal/es/index.mjs.map +1 -0
  13. package/package.json +9 -8
  14. package/build/cjs/index.typings.d.ts +0 -43
  15. package/build/cjs/index.typings.js +0 -19
  16. package/build/cjs/index.typings.js.map +0 -1
  17. package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
  18. package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js +0 -9
  19. package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
  20. package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
  21. package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js +0 -50
  22. package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
  23. package/build/cjs/src/service-plugins-error-classes.d.ts +0 -17
  24. package/build/cjs/src/service-plugins-error-classes.js +0 -21
  25. package/build/cjs/src/service-plugins-error-classes.js.map +0 -1
  26. package/build/cjs/src/service-plugins-types.js +0 -84
  27. package/build/cjs/src/service-plugins-types.js.map +0 -1
  28. package/build/es/index.d.ts +0 -3
  29. package/build/es/index.js +0 -4
  30. package/build/es/index.js.map +0 -1
  31. package/build/es/index.typings.d.ts +0 -43
  32. package/build/es/index.typings.js +0 -3
  33. package/build/es/index.typings.js.map +0 -1
  34. package/build/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
  35. package/build/es/src/interfaces-automations-v1-trigger-provider.context.js +0 -6
  36. package/build/es/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
  37. package/build/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
  38. package/build/es/src/interfaces-automations-v1-trigger-provider.public.js +0 -47
  39. package/build/es/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
  40. package/build/es/src/service-plugins-error-classes.d.ts +0 -17
  41. package/build/es/src/service-plugins-error-classes.js +0 -17
  42. package/build/es/src/service-plugins-error-classes.js.map +0 -1
  43. package/build/es/src/service-plugins-types.js +0 -81
  44. package/build/es/src/service-plugins-types.js.map +0 -1
  45. package/build/internal/cjs/index.typings.d.ts +0 -43
  46. package/build/internal/cjs/index.typings.js +0 -19
  47. package/build/internal/cjs/index.typings.js.map +0 -1
  48. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
  49. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js +0 -9
  50. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
  51. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
  52. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js +0 -50
  53. package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
  54. package/build/internal/cjs/src/service-plugins-error-classes.d.ts +0 -17
  55. package/build/internal/cjs/src/service-plugins-error-classes.js +0 -21
  56. package/build/internal/cjs/src/service-plugins-error-classes.js.map +0 -1
  57. package/build/internal/cjs/src/service-plugins-types.d.ts +0 -892
  58. package/build/internal/cjs/src/service-plugins-types.js +0 -84
  59. package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
  60. package/build/internal/es/index.d.ts +0 -3
  61. package/build/internal/es/index.js +0 -4
  62. package/build/internal/es/index.js.map +0 -1
  63. package/build/internal/es/index.typings.d.ts +0 -43
  64. package/build/internal/es/index.typings.js +0 -3
  65. package/build/internal/es/index.typings.js.map +0 -1
  66. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
  67. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js +0 -6
  68. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
  69. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
  70. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js +0 -47
  71. package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
  72. package/build/internal/es/src/service-plugins-error-classes.d.ts +0 -17
  73. package/build/internal/es/src/service-plugins-error-classes.js +0 -17
  74. package/build/internal/es/src/service-plugins-error-classes.js.map +0 -1
  75. package/build/internal/es/src/service-plugins-types.d.ts +0 -892
  76. package/build/internal/es/src/service-plugins-types.js +0 -81
  77. package/build/internal/es/src/service-plugins-types.js.map +0 -1
@@ -1,892 +0,0 @@
1
- export interface ValidateConfigurationRequest {
2
- /**
3
- * Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
4
- * @minLength 1
5
- * @maxLength 100
6
- */
7
- triggerKey: string;
8
- /**
9
- * Current selection state of the trigger's filters.
10
- * @maxSize 5
11
- */
12
- selectedFilterOptions?: SelectedFilterOptions[];
13
- /** Trigger configuration mapping that's saved on the automation. */
14
- automationConfigMapping?: Record<string, any> | null;
15
- }
16
- export interface SelectedFilterOptions {
17
- /**
18
- * 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`.
19
- * @minLength 1
20
- * @maxLength 110
21
- */
22
- fieldKey?: string;
23
- /**
24
- * Values selected for the filter field.
25
- * @maxSize 100
26
- */
27
- values?: string[];
28
- }
29
- export interface ValidateConfigurationResponse {
30
- /** Whether the trigger configuration is valid. */
31
- valid?: boolean;
32
- /** Error details for an invalid trigger configuration. */
33
- configurationErrors?: ProviderConfigurationError[];
34
- }
35
- export interface ProviderConfigurationError {
36
- /** Key corresponding to the field in the schema. */
37
- fieldKey?: string | null;
38
- /** Error message. */
39
- message?: string;
40
- /** Label for a call-to-action button that's displayed with the error. Translated according to the SPI language context. */
41
- ctaLabel?: string | null;
42
- /** URL to redirect to when the call-to-action button is clicked. */
43
- ctaUrl?: string | null;
44
- /** Title for the error. */
45
- title?: string;
46
- }
47
- export interface GetDynamicSchemaRequest {
48
- /**
49
- * Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
50
- * @minLength 1
51
- * @maxLength 100
52
- */
53
- triggerKey: string;
54
- /**
55
- * Current selection state of the trigger's filters.
56
- * @maxSize 5
57
- */
58
- selectedFilterOptions?: SelectedFilterOptions[];
59
- }
60
- export interface GetDynamicSchemaResponse {
61
- /** A [JSON schema](https://json-schema.org/) corresponding to the filter selection sent in the request. */
62
- dynamicSchema?: Record<string, any> | null;
63
- }
64
- export interface RefreshPayloadRequest {
65
- /**
66
- * Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
67
- * @minLength 1
68
- * @maxLength 100
69
- */
70
- triggerKey?: string;
71
- /**
72
- * ID of the related resource in GUID format.
73
- * @format GUID
74
- */
75
- externalEntityId?: string | null;
76
- /** Payload to update. */
77
- payload: Record<string, any> | null;
78
- }
79
- export interface RefreshPayloadResponse {
80
- /** Updated payload. */
81
- payload?: Record<string, any> | null;
82
- /**
83
- * Whether the automation activation should be canceled.
84
- *
85
- * Default: `false`.
86
- */
87
- cancelActivation?: boolean | null;
88
- }
89
- export interface OnAutomationSavedRequest {
90
- /** Saved automation. */
91
- automation: Automation;
92
- }
93
- export interface Automation extends AutomationOriginInfoOneOf {
94
- /** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
95
- applicationInfo?: ApplicationOrigin;
96
- /** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
97
- preinstalledInfo?: PreinstalledOrigin;
98
- /**
99
- * Automation ID.
100
- * @format GUID
101
- * @readonly
102
- */
103
- _id?: string | null;
104
- /**
105
- * Revision number. This increments by 1 whenever the automation is updated. Specify the current revision number whenever updating an existing automation.
106
- * @readonly
107
- */
108
- revision?: string | null;
109
- /**
110
- * Who created the automation.
111
- * @immutable
112
- * @readonly
113
- */
114
- createdBy?: AuditInfo;
115
- /**
116
- * When the automation was created.
117
- * @readonly
118
- */
119
- _createdDate?: Date | null;
120
- /**
121
- * Who last updated the automation.
122
- * @readonly
123
- */
124
- updatedBy?: AuditInfo;
125
- /**
126
- * When the automation was last updated.
127
- * @readonly
128
- */
129
- _updatedDate?: Date | null;
130
- /**
131
- * Automation name as displayed on the user's site.
132
- * @minLength 1
133
- * @maxLength 500
134
- */
135
- name?: string;
136
- /**
137
- * Automation description.
138
- * @maxLength 2000
139
- */
140
- description?: string | null;
141
- /** Automation configuration. */
142
- configuration?: AutomationConfiguration;
143
- /**
144
- * How the automation was added to the user's site.
145
- * @immutable
146
- */
147
- origin?: Origin;
148
- /** Automation settings. */
149
- settings?: AutomationSettings;
150
- /**
151
- * When the automation is a draft, the draft details.
152
- * @readonly
153
- */
154
- draftInfo?: DraftInfo;
155
- /**
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`.
159
- */
160
- archived?: boolean;
161
- }
162
- /** @oneof */
163
- export interface AutomationOriginInfoOneOf {
164
- /** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
165
- applicationInfo?: ApplicationOrigin;
166
- /** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
167
- preinstalledInfo?: PreinstalledOrigin;
168
- }
169
- export interface ActionSettings {
170
- /**
171
- * Permanent actions. Permanent actions cannot be deleted.
172
- *
173
- * When empty, all actions can be deleted by the user.
174
- * @maxSize 30
175
- * @format GUID
176
- */
177
- permanentActionIds?: string[];
178
- /**
179
- * Read-only actions. Read-only actions cannot be edited.
180
- *
181
- * When empty, all actions are editable.
182
- * @maxSize 30
183
- * @format GUID
184
- */
185
- readonlyActionIds?: string[];
186
- /**
187
- * Whether to disable the ability to add a delay to the automation.
188
- *
189
- * Default: `false`.
190
- */
191
- disableDelayAddition?: boolean;
192
- /**
193
- * Whether to disable the ability to add a condition to the automation.
194
- *
195
- * Default: `false`.
196
- */
197
- disableConditionAddition?: boolean;
198
- }
199
- export declare enum Domain {
200
- /** User domain (default). */
201
- USER = "USER",
202
- /** Wix domain. */
203
- WIX = "WIX",
204
- /** Wix account-level domain. */
205
- WIX_ACCOUNT = "WIX_ACCOUNT"
206
- }
207
- export interface Enrichment {
208
- /**
209
- * Enrichment input mappings.
210
- * @maxSize 2
211
- */
212
- inputMappings?: Record<string, any>[] | null;
213
- }
214
- export interface AuditInfo extends AuditInfoIdOneOf {
215
- /**
216
- * [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
217
- * @format GUID
218
- */
219
- userId?: string;
220
- /**
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.
224
- * @format GUID
225
- */
226
- appId?: string;
227
- }
228
- /** @oneof */
229
- export interface AuditInfoIdOneOf {
230
- /**
231
- * [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
232
- * @format GUID
233
- */
234
- userId?: string;
235
- /**
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.
239
- * @format GUID
240
- */
241
- appId?: string;
242
- }
243
- export interface AutomationConfiguration {
244
- /** Status of the automation on the site. */
245
- status?: Status;
246
- /** Trigger configuration. */
247
- trigger?: Trigger;
248
- /**
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.
252
- * @maxSize 20
253
- * @format GUID
254
- */
255
- rootActionIds?: string[];
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. */
257
- actions?: Record<string, Action>;
258
- }
259
- export declare enum TimeUnit {
260
- UNKNOWN_TIME_UNIT = "UNKNOWN_TIME_UNIT",
261
- /** Minutes. */
262
- MINUTES = "MINUTES",
263
- /** Hours. */
264
- HOURS = "HOURS",
265
- /** Days. */
266
- DAYS = "DAYS",
267
- /** Weeks. */
268
- WEEKS = "WEEKS",
269
- /** Months. */
270
- MONTHS = "MONTHS"
271
- }
272
- export interface Filter {
273
- /**
274
- * Filter ID.
275
- * @format GUID
276
- */
277
- _id?: string;
278
- /**
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).
282
- * @minLength 1
283
- * @maxLength 110
284
- */
285
- fieldKey?: string;
286
- /**
287
- * Filter expression.
288
- *
289
- * For the automation to run, the expression must evaluate to `true`.
290
- * @maxLength 2500
291
- */
292
- filterExpression?: string;
293
- }
294
- export interface FutureDateActivationOffset {
295
- /**
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).
299
- * @maxLength 1000
300
- */
301
- preScheduledEventOffsetExpression?: string;
302
- /** Unit in which to set the action offset. */
303
- scheduledEventOffsetTimeUnit?: TimeUnit;
304
- }
305
- export interface RateLimit {
306
- /**
307
- * Maximum number of times the trigger can be activated.
308
- * @maxLength 1000
309
- */
310
- maxActivationsExpression?: string;
311
- /**
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.
315
- * @maxLength 1000
316
- */
317
- durationExpression?: string | null;
318
- /** Unit in which to set the duration of the rate limit. */
319
- durationTimeUnit?: TimeUnit;
320
- /**
321
- * Activation identifier used to count the number of activations.
322
- * @minLength 1
323
- * @maxLength 400
324
- */
325
- uniqueIdentifierExpression?: string | null;
326
- }
327
- export interface FilterValueSelection {
328
- /**
329
- * Values that can help the user filter certain automations. Specify values in the following format: `<filter_id>__<selected_value>`.
330
- * @maxLength 80
331
- * @maxSize 50
332
- */
333
- selectedFilterValues?: string[];
334
- }
335
- export interface ConditionExpressionGroup {
336
- /** Logical operator used to evaluate the condition expressions. */
337
- operator?: Operator;
338
- /**
339
- * Expressions evaluated using the selected operator.
340
- * @minSize 1
341
- * @maxSize 20
342
- * @maxLength 2500
343
- */
344
- booleanExpressions?: string[];
345
- }
346
- export declare enum Operator {
347
- /** Unknown. */
348
- UNKNOWN_OPERATOR = "UNKNOWN_OPERATOR",
349
- /** `OR` operator. */
350
- OR = "OR",
351
- /** `AND` operator. */
352
- AND = "AND"
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
- }
388
- export declare enum Type {
389
- /** Based on the trigger. */
390
- UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
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. */
392
- APP_DEFINED = "APP_DEFINED",
393
- /** Condition. This determines which action runs next. */
394
- CONDITION = "CONDITION",
395
- /** Delay. The automation must wait before executing the next step. */
396
- DELAY = "DELAY",
397
- /** Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. */
398
- RATE_LIMIT = "RATE_LIMIT"
399
- }
400
- export interface AppDefinedAction {
401
- /**
402
- * ID of the app that defines the action.
403
- * @format GUID
404
- */
405
- appId?: string;
406
- /**
407
- * Action key.
408
- * @minLength 1
409
- * @maxLength 100
410
- */
411
- actionKey?: string;
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). */
413
- inputMapping?: Record<string, any> | null;
414
- /**
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.
418
- * @maxSize 10
419
- */
420
- skipConditionOrExpressionGroups?: ConditionExpressionGroup[];
421
- /**
422
- * IDs of actions that run in parallel after the action completes.
423
- * @maxSize 20
424
- * @format GUID
425
- */
426
- postActionIds?: string[];
427
- /** Action output schema. When specified, this replaces the action schema. */
428
- overrideOutputSchema?: Record<string, any> | null;
429
- }
430
- export interface ConditionAction {
431
- /**
432
- * Condition is `true` if one or more of the expression groups evaluates to `true`.
433
- * @minSize 1
434
- * @maxSize 10
435
- */
436
- orExpressionGroups?: ConditionExpressionGroup[];
437
- /**
438
- * IDs of actions to run when the condition evaluates to `true`.
439
- * @maxSize 20
440
- * @format GUID
441
- */
442
- truePostActionIds?: string[];
443
- /**
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`.
461
- * @maxSize 20
462
- * @format GUID
463
- */
464
- falsePostActionIds?: string[];
465
- }
466
- export interface DelayAction {
467
- /**
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`.
471
- * @maxLength 1000
472
- */
473
- offsetExpression?: string | null;
474
- /** Unit in which to set the wait time to wait before the action runs. */
475
- offsetTimeUnit?: TimeUnit;
476
- /**
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.
480
- * @maxLength 1000
481
- */
482
- dueDateEpochExpression?: string | null;
483
- /**
484
- * IDs of actions to run in parallel after the time delay.
485
- * @maxSize 20
486
- * @format GUID
487
- */
488
- postActionIds?: string[];
489
- }
490
- export interface RateLimitAction {
491
- /**
492
- * Maximum number of times the action can run.
493
- * @maxLength 1000
494
- */
495
- maxActivationsExpression?: string;
496
- /**
497
- * Rate limit duration.
498
- *
499
- * When empty, the rate limit does not expire.
500
- * @maxLength 1000
501
- */
502
- rateLimitDurationExpression?: string | null;
503
- /** Unit in which to set the duration of the rate limit. */
504
- rateLimitDurationTimeUnit?: TimeUnit;
505
- /**
506
- * Unique identifier of each activation by which rate limiter counts activations.
507
- * @minLength 1
508
- * @maxLength 400
509
- */
510
- uniqueIdentifierExpression?: string | null;
511
- /**
512
- * IDs of actions to run in parallel after the action completes.
513
- * @maxSize 20
514
- * @format GUID
515
- */
516
- postActionIds?: string[];
517
- }
518
- export interface SetVariablesAction {
519
- /** Output mapping. For example: `{"someField": "{{10}}", "someOtherField": "{{multiply( var('account.points.balance') ;2 )}}" }`. */
520
- outputMapping?: Record<string, any> | null;
521
- /**
522
- * Output JSON schema representation.
523
- *
524
- * > **Note**: To minimize request size, you can also specify a string.
525
- */
526
- outputSchema?: Record<string, any> | null;
527
- /**
528
- * IDs of actions to run in parallel after variable initialization.
529
- * @maxSize 20
530
- * @format GUID
531
- */
532
- postActionIds?: string[];
533
- }
534
- export interface OutputAction {
535
- /** Output action output mapping. */
536
- outputMapping?: Record<string, any> | null;
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
- }
546
- export declare enum Status {
547
- /** Unknown. */
548
- UNKNOWN_STATUS = "UNKNOWN_STATUS",
549
- /** Active. Active automations can be triggered. */
550
- ACTIVE = "ACTIVE",
551
- /** Inactive. Inactive automations cannot be triggered. */
552
- INACTIVE = "INACTIVE"
553
- }
554
- export interface Trigger {
555
- /**
556
- * ID of the app that defines the trigger.
557
- * @format GUID
558
- */
559
- appId?: string;
560
- /**
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).
564
- * @minLength 1
565
- * @maxLength 100
566
- */
567
- triggerKey?: string;
568
- /**
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).
572
- * @maxSize 5
573
- */
574
- filters?: Filter[];
575
- /**
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).
579
- */
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. */
584
- overrideSchema?: Record<string, any> | null;
585
- }
586
- export interface Action extends ActionInfoOneOf {
587
- /** Details of the action when its `type` is `APP_DEFINED`. */
588
- appDefinedInfo?: AppDefinedAction;
589
- /** Details of the action when its `type` is `CONDITION`. */
590
- conditionInfo?: ConditionAction;
591
- /** Details of the action when its `type` is `CODE_CONDITION`. */
592
- codeConditionInfo?: CodeConditionAction;
593
- /** Details of the action when its `type` is `DELAY`. */
594
- delayInfo?: DelayAction;
595
- /** Details of the action when its `type` is `RATE_LIMIT`. */
596
- rateLimitInfo?: RateLimitAction;
597
- /**
598
- * Action ID.
599
- *
600
- * If not specified, automatically generated by Wix.
601
- * @format GUID
602
- */
603
- _id?: string | null;
604
- /** [Action type](https://dev.wix.com/docs/rest/business-management/automations/automations/automations-v2/about-automation-configuration#action-type). */
605
- type?: Type;
606
- /**
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.
610
- * @minLength 1
611
- * @maxLength 100
612
- */
613
- namespace?: string | null;
614
- }
615
- /** @oneof */
616
- export interface ActionInfoOneOf {
617
- /** Details of the action when its `type` is `APP_DEFINED`. */
618
- appDefinedInfo?: AppDefinedAction;
619
- /** Details of the action when its `type` is `CONDITION`. */
620
- conditionInfo?: ConditionAction;
621
- /** Details of the action when its `type` is `CODE_CONDITION`. */
622
- codeConditionInfo?: CodeConditionAction;
623
- /** Details of the action when its `type` is `DELAY`. */
624
- delayInfo?: DelayAction;
625
- /** Details of the action when its `type` is `RATE_LIMIT`. */
626
- rateLimitInfo?: RateLimitAction;
627
- }
628
- export interface FilterableAppDefinedActions {
629
- /**
630
- * App-defined action identifiers. Identifiers have the following format: `${appId}_${actionKey}`.
631
- * @minSize 1
632
- * @maxSize 100
633
- * @minLength 1
634
- * @maxLength 150
635
- */
636
- actionIdentifiers?: string[];
637
- }
638
- export declare enum Origin {
639
- /** Default value. */
640
- UNKNOWN_ORIGIN = "UNKNOWN_ORIGIN",
641
- /** Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-user). */
642
- USER = "USER",
643
- /** Created by a [Wix app](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-app) for a particular site. */
644
- APPLICATION = "APPLICATION",
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"
647
- }
648
- export interface ApplicationOrigin {
649
- /**
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.
653
- * @format GUID
654
- */
655
- appId?: string;
656
- }
657
- export interface PreinstalledOrigin {
658
- /**
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).
660
- * @format GUID
661
- */
662
- appId?: string;
663
- /**
664
- * Whether the automation is an override.
665
- *
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`.
673
- * @immutable
674
- * @readonly
675
- */
676
- override?: boolean | null;
677
- }
678
- export interface AutomationSettings {
679
- /**
680
- * Whether the automation is hidden from users.
681
- *
682
- * Default: `false`
683
- */
684
- hidden?: boolean;
685
- /**
686
- * Whether the automation is read-only.
687
- *
688
- * Default: `false`
689
- */
690
- readonly?: boolean;
691
- /**
692
- * Whether to disable the option to delete the automation from the site.
693
- *
694
- * Default: `false`.
695
- */
696
- disableDelete?: boolean;
697
- /**
698
- * Whether to disable the option to change the automation's `configuration.status`, for example from `ACTIVE` to `INACTIVE`.
699
- *
700
- * Default: `false`.
701
- */
702
- disableStatusChange?: boolean;
703
- /** Automation action settings. */
704
- actionSettings?: ActionSettings;
705
- }
706
- export interface DraftInfo {
707
- /**
708
- * ID of the original automation.
709
- * @format GUID
710
- * @readonly
711
- */
712
- originalAutomationId?: string | null;
713
- }
714
- export interface Enrichments {
715
- /** Whether the studio site enrichment is wanted. */
716
- studioSite?: Enrichment;
717
- }
718
- export interface ExtendedFields {
719
- /**
720
- * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
721
- * The value of each key is structured according to the schema defined when the extended fields were configured.
722
- *
723
- * You can only access fields for which you have the appropriate permissions.
724
- *
725
- * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
726
- */
727
- namespaces?: Record<string, Record<string, any>>;
728
- }
729
- export interface OnAutomationSavedResponse {
730
- }
731
- export interface OnAutomationDeletedRequest {
732
- /**
733
- * ID of the deleted automation.
734
- * @format GUID
735
- */
736
- automationId: string;
737
- }
738
- export interface OnAutomationDeletedResponse {
739
- }
740
- export interface TriggerProviderSPIConfig {
741
- /**
742
- * The trigger configuration
743
- *
744
- * example of a trigger:
745
- *
746
- * {
747
- * appId: "56cc7843-fdfc-417f-a660-d4af9a2eafe3",
748
- * triggerKey: "form_submit",
749
- * displayName: "Visitor submits a form",
750
- * payloadDataSchema: {
751
- * "$schema": "http://json-schema.org/draft-07/schema",
752
- * "type": "object",
753
- * "title": "Visitor submits a form Payload Schema",
754
- * "description": "The schema of the payload that is part of the triggered event",
755
- * "default": {},
756
- * "examples": [
757
- * {
758
- * "formId": "60d2cd50-1047-4164-884d-8c24fbda84bb",
759
- * "formName": "My Cool Form
760
- * }
761
- * ],
762
- * "properties": {
763
- * "formId": {
764
- * "$id": "#/properties/formId",
765
- * "type": "string",
766
- * "format": "uuid",
767
- * "title": "Form ID",
768
- * "description": "The form identifier",
769
- * "default": "",
770
- * "examples": [
771
- * "60d2cd50-1047-4164-884d-8c24fbda84bb"
772
- * ]
773
- * },
774
- * "formName": {
775
- * "$id": "#/properties/formName",
776
- * "type": "string",
777
- * "title": "Form Name",
778
- * "description": "The form display name",
779
- * "default": "",
780
- * "examples": [
781
- * "My Form"
782
- * ]
783
- * },
784
- * "contactId": {
785
- * "$id": "#/properties/contactId",
786
- * "type": "string",
787
- * "format": "uuid",
788
- * "title": "Contact Id",
789
- * "description": "The Id of the contact which submitted the form",
790
- * "default": "",
791
- * "identityType": "contact", // can be contact, visitor, user limited to 1 type per identity,
792
- * "namespace": "contact" // friendly name to be used later on, in order to user that person's data "contact.firstName"
793
- * }
794
- * },
795
- * "required": [
796
- * "formId",
797
- * "formName",
798
- * "contactId"
799
- * ],
800
- * "additionalProperties": false
801
- * }
802
- * }
803
- */
804
- triggerConfig?: Record<string, any> | null;
805
- /** URL to the trigger provider service */
806
- baseUri?: string;
807
- }
808
- /**
809
- * this message is not directly used by any service,
810
- * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.
811
- * e.g. SPIs, event-handlers, etc..
812
- * NOTE: this context object MUST be provided as the last argument in each Velo method signature.
813
- *
814
- * Example:
815
- * ```typescript
816
- * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {
817
- * ...
818
- * }
819
- * ```
820
- */
821
- export interface Context {
822
- /** 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. */
823
- requestId?: string | null;
824
- /**
825
- * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
826
- * @format CURRENCY
827
- */
828
- currency?: string | null;
829
- /** An object that describes the identity that triggered this request. */
830
- identity?: IdentificationData;
831
- /** 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"`. */
832
- languages?: string[];
833
- /**
834
- * The service provider app's instance ID.
835
- * @format GUID
836
- */
837
- instanceId?: string | null;
838
- }
839
- export declare enum IdentityType {
840
- UNKNOWN = "UNKNOWN",
841
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
842
- MEMBER = "MEMBER",
843
- WIX_USER = "WIX_USER",
844
- APP = "APP"
845
- }
846
- export interface IdentificationData extends IdentificationDataIdOneOf {
847
- /**
848
- * ID of a site visitor that has not logged in to the site.
849
- * @format GUID
850
- */
851
- anonymousVisitorId?: string;
852
- /**
853
- * ID of a site visitor that has logged in to the site.
854
- * @format GUID
855
- */
856
- memberId?: string;
857
- /**
858
- * ID of a Wix user (site owner, contributor, etc.).
859
- * @format GUID
860
- */
861
- wixUserId?: string;
862
- /**
863
- * ID of an app.
864
- * @format GUID
865
- */
866
- appId?: string;
867
- /** @readonly */
868
- identityType?: IdentityType;
869
- }
870
- /** @oneof */
871
- export interface IdentificationDataIdOneOf {
872
- /**
873
- * ID of a site visitor that has not logged in to the site.
874
- * @format GUID
875
- */
876
- anonymousVisitorId?: string;
877
- /**
878
- * ID of a site visitor that has logged in to the site.
879
- * @format GUID
880
- */
881
- memberId?: string;
882
- /**
883
- * ID of a Wix user (site owner, contributor, etc.).
884
- * @format GUID
885
- */
886
- wixUserId?: string;
887
- /**
888
- * ID of an app.
889
- * @format GUID
890
- */
891
- appId?: string;
892
- }