@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.
- package/build/cjs/index.d.ts +967 -3
- package/build/cjs/index.js +173 -16
- package/build/cjs/index.js.map +1 -1
- package/build/{cjs/src/service-plugins-types.d.ts → es/index.d.mts} +131 -56
- package/build/es/index.mjs +143 -0
- package/build/es/index.mjs.map +1 -0
- package/build/internal/cjs/index.d.ts +967 -3
- package/build/internal/cjs/index.js +173 -16
- package/build/internal/cjs/index.js.map +1 -1
- package/build/{es/src/service-plugins-types.d.ts → internal/es/index.d.mts} +131 -56
- package/build/internal/es/index.mjs +143 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/package.json +9 -8
- package/build/cjs/index.typings.d.ts +0 -43
- package/build/cjs/index.typings.js +0 -19
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js +0 -9
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js +0 -50
- package/build/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
- package/build/cjs/src/service-plugins-error-classes.d.ts +0 -17
- package/build/cjs/src/service-plugins-error-classes.js +0 -21
- package/build/cjs/src/service-plugins-error-classes.js.map +0 -1
- package/build/cjs/src/service-plugins-types.js +0 -84
- package/build/cjs/src/service-plugins-types.js.map +0 -1
- package/build/es/index.d.ts +0 -3
- package/build/es/index.js +0 -4
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -43
- package/build/es/index.typings.js +0 -3
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js +0 -6
- package/build/es/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js +0 -47
- package/build/es/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
- package/build/es/src/service-plugins-error-classes.d.ts +0 -17
- package/build/es/src/service-plugins-error-classes.js +0 -17
- package/build/es/src/service-plugins-error-classes.js.map +0 -1
- package/build/es/src/service-plugins-types.js +0 -81
- package/build/es/src/service-plugins-types.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -43
- package/build/internal/cjs/index.typings.js +0 -19
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js +0 -9
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js +0 -50
- package/build/internal/cjs/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
- package/build/internal/cjs/src/service-plugins-error-classes.d.ts +0 -17
- package/build/internal/cjs/src/service-plugins-error-classes.js +0 -21
- package/build/internal/cjs/src/service-plugins-error-classes.js.map +0 -1
- package/build/internal/cjs/src/service-plugins-types.d.ts +0 -892
- package/build/internal/cjs/src/service-plugins-types.js +0 -84
- package/build/internal/cjs/src/service-plugins-types.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -3
- package/build/internal/es/index.js +0 -4
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -43
- package/build/internal/es/index.typings.js +0 -3
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.d.ts +0 -5
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js +0 -6
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.context.js.map +0 -1
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.d.ts +0 -52
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js +0 -47
- package/build/internal/es/src/interfaces-automations-v1-trigger-provider.public.js.map +0 -1
- package/build/internal/es/src/service-plugins-error-classes.d.ts +0 -17
- package/build/internal/es/src/service-plugins-error-classes.js +0 -17
- package/build/internal/es/src/service-plugins-error-classes.js.map +0 -1
- package/build/internal/es/src/service-plugins-types.d.ts +0 -892
- package/build/internal/es/src/service-plugins-types.js +0 -81
- package/build/internal/es/src/service-plugins-types.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ServicePluginDefinition, BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
interface ValidateConfigurationRequest {
|
|
2
4
|
/**
|
|
3
5
|
* Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
|
|
4
6
|
* @minLength 1
|
|
@@ -13,7 +15,7 @@ export interface ValidateConfigurationRequest {
|
|
|
13
15
|
/** Trigger configuration mapping that's saved on the automation. */
|
|
14
16
|
automationConfigMapping?: Record<string, any> | null;
|
|
15
17
|
}
|
|
16
|
-
|
|
18
|
+
interface SelectedFilterOptions {
|
|
17
19
|
/**
|
|
18
20
|
* 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
21
|
* @minLength 1
|
|
@@ -26,13 +28,13 @@ export interface SelectedFilterOptions {
|
|
|
26
28
|
*/
|
|
27
29
|
values?: string[];
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
interface ValidateConfigurationResponse {
|
|
30
32
|
/** Whether the trigger configuration is valid. */
|
|
31
33
|
valid?: boolean;
|
|
32
34
|
/** Error details for an invalid trigger configuration. */
|
|
33
35
|
configurationErrors?: ProviderConfigurationError[];
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
interface ProviderConfigurationError {
|
|
36
38
|
/** Key corresponding to the field in the schema. */
|
|
37
39
|
fieldKey?: string | null;
|
|
38
40
|
/** Error message. */
|
|
@@ -44,7 +46,7 @@ export interface ProviderConfigurationError {
|
|
|
44
46
|
/** Title for the error. */
|
|
45
47
|
title?: string;
|
|
46
48
|
}
|
|
47
|
-
|
|
49
|
+
interface GetDynamicSchemaRequest {
|
|
48
50
|
/**
|
|
49
51
|
* Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
|
|
50
52
|
* @minLength 1
|
|
@@ -57,11 +59,11 @@ export interface GetDynamicSchemaRequest {
|
|
|
57
59
|
*/
|
|
58
60
|
selectedFilterOptions?: SelectedFilterOptions[];
|
|
59
61
|
}
|
|
60
|
-
|
|
62
|
+
interface GetDynamicSchemaResponse {
|
|
61
63
|
/** A [JSON schema](https://json-schema.org/) corresponding to the filter selection sent in the request. */
|
|
62
64
|
dynamicSchema?: Record<string, any> | null;
|
|
63
65
|
}
|
|
64
|
-
|
|
66
|
+
interface RefreshPayloadRequest {
|
|
65
67
|
/**
|
|
66
68
|
* Trigger key as defined in your app's trigger configuration in the app dashboard. For example, `form_submitted` or `invoice_due`.
|
|
67
69
|
* @minLength 1
|
|
@@ -76,7 +78,7 @@ export interface RefreshPayloadRequest {
|
|
|
76
78
|
/** Payload to update. */
|
|
77
79
|
payload: Record<string, any> | null;
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
interface RefreshPayloadResponse {
|
|
80
82
|
/** Updated payload. */
|
|
81
83
|
payload?: Record<string, any> | null;
|
|
82
84
|
/**
|
|
@@ -86,11 +88,11 @@ export interface RefreshPayloadResponse {
|
|
|
86
88
|
*/
|
|
87
89
|
cancelActivation?: boolean | null;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
interface OnAutomationSavedRequest {
|
|
90
92
|
/** Saved automation. */
|
|
91
93
|
automation: Automation;
|
|
92
94
|
}
|
|
93
|
-
|
|
95
|
+
interface Automation extends AutomationOriginInfoOneOf {
|
|
94
96
|
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
95
97
|
applicationInfo?: ApplicationOrigin;
|
|
96
98
|
/** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
|
|
@@ -160,13 +162,13 @@ export interface Automation extends AutomationOriginInfoOneOf {
|
|
|
160
162
|
archived?: boolean;
|
|
161
163
|
}
|
|
162
164
|
/** @oneof */
|
|
163
|
-
|
|
165
|
+
interface AutomationOriginInfoOneOf {
|
|
164
166
|
/** When the origin of the automation is `APPLICATION`, the details of the app that created it. */
|
|
165
167
|
applicationInfo?: ApplicationOrigin;
|
|
166
168
|
/** When the origin of the automation is `PREINSTALLED`, the details of the preinstalled automation. */
|
|
167
169
|
preinstalledInfo?: PreinstalledOrigin;
|
|
168
170
|
}
|
|
169
|
-
|
|
171
|
+
interface ActionSettings {
|
|
170
172
|
/**
|
|
171
173
|
* Permanent actions. Permanent actions cannot be deleted.
|
|
172
174
|
*
|
|
@@ -196,7 +198,7 @@ export interface ActionSettings {
|
|
|
196
198
|
*/
|
|
197
199
|
disableConditionAddition?: boolean;
|
|
198
200
|
}
|
|
199
|
-
|
|
201
|
+
declare enum Domain {
|
|
200
202
|
/** User domain (default). */
|
|
201
203
|
USER = "USER",
|
|
202
204
|
/** Wix domain. */
|
|
@@ -204,14 +206,14 @@ export declare enum Domain {
|
|
|
204
206
|
/** Wix account-level domain. */
|
|
205
207
|
WIX_ACCOUNT = "WIX_ACCOUNT"
|
|
206
208
|
}
|
|
207
|
-
|
|
209
|
+
interface Enrichment {
|
|
208
210
|
/**
|
|
209
211
|
* Enrichment input mappings.
|
|
210
212
|
* @maxSize 2
|
|
211
213
|
*/
|
|
212
214
|
inputMappings?: Record<string, any>[] | null;
|
|
213
215
|
}
|
|
214
|
-
|
|
216
|
+
interface AuditInfo extends AuditInfoIdOneOf {
|
|
215
217
|
/**
|
|
216
218
|
* [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
|
|
217
219
|
* @format GUID
|
|
@@ -226,7 +228,7 @@ export interface AuditInfo extends AuditInfoIdOneOf {
|
|
|
226
228
|
appId?: string;
|
|
227
229
|
}
|
|
228
230
|
/** @oneof */
|
|
229
|
-
|
|
231
|
+
interface AuditInfoIdOneOf {
|
|
230
232
|
/**
|
|
231
233
|
* [User ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#user-id).
|
|
232
234
|
* @format GUID
|
|
@@ -240,7 +242,7 @@ export interface AuditInfoIdOneOf {
|
|
|
240
242
|
*/
|
|
241
243
|
appId?: string;
|
|
242
244
|
}
|
|
243
|
-
|
|
245
|
+
interface AutomationConfiguration {
|
|
244
246
|
/** Status of the automation on the site. */
|
|
245
247
|
status?: Status;
|
|
246
248
|
/** Trigger configuration. */
|
|
@@ -256,7 +258,7 @@ export interface AutomationConfiguration {
|
|
|
256
258
|
/** 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
259
|
actions?: Record<string, Action>;
|
|
258
260
|
}
|
|
259
|
-
|
|
261
|
+
declare enum TimeUnit {
|
|
260
262
|
UNKNOWN_TIME_UNIT = "UNKNOWN_TIME_UNIT",
|
|
261
263
|
/** Minutes. */
|
|
262
264
|
MINUTES = "MINUTES",
|
|
@@ -269,7 +271,7 @@ export declare enum TimeUnit {
|
|
|
269
271
|
/** Months. */
|
|
270
272
|
MONTHS = "MONTHS"
|
|
271
273
|
}
|
|
272
|
-
|
|
274
|
+
interface Filter {
|
|
273
275
|
/**
|
|
274
276
|
* Filter ID.
|
|
275
277
|
* @format GUID
|
|
@@ -291,7 +293,7 @@ export interface Filter {
|
|
|
291
293
|
*/
|
|
292
294
|
filterExpression?: string;
|
|
293
295
|
}
|
|
294
|
-
|
|
296
|
+
interface FutureDateActivationOffset {
|
|
295
297
|
/**
|
|
296
298
|
* Amount of time before the trigger to run the automation.
|
|
297
299
|
*
|
|
@@ -302,7 +304,7 @@ export interface FutureDateActivationOffset {
|
|
|
302
304
|
/** Unit in which to set the action offset. */
|
|
303
305
|
scheduledEventOffsetTimeUnit?: TimeUnit;
|
|
304
306
|
}
|
|
305
|
-
|
|
307
|
+
interface RateLimit {
|
|
306
308
|
/**
|
|
307
309
|
* Maximum number of times the trigger can be activated.
|
|
308
310
|
* @maxLength 1000
|
|
@@ -324,7 +326,7 @@ export interface RateLimit {
|
|
|
324
326
|
*/
|
|
325
327
|
uniqueIdentifierExpression?: string | null;
|
|
326
328
|
}
|
|
327
|
-
|
|
329
|
+
interface FilterValueSelection {
|
|
328
330
|
/**
|
|
329
331
|
* Values that can help the user filter certain automations. Specify values in the following format: `<filter_id>__<selected_value>`.
|
|
330
332
|
* @maxLength 80
|
|
@@ -332,7 +334,7 @@ export interface FilterValueSelection {
|
|
|
332
334
|
*/
|
|
333
335
|
selectedFilterValues?: string[];
|
|
334
336
|
}
|
|
335
|
-
|
|
337
|
+
interface ConditionExpressionGroup {
|
|
336
338
|
/** Logical operator used to evaluate the condition expressions. */
|
|
337
339
|
operator?: Operator;
|
|
338
340
|
/**
|
|
@@ -343,7 +345,7 @@ export interface ConditionExpressionGroup {
|
|
|
343
345
|
*/
|
|
344
346
|
booleanExpressions?: string[];
|
|
345
347
|
}
|
|
346
|
-
|
|
348
|
+
declare enum Operator {
|
|
347
349
|
/** Unknown. */
|
|
348
350
|
UNKNOWN_OPERATOR = "UNKNOWN_OPERATOR",
|
|
349
351
|
/** `OR` operator. */
|
|
@@ -351,7 +353,7 @@ export declare enum Operator {
|
|
|
351
353
|
/** `AND` operator. */
|
|
352
354
|
AND = "AND"
|
|
353
355
|
}
|
|
354
|
-
|
|
356
|
+
interface CodeSnippet {
|
|
355
357
|
/** Logical operator used to evaluate the condition expressions. */
|
|
356
358
|
language?: Language;
|
|
357
359
|
/**
|
|
@@ -360,14 +362,14 @@ export interface CodeSnippet {
|
|
|
360
362
|
*/
|
|
361
363
|
code?: string;
|
|
362
364
|
}
|
|
363
|
-
|
|
365
|
+
declare enum Language {
|
|
364
366
|
/** Unknown. */
|
|
365
367
|
UNKNOWN_LANGUAGE = "UNKNOWN_LANGUAGE",
|
|
366
368
|
/** `JAVASCRIPT` language. */
|
|
367
369
|
JAVASCRIPT = "JAVASCRIPT"
|
|
368
370
|
}
|
|
369
371
|
/** Path definition */
|
|
370
|
-
|
|
372
|
+
interface Path {
|
|
371
373
|
/**
|
|
372
374
|
* Unique path ID.
|
|
373
375
|
* @format GUID
|
|
@@ -385,7 +387,7 @@ export interface Path {
|
|
|
385
387
|
*/
|
|
386
388
|
postActionId?: string | null;
|
|
387
389
|
}
|
|
388
|
-
|
|
390
|
+
declare enum Type {
|
|
389
391
|
/** Based on the trigger. */
|
|
390
392
|
UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE",
|
|
391
393
|
/** 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. */
|
|
@@ -397,7 +399,7 @@ export declare enum Type {
|
|
|
397
399
|
/** Rate-limiter. This stops the automation flow if the subsequent action has reached its maximum allowed executions. */
|
|
398
400
|
RATE_LIMIT = "RATE_LIMIT"
|
|
399
401
|
}
|
|
400
|
-
|
|
402
|
+
interface AppDefinedAction {
|
|
401
403
|
/**
|
|
402
404
|
* ID of the app that defines the action.
|
|
403
405
|
* @format GUID
|
|
@@ -427,7 +429,7 @@ export interface AppDefinedAction {
|
|
|
427
429
|
/** Action output schema. When specified, this replaces the action schema. */
|
|
428
430
|
overrideOutputSchema?: Record<string, any> | null;
|
|
429
431
|
}
|
|
430
|
-
|
|
432
|
+
interface ConditionAction {
|
|
431
433
|
/**
|
|
432
434
|
* Condition is `true` if one or more of the expression groups evaluates to `true`.
|
|
433
435
|
* @minSize 1
|
|
@@ -447,7 +449,7 @@ export interface ConditionAction {
|
|
|
447
449
|
*/
|
|
448
450
|
falsePostActionIds?: string[];
|
|
449
451
|
}
|
|
450
|
-
|
|
452
|
+
interface CodeConditionAction {
|
|
451
453
|
/** 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
454
|
snippet?: CodeSnippet;
|
|
453
455
|
/**
|
|
@@ -463,7 +465,7 @@ export interface CodeConditionAction {
|
|
|
463
465
|
*/
|
|
464
466
|
falsePostActionIds?: string[];
|
|
465
467
|
}
|
|
466
|
-
|
|
468
|
+
interface DelayAction {
|
|
467
469
|
/**
|
|
468
470
|
* Time to wait before running the action. The wait time starts from when the current action completes.
|
|
469
471
|
*
|
|
@@ -487,7 +489,7 @@ export interface DelayAction {
|
|
|
487
489
|
*/
|
|
488
490
|
postActionIds?: string[];
|
|
489
491
|
}
|
|
490
|
-
|
|
492
|
+
interface RateLimitAction {
|
|
491
493
|
/**
|
|
492
494
|
* Maximum number of times the action can run.
|
|
493
495
|
* @maxLength 1000
|
|
@@ -515,7 +517,7 @@ export interface RateLimitAction {
|
|
|
515
517
|
*/
|
|
516
518
|
postActionIds?: string[];
|
|
517
519
|
}
|
|
518
|
-
|
|
520
|
+
interface SetVariablesAction {
|
|
519
521
|
/** Output mapping. For example: `{"someField": "{{10}}", "someOtherField": "{{multiply( var('account.points.balance') ;2 )}}" }`. */
|
|
520
522
|
outputMapping?: Record<string, any> | null;
|
|
521
523
|
/**
|
|
@@ -531,11 +533,11 @@ export interface SetVariablesAction {
|
|
|
531
533
|
*/
|
|
532
534
|
postActionIds?: string[];
|
|
533
535
|
}
|
|
534
|
-
|
|
536
|
+
interface OutputAction {
|
|
535
537
|
/** Output action output mapping. */
|
|
536
538
|
outputMapping?: Record<string, any> | null;
|
|
537
539
|
}
|
|
538
|
-
|
|
540
|
+
interface SplitAction {
|
|
539
541
|
/**
|
|
540
542
|
* List of paths to split execution into.
|
|
541
543
|
* @minSize 2
|
|
@@ -543,7 +545,7 @@ export interface SplitAction {
|
|
|
543
545
|
*/
|
|
544
546
|
paths?: Path[];
|
|
545
547
|
}
|
|
546
|
-
|
|
548
|
+
declare enum Status {
|
|
547
549
|
/** Unknown. */
|
|
548
550
|
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
549
551
|
/** Active. Active automations can be triggered. */
|
|
@@ -551,7 +553,7 @@ export declare enum Status {
|
|
|
551
553
|
/** Inactive. Inactive automations cannot be triggered. */
|
|
552
554
|
INACTIVE = "INACTIVE"
|
|
553
555
|
}
|
|
554
|
-
|
|
556
|
+
interface Trigger {
|
|
555
557
|
/**
|
|
556
558
|
* ID of the app that defines the trigger.
|
|
557
559
|
* @format GUID
|
|
@@ -583,7 +585,7 @@ export interface Trigger {
|
|
|
583
585
|
/** Trigger schema override. When specified, this replaces the trigger schema. */
|
|
584
586
|
overrideSchema?: Record<string, any> | null;
|
|
585
587
|
}
|
|
586
|
-
|
|
588
|
+
interface Action extends ActionInfoOneOf {
|
|
587
589
|
/** Details of the action when its `type` is `APP_DEFINED`. */
|
|
588
590
|
appDefinedInfo?: AppDefinedAction;
|
|
589
591
|
/** Details of the action when its `type` is `CONDITION`. */
|
|
@@ -613,7 +615,7 @@ export interface Action extends ActionInfoOneOf {
|
|
|
613
615
|
namespace?: string | null;
|
|
614
616
|
}
|
|
615
617
|
/** @oneof */
|
|
616
|
-
|
|
618
|
+
interface ActionInfoOneOf {
|
|
617
619
|
/** Details of the action when its `type` is `APP_DEFINED`. */
|
|
618
620
|
appDefinedInfo?: AppDefinedAction;
|
|
619
621
|
/** Details of the action when its `type` is `CONDITION`. */
|
|
@@ -625,7 +627,7 @@ export interface ActionInfoOneOf {
|
|
|
625
627
|
/** Details of the action when its `type` is `RATE_LIMIT`. */
|
|
626
628
|
rateLimitInfo?: RateLimitAction;
|
|
627
629
|
}
|
|
628
|
-
|
|
630
|
+
interface FilterableAppDefinedActions {
|
|
629
631
|
/**
|
|
630
632
|
* App-defined action identifiers. Identifiers have the following format: `${appId}_${actionKey}`.
|
|
631
633
|
* @minSize 1
|
|
@@ -635,7 +637,7 @@ export interface FilterableAppDefinedActions {
|
|
|
635
637
|
*/
|
|
636
638
|
actionIdentifiers?: string[];
|
|
637
639
|
}
|
|
638
|
-
|
|
640
|
+
declare enum Origin {
|
|
639
641
|
/** Default value. */
|
|
640
642
|
UNKNOWN_ORIGIN = "UNKNOWN_ORIGIN",
|
|
641
643
|
/** Created by a [Wix user](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#wix-user). */
|
|
@@ -645,7 +647,7 @@ export declare enum Origin {
|
|
|
645
647
|
/** [Preinstalled automation](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/pre-installed-automations/about-pre-installed-automations). */
|
|
646
648
|
PREINSTALLED = "PREINSTALLED"
|
|
647
649
|
}
|
|
648
|
-
|
|
650
|
+
interface ApplicationOrigin {
|
|
649
651
|
/**
|
|
650
652
|
* [App ID](https://dev.wix.com/docs/build-apps/get-started/overview/glossary#app-id).
|
|
651
653
|
*
|
|
@@ -654,7 +656,7 @@ export interface ApplicationOrigin {
|
|
|
654
656
|
*/
|
|
655
657
|
appId?: string;
|
|
656
658
|
}
|
|
657
|
-
|
|
659
|
+
interface PreinstalledOrigin {
|
|
658
660
|
/**
|
|
659
661
|
* 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
662
|
* @format GUID
|
|
@@ -675,7 +677,7 @@ export interface PreinstalledOrigin {
|
|
|
675
677
|
*/
|
|
676
678
|
override?: boolean | null;
|
|
677
679
|
}
|
|
678
|
-
|
|
680
|
+
interface AutomationSettings {
|
|
679
681
|
/**
|
|
680
682
|
* Whether the automation is hidden from users.
|
|
681
683
|
*
|
|
@@ -703,7 +705,7 @@ export interface AutomationSettings {
|
|
|
703
705
|
/** Automation action settings. */
|
|
704
706
|
actionSettings?: ActionSettings;
|
|
705
707
|
}
|
|
706
|
-
|
|
708
|
+
interface DraftInfo {
|
|
707
709
|
/**
|
|
708
710
|
* ID of the original automation.
|
|
709
711
|
* @format GUID
|
|
@@ -711,11 +713,11 @@ export interface DraftInfo {
|
|
|
711
713
|
*/
|
|
712
714
|
originalAutomationId?: string | null;
|
|
713
715
|
}
|
|
714
|
-
|
|
716
|
+
interface Enrichments {
|
|
715
717
|
/** Whether the studio site enrichment is wanted. */
|
|
716
718
|
studioSite?: Enrichment;
|
|
717
719
|
}
|
|
718
|
-
|
|
720
|
+
interface ExtendedFields {
|
|
719
721
|
/**
|
|
720
722
|
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
721
723
|
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
@@ -726,18 +728,18 @@ export interface ExtendedFields {
|
|
|
726
728
|
*/
|
|
727
729
|
namespaces?: Record<string, Record<string, any>>;
|
|
728
730
|
}
|
|
729
|
-
|
|
731
|
+
interface OnAutomationSavedResponse {
|
|
730
732
|
}
|
|
731
|
-
|
|
733
|
+
interface OnAutomationDeletedRequest {
|
|
732
734
|
/**
|
|
733
735
|
* ID of the deleted automation.
|
|
734
736
|
* @format GUID
|
|
735
737
|
*/
|
|
736
738
|
automationId: string;
|
|
737
739
|
}
|
|
738
|
-
|
|
740
|
+
interface OnAutomationDeletedResponse {
|
|
739
741
|
}
|
|
740
|
-
|
|
742
|
+
interface TriggerProviderSPIConfig {
|
|
741
743
|
/**
|
|
742
744
|
* The trigger configuration
|
|
743
745
|
*
|
|
@@ -818,7 +820,7 @@ export interface TriggerProviderSPIConfig {
|
|
|
818
820
|
* }
|
|
819
821
|
* ```
|
|
820
822
|
*/
|
|
821
|
-
|
|
823
|
+
interface Context {
|
|
822
824
|
/** 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
825
|
requestId?: string | null;
|
|
824
826
|
/**
|
|
@@ -836,14 +838,14 @@ export interface Context {
|
|
|
836
838
|
*/
|
|
837
839
|
instanceId?: string | null;
|
|
838
840
|
}
|
|
839
|
-
|
|
841
|
+
declare enum IdentityType {
|
|
840
842
|
UNKNOWN = "UNKNOWN",
|
|
841
843
|
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
842
844
|
MEMBER = "MEMBER",
|
|
843
845
|
WIX_USER = "WIX_USER",
|
|
844
846
|
APP = "APP"
|
|
845
847
|
}
|
|
846
|
-
|
|
848
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
847
849
|
/**
|
|
848
850
|
* ID of a site visitor that has not logged in to the site.
|
|
849
851
|
* @format GUID
|
|
@@ -868,7 +870,7 @@ export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
|
868
870
|
identityType?: IdentityType;
|
|
869
871
|
}
|
|
870
872
|
/** @oneof */
|
|
871
|
-
|
|
873
|
+
interface IdentificationDataIdOneOf {
|
|
872
874
|
/**
|
|
873
875
|
* ID of a site visitor that has not logged in to the site.
|
|
874
876
|
* @format GUID
|
|
@@ -890,3 +892,76 @@ export interface IdentificationDataIdOneOf {
|
|
|
890
892
|
*/
|
|
891
893
|
appId?: string;
|
|
892
894
|
}
|
|
895
|
+
|
|
896
|
+
interface ValidateConfigurationEnvelope {
|
|
897
|
+
request: ValidateConfigurationRequest;
|
|
898
|
+
metadata: Context;
|
|
899
|
+
}
|
|
900
|
+
interface GetDynamicSchemaEnvelope {
|
|
901
|
+
request: GetDynamicSchemaRequest;
|
|
902
|
+
metadata: Context;
|
|
903
|
+
}
|
|
904
|
+
interface RefreshPayloadEnvelope {
|
|
905
|
+
request: RefreshPayloadRequest;
|
|
906
|
+
metadata: Context;
|
|
907
|
+
}
|
|
908
|
+
declare const provideHandlers$1: ServicePluginDefinition<{
|
|
909
|
+
/**
|
|
910
|
+
*
|
|
911
|
+
* This endpoint allows you to run your own logic to validate trigger fields. Implement this endpoint if you need to perform extra validation on top of
|
|
912
|
+
* the Wix validation process.
|
|
913
|
+
*
|
|
914
|
+
* Wix calls Validate Configuration in the following cases:
|
|
915
|
+
*
|
|
916
|
+
* - When a Wix user activates the automation.
|
|
917
|
+
* - When a Wix user selects the automation from the **Your automations** list in the [**Automations**](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations)
|
|
918
|
+
* dashboard.
|
|
919
|
+
* - When a Wix user opens the automation to edit it.
|
|
920
|
+
*
|
|
921
|
+
* If the user configured filters when setting up their automation, these are included in the request.
|
|
922
|
+
* Wix uses the returned response to display an error message to a user if the requested trigger is invalid. */
|
|
923
|
+
validateConfiguration(payload: ValidateConfigurationEnvelope): ValidateConfigurationResponse | Promise<ValidateConfigurationResponse>;
|
|
924
|
+
/**
|
|
925
|
+
*
|
|
926
|
+
* This endpoint returns a [JSON schema](https://json-schema.org/) object
|
|
927
|
+
* that's used to dynamically update the fields available to a Wix user
|
|
928
|
+
* when they configure an [automation](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Ftriggers/site-automations).
|
|
929
|
+
*
|
|
930
|
+
* Wix calls this endpoint when a user selects an option from an
|
|
931
|
+
* [item selection filter](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/filter-fields#item-selection)
|
|
932
|
+
* configured for a trigger.
|
|
933
|
+
* Wix appends the returned schema to the
|
|
934
|
+
* [payload schema](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/automations/triggers/payload-schema)
|
|
935
|
+
* you defined for the trigger and makes the fields available to the Wix user's automation. */
|
|
936
|
+
getDynamicSchema(payload: GetDynamicSchemaEnvelope): GetDynamicSchemaResponse | Promise<GetDynamicSchemaResponse>;
|
|
937
|
+
/**
|
|
938
|
+
*
|
|
939
|
+
* If an automation's action is delayed, implement this method to retrieve the latest data in the trigger payload before the action fires.
|
|
940
|
+
*
|
|
941
|
+
* For example, if an automation is triggered but its action is set to fire only 24 hours later, Wix calls Refresh Payload before starting
|
|
942
|
+
* the action. This fetches the latest data in the trigger payload. The returned data can be used to update the trigger payload that is passed
|
|
943
|
+
* to the action. */
|
|
944
|
+
refreshPayload(payload: RefreshPayloadEnvelope): RefreshPayloadResponse | Promise<RefreshPayloadResponse>;
|
|
945
|
+
}>;
|
|
946
|
+
|
|
947
|
+
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1>;
|
|
948
|
+
|
|
949
|
+
declare class ProviderNotFoundWixError extends Error {
|
|
950
|
+
/** @hidden */
|
|
951
|
+
httpCode: number;
|
|
952
|
+
/** @hidden */
|
|
953
|
+
statusCode: string;
|
|
954
|
+
/** @hidden */
|
|
955
|
+
applicationCode: string;
|
|
956
|
+
/** @hidden */
|
|
957
|
+
name: string;
|
|
958
|
+
/** @hidden */
|
|
959
|
+
errorType: string;
|
|
960
|
+
/** @hidden */
|
|
961
|
+
spiErrorData: object;
|
|
962
|
+
constructor();
|
|
963
|
+
/** @hidden */
|
|
964
|
+
static readonly __type = "wix_spi_error";
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
export { type Action, type ActionInfoOneOf, type ActionSettings, type AppDefinedAction, type ApplicationOrigin, type AuditInfo, type AuditInfoIdOneOf, type Automation, type AutomationConfiguration, type AutomationOriginInfoOneOf, type AutomationSettings, type CodeConditionAction, type CodeSnippet, type ConditionAction, type ConditionExpressionGroup, type Context, type DelayAction, Domain, type DraftInfo, type Enrichment, type Enrichments, type ExtendedFields, type Filter, type FilterValueSelection, type FilterableAppDefinedActions, type FutureDateActivationOffset, type GetDynamicSchemaRequest, type GetDynamicSchemaResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, Language, type OnAutomationDeletedRequest, type OnAutomationDeletedResponse, type OnAutomationSavedRequest, type OnAutomationSavedResponse, Operator, Origin, type OutputAction, type Path, type PreinstalledOrigin, type ProviderConfigurationError, ProviderNotFoundWixError, type RateLimit, type RateLimitAction, type RefreshPayloadRequest, type RefreshPayloadResponse, type SelectedFilterOptions, type SetVariablesAction, type SplitAction, Status, TimeUnit, type Trigger, type TriggerProviderSPIConfig, Type, type ValidateConfigurationRequest, type ValidateConfigurationResponse, provideHandlers, provideHandlers$1 as publicProvideHandlers };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// src/service-plugins-types.ts
|
|
2
|
+
var Domain = /* @__PURE__ */ ((Domain2) => {
|
|
3
|
+
Domain2["USER"] = "USER";
|
|
4
|
+
Domain2["WIX"] = "WIX";
|
|
5
|
+
Domain2["WIX_ACCOUNT"] = "WIX_ACCOUNT";
|
|
6
|
+
return Domain2;
|
|
7
|
+
})(Domain || {});
|
|
8
|
+
var TimeUnit = /* @__PURE__ */ ((TimeUnit2) => {
|
|
9
|
+
TimeUnit2["UNKNOWN_TIME_UNIT"] = "UNKNOWN_TIME_UNIT";
|
|
10
|
+
TimeUnit2["MINUTES"] = "MINUTES";
|
|
11
|
+
TimeUnit2["HOURS"] = "HOURS";
|
|
12
|
+
TimeUnit2["DAYS"] = "DAYS";
|
|
13
|
+
TimeUnit2["WEEKS"] = "WEEKS";
|
|
14
|
+
TimeUnit2["MONTHS"] = "MONTHS";
|
|
15
|
+
return TimeUnit2;
|
|
16
|
+
})(TimeUnit || {});
|
|
17
|
+
var Operator = /* @__PURE__ */ ((Operator2) => {
|
|
18
|
+
Operator2["UNKNOWN_OPERATOR"] = "UNKNOWN_OPERATOR";
|
|
19
|
+
Operator2["OR"] = "OR";
|
|
20
|
+
Operator2["AND"] = "AND";
|
|
21
|
+
return Operator2;
|
|
22
|
+
})(Operator || {});
|
|
23
|
+
var Language = /* @__PURE__ */ ((Language2) => {
|
|
24
|
+
Language2["UNKNOWN_LANGUAGE"] = "UNKNOWN_LANGUAGE";
|
|
25
|
+
Language2["JAVASCRIPT"] = "JAVASCRIPT";
|
|
26
|
+
return Language2;
|
|
27
|
+
})(Language || {});
|
|
28
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
29
|
+
Type2["UNKNOWN_ACTION_TYPE"] = "UNKNOWN_ACTION_TYPE";
|
|
30
|
+
Type2["APP_DEFINED"] = "APP_DEFINED";
|
|
31
|
+
Type2["CONDITION"] = "CONDITION";
|
|
32
|
+
Type2["DELAY"] = "DELAY";
|
|
33
|
+
Type2["RATE_LIMIT"] = "RATE_LIMIT";
|
|
34
|
+
return Type2;
|
|
35
|
+
})(Type || {});
|
|
36
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
37
|
+
Status2["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
38
|
+
Status2["ACTIVE"] = "ACTIVE";
|
|
39
|
+
Status2["INACTIVE"] = "INACTIVE";
|
|
40
|
+
return Status2;
|
|
41
|
+
})(Status || {});
|
|
42
|
+
var Origin = /* @__PURE__ */ ((Origin2) => {
|
|
43
|
+
Origin2["UNKNOWN_ORIGIN"] = "UNKNOWN_ORIGIN";
|
|
44
|
+
Origin2["USER"] = "USER";
|
|
45
|
+
Origin2["APPLICATION"] = "APPLICATION";
|
|
46
|
+
Origin2["PREINSTALLED"] = "PREINSTALLED";
|
|
47
|
+
return Origin2;
|
|
48
|
+
})(Origin || {});
|
|
49
|
+
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
50
|
+
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
51
|
+
IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
52
|
+
IdentityType2["MEMBER"] = "MEMBER";
|
|
53
|
+
IdentityType2["WIX_USER"] = "WIX_USER";
|
|
54
|
+
IdentityType2["APP"] = "APP";
|
|
55
|
+
return IdentityType2;
|
|
56
|
+
})(IdentityType || {});
|
|
57
|
+
|
|
58
|
+
// src/interfaces-automations-v1-trigger-provider.public.ts
|
|
59
|
+
import { ServicePluginDefinition } from "@wix/sdk-types";
|
|
60
|
+
import {
|
|
61
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
62
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
63
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
64
|
+
var provideHandlers = ServicePluginDefinition("AUTOMATIONS_TRIGGER_PROVIDER", [
|
|
65
|
+
{
|
|
66
|
+
name: "validateConfiguration",
|
|
67
|
+
primaryHttpMappingPath: "/validate-configuration",
|
|
68
|
+
transformations: {
|
|
69
|
+
toREST: (payload) => {
|
|
70
|
+
const toRestResponse = payload;
|
|
71
|
+
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
72
|
+
},
|
|
73
|
+
fromREST: (payload) => {
|
|
74
|
+
const fromRestRequest = payload;
|
|
75
|
+
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "getDynamicSchema",
|
|
81
|
+
primaryHttpMappingPath: "/dynamic-schema",
|
|
82
|
+
transformations: {
|
|
83
|
+
toREST: (payload) => {
|
|
84
|
+
const toRestResponse = payload;
|
|
85
|
+
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
86
|
+
},
|
|
87
|
+
fromREST: (payload) => {
|
|
88
|
+
const fromRestRequest = payload;
|
|
89
|
+
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "refreshPayload",
|
|
95
|
+
primaryHttpMappingPath: "/refresh-payload",
|
|
96
|
+
transformations: {
|
|
97
|
+
toREST: (payload) => {
|
|
98
|
+
const toRestResponse = payload;
|
|
99
|
+
return renameKeysFromSDKRequestToRESTRequest(toRestResponse);
|
|
100
|
+
},
|
|
101
|
+
fromREST: (payload) => {
|
|
102
|
+
const fromRestRequest = payload;
|
|
103
|
+
return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
]);
|
|
108
|
+
|
|
109
|
+
// src/interfaces-automations-v1-trigger-provider.context.ts
|
|
110
|
+
import { createServicePluginModule } from "@wix/sdk-runtime/service-plugin-modules";
|
|
111
|
+
var provideHandlers2 = createServicePluginModule(provideHandlers);
|
|
112
|
+
|
|
113
|
+
// src/service-plugins-error-classes.ts
|
|
114
|
+
var ProviderNotFoundWixError = class extends Error {
|
|
115
|
+
constructor() {
|
|
116
|
+
super("ProviderNotFound");
|
|
117
|
+
this.httpCode = 404;
|
|
118
|
+
this.statusCode = "NOT_FOUND";
|
|
119
|
+
this.applicationCode = "PROVIDER_NOT_FOUND";
|
|
120
|
+
this.name = "ProviderNotFound";
|
|
121
|
+
this.errorType = "SPI";
|
|
122
|
+
this.spiErrorData = {
|
|
123
|
+
name: "ProviderNotFound",
|
|
124
|
+
applicationCode: "PROVIDER_NOT_FOUND"
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
/** @hidden */
|
|
129
|
+
ProviderNotFoundWixError.__type = "wix_spi_error";
|
|
130
|
+
export {
|
|
131
|
+
Domain,
|
|
132
|
+
IdentityType,
|
|
133
|
+
Language,
|
|
134
|
+
Operator,
|
|
135
|
+
Origin,
|
|
136
|
+
ProviderNotFoundWixError,
|
|
137
|
+
Status,
|
|
138
|
+
TimeUnit,
|
|
139
|
+
Type,
|
|
140
|
+
provideHandlers2 as provideHandlers,
|
|
141
|
+
provideHandlers as publicProvideHandlers
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=index.mjs.map
|