@wix/automations 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,445 @@
1
+ interface ReportEventRequest$1 {
2
+ /**
3
+ * Trigger key as defined in your app's trigger configuration
4
+ * in the Wix Developers Center.
5
+ * For example, `form_submitted` or `invoice_due`.
6
+ */
7
+ triggerKey: string;
8
+ /**
9
+ * Event payload, formatted as key:value pairs.
10
+ * Must comply with the payload schema
11
+ * if you provided one when configuring your trigger.
12
+ *
13
+ * Key names can include only alphanumeric characters or underscores
14
+ * (`A-Z`, `a-z`, `0-9`, `_`).
15
+ * They cannot start with an underscore.
16
+ *
17
+ * Values can be strings, numbers, integers, booleans, or arrays.
18
+ * If a value is an array, the array items must be objects,
19
+ * and nested object properties must be
20
+ * strings, numbers, integers, or booleans only.
21
+ */
22
+ payload?: Record<string, any> | null;
23
+ /**
24
+ * ID of the related resource in GUID format.
25
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
26
+ *
27
+ * Required if your app needs to
28
+ * [cancel the event](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/cancel-event)
29
+ * if the automation becomes no longer relevant.
30
+ *
31
+ * Typically, this ID is defined in your system,
32
+ * but you can also use any Wix resource GUID,
33
+ * such as contact ID, member ID, or invoice ID.
34
+ * See
35
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#about-canceling-events)
36
+ * for more information.
37
+ */
38
+ externalEntityId?: string | null;
39
+ /** Idempotency information for the event */
40
+ idempotency?: Idempotency$1;
41
+ }
42
+ interface Idempotency$1 {
43
+ /**
44
+ * A unique identifier for the event.
45
+ * If you send the same idempotency key in multiple report event requests, for the same trigger key and app id,
46
+ * consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.
47
+ */
48
+ key?: string;
49
+ /** Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week. */
50
+ ttlInMilliseconds?: string | null;
51
+ }
52
+ interface ReportEventResponse$1 {
53
+ /** The activation IDs of triggered ReportEvents. */
54
+ activationIds?: string[];
55
+ }
56
+ interface BulkReportEventRequest$1 {
57
+ /**
58
+ * Trigger key as defined in your app's trigger configuration
59
+ * in the Wix Developers Center.
60
+ * For example, `form_submitted` or `invoice_due`.
61
+ */
62
+ triggerKey: string;
63
+ /** Repeated list of event details for bulk reporting */
64
+ eventsInfo: EventInfo$1[];
65
+ }
66
+ interface EventInfo$1 {
67
+ /**
68
+ * Event payload, formatted as key:value pairs.
69
+ * Must comply with the payload schema
70
+ * if you provided one when configuring your trigger.
71
+ */
72
+ payload?: Record<string, any> | null;
73
+ /** ID of the related resource in GUID format. */
74
+ externalEntityId?: string | null;
75
+ /** Idempotency information for the event */
76
+ idempotency?: Idempotency$1;
77
+ }
78
+ interface BulkReportEventResponse$1 {
79
+ /** Trigger key associated with the event */
80
+ triggerKey?: string;
81
+ /** List of results for each item in the bulk report event request */
82
+ results?: BulkReportEventResult$1[];
83
+ /** Metadata for the overall bulk action, including success and failure counts */
84
+ bulkActionMetadata?: BulkActionMetadata$1;
85
+ }
86
+ interface BulkReportEventResult$1 {
87
+ /** Metadata for the individual item in the request */
88
+ itemMetadata?: ItemMetadata$1;
89
+ /** Event details for the item in the request */
90
+ eventInfo?: EventInfo$1;
91
+ /** The activation IDs of triggered ReportEvents. */
92
+ activationIds?: string[];
93
+ }
94
+ interface ItemMetadata$1 {
95
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
96
+ id?: string | null;
97
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
98
+ originalIndex?: number;
99
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
100
+ success?: boolean;
101
+ /** Details about the error in case of failure. */
102
+ error?: ApplicationError$1;
103
+ }
104
+ interface ApplicationError$1 {
105
+ /** Error code. */
106
+ code?: string;
107
+ /** Description of the error. */
108
+ description?: string;
109
+ /** Data related to the error. */
110
+ data?: Record<string, any> | null;
111
+ }
112
+ interface BulkActionMetadata$1 {
113
+ /** Number of items that were successfully processed. */
114
+ totalSuccesses?: number;
115
+ /** Number of items that couldn't be processed. */
116
+ totalFailures?: number;
117
+ /** Number of failures without details because detailed failure threshold was exceeded. */
118
+ undetailedFailures?: number;
119
+ }
120
+ interface BulkCancelEventRequest$1 {
121
+ /**
122
+ * Trigger key whose events you want to cancel.
123
+ * For example, `form_submitted` or `invoice_due`.
124
+ */
125
+ triggerKey: string;
126
+ /** Repeated list of external_entity_id, representing the related resources' IDs */
127
+ externalEntityIds: string[];
128
+ }
129
+ interface BulkCancelEventResponse$1 {
130
+ /** Trigger key related to the cancelled event */
131
+ triggerKey?: string;
132
+ /** List of results for each item in the bulk cancel event request */
133
+ results?: BulkCancelEventResult$1[];
134
+ /** Metadata for the overall bulk action, including success and failure counts */
135
+ bulkActionMetadata?: BulkActionMetadata$1;
136
+ }
137
+ interface BulkCancelEventResult$1 {
138
+ /** Metadata of the item, including its ID and success or failure status */
139
+ itemMetadata?: ItemMetadata$1;
140
+ /** ID of the related resource in GUID format */
141
+ externalEntityId?: string;
142
+ }
143
+ interface CancelEventRequest$1 {
144
+ /**
145
+ * ID of the related resource in GUID format.
146
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
147
+ *
148
+ * Typically, this ID is defined in your system,
149
+ * but you can also use any Wix resource GUID,
150
+ * such as contact ID, member ID, or invoice ID.
151
+ * See
152
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
153
+ * for more information.
154
+ */
155
+ externalEntityId: string;
156
+ /**
157
+ * Trigger key whose event you want to cancel.
158
+ * For example, `form_submitted` or `invoice_due`.
159
+ */
160
+ triggerKey: string;
161
+ }
162
+ interface CancelEventResponse$1 {
163
+ }
164
+ interface ReportEventResponseNonNullableFields$1 {
165
+ activationIds: string[];
166
+ }
167
+ interface BulkReportEventResponseNonNullableFields$1 {
168
+ triggerKey: string;
169
+ results: {
170
+ itemMetadata?: {
171
+ originalIndex: number;
172
+ success: boolean;
173
+ error?: {
174
+ code: string;
175
+ description: string;
176
+ };
177
+ };
178
+ eventInfo?: {
179
+ idempotency?: {
180
+ key: string;
181
+ };
182
+ };
183
+ activationIds: string[];
184
+ }[];
185
+ bulkActionMetadata?: {
186
+ totalSuccesses: number;
187
+ totalFailures: number;
188
+ undetailedFailures: number;
189
+ };
190
+ }
191
+ interface BulkCancelEventResponseNonNullableFields$1 {
192
+ triggerKey: string;
193
+ results: {
194
+ itemMetadata?: {
195
+ originalIndex: number;
196
+ success: boolean;
197
+ error?: {
198
+ code: string;
199
+ description: string;
200
+ };
201
+ };
202
+ externalEntityId: string;
203
+ }[];
204
+ bulkActionMetadata?: {
205
+ totalSuccesses: number;
206
+ totalFailures: number;
207
+ undetailedFailures: number;
208
+ };
209
+ }
210
+
211
+ interface ReportEventRequest {
212
+ /**
213
+ * Trigger key as defined in your app's trigger configuration
214
+ * in the Wix Developers Center.
215
+ * For example, `form_submitted` or `invoice_due`.
216
+ */
217
+ triggerKey: string;
218
+ /**
219
+ * Event payload, formatted as key:value pairs.
220
+ * Must comply with the payload schema
221
+ * if you provided one when configuring your trigger.
222
+ *
223
+ * Key names can include only alphanumeric characters or underscores
224
+ * (`A-Z`, `a-z`, `0-9`, `_`).
225
+ * They cannot start with an underscore.
226
+ *
227
+ * Values can be strings, numbers, integers, booleans, or arrays.
228
+ * If a value is an array, the array items must be objects,
229
+ * and nested object properties must be
230
+ * strings, numbers, integers, or booleans only.
231
+ */
232
+ payload?: Record<string, any> | null;
233
+ /**
234
+ * ID of the related resource in GUID format.
235
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
236
+ *
237
+ * Required if your app needs to
238
+ * [cancel the event](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/cancel-event)
239
+ * if the automation becomes no longer relevant.
240
+ *
241
+ * Typically, this ID is defined in your system,
242
+ * but you can also use any Wix resource GUID,
243
+ * such as contact ID, member ID, or invoice ID.
244
+ * See
245
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#about-canceling-events)
246
+ * for more information.
247
+ */
248
+ externalEntityId?: string | null;
249
+ /** Idempotency information for the event */
250
+ idempotency?: Idempotency;
251
+ }
252
+ interface Idempotency {
253
+ /**
254
+ * A unique identifier for the event.
255
+ * If you send the same idempotency key in multiple report event requests, for the same trigger key and app id,
256
+ * consecutive requests will be ignored after the first one. Note that the idempotency key is kept for a week before it expires.
257
+ */
258
+ key?: string;
259
+ /** Optional. The time to live (TTL) in milliseconds before the key will expire. Default is a week. */
260
+ ttlInMilliseconds?: string | null;
261
+ }
262
+ interface ReportEventResponse {
263
+ /** The activation IDs of triggered ReportEvents. */
264
+ activationIds?: string[];
265
+ }
266
+ interface BulkReportEventRequest {
267
+ /**
268
+ * Trigger key as defined in your app's trigger configuration
269
+ * in the Wix Developers Center.
270
+ * For example, `form_submitted` or `invoice_due`.
271
+ */
272
+ triggerKey: string;
273
+ /** Repeated list of event details for bulk reporting */
274
+ eventsInfo: EventInfo[];
275
+ }
276
+ interface EventInfo {
277
+ /**
278
+ * Event payload, formatted as key:value pairs.
279
+ * Must comply with the payload schema
280
+ * if you provided one when configuring your trigger.
281
+ */
282
+ payload?: Record<string, any> | null;
283
+ /** ID of the related resource in GUID format. */
284
+ externalEntityId?: string | null;
285
+ /** Idempotency information for the event */
286
+ idempotency?: Idempotency;
287
+ }
288
+ interface BulkReportEventResponse {
289
+ /** Trigger key associated with the event */
290
+ triggerKey?: string;
291
+ /** List of results for each item in the bulk report event request */
292
+ results?: BulkReportEventResult[];
293
+ /** Metadata for the overall bulk action, including success and failure counts */
294
+ bulkActionMetadata?: BulkActionMetadata;
295
+ }
296
+ interface BulkReportEventResult {
297
+ /** Metadata for the individual item in the request */
298
+ itemMetadata?: ItemMetadata;
299
+ /** Event details for the item in the request */
300
+ eventInfo?: EventInfo;
301
+ /** The activation IDs of triggered ReportEvents. */
302
+ activationIds?: string[];
303
+ }
304
+ interface ItemMetadata {
305
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
306
+ _id?: string | null;
307
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
308
+ originalIndex?: number;
309
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
310
+ success?: boolean;
311
+ /** Details about the error in case of failure. */
312
+ error?: ApplicationError;
313
+ }
314
+ interface ApplicationError {
315
+ /** Error code. */
316
+ code?: string;
317
+ /** Description of the error. */
318
+ description?: string;
319
+ /** Data related to the error. */
320
+ data?: Record<string, any> | null;
321
+ }
322
+ interface BulkActionMetadata {
323
+ /** Number of items that were successfully processed. */
324
+ totalSuccesses?: number;
325
+ /** Number of items that couldn't be processed. */
326
+ totalFailures?: number;
327
+ /** Number of failures without details because detailed failure threshold was exceeded. */
328
+ undetailedFailures?: number;
329
+ }
330
+ interface BulkCancelEventRequest {
331
+ /**
332
+ * Trigger key whose events you want to cancel.
333
+ * For example, `form_submitted` or `invoice_due`.
334
+ */
335
+ triggerKey: string;
336
+ /** Repeated list of external_entity_id, representing the related resources' IDs */
337
+ externalEntityIds: string[];
338
+ }
339
+ interface BulkCancelEventResponse {
340
+ /** Trigger key related to the cancelled event */
341
+ triggerKey?: string;
342
+ /** List of results for each item in the bulk cancel event request */
343
+ results?: BulkCancelEventResult[];
344
+ /** Metadata for the overall bulk action, including success and failure counts */
345
+ bulkActionMetadata?: BulkActionMetadata;
346
+ }
347
+ interface BulkCancelEventResult {
348
+ /** Metadata of the item, including its ID and success or failure status */
349
+ itemMetadata?: ItemMetadata;
350
+ /** ID of the related resource in GUID format */
351
+ externalEntityId?: string;
352
+ }
353
+ interface CancelEventRequest {
354
+ /**
355
+ * ID of the related resource in GUID format.
356
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
357
+ *
358
+ * Typically, this ID is defined in your system,
359
+ * but you can also use any Wix resource GUID,
360
+ * such as contact ID, member ID, or invoice ID.
361
+ * See
362
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
363
+ * for more information.
364
+ */
365
+ externalEntityId: string;
366
+ /**
367
+ * Trigger key whose event you want to cancel.
368
+ * For example, `form_submitted` or `invoice_due`.
369
+ */
370
+ triggerKey: string;
371
+ }
372
+ interface CancelEventResponse {
373
+ }
374
+ interface ReportEventResponseNonNullableFields {
375
+ activationIds: string[];
376
+ }
377
+ interface BulkReportEventResponseNonNullableFields {
378
+ triggerKey: string;
379
+ results: {
380
+ itemMetadata?: {
381
+ originalIndex: number;
382
+ success: boolean;
383
+ error?: {
384
+ code: string;
385
+ description: string;
386
+ };
387
+ };
388
+ eventInfo?: {
389
+ idempotency?: {
390
+ key: string;
391
+ };
392
+ };
393
+ activationIds: string[];
394
+ }[];
395
+ bulkActionMetadata?: {
396
+ totalSuccesses: number;
397
+ totalFailures: number;
398
+ undetailedFailures: number;
399
+ };
400
+ }
401
+ interface BulkCancelEventResponseNonNullableFields {
402
+ triggerKey: string;
403
+ results: {
404
+ itemMetadata?: {
405
+ originalIndex: number;
406
+ success: boolean;
407
+ error?: {
408
+ code: string;
409
+ description: string;
410
+ };
411
+ };
412
+ externalEntityId: string;
413
+ }[];
414
+ bulkActionMetadata?: {
415
+ totalSuccesses: number;
416
+ totalFailures: number;
417
+ undetailedFailures: number;
418
+ };
419
+ }
420
+
421
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
422
+ getUrl: (context: any) => string;
423
+ httpMethod: K;
424
+ path: string;
425
+ pathParams: M;
426
+ __requestType: T;
427
+ __originalRequestType: S;
428
+ __responseType: Q;
429
+ __originalResponseType: R;
430
+ };
431
+ declare function reportEvent(): __PublicMethodMetaInfo<'POST', {}, ReportEventRequest, ReportEventRequest$1, ReportEventResponse & ReportEventResponseNonNullableFields, ReportEventResponse$1 & ReportEventResponseNonNullableFields$1>;
432
+ declare function bulkReportEvent(): __PublicMethodMetaInfo<'POST', {}, BulkReportEventRequest, BulkReportEventRequest$1, BulkReportEventResponse & BulkReportEventResponseNonNullableFields, BulkReportEventResponse$1 & BulkReportEventResponseNonNullableFields$1>;
433
+ declare function bulkCancelEvent(): __PublicMethodMetaInfo<'POST', {}, BulkCancelEventRequest, BulkCancelEventRequest$1, BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields, BulkCancelEventResponse$1 & BulkCancelEventResponseNonNullableFields$1>;
434
+ declare function cancelEvent(): __PublicMethodMetaInfo<'POST', {}, CancelEventRequest, CancelEventRequest$1, CancelEventResponse, CancelEventResponse$1>;
435
+
436
+ type meta___PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = __PublicMethodMetaInfo<K, M, T, S, Q, R>;
437
+ declare const meta_bulkCancelEvent: typeof bulkCancelEvent;
438
+ declare const meta_bulkReportEvent: typeof bulkReportEvent;
439
+ declare const meta_cancelEvent: typeof cancelEvent;
440
+ declare const meta_reportEvent: typeof reportEvent;
441
+ declare namespace meta {
442
+ export { type meta___PublicMethodMetaInfo as __PublicMethodMetaInfo, meta_bulkCancelEvent as bulkCancelEvent, meta_bulkReportEvent as bulkReportEvent, meta_cancelEvent as cancelEvent, meta_reportEvent as reportEvent };
443
+ }
444
+
445
+ export { meta as activations };